Tools and hacks


Welcome to my tools page. This is a simple link to the various hacks that I come up with.

Wikipedia: language redirect Example: (takes you to the article on Hamar (哈马尔) in Chinese Wikipedia.

Explanation: redir/from-language/to-language/article.

Example 2: (looks up democracy (ديمقراطي) in Arabic Wikipedia)

Rationale: Supposed to be used through for example a Firefox shortcut ( for your most common combination. I use it frequently for Chinese, when my friend tells me he just made a great page about Moscow, or to find out how they spell Plato.

(source code)

(Update 23.11.2007: Fixed the code so that article names with spaces work again)

Wikipedia: which language has the longest article I, and many of my friends, speak more than one language. Wikipedia sometimes has surprising gems in some of the smaller languages, yet I find myself always going automatically to the English one (or the Norwegian one for Norwegian topics), thus missing out on the cases where other language versions (which I can read) have better articles.

Example:,da,sv,de,it/Democracy (will automatically redirect to the longest article about democracy in any of Norwegian, Danish, Swedish, German and Italian)

Explanation: bigger/language-from/languages-to-comma-separated/article-name

As the above, this is also supposed to be used for a Firefox shortcut, where you pre-program the languages you can understand. Of course size is not a perfect measure of the quality of an article, but it’s a quick proxy for where there is most interesting content.

I was initially reluctant to release this, as I was worried about the impact of WP’s servers (it has to hit every single language version once to get the size), however I now changed it to use HEAD to make its requests, so each request is just a few byte. Through my experience with redir, I know that not many people will use this, and if they do, that’s just an incentive for Wikipedia to implement something similar natively.

(source code)

Hindi-English dictionary

Based on data from, Shabdanjali, and a database from a friend, all released under open licenses. This is an incredibly imperfect first attempt at creating a Hindi-English dictionary in StarDict format. (Read more).

Stardict Hindi-English dictionary XDXF Hindi-English dictionary Python script to convert from ISCII to UTF8 (not written by me, BSD license)

Offline Wikipedia viewer/random access compressed archive system

A ZArchive library function that enables you to store millions of text chunks in a bzip2/gzipped file, and random access them very rapidly. Used in a Wikipedia offline compressor (to process Wikipedia dumps) and a reader (runs as a webserver on localhost, enabling you to access entire Wikipedia versions offline). Written in Ruby. Available from Gitorious.

Simple personal time tracker with Ruby and Growl

A set of scripts designed to use global shortcuts to easily and unobtrusively let you track how you spend your time on different projects while you're at your computer. (Read more).

Available from GitHub.

(Thanks to pvera @ flickr for the photo)