I can share and save my status messages !

I love showing off my status messages of gtalk. I often set witty messages, latest (probably unheard) news, my latest blog links in my status. Many a times I wish to log those messages to make a life stream. Wouldn’t it be great if I could someday check, what was my status on my last birthday ! Or may be, I would love to remember those moments when I used to impress my girlfriend by weird status messages. Status messages are no more just for “available” , “busy” and “idle”. Its like microblogging now.

Thanks to http://gtalkbots.com . Now I can save all my status messages and even share it to the world. So now I can have my life stream saved without any pain of logging in to the website. I simply had to add bots@gtalkbots.com to my buddy list and register once in the website. Simple !

This bot is intelligent as well. I can save any notes link etc just by messaging “<notes> Anything I want to save.”

This site is even providing widgets for my blog. Check out the two widgets in the side panel of this page. There are two gtalkbots.com widgets on my blog. One of them shows my last 10 status messages and the other one displays the last 10 shared status message of the world.

I can even ‘track’ my friends’ status messages. Isnt all these great ??

Check out my gtalkbots page: http://gtalkbots.com/spsneo

Hope you will also love this service and give a try at least.

Posted in gtalkbots, microblogging | Tagged , , , | Leave a comment

Google Launching a New Browser : Chrome

Google today confirmed that they are going to launch a new browser : chrome tomorrow. Check out the Google’s official blog here.
The web browser will compete with Internet Explorer and Mozilla Firefox.
Google has also launched a comic which describes the need and feature of the new browses.

Here’s the link to the comic http://www.google.com/googlebooks/chrome

Well, Google has already released the “Chrome” Browser for Windows Vista and XP

Download it here

