Random Questionnaire

I found this Interesting Questionnaire in some blog. I felt I should try answering them too.

1. When you looked at yourself in the mirror today, what was the first thing you thought?
Has my hair really turned grey? Oh F*&k it has J :O

2. How much cash do you have in your wallet right now?
Around 750 bucks.

3. What’s a word that rhymes with DOOR?

Bore, sore, who …. What the hell ….i don’t know.

4. Who is the 4th person on your missed call list on your cell phone?
Rishit Shah. He’ll surely kill me .


5. What is your favorite ring tone on your phone?
Always on Silent 24X7.

6. What are you wearing right now?
pair of shorts and T-shirt.

7. Do you label yourself?
Nah….


8. Name the brand of the shoes you’re currently own?
Lee Cooper…got it recently!


9.Bright or Dark Room?
Bright.

10. What do you think about the person who took this survey before you?
I don’t even know him


11. What does your watch look like?
black strap with lots of scratches.


12. What were you doing at midnight last night?
its better I don’t answer :P

13. What did your last text message you received on your cell say?
From Abhishek : One of the best definitions about  “Home”

“home is a place where u can scratch you’re a$$ exactly where it itches!! Home Sweet home !!! LOL


14. What's a word that you say a lot?
What the F@#*. And in Hindi “baigan”


15. Who told you he/she loved you last?(please exclude spouse , family, children)
No one since Everybody decides that I am selfish after a while.

16. Last furry thing you touched?
Can’t remember :P


17. Favourite age you have been so far?
15

18. What was the last thing you said to someone before doing this?
To mom 1 hour back : Yes I will sleep immediately

19.The last song you listened to?
Nickelback : Rockstar Robbie Williams : Bodies

20. Where did you live in 1987?
No Idea..wasn’t born yet

21. Are you jealous of anyone?
No one in Particular. In general everyone :P

22. Is anyone jealous of you?
can’t think of anyone in particular.

23. Name three things that you have on you at all times?
Mobile, my spectacles ….only two

24. What’s your favourite town/city?
Hyderabad

25. When was the last time you wrote a letter to someone on paper and mailed it?
in class 4 for a letter writing contest…hell it was a long time ago


26. Can you change the oil on a car?
No.

27. Your first love/big crush: what is the last thing you heard about him/her?
She’s a maniac :P


28. Does anything hurt on your body right now?
My neck and back….


29.What is your current desktop picture?
it’s one of the windows 7 wallpapers with yellow dry grass

30. Have you been burnt by love?
No. there was no fire at all :P

My Take on The Facebook Hacker Cup Part-2 Qualification Round

And the Results are out!! Facebook Hacker Cup Team announced the results and I safely got through the next round.

Coming to the next problem that I solved. This was perhaps the most easiest. It is the Studious Student problem. The logic for the problem was pretty simple. But I don’t think I got it entirely correct.

Image001

The BruteForce method would again take a long time to process the input and get the output within the limit of time. So switching to DP again.

Image002

This was kind of the solution that I had arrived to but the sample output wasn’t quite the same. So had to change the sorting condition to a certain extent. The inbuilt sort would place the shorter string first and then the longer one which had the same initial substring.

The input file which I got is

Image003

Somehow got the output. This solution may not be right.

Finally after the much chaos and drama the results were announced and somehow managed to get through to the next round. The next round will be on the 15th of this month. The details are:

Online Round 1 consists of 3 sub-rounds, each lasting 3 hours. Competitors who advance to Online Round 1 can participate in any of the 3 sub-rounds, until they qualify for Online Round 2.

  • The first sub-round will start January 15, 2011 at 15:00 UTC (7:00 AM PST) and end January 15, 2011 at 18:00 UTC (10:00 AM PST) .
  • The second sub-round will start January 15, 2011 at 21:00 UTC (1:00 PM PST) and end January 16, 2011 at 0:00 UTC (January 15, 2011 - 4:00 PM PST).
  • The third sub-round will start January 16, 2011 at 21:00 UTC (1:00 PM PST) and end January 17, 2011 at 0:00 UTC (January 16, 2011 - 4:00 PM PST).

During the sub-rounds, competitors must log in to the Competition website and will be presented with a problem set. Of those participating in Online Round 1, the top-scoring 1000 competitors from each of the 3 sub-rounds will advance to Online Round 2. Competitors who advance to Online Round 2 from a sub-round may not participate in later sub-rounds. Competitors who fail to advance from a sub-round may attempt to advance to Online Round 2 in later sub-rounds.

Success

My Take on Facebook Hacker Cup 2011- Part I

This  was, I guess, the first time Facebook was organising something where hackers compete against each other for fame, fortune, glory and a shot at the coveted Hacker Cup . I thought I’d give a try. The big mistake Facebook made was the 6 time limit that they had imposed which was later lifted. But still the site had issues with the timer, even after we submitted the output within 6 minutes the Timer would expire.

