Latest Publications

Tweeting from Bash

I know that this is nothing new, but I too have begun tweeting from the shell. I use a bash script which POSTs the required data to the Twitter servers. It also uses ispell to run a quick spell-check before POSTing. See the code here.

My CV (Phew)

After hours of reviewing and proofreading here is the first usable version of my CV. I know it is not perfect. It never will be. And I’ll probably change it.

Long Time No C

For quite some time I have been working on a simulator which we (me with the other awesome folks from http://robotix.in) would use to evaluate the submissions for our XAnts problem statement. I initially implemented the entire thing in pure Java (I know … What was I thinking?) but in the past few days have re-implemented a lot of it in C. The code I’ve written so far is up on github on my fresh new account.


A lot of my coding style has been influenced by what I have seen of the Linux kernel. The project is currently in its infancy and has absolutely no documentation (yet). I intend to release the first few versions that solely run on *NIX and will slowly port the entire thing to Windows as well. That should only involve re-writing some socket code.

Installing libstdc++5 on Squeeze

I was getting started with the Google Web Toolkit and the Google App Engine when I ran into a very strange problem – I got a ** Unable to load Mozilla for hosted mode ** error. Apparently the Google plugin for Eclipse is not linked to libstdc++6 but to libstdc++5 – something my ‘Squeeze’ Debian system does not have.


Some googling told me that a simple sudo apt-get install libstdc++5 should do the trick. Upon that, however, the sweet little package manager gently reminded me that Package libstdc++5 has no installation candidate. Other packages which looked like things that could possibly work gave errors like Package libstdc++5-3.3-dbg is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source rendering me a whole lot of help.


After some more hit and trial I figured out I should just download the deb package and install it using dpkg. But that did not work since the package depended on gcc-3.3-base and I had gcc-4.1-base installed. Ultimately, overcome by frustration, I extracted libstdc++5.0.7.so from the deb package to /usr/lib/libstdc++5.so. I never thought it would work. It did.

Why I prefer GNU/Linux to Microsoft Windows

I have a particularly nosy friend (lets call him R) who happens to storm into my room every now and then trying to convince me to give up on my sweet little GNU/Linux system and to switch back to Windows (it’s true, I did use Windows once). His typical line of reasoning includes any or all of the following:

  • Windows has a GUI and hence is better than a typical GNU/Linux system where all you have is a blinking cursor on a black screen where you type in stuff to make stuff happen.
  • Windows has better hardware support (having to install drivers for everything other than the basic system devices apparently makes windows more flexible).
  • Linux kicked my dog and stole my girlfriend (or was that Linus?).
  • Photoshop, 3DS Max and Dreamweaver (he’s probably right on this one …)
  • Any other arbitrary point on similar lines.

Jokes apart, R does raise an important point – Window is not as unstable as most GNU/Linux gurus tout it to be (for this discussion, ‘Windows’ == ‘Windows NT’ and not the Windows 9X shit). The latest version of Microsoft Windows, Windows 7, puts up a nice show and it is probably easier to get a root shell prompt on a typical personal GNU/Linux box (just add init=/bin/sh to the kernel command line in GRUB) than hack into an administrator account on a Windows NT based system. So why do I use GNU/Linux?


Do not get me wrong – I love GNU/Linux, to the extent of being a fan but I am try to not have the holier-than-thou image some people try to project, GNU/Linux is the most down-to-earth software I’ve ever seen – it should not give you wings (reminds me of this XKCD comic). Nevertheless there are essentially three reasons why I prefer GNU/Linux to Microsoft Windows


3. GNU/Linux is free (as in free speech … well mostly). This may be a big deal to most people but I am more of a pragmatist that an idealist, GNU/Linux being free is important but not the most important thing on my list.


2. Logical structure – anyone who has carefully examined a Windows system and a *NIX system will have noticed how arbitrary most of the conventions on Microsoft Windows are while the ones on a *NIX system are logically consistent and generally well-devised. Why do I have to access my first partition at C:\? Where do all the header files go? Where is pkg-config?


1. Transparency and loose coupling – keeping the closed-sourceness of Windows aside I find the entire system, the way the components come together pretty opaque. I mean what is the registry? Sure, Googling will give an answer but adding another level of redirection has definitely made the registry system quite opaque. The same logic applies to mounting and unmounting devices – I can’t do a dd if=crap.img of=/dev/sdb on Windows! Another thing I completely dislike about Windows is how everything is so tightly integrated. In the Arch Linux system I used to run (I recently switched to Debian but more on that later) I could compile and run my own kernel, install a bootloader of my choice (GRUB, LILO, GRUB2 … whatever) and use one of the dozens of Desktop Environments that exist. Can I do the same on Windows?


I do not consider Windows evil (dumb … maybe) but it still has its place. And why not? When we strip down all the technicalities (beyond which many ‘geeks’ fail to see) all that remains are opinions, opinions which are never absolute.

The Start-Up

For the past thirty or so days Anirudh, Anurag and I have been working on an exciting top-secret-not-without-reasons idea which we plan to be our start-up.


Currently we have a working client implementation on the Android platform and we will soon start working on an iPhone based client as well (and then maybe even do something for the Symbian platform).

:|

I have not blogged in a while – have remained busy with both my ADC project and various things particular to the third semester in the life of an IIT Kharagpur student.


I could, however, find time to shift my blog from the free web hosting at http://www.000space.com to a paid hosting service. The PHP executes much faster and the URLs work properly now.


I guess that’s it for now, will be back with slightly more interesting stuff soon.

You know what I did last summer

In a few hours I will be leaving for Kharagpur, after spending a vacation of about two and a half months back here in beautiful Dehradoon valley. Before you continue please understand that this is more like a note to myself than anything else. Nevertheless, you are welcome to read ahead. As I was leaving Kharagpur I resolved to make these ninety odd days as fruitful as possible. And even though nothing is ever perfect I like to think I have succeeded in this to some measurable extent. Some stuff I started during the vacations is not yet complete – I intent to keep working on those specific goals once I reach Kharagpur and get settled in my new hall.

  1. The Digital Circle

    1. For various reasons I ended up writing up a lot of code in Java. Though no self respecting geek will consider writing code in Java a worthy pastime, I ended up learning a lot. The last time I coded in Java was a around three years back and now I discovered I could do things with Java I previously could not. Specifically I ended up knowing a lot about the Android platform – well, enough to judge how crappy it really is.

    2. I set up this very blog. For the record currently the blog is hosted on a free hosting provider (http://www.000space.com) and the domain name was bought from http://www.dynonames.com. I’ve also, very recently, set up Google Apps on my domain – now I have a really neat webmail interface at http://mail.playingwithpointers.com.

    3. I am having a go at hacking the Linux kernel. Though I am nowhere near to writing full-fledged kernel driver modules or debugging kernel panics, I have learnt quite a few things. Currently I am following ‘Linux Device Drivers’ by Colbert, Rubini and Greg and ‘Linux Kernel Development’ by Robert Love. I know I still have a long long way to go but I know I’m getting somewhere (I know basic stuff about how the kernel memory paging, process management – how the scheduler works, writing a basic driver) and will continue to put in my best efforts.

    4. Learned miscellaneous stuff about GNU/Linux – things ranging from some basic GNU utilities present in a typical distribution to licensing and patenting issues.

  2. The Offliners

    1. After two months of debating with so called logical theists I am finally a firm atheist. After a lot of thinking I’ve finally figured out exactly why theism does not make sense. Will probably write more on this in a later post.

    2. Connected with a few of my old friends. Though I could not connect as much as I wished I could, but I did have fun.

    3. Worked out big time. I hit the gym everyday for the past ninety days and lifted weights like an ox.

    4. Tried to learn up new things as much as possible – looked up Wikipedia for every small thing that struck my curiosity.

    5. Rediscovered coffee – I’ve already dedicated a post to this topic I think.

The Avant Window Manager

My Desktop with AWN

My Desktop with AWN

I generally stay away from the my-desktop-is-flashy-so-what-if-it-eats-CPU crowd but I seem to have met my match. Day before yesterday I installed The Avant Window Manager. Currently I am running AWN on top of XFCE. I’ve removed the XFCE panel and now all I have is the AWN running at the bottom of my screen.

The AWN Popup Terminal

The AWN Popup Terminal

I absolutely love the popup terminal applet that comes with AWN. Though it is difficult to comment on how long I will find AWN as interesting as I find it now but, as they say, so far so good.

Rendezvous with GRUB2

I recently upgraded my boot-loader to GNU GRUB 2. It has several new interesting features which sets it apart it from the older version, now termed GRUB Legacy

Another reason for my upgrade to GNU GRUB 2 was that GRUB legacy it no longer being under active development – no new features will be added to it, ever. The GNU website cites messy code as the primary reason for this decision. GRUB 2, as of now, is relatively stable and will probably run properly on your system unless you happen to have a really weird configuration.

On a typical Arch GNU/Linux system a simple sudo pacman -S grub2 will do the job. The sweet little package manager actually will tell you about the new grub2 package conflicting with the older grub package and will offer to remove the older package for you.

One very important difference between GRUB Legacy and GRUB 2 is the configuration file – instead of /boot/grub/menu.lst the configuration file is stored at /boot/grub/grub.cfg. The format is also very different, a sample grub.cfg would look like


# Timeout for menu
set timeout=10

# Set default boot entry as Entry 0
set default=0

# Entry 0 - Load Linux kernel
menuentry "My Linux Kernel on (hd0,1)" {
set root=(hd0,1)
linux /vmlinuz root=/dev/hda1
initrd /initrd
}

# Entry 1 - Chainload another bootloader
menuentry "Chainload my OS" {
set root=(hd0,3)
chainloader +1
}

The numbering of the hard drives is also different – what was (hd0,8) on my system with GRUB legacy is now (hd0,9).

Coming to the more interesting stuff – you have the option of setting the font for the GRUB interface. You need to convert your fonts to the pf2 format before you can use them. GRUB 2 provides an utility for this conversion – grub-mkfont. I tried converting my favorite Monaco from ttf to pf2 but the menu seems not to like the height of the font – I probably need to pass some extra parameters to grub-mkfont, will work that out later. If your graphics card is currently supported you can actually display a high-resolution GNU menu and maybe even a nice background image (not those 14 color pictures supported by GRUB legacy but a proper JPEG or TGA image). You can do all this by something like the following:


if loadfont /usr/share/grub/unicode.pf2 ; then
set gfxmode="1024x768"
insmod gfxterm
insmod vbe
terminal_output gfxterm
if terminal_output gfxterm; then true ; else
terminal gfxterm
fi
fi

insmod tga
background_image /boot/grub/GrubSplash.tga

Overall the GNU GRUB 2 gives a nice feeling, it is stable on my Acer Aspire 4720z and when I boot up I get a nice 1024×768 background image (it is still unable to display a 1280×800 native resolution) and a nice and smooth font. The new GRUB is also slightly slower – you might notice a slight latency as the bootloader loads itself. In short, the new GRUB looks very promising and coupled with things like scripting support and real memory management one can guess how interesting the future will be.