Thursday, November 22, 2007

Philippe Jaroussky - Vivaldi Aria

If you ever doubt there's a God in heaven, just listen to Philippe Jaroussky sing.

Monday, October 29, 2007

GMail over IMAP

GMail finally offers IMAP access. Now all we need is an IMAP client that does not suck.

Offline IMAP access is terrible in Thunderbird and even worse in Outlook. GMail's mobile interfaces, basic HTML and Java applet, work really well for accessing your email on the move. The full blown GMail web interface offers unmatched scalability, search, calendar, chat and docs integration. Moving back to Thunderbird is just too painful.

I reckon the best usage for GMail's IMAP access is that it is now trivial to backup your GMail data. See ImapSize or the plethora of IMAP backup/sync tools on Freshmeat. It works great for Google Apps For Domain users too.

Monday, September 24, 2007

OpenBSD 4.1 Live CD

OpenBSD is an excellent choice for debugging and troubleshooting network problems as it offers a wealth of advanced functionality right out of the box:

  1. support for most hardware
  2. Layer 2 functionality: bridging, trunking, 802.1Q VLANs
  3. Layer 3 functionality: static routing, OSPF, BGP
  4. pf and altq for firewalling and QoS
  5. user land servers: dhcp, dns, httpd
I created an OpenBSD Live CD that I could just drop into any x86 computer (compatible with the GENERIC kernel) and enjoy a basic install of an OpenBSD system. I simply did a basic install of OpenBSD in my hard disk using the bsd, bsd.mp, bsd.rd, base, etc, man file sets (note no x11), and copied them to the CDROM. Minimal modification was required to ensure that /dev, /etc, /var and /usr/local were writeable. Other than this, the Live CD is identical to a real OpenBSD 4.1 install.