Now shifting focus to the problems which I thought would be tough to start off.

1)      Double Squares

Image001

2)      Peg Game

Image003

3)      Studious Student

Image002

Frankly, I was too lazy even to read the 2nd question. I’ll just mention here the problems that I tried to solve which I thought were pretty easy to start of with. Also the my initial code for solving these 2 problems was pretty simple and small. I was just using a brute force logic to solve the problem. Although I got the solution right  but the time taken by that code even for smaller input was visibly large. Perhaps facebook already gave the hint to try something else.(See the image above “ Too hard for brute Force, switching to dp”)

So the problems seemed to be pretty easy to start off. Also this is my way of doing these problems , I may miserably fail and be completely wrong. But I shall continue to learn.

Later with some math background ,I started solving the Double Squares problem.

Dynamic Programming : if you’re not familiar with this topics click here and here

In case of the brute force method there were a large number of couples which obviously can be omitted as the number should less than maxsqrt in the code below. So only I would check for couples from 0 to maxsqrt and increase the count only when the temp value is a numeric. For example,  10 this would mean that I have to start from 0 and go only upto 3. The count would increase once the square root of the difference between the input and the square of the other value(here i ) is an Integer(not floating point).

10 = 32  + 1 and 10 = 1 + 3. Here each couple is counted twice so the final count is divided by 2 to get the correct value. The code below shows you the same.

Image004

Well, this program was pretty fast compared to the BruteForce algorithm. Later when I tried the brute force method on the input file from the Facebook hacker cup it approximately took 3 minutes for the entire program to run.  The input file  and the output file are given below. Hope the answers are correct.

I think handling Input /Output  is also a worthwhile mention here : also ignore the style of coding(it is not the best)

Image007

I think this is only one way of doing this problem and there may be a variety of methods unknown to me, possibilities are limitless. I welcome any suggestions and thoughts on this problem.

The timer expired and I couldn’t submit my code nor the output which meant it was a total waste. So maybe next time Facebook can get their thing right. I guess, most others will agree on this, the Cup was designed by the same people who designed the Facebook Chat :P.

To Be Continued

(download)

Who said there were no viruses in Linux!

It was always said in college that there were no viruses in Linux. Here’s the truth!

Given the tight security integrated into Linux, it is difficult to take advantage of a vulnerability on the computer, but some programmers have found ways around the security measures. There are several free options for anti-virus on Linux that you really should use, even if it isn't always running - a weekly or monthly scan doesn't hurt. Free anti-virus solutions include: ClamAV, AVG, Avast and F-Prot.

1996:
The cracker group VLAD wrote the first Linux virus named Staog. The virus took advantage of a flaw in the Kernel that allowed it to stay resident on the machine and wait for a binary file to be executed. Once executed the virus would attach itself to that file. Shortly after the virus was discovered the flaw was fixed and the virus quickly became extinct. VLAD was also responsible for writing the first known virus for Windows 95, Boza.

1997:
The Bliss computer virus made its way out into the wild. The virus would attach itself to executables on the system and prevent them from running. A user had to have root access for the virus to be affected, and to this day Debian lists itself as still being vulnerable to this virus. The threat to Debian is minimal though as users do not typically run as root. 

1999:
No significant viruses were reported this year but oddly enough a hoax message went around stating there was a virus that was threatening to install Linux on your computer. At the time the Melissa virus was ravaging PCs worldwide and on April 1, 1999 (April Fools Day) a message went out warning that a virus named Tuxissa was running about secretly installing Linux on unsuspecting computers. 

2000:
A rather harmless virus, Virus.Linux.Winter.341, showed up and inserted itself into ELF files; ELF files are executable Linux files. The virus was very small, only 341 bytes, and would insert LoTek by Wintermute into the Notes section of an ELF file. The virus was also supposed to change the computer name to Wintermute but never gained control of a machine to effect the change. 

2001:
This was an eventful year for Linux viruses; the first was the ZipWorm, a harmless virus that would simply attach itself to any zip files located in the same directory it was executed in. Next was the Satyr virus which was also a harmless virus, it would simply attach itself to ELF files adding the string unix.satyr version 1.0 (c)oded jan-2001 by Shitdown [MIONS], http://shitdown.sf.**(edited as URL causes Avast to block page). There was also a virus released called Ramen which would replace index.html files with their own version displaying Ramen Crew at the top and a package of Ramen Noodles at the bottom. Later a worm by the name of Cheese came out that actually closed the backdoors created by the Ramen virus. There were several other viruses released this year that were relatively harmless. 

2002:
A vulnerability in Apache led to the creation and spread of the Mighty worm. The worm would exploit a vulnerability in Apache's SSL interface, then infect the unsuspecting victims computer. Once on the computer it would create a secret connection to an IRC server and join a channel to wait for commands to be sent to it. 