I don’t know why Google doesn’t release products for Linux :(

Waiting for Chrome (Linux Version)

Posted in Chrome, Firefox, Google | Tagged , , , | 2 Comments

Reusing SSH connection

Very often, while working on a network node via SSH, we need multiple connections to the same node. For example, say you are connected to a node A, and then you need to transfer a file to the same node from your local machine. Then we have to scp, which establishes a fresh connection to that machine and one has to enter the password again. So, it takes some time as well as it is irritating to enter password again and again.

Here’s the remedy :

Open the file /etc/ssh/ssh_config on your local machine as root to edit. Or if you are not the root user, you can create a fileĀ  ~/.ssh/configĀ  for user level SSH configurations.

Add the following lines at the end of the file you opened just now:

ControlMaster auto
ControlPath /tmp/ssh-%r@%h:%p

Save the file and you are done !!

Now check out (One can try it this way) -Open a terminal and connect to a server :

$ ssh s.siddharth@202.141.81.145

The connection gets established after entering the proper password.

Then in another terminal try to copy a file from your local machine to the same server :

$ scp -r ~/pintos s.siddharth@202.141.81.145

This time, you don’t need to wait for a fresh connection, neither you will have to enter the password again. File transfer starts instantaneously. SSH shared the already established connection.
Similarly you can open another terminal without waiting and entering the password again.

One can check out more configurations for SSH by checking out the man pages of ssh_config
$ man ssh_config

Hope you liked this tip !!

Posted in Linux, SSH | Tagged , , , | 6 Comments

Download Files Larger Than The Download Limit

Yesterday I had to download a file of size 232 MB. As I connect to the Internet via proxy and the authorities have restricted the file size download limit to 150 MB, I had to find some alternative. Similar scenarios are there in almost all Educational Institutions.

I was searching for the solution, somebody told me about JGet (a Multithreaded Java Software), but it hogs up a lot of system resources. I was in search of an alternate solution, then somebody on ##linux in irc.freenode.net told me about curl. Though I had heard of it earlier as well and I used it to automate web browsing like posting form data etc. But this time when I went through the man pages of curl, I realized how powerful is curl.

There are hundreds of options for CURL. I will just demonstrate you the one option which can help you download files of almost any size.

Lets start off…

In this example I am trying to download 32 Bit Fedora Live CD iso image. In this example, what we will do is download a part of file in one connection. After downloading all files we will concatenate them. This is what almost any Download manager software does.

To download a part of file theres an option -r/ --range available in curl which lets us specify the range of bytes of the file to be downloaded.

Range can be specified in following ways :
curl -r 0-499
This specifies to download first 500 bytes
curl -r 500-999
This specifies to download bytes starting from 500 to 999.
curl -r -500
specifies to download last 500 bytes.
curl -r 500-
specifies to download the bytes from offset 500 and forward

There are few more options. Check out the man pages. ( I have copied the simple options here).

Now here I have to download Fedora live CD iso which is 691 MB in size. So, I will download 100 MB in each connection, like this:
curl -# -r 0-99999999 -o fedora.iso.part1 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 100000000-199999999 -o fedora.iso.part2 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 200000000-299999999 -o fedora.iso.part3 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 300000000-399999999 -o fedora.iso.part4 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 400000000-499999999 -o fedora.iso.part5 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 500000000-599999999 -o fedora.iso.part6 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

curl -# -r 600000000- -o fedora.iso.part7 http://download.fedoraproject.org/pub/fedora/linux/releases/9/Live/i686/Fedora-9-i686-Live.iso &

In the above code -# is to suppress the details of progress meter. You can ignore this option.

After all the files are downloaded, we need to concatenate them. This is quite simple.

$ cat fedora.iso.part? > fedora-9-live.iso
And your live CD iso image is ready as fedora-9-live.iso
To verify the file has been downloaded and concatenated correctly you may verify the checksums before burning it to a CD/DVD.

This process could be automated if somehow by a simple shell script if we could get the file size before starting the downloaded. To accomplish this, I once again went through the man pages. And I found a useful option -I/ --head . This option fetches the HTTP-header only. One can easily get the file size as Content-Length from the HTTP headers. But, when I tried this through proxy servers I got a X-Squid-Error: ERR_TOO_BIG , so couldn’t determine the correct file size. And hence I am unable to automate the process. Anybody, any help ?? (please post it as comment).

Happy Downloading !!

Posted in curl, Linux, proxy | Tagged , , , | 20 Comments

Random Wallpapers in Gnome

There are many softwares in Windows(TM) which changes the wallpaper randomly from a given set of images. I was thinking of this for my Linux machine. I came up with a shell script. Though there can be many other ways. I just wanted to share my script and nothing else.

Update: There’s a tool which does all this automatically. drapes in Universe repository

Here in this code I am assuming that you have got all your wallpaper images in the directory /home/username/Pictures . You have to replace this directory with your wallpaper directory.

Here goes the code :

#! /bin/bash
wallpaper_folder=/home/username/Pictures
wallpaper_array=($wallpaper_folder/*.jpg)
number=${#wallpaper_array[*]}
((number=RANDOM%number))
random_wallpaper=${wallpaper_array[$number]}
gconftool-2 --type string --set /desktop/gnome/background/picture_filename "$random_wallpaper"

Well, so let us quickly analyze the code. First line is the famous ‘sha-bang’.

In the second line I am just setting the path of the wallpaper folder to the variable wallpaper_folder.

Third line I am creating an array containing all the file names with the extension jpg in the directory ‘wallpaper_folder’ (spaces are being escaped). More about bash arrays here.

Fourth line, I am calculating the number of elements in the array. This is the standard method of calculating the number of elements in a bash array. (replacing # with @ will also work fine).

Then in the fifth line, random number is generated within the range 0 to ‘number’. More about random numbers in bash here.

Sixth line set the variable random_wallpaper to the value corresponding to the key ‘number’ in the array wallpaper_array.

Seventh line, finally sets the file ‘random_wallpaper’ as the wallpaper. gconftool-2 is used to do customization in GNOME settings. Check out the man pages of gconftool-2 to know more about it. There’s a GUI tool for this gconftool-2 : gconf-editor

Now this script just sets the wallpaper randomly from a given set of images. Now you can schedule this script using cron to execute it at some regular interval. (In case you dont know what is cron, check out the manual pages of cron and crontab).

Posted in GNOME, Linux | Tagged , , | 3 Comments