got up at 11. went to bank and lodged complaints about my card transfer. while lodging complaint a guy shouts at the bank manager for causing him inconvinience for withdrawing money which was a pretty huge amount about 75k. then went to FOSS.IN and attended talk by debayan. It was a good one and at last I got to know properly what he was working on. Also got my hand on the OLPC laptop, which was very cute. Tried to use it for sometime. Interface was good and would like to get one of it myself someday but it seems that you just cannot buy one. Then went to the KDE Potd hoping to get a kde sweat shirt. Unfortunaetly couldnt get one. :(. Then left in middle of the daily keynote as I had to go to my old room and pay the monthly rent. Then had dinner with my old roomies. Then caught a bus to Shivajinagar to go back home. While reading the novel on the bus, one man apparently indian origin but a US returned( as I guess from his accent) advised me not to read novels while moving on bus as it harms the eyes. I asked him how else I could utilize my precious time while travelling. He couldnt suggest anything. However this has left me with thinking for an idea how to utilize thier time while travelling on bus. FM is not an answer as nowadays it is more crap than songs and it is not productive anyways. Now I am sitting in a cyber cafe. Came to apply in Cisco which I could only using IE 6 or 7. But the webpage is complete crap and it is hosted by merittrac. It does not even load in IE6 properly. Anyways I will have to try somewhere else I guess now. Now I think I will leave for my room. Hope to have fun tomorrow at FOSS.IN.
December 3, 2009
December 1, 2009
Get all your Gmail Contacts in Thunderbird Address Book
Thanks to this post, I found a addon of thunderbird which synchronizes all your contacts of gmail with thunderbird address book.
Here is the link for the addon
https://addons.mozilla.org/en-US/thunderbird/addon/7307
November 13, 2009
November 12, 2009
a shell script to check if a ipaddress is taken using ping
With the help of Abhas Bhaiyya, I could write this shell script which checks if an ipaddress can be pinged.
#!/bin/sh
if [ `ping -c1 192.168.31.31 >/dev/null; echo $?` -eq 1 ]
then
echo “not able to ping”
fi
/dev/null is used here so that the output of the ping command is not compared with 1.
$? gives out the return code of the command.
November 12, 2009
how to get the last argument from the last command in the shell
‘!$’ is the right answer.
For example: $vim test.pl
$chmod +x !$
$./!$
So what is happening above is
first vim test.pl opens a file.
then after you have written a perl script, you would like to make it executable. There is no need for you to specify the file name again. You can just use !$.
In the third command again to execute the file, there is no need to mention the file name again. You just use !$ again.
November 11, 2009
What does ‘+’ in BLOCKS column in partition table output of fdisk command mean?
On the printout of a partition table, in the BLOCKS column, several
partition block count have a ‘+’ at the end – some do not. What does
this mean?
It means that the partition does not end on the 1k block boundary.
In other words the partition has an odd number of 512 bytes sectors
allocated. Use “x” command and then “p” to see.
November 10, 2009
Postal to the rescue.
Postal is used to benchmark SMTP servers.
I am using it so that I can send mails continously to my test server and hence check if it is working properly. Hence this saves me from the pain of composing mails everytime I do some changes in the server and check if the changes I made is what I intended.
All I have to do is execute one command given below.
postal -m 100 -f test -t 5 192.168.31.100 users_mail
users_mail has the list of all the users in my test server.
November 9, 2009
Using sed
How to use sed command to remove lines from a file which match a particular pattern.
sed ‘//d’ file-name > tmp
This command will delete all the lines from the file which match the pattern and then store the contents in the ‘tmp’ file.
How to use sed command to substitute strings which match a pattern and then replace it with another string?
sed -e ‘s///’
This command is to match a string and replace it with another string. The new contents of the will be stored in
How to use a pattern matched in sed command also in the replaced string?
Use & to substitute the matched string.
November 3, 2009
one line perl command to get the @INC array
Below is a one line command to display all the entry in @INC array which contains the paths where perl programs looks for perl modules.
perl -e ‘foreach $_ (@INC){ print $_,”n”};’
November 3, 2009
To allow forwarding of a port in the server
Well I needed to forward port 587 in my server so that Thunderbird installed in my local desktop could send mails through gmail account.
Here is how I did it.
iptables -I FORWARD -p tcp –dport 587 -j ACCEPT
What the above command does exactly is writes a (-I) inserts a new rule in the FORWARD chain which (-j) ACCEPTs all packets following (-p) tcp protocol and (–dport) destination port 587