Restart/Shutdown your Linux machine using dbus

Ok. This is fairly trivial stuff for many of you, but what I found interesting is that the SystemBus lets you shutdown/restart/suspend/hibernate as an ordinary user. Of course, if you think of a desktop, that is a pretty basic expectation of what an ordinary end-user should be able to do. But when I think about a server, the thought that people can bypass a sudo while doing a shutdown makes me uneasy.

Regular expressions in Python by example

Every time I come back to Python from the land of Perl here at work, I need to re-learn how to use regular expressions in Python, as it is, IMHO, quite a bit different from Perl. Rather than trawling through the docs again, I made some online notes this time. Hope it is useful to somebody.

The constant conflict between the Maker's Schedule and Manager's Schedule

This is something that has bothered me always for the past several years, especially in the period when I was working on my own. Paul Graham has managed to put this so eloquently into words: … There are two types of schedule, which I’ll call the manager’s schedule and the maker’s schedule. The manager’s schedule is for bosses. Its embodied in the traditional appointment book, with each day cut into one hour intervals.

Quick local DNS caching for your workstation in Ubuntu

The latest Ubuntu releases makes it real easy to set up a local DNS cache for your workstation using dnscache from the well-known djbdns software by D. J. Bernstein. For those who have historically installed djbdns/ucspi-tcp/daemontools from source because of distribution restrictions, things changed really for the better after DJB placed all these software in the public domain in 2007. You can now setup all this in about one minute! (depending on your Internet connection though.

The magical moment that made me a FOSS guy forever

11 years back, I was just yet another guy out of college with a background of Turbo C/C++ and Pascal as most other batchmates of mine. My software career could have gone anywhere. PC Quest Linux was just a toy with which I was playing with but wasn’t too much attached to yet. A stroke of good luck helped me get an opportunity to work with one of my close school friends - Inder, who introduced me to PHP 3.

Quick tip: Merging photos from two different cameras

This time when we went to Pondicherry on the year end, we took two cameras - I took my Rebel XTi and my wife the LX3. While uploading our photos to Flickr, we had a problem. We wanted to merge our photo sets, but because of the different photo naming conventions of the two cameras, the photos won’t be sorted according to time taken. The solution, as I found out after a bit of digging and trying out different exif tools, was simple enough.

Adding new CA certificates in Ubuntu (Jaunty)

A quick tip. I couldn’t find this from a quick search when I really needed it. The problem - command line programs like fetchmail use the system wide openssl CA certificates to verify the authenticity of the server certificates they are provided when they connect to an SSL server like POP3 or IMAP. Sometimes, you will have providers like Dreamhost, who will get smart and ditch the atrocious certificate issuing set up we have right now, and give you a self-signed certificate to verify their servers.

Using the official Flickr uploadr on Ubuntu

I normally use jUploader for uploading photos to Flickr from my Ubuntu Jaunty box. However, since I got the amazing Panasonic DMC-LX3 compact camera, I have been uploading HD videos too to Flickr. Now none of the FOSS tools that I know of support video right now. Since I insist on uploading photos in the order that I have taken them, it makes my photo upload workflow really messy - upload a few photos from jUploader, go to flickr.

Akamai awesomeness and Opendns lameness

Akamai footprint awesomeness. My IP address. sandipb@pluto:~$ wget -O - -q;echo sandipb@pluto:~$ host domain name pointer Akamai CDN for downloading Adobe AIR. sandipb@pluto:~$ host is an alias for is an alias for is an alias for has address has address sandipb@pluto:~$ host domain name pointer I am downloading from a server co-located at my ISP.

Getting more printable PDFs from texinfo manuals

Texinfo manuals are used primarily by various GNU projects like Glibc, gcc, gdb, etc. Texinfo is an extremely powerful format for writing high quality professional documentation and can be easily converted to HTML, PDF, Docbook XML and various other formats. The language features tex macros which are quite easy to pick up, and much easier to hand write as compared to the new fangled XML formats. However, my pet grouse for a long time was that the PDFs, which look excellent on screen don’t seem to print too well on paper.