2004:
Similar to the virus from the previous year, the Binom virus would simply expand the size of the file and write the string [ Cyneox/DCA in to the free space. The virus was spread by executing an infected file. 

2005:
The Lupper worm began spreading to vulnerable Linux web servers. The worm would hit a web server looking for a specific URL, then it would attempt to exploit a vulnerable PHP/CGI script. If the server then allowed remote shell command execution and file downloads, it would become infected and begin searching for another server to infect. 

2006:
A variant of the Mighty worm from 2002 named Kaiten was born. It would open a connection to an IRC channel and wait for commands to be sent and executed. 

2007:
An exploit in OpenOffice led to the spread of a virus named BadBunny. This virus would infect Windows, Mac and Linux machines. The virus creates a file called badbunny.py as an XChat script and creates badbunny.pl, a Perl virus infecting other Perl files. There was also a trojan horse released by the name of Rexob. Once on the machine, it would open a backdoor allowing remote code execution. 

2009:
A website for GNOME users to download screensavers and other pieces of eye-candy unknowingly hosted a malicious screen saver called WaterFall. Once installed on the machine it would open up a backdoor that when executed would cause the machine to assist in a distributed denial of service attack (DDOS). The DDOS attack was very specific and targeted a specific website, MMOwned.com. 

2010:
The koobface virus, a virus that spreads through social networking sites targets Windows, Mac and, in a more recent variant, Linux computers. Once infected, the virus attempts to gather login information for FTP and social networking sites. Once your password has been compromised the virus will send an infected message to all of your friends in your social network. 

This is by no means a complete list of Linux viruses but it does cover the major ones. It also points out that most of the viruses found on Linux are fairly harmless. That doesn't mean they don't exist though. Be sure to keep an eye on what your downloading and where you're going on the Internet and you will most likely stay virus free. An occasional virus scan wouldn't hurt either. 

Read the original article at http://www.neowin.net/news/a-history-of-viruses-on-linux

Even after reading this I still feel even windows vista/7 is also pretty immune to viruses. Its just think that you need to be careful.  I have been using windows vista and then windows 7 for over 4 years now without an anti-virus and I don’t seem to any viruses detected when I scan with 2-3 different  anti viruses.

How to remove Autoposting of Rotating Images Spam Status messages on Facebook!!

• Wall posts like ""Hi Friends see Face-book images rotate 360* see here >> http://kingsize123.tk/"" was some kind of spam which was using "Upload via Email" and automatically updating the status messages on Facebook.After googling a lot finally found a solution and adding it to my blog.
This is how you can fix that problem.

1

Step 2 : in the "Upload Via Email" Section, Click "find out more"
2

Step 3: In the POP-up window  in the Tip Section look out for "refresh your upload email"

3

Step 4 : Click on that link and then click "Reset".

Tip of the Day : Don't execute random javascript in your browser.

Configuring the NFS server on Ubuntu

In order to set NFS server you need to install the following packages:

=> nfs-kernel-server - Linux NFS Server

=> nfs-common - NFS Common programs

=> portmap - The RPC portmapper

 

Ubuntu Linux install NFS Server

Use apt-get command to install all required packages:
$ sudo apt-get install nfs-kernel-server portmap nfs-common

Sharing directory with /etc/exports

The NFS file systems being exported / shared using /etc/exports file. You need to specify directory (file system) to share with rest of the nfs client computers. The file /etc/exports serves as the access control list for file systems which may be exported to NFS clients.
$ sudo vi /etc/exports
To export /data directory to 192.168.1.0/24 network enter the following in /etc/exports file:
/data 192.168.1.0/24(rw,async)
To export /sales to hostname tom and jerry, enter:
/sales tom(ro,sync) jerry(ro,sync)
To export /users to 192.168.1.0/24 in read write format, enter:
/users 192.168.1.0/24(ro,sync) jerry(rw,fsid=0,insecure,no_subtree_check,async)
Where,

  • rw : Allow clients to read as well as write access
  • ro : Read only access
  • insecure : Tells the NFS server to use unpriveledged ports (ports > 1024).
  • no_subtree_check : If the entire volume (/users) is exported, disabling this check will speed up transfers.
  • async : async will speed up transfers.

Save and close the file. Just restart nfs-server:
$ sudo /etc/init.d/nfs-kernel-server restart

Now your NFS sever is sharing /sales and /data directories.

How do I access shared directories from Linux client computer?

Login to Linux desktop system and enter the following command to mount shared directories. First, create a mountpoint on your client computer:
# mkdir /mnt/data
Mount the server:
# mount nfs-server:/data /mnt/data
You can also use following syntax for NFS client version 4:
# mount -t nfs4 -o proto=tcp,port=2049 nfs-server:/data /mnt/data
OR
# mount -t nfs4 -o proto=tcp,port=2049 192.168.1.100:/data /mnt/data
Where,

  • 192.168.1.100 : NFS Server IP address
  • proto=tcp,port=2049 : Force to use TCP protocol i.e. mount the NFS filesystem using TCP. The numeric value of the port to connect to the NFS server on. If the port number is 0 (the default) then query the remote host’s portmapper for the port number to use. If the remote host’s NFS daemon is not registered with its portmapper, the standard NFS port number 2049 is used instead.

How do I access my files?

To access shared files use regular commands or GUI file manager:
$ cd /mnt/data
$ ls
$ mkdir office
$ pwd

To see mounted file system and available disk space use df command:
$ df -h
Output:

Filesystem Size Used Avail Use% Mounted on /dev/sda2 92G 23G 65G 26% / varrun 1013M 128K 1013M 1% /var/run varlock 1013M 0 1013M 0% /var/lock udev 1013M 84K 1013M 1% /dev devshm 1013M 0 1013M 0% /dev/shm /dev/sda1 98G 22G 77G 23% /media/sda1 /dev/sda5 274G 29G 245G 11% /share /dev/sdb2 230G 4.9G 213G 3% /backup.iscsi nfs-server:/data/ 230G 31G 188G 14% /mnt/data

How do I see all shared directories from client computer?

Use showmount command to query the mount daemon (NFS Server) on a remote host for information about the state of the NFS server on that machine:
$ showmount -a
Output:

All mount points on nfs-server: nfs-server:/olddisk nfs-server:/sales nfs-server:/data nfs-server:/mp3s-video nfs-server:/wwwroot
This is perhaps the most easiest way to setup the NFS server and Client for file sharing.Some of the problems i encountered was the loopback address which i had to enable using the command dpkg-reconfigure portmapAlso if you want to mount the nfs-share at startup then the follwong line is to be added to the file /etc/fstablocalhost:/home/nfs-share /nfs-client-share nfs defaults 0 0<file system> <mount point>   <type>  <options>       <dump>  <pass>This makes the client share to appear at startup.

 

 

2 ways to get more from your Gmail address

I recently discovered some little-known ways to use your Gmail address that can give greater control over your inbox and save you some time and headache. When you choose a Gmail address, you actually get more than just "yourusername@gmail.com." Here are two different ways you can modify your Gmail address and still get your mail:

•Append a plus ("+") sign and any combination of words or numbers after your email address. For example, if your name was hikingfan@gmail.com, you could send mail to hikingfan+friends@gmail.com or hikingfan+mailinglists@gmail.com.

•Insert one or several dots (".") anywhere in your email address. Gmail doesn't recognize periods as characters in addresses -- we just ignore them. For example, you could tell people your address was hikingfan@gmail.com, hiking.fan@gmail.com or hi.kin.g.fan@gmail.com. (We understand that there has been some confusion about this in the past, but to settle it once and for all, you can indeed receive mail at all the variations with dots.)

For me, the real value in being able to manipulate your email address is that it makes it really easy to filter on those variants. For example you could use hikingfan+bank@gmail.com when you sign up for online banking and then set up a filter to automatically star, archive or label emails addressed to hikingfan+bank. You can also use this when you register for a service and think they might share your information. For example, I added "+donation" when I gave money to a political organization once, and now when I see emails from other groups to that address, I know how they got it. Solution: filtered to auto-delete.

Windows 8 to be released in 2012

Microsoft has been silent about the future Operating System,apart from the leak on the MSDN Blog a long time back there has been no news about when Windows 8 will be released, though recently Microsoft Netherlands team on the occasion of first Birthday of Windows 7, has posted on the official news site ,that Windows 8 will hit the market in about 2 years time.They have also mentioned that Windows 7 SP1 would be available in first half of next year. The page via translator reads as-

The phasing out of Windows XP, Microsoft is nearing completion. In July 2010, the support for Windows XP with Service Pack 2 stops. Today Microsoft will stop selling Windows XP to PC manufacturers and the aftermarket sales of Windows Vista. For Windows 7, Microsoft Service Pack 1. This service pack is still in the testing phase and is expected in the first half of next year available. The first update of Windows 7 is the new version of Windows Live Essentials (explore.live.com) became available in mid-June. Furthermore, Microsoft is of course the next version of Windows. But it will take about two years before "Windows 8 ‘on the market. The latest news about Windows is available at www.windows.nl / blog.

If Windows 8 would be RTMed within two years then it would be interesting to see when the beta version is released,probably somewhere around June or July next year..

With full regards to the original author

http://windows8beta.com/2010/10/windows-8-to-be-released-in-2012?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+Windows8Beta+%28Windows+8+Beta%29