Steps to use this OpenBSD 4.1 Live CD:
  1. Download from: primary site, md5 (please contact me if you can help by mirroring)
  2. Decompress the obsd41_livecd.7z file using 7-Zip and burn the ISO to a CDROM. The uncompressed ISO is 183MB.
  3. Boot the target PC using the Live CD.
  4. The kernel will automatically boot with the -a flag and will prompt you for the root device location. This allows you to mount the root filesystem from any device (another reason this step exists is because there's no reliably way of auto detecting the CD you booted from). If you are booting from your first CDROM drive enter cd0a at the kernel prompt.
  5. Once booting is complete, you can login with the root account. The root account has a blank password (yes, this is intentional) so just press Enter and you'll be dropped into a root shell.
  6. Only the lo0 interface is automatically configured on boot, and all other network interfaces must be configured manually.
Features/limitations of this Live CD:
  1. The Live CD works only on x86 hardware.
  2. The Live CD contains a installation of the bsd, bsd.mp, bsd.rd, base, etc, and man file sets.
  3. The compilers, games, X11, source code, etc file sets are not installed.
  4. You cannot remove the Live CD from the CDROM drive while the Live CD is in use as the root file system is mounted directly from the CD.
  5. The Live CD has no persistent storage, so any changes you make to the system will be lost when you shutdown the system. You need to handle persistence manually.
  6. After the Live CD boots, /dev, /tmp, /var and /usr/local are mounted on writeable MFS file systems. You can use pkg_add and temporarily install packages in /usr/local. /tmp is mounted without the noexec/nosuid flags, so you can run binaries from these locations.
  7. Unlike other Live CDs, you do not have the option to install OpenBSD to your hard disk from within the Live CD. Note that however, there's nothing stopping you from formatting your disk and going through the installation process manually.
  8. The only way of customizing this Live CD, is by building your own! OpenBSD makes it really simple affair to roll your own Live CDs, and I'll be documenting this process in another blog post in the future.
Bugs:
  1. Despite all my efforts with mkhybrid, TRANS.TBL files are not hidden
  2. File permissions in the CD filesystem are wonky (dirs 555, files 444, binaries 555), but has not broken anything so far. SSH keys in /etc/ssh escape this limitation with only a warning, and this is because /etc is moved to mfs early in the boot process.

Sunday, September 09, 2007

Pavarotti dies

On 6th September 2007 Luciano Pavarotti rests in peace forever. Here is Pavarotti performing Nessun Dorma (Let no one sleep) in Paris in 1998. Bravo! Bravo!

Tuesday, July 03, 2007

Using mairix through procmail

My email provider Dream Host runs the Courier IMAP server and I primarily use Mozilla Thunderbird as my mail client. I've had numerous problems with Thunderbird's off-line IMAP support and email search that I've started looking for other solutions.

When I was using mutt as my email client, I also used mairix to index and search my emails. Mairix is a brilliant program that offers GMail like full text search of your emails. I've missed that functionality ever since, so I started thinking on how to integrate Thunderbird and mairix. After some delusional ideas about building Thunderbird extensions and wrapping mairix in a cgi script, I finally hit on the obvious: run mairix through procmail.

So I wrote a procmail rule that invokes mairix and dumps the search results in predefined IMAP folder. To search my emails in Thunderbird, I simply send myself an email with a special subject line that triggers mairix. Mairix then populates the "search" folder with search results which I access from Thunderbird.

If you have already used mairix and procmail, implementing this is a trivial task. Here is my setup in case you need some help:

Mairix:

  1. I periodically run mairix indexing from cron so that the mairix db is up to date. You can also trigger the mairix indexing process whenever an email is delivered by using a procmail recipie. If you receive a huge quantity of email the later method is not recommended as it can increase server load.
  2. Mairix supports incremental indexing, so periodically running mairix is fast. Mairix always uses the index to return search results, so having an up to date index is crucial. My 500MB of mail boxes has a 2MB mairix index database.
  3. Please read the mairix documentation for an explanation of the mairixrc file
# ~/.mairixrc
base=~/Maildir
database=~/Maildir/mairixdb
maildir=.Inbox:.Archived
mfolder=.search

Procmail:
  1. you'll need to change ME@MYDOMAIN with your own email ID so that mairix is not accidentally triggered when someone else sends you an email.
  2. subject line of the email you send needs be of the form [search] needle. Everything after [search] is passed to mairix on the command line. Please refer to the mairix documentation for a list of search terms that can be used.

# ~/.procmailrc
MAILDIR=$HOME/Maildir

SHELL=/bin/sh
# no procmail_log

# enable mairix searches through email
:0:hw
* ^From:.*ME@MYDOMAIN\.com
* ^Subject: .*\[search\] \/.*
| ~/bin/mairix $MATCH

# catch all for inbox
:0
$HOME/Maildir/

Wednesday, June 13, 2007

Clinton's at Harvard Uni Class Day

Open Culture has an interesting video of Bill Clinton speaking at Harvard University's Class Day event. A quote from the article:

... it reminds us that there may be again a day when we can look to the White House for leadership and inspiration.

Update: oculture.com link is broken. Youtube carries the same videos in 3 parts - part 1, part 2 and part 3.

I'm a huge supporter of Clinton's current humanitarian work in building a better world. Incidentally, he won the 2007 TED prize and his acceptance speech is also worth watching.

In the same way, I hope that our own President Abdul Kalam will also reach greater heights once his term in office is over and he's free of political incumbents.

Sunday, May 06, 2007

Carina Nebula: The Cosmic Crucible

In celebration of the Hubble 17th launch date anniversary, astronomers released the largest panoramic photographs every taken by the Hubble's cameras. The Carina Nebula is 50 light years across and shows the birth and death of stars in an unprecedented level of detail (click the image below for a high-res version).


Hubble website has plenty of details of this magnificent nebula: Star birth in the Extreme, Carina Nebula Details, Key to Detail Images.

Saturday, April 14, 2007

Book review: Advanced Linux Programming

CodeSourcery has made their Advanced Linux Programming book a free download.

This is as close to the indispensable Richard Stevens' Advanced Programming in the Unix Environment as you can get. ALP is highly recommended reading.

Monday, April 02, 2007

Hubble Detects 50,000 Galaxies

Hubble recently identified 50,000 evolving galaxies near the Big Dipper.

Read the full article from hubble site and the photo that puts everything in perspective.

I don't think I can get used to how big the Universe is. Ever.

Wednesday, February 28, 2007

Most unforgettable photos ever

Dismal World has some unforgettable photos. These are ones that have opened the eyes of nations to acts of aggression and despair. Photos that changed the world. See, feel, and reflect on how precious life is, and it's futility.

Tuesday, February 27, 2007

Free book summaries: wikisummaries.org

WikiSummaries.org offers free summaries of the latest books. There are only ~ 40 books at the moment, but I'm sure the list will grow in the future. David Allen's Get Things Done: The Art of Stress-Free Productivity has been summarized rather well.

Btw, if you want to read (or listen to audio books), head over to the Project Gutenberg website. They have over 17,000 books that are out of copyright.

Sunday, February 25, 2007

My photos are up on picasa!

My photo albums are now hosted on Picasa. Head over and take a look!

Thursday, February 22, 2007

Hubble Deep Space Photos

In 1995, the Hubble Space Telescope peered into a blank, uninteresting part of the sky for 10 days. Scientists were searching for possibilities of distant stars. This image was known as the Hubble Deep Field. Later on in September 2003, the Hubble repeated it's attempt at deep space imaging - the Hubble Ultra Deep Field [HUDF].

The results were nothing short of astounding and humbling!

Take a grain of sand and hold it at arms length. That's the size of sky the Hubble was looking at, and in this tiny patch of empty sky, the Hubble discovered 10,000 galaxies. Many of them as far as 78 billion light years away. This is the farthest mankind has ever looked into space.

Our planet revolves around a rather unremarkable star - the Sun - which along with billions of other stars is a part of an unremarkable galaxy - the Milky Way. A piece of unremarkable sky, the size of a grain of sand, holds 10,000 such galaxies. It seems ludicrous to think that the Earth is the only living planet in the Universe.

Wikipedia has more information on HDF and HUDF and the associated research.

Wednesday, February 21, 2007

Joel Spolsky on Customer Support

Joel Spolsky has written an excellent article titled the Seven tips for remarkable customer support. Head over to his website for other interesting articles.

Wednesday, October 04, 2006

Low level flight through Paris

One August morning in 1976, French filmmaker Claude Lelouch mounted a camera on the front bumper of his Ferrari 275GTB and had a friend, a F1 driver, rip through the streets of Paris.

I heard about the famed cult video ages ago and finally found it! You can even follow the adventure in realtime on this Google Maps mashup.

Running 18 red lights, and reckless driving got Lelouch arrested after he screened the video. He however claimed that he had taken adequate precautions. He further protected the identity of this friend, the driver.

Since the car is never revealed in the video, the usual suspects were a series of exotics -- 275GTB, Alpine A110, or even a Matara 675.

Wild speculation aside, Lelouch recently confessed that he was driving his own 6.9L Mercedes and tapped over the audio from a 275GTB. The car never exceeded 145kmph. I wish he never said the truth... imagination is better than reality.

The Ghost Rider offers solace.

My best long distance run has been the 530 kms from Kodai to Chennai in 6 hrs 30 mins. Short distances runs inside Chennai is my regular return from work drive, from the Thousand Lights Mosque area to Adyar in a tad over 7 mins.

Friday, September 08, 2006

Shuffle without iTunes

I bought an iPod Shuffle some time in July 2005 and was immediately annoyed because it worked only with iTunes. In my opinion, the sanest way to download content to a USB attached audio player is to make the device available as a USB Mass Storage Device and just copy files to it as you would on a USB memory stick. Salvation was not far away...

Googlemancy revealed that Martin Fiedler's shuffle-db Python script would allow me to dispense with iTunes entirely. The only shortfall with shuffle-db was that it required your computer to have Python installed. While most Linuxen come with Python, Windows boxes typically don't. I used the excellent py2exe extension and compiled shuffle-db script into standalone executables, shuffle-db-0.7-pre1.zip and shuffle-db-1.0-rc1-winxp.zip are both available. The 0.7-pre1 release should work on Win2k/XPwhile the 1.0-rc1 release has been tested on WinXP SP2 only.

If you have iTunes, this is good time to uninstall it. Plug in your Shuffle and it should appear as a regular USB Removable Storage Device. If your Shuffle is unused, you need to initialize it correctly before proceeding. The "Usage" section of the shuffle-db website has details.

Unzip the files into the root directory of your Shuffle. My Shuffle is mounted as the F: and this may be different on your box, so ensure that the runme shortcut points to rebuild_db.exe.

If you are on a non-Windows platform and have Python installed, you can still use shuffle-db, by running python rebuild_db.py.

Copy/delete mp3 files to/from any folder on the Shuffle. Before disconnecting the Shuffle from your computer, double click the runme shortcut. This runs rebuild_db.exe and recreates the necessary index. That's all there is to it!

Note that shuffle-db silently ignores non audio files, and the iPod can be used as a USB memory stick as well.

Thursday, September 07, 2006

GMail as smarthost for FreeBSD-6.1 Sendmail

Update: This does not work!! FreeBSD 6.1 sendmail does not include TLS (GNU TLS or SSL), so you need to recompile sendmail with TLS support. Easier still is to install Exim 4 from ports that supports all we need.


I run a FreeBSD 6.1 box at home and want to send emails from it by using GMail as my mail relay (smarthost). GMail provides secure mail relaying by using SMTP AUTH and TLS. Hence this setup will work for DSL users on a dynamic IP addresses as well as mobile users.

Here is how you go about setting up all this:

Step 0: DNS settings

If you don't have a fully qualified DNS entry for your box, sendmail will have trouble starting up. I have a Dynamic DNS domain mithila.ath.cx and it's wild carded, ie. *.mithila.ath.cx will all point to mithila.ath.cx. My /etc/resolv.conf looks like this:
search mithila.ath.cx
nameserver 208.67.222.222
nameserver 208.67.220.220
I use OpenDNS as my servers because my ISP DNS servers are unreliable.

Step 1: Editing freebsd.mc

Edit /etc/mail/freebsd.mc and add the following lines to the bottom of the file:

define(`SMART_HOST',`smtp.gmail.com')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl
define(`CERT_DIR', `MAIL_SETTINGS_DIR`'certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/CAcert.pem')
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')

Step 2: Create client-info with your gmail username/password

[root@mithila /etc/mail] mkdir /etc/mail/auth
[root@mithila /etc/mail] touch /etc/mail/auth/client-info
The contents of /etc/mail/auth/client-info is a single line:
[root@mithila /etc/mail/auth]# cat client-info
AuthInfo:smtp.gmail.com "U:root" "I:GMAILUSER@gmail.com" "P:PASSWORD"
Replace GMAILUSER with your gmail username and PASSWORD with your gmail password. Note that you are storing your gmail password in clear text, so please take the necessary precautions.

To create the client-info hash, run the following:
[root@mithila /etc/mail/auth] makemap hash client-info < client-info

Finish this step by fixing the ownership and permission on your files (sendmail is picky about this):
[root@mithila /etc/mail/auth] chown -R root:wheel /etc/mail/auth
[root@mithila /etc/mail/auth] chmod 700 /etc/mail/auth
[root@mithila /etc/mail/auth] chmod 600 /etc/mail/auth/*

Step 3: Creating SSL certs

The OpenBSD starttls(8) manpage has an excellent walkthrough for creating an SSL certs. Following is just a repeat of the relevant bits of the manpage.

[root@mithila /etc/mail] mkdir /etc/mail/certs
[root@mithila /etc/mail] cd certs
[root@mithila /etc/mail/certs] openssl dsaparam 1024 -out dsa1024.pem
[root@mithila /etc/mail/certs] openssl req -x509 -nodes -days 3650 -newkey dsa:dsa1024.pem -out /etc/mail/certs/mycert.pem -keyout /etc/mail/certs/mykey.pem
[root@mithila /etc/mail/certs] ln -s /etc/mail/certs/mycert.pem /etc/mail/certs/CAcert.pem
[root@mithila /etc/mail/certs] openssl req -x509 -new -days 3650 -key /etc/mail/certs/mykey.pem -out /etc/mail/certs/mycert.pem

Remove temporary files and fix ownership and permissions:

[root@mithila /etc/mail/certs] rm dsa1024.pem
[root@mithila /etc/mail/certs] chown -R root:wheel .
[root@mithila /etc/mail/certs] chmod 700 .
[root@mithila /etc/mail/certs] chmod 600 *

Step 4: Create new sendmail.cf

[root@mithila /etc/mail] make; make install
[root@mithila /etc/mail] /etc/rc.d/sendmail stop
[root@mithila /etc/mail] /etc/rc.d/sendmail start 
Watch /var/log/maillog for errors when sendmail is restarted.

Step 5: send test email

[rsubr@mithila ~] mail -s 'MAILTEST' GMAILUSER@gmail.com < /etc/motd
[rsubr@mithila ~] mail -s 'MAILTEST' username@domain.com < /etc/motd
Watch /var/log/maillog for errors. That's all folks!

Issues

Ensure that your box is capable of resolving MX records for domains.
[rsubr@mithila ~] dig -t mx gmail.com
For some strange reason, my DSL router did not want to resolve mx records, and sendmail barfed. Using the right DNS servers in /etc/resolv.conf should do the trick, or you could just run named and point DNS to localhost. I chose the former, and since my ISP (Airtel) has unreliable DNS servers, I use the OpenDNS servers 208.67.222.222, 208.67.220.220.

Tuesday, September 05, 2006

Electric Sheep

Do androids dream of electric sheep? What does your computer dream about? Spot Draves started the Electric Sheep project in 1999 that enabled tens of thousands of computers to collectively dream. The Dreams in High Fidelity website has high resolution computer dreams. There are dozens beautiful images from the archive.

Sunday, September 03, 2006

Race to the clouds

A video of Monster Tajima's latest attempt at conquering Pikes Peak showed up on YouTube recently. Monster was announced the overall winner and Suzuki Sport website has more.

YouTube also has the Climb Dance video of Ari Vatanen's 1998 attempt at taming the Mountain in a purpose built Peugeot 405-T16. Simply watching the video gives me the shivers! Ari is God.

Ari Vatanen: Our lives can't be judged by a stopwatch.

Thursday, August 31, 2006

Emerson's Success

Success
To laugh often and much;
to win the respect of intelligent people
and the affection of children;
to earn the appreciation of honest critics
and endure the betrayal of false friends;
to appreciate beauty; to find the best in others;
to leave the world a bit better,
whether by a healthy child,
a garden patch
or a redeemed social condition;
to know even one life has breathed easier
because you have lived.
This is to have succeeded.

This poem is often credited to Ralph Emerson, but there is some controversy around it.

Anyway, Emerson is my inspirational poet/author for September. rwe.org has the complete works of Emerson for free.