The UK

Recently (July 9-23), I spent some time in the UK. I've been a bit busy since then, and have not had time to write up my activities and post them. Anyway, I've got some time now, so I'm posting now :-). The primary reason I went to the UK was for the FLoC '10 conference (which was held in Edinburgh, Scotland), where I had a paper in CAV. There is more info (including the paper) on my school home page.

We spent a few days wandering around London, which is quite the tourist trap. I went and saw Abbey Road and walked across the zebra crossing, we went and saw the Eye and Tower of London, we saw the Sherlock Holmes museum, we went to Greenwich to sand on the prime meridian, and Windsor Castle. The world cup final (Spain vs. Holland) occurred, and we watched it in an English pub. Naturally, there were many other visits to pubs too... I had to get the full experience, you know ;-).

After London, we went to Edinburgh for the conference. We didn't do much sight seeing while the conference was in session, but we did eat quite a lot of food, including haggis at the fancy conference dinner where we got to here a bagpiper recite the Address to a Haggis before our meal.

After the conference, we spent a day touring Glasgow, a day touring Edinburgh, and a day touring the Scottish country side (including a boat ride across Loch Ness, but no Nessie sighting). It was a fun trip!

Aditya and I took lots and lots of photos, so enjoy! I stitched some panoramas together, and some of them turned out pretty good. Note that there are no thumbnails because the images are huge, and the thumbnail generation program crashes on them. You'll just have to download them (but do it on a computer with lots of RAM, as the images are ~25 MB each). Enjoy!

Primus sucks!

Last night I went to my first (but hopefully not last!) Primus show. The show itself was fantastic, Les Claypool is a fantastically weird and equally awesome bassist. I learned that Les is writing a new album with Primus to be released in 2011, which is awesome (there's a Meshuggah album due out then too, it's going to be a great year for music).

For those who are curious about the title: Primus' slogan is "Primus Sucks". It came to be when everyone kept commenting on how incredibly talented Les (and indeed, all the band members were): "hey, you're really good!". Eventually, Les started responding with "No, we suck", and their slogan was born. So, if you're a true Primus fan, you say "Hey man, Primus sucks!". It was chanted during the encore at the show last night.

Anyway, I get to cross another band off of my list. Woohoo!

Gmail, Conky, and libnotify

Several years ago I discovered a fantastic system monitor named conky. Over the years I've been tweaking my .conkyrc and it has really evolved into a little command center all on it's own. However, I read my e-mail through a mutt, and thus to check it I have to open mutt and look and see if I have any new mail. This is often obnoxious, because I'll either forget to check and miss something until later, or I'll check a lot and not get any e-mail. Today it occurred to me "hey, computers are good at repetitive tasks!", so I decided to automatically check my e-mail and render the results in conky. I also have heard lots of noise about libnotify, and how wonderful it is, so I decided to use that as well. The result is a script which checks a user's Gmail (using a password stored in a keyring), updates conky, and shows a libnotify notification if necessary. It also supports querying of arbitrary Gmail labels, allowing you to display unread counts for other e-mail addresses you might possibly have mapped to your Gmail account.

You can get your own copy to play around with if you like. It's fairly well documented, but I'll answer any questions anyone has. The dependencies (at least on Ubuntu) are python-notify python-keyring and your favorite of: python-keyring-gnome or python-keyring-kwallet.

I've released it under a beerware style license, in hopes that someone, somewhere, might find it useful. Feedback is appreciated!

Gmail Atom Feed Authentication

Perhaps the most complicated part of the application in my recent post was the authentication with Gmail. Although my final method boils down to only a few lines of python, Google describes several different ways to authenticate (additionally, putting the username and password directly in the URL). I didn't like any of these options, as some seemed much too complicated for what I wanted to do, some didn't work, and some were too insecure. However, it turns out that the atom feed supports HTTP's basic access authentication. In python, this is fairly easy to do:

$ python
>>> import urllib2, base64
>>> username = "me@gmail.com"; password = "secret"
>>> url = "https://mail.google.com/mail/feed/atom/"
>>> req = urllib2.Request(url)
>>> authstr = base64.encodestring("%s:%s" % (username, password))[:-1]
>>> req.add_header("Authorization", "Basic " + authstr)
>>> urllib2.urlopen(req).read()

Note that the above also works for Google apps users you just have to stick "/a/example.com" in the appropriate spot in the URL. Hopefully this will help out someone else who is hopelessly bashing Google's servers with failed login attempts ;-)