December 24, 2006

Now I can create my blog posts from Google Docs! Google guys are awesome. Slowly, I am starting to like Google Docs. It didn't interest me much when Google Docs was introduced originally. Since I use many features of Microsoft Word, Google Docs feels like using Notepad with formatting abilities. Yes, I still miss a lot of features I am used to using. But I like Google Docs for at least these reasons:
  • I don't have to save my documents. It's done automatically.
  • Collaborating is really very easy. Multiple users can edit the same document simultaneously. To let someone view my document, all I have to give them is a link. Whenever I update the document, I don't have to send the new version to them; they always get the latest document.
  • I don't have to carry around my files. It's always there in Google servers (with enough backups :-).

Google Docs is in its infancy now. After a few years, I guess, I won't miss Microsoft Word!

PS: I used Google Docs to write this post.


My Own Sify Broadband Client

** Update: This project is now hosted on Google Code. See http://code.google.com/p/msify/wiki/GettingStarted for more information and to download the latest version. ** I just got a new Sify BroadBand connection. My experience with Sify Broadband proved again that using a non-Windows machine in India is not very easy. I will spare my Linux-In-India woes to another post. Now let me tell you about the tools I use to log in to Sify's network. All Sify customers are assigned a static IP address. To be able to use Sify Broadband, we have to configure our machine to use that particualr IP address. Sify provides different client programs for different operating systems. With these programs only we can sign into their network. Using their Linux client is a pain. The client program has two parts -- sifyd that runs in the background, and sifyconnect that we can use to log into Sify's network. I was not very happy with these programs because:
  • If something goes bad, sifyd dies. We have to manually spawn it again. And only root user can do that.
  • sifyconnect will not let me pass my user name and password in the command-line. Every time, I have to type my user name and password only when it's ready to accept my input. For obvious reasons, password is read from the terminal instead of standard input. Hence I cannot write a shell script to run sifyconnect and input my user name and password automatically.
  • I have to manually reconfigure my network to Sify-specified IP address etc. before I invoke sifyconnect.
It is fortunate that there is a third-party open source Sify Broadband client called EasySify. I downloaded its code to find what's happening underneath. With some small experiments I could understand that they are using a really simple protocol between the client and the server. In a few hours I could write my own version of Sify client. How is my client program different from Sify? The big difference (that matters for me) is that it delivers me what I want in the way I want it to be. :-) My client also has two parts (no, not in any way similar to sifyconnect/sifyd ;-). One shell script that reconfigures my network connection to match Sify's network and a Python program that actually talks to Sify server over HTTP. Both the programs take input from ~/.sify configuration file. My .sify file looks like this:
[network]
interface = eth0
localip = 14.44.23.101
netmask = 255.255.255.0
gateway = 14.44.23.1
nameserver1 = 202.144.10.50
nameserver2 = 202.144.13.50

[authentication]
username = my_username
password = my_password
Once this file is ready, all I need are set-ifconfig.sh and sify.py. I put both the files in ~/bin, which is in my PATH, and I am done! When I come back from office, all I have to do is to connect the network cable and run the command sify.py i to log in to Sify. To disconnect, I just type sify.py o. Life is easier now! If you are interested, you are free to download and use it. Before that, I must tell you a few limitations of this script:
  • Your password must be specified in the config file. If you cannot do so for security reasons, this script won't work.
  • You won't see good-looking output from the script. It spews out whatever XML it receives from the server.
  • It works only in Linux. (Check out EasySify if you use Windows.)
Changing the script to eliminate these problems is fairly trivial. But for my usage, current version is good enough. If you think you can use this script if at all it's a bit more friendlier to the user (with improved error-handling, easy-to-understand messages etc.), let me know. I will make the changes for you.