Monthly Archives: June 2009

Using your Gmail contacts in Mutt

I really enjoy using Mutt as my email client. However, sometimes I have to log
into my Gmail account to view my contacts. Tired of this, I exported my Gmail
contacts and imported them into abook.

Now I can view my Gmail contacts in Mutt.

Here’s how I did it:

(Sorry, no cut and paste instructions.)

* Export your Gmail contacts in the vcard format

* Download the abook source and patch it with the vcard diff (available on the abook website). NOTE: you can also use the script available in the contrib/ dir in the source.

* Import your contacts by invoking abook with the following options: ‘–convert –informat vcard –infile INPUT.vcf –outformat abook –outfile ~/.abook/addressbook’

* Configure your abook (see `man abookrc`). abook has sane defaults so your config file can be very minimal:

set www_command=elinks
set add_email_prevent_duplicates=true

* Next, configure mutt to interact with abook. I added the following lines to my muttrc
set query_command=”abook –mutt-query ‘%s'”
macro index,pager A “abook –add-email-query” “add the sender to the address book”

That’s all :). Press A while in Mutt to add a contact and Q to query the address book.

Recent Microsoft Developments

Microsoft has been hard at working preparing for the Windows 7 RTM release in October.

Their latest build of Windows 7 is Build 7232. This build was quickly leaked to torrent sites as a VHD (Virtual Hard Disk), just like the previous iterations: build 7201, 7227, 7229, and 7231.

Another important development is the ‘Microsoft Security Essentials Public Beta.’ Although the beta period is over the reception was generally positive and it is something you can look forward to in the near future (~ late 2009).

I look forward to the RTM release of Windows 7 as well as the next beta of Microsoft Security Essentials.

Budget Intel Gaming Rig ($500)

Recently I built my first gaming rig (also my first PC build) with a measly
budget of $500.

The specs:

  • Case: Antec 300
  • CPU: Intel Pentium E6300 Wolfdale
  • PSU: Antec EA650 650W
  • GPU: Sapphire Radeon HD 4830
  • HDD: Western Digital Cavier SE 320GB
  • Mobo: Gigabyte GA-G31-ES2l LGA 775 Intel µATX
  • RAM: OCZ SLI-Ready 240-pin DDR2 SDRAM DDR2 800

Everything was purchased from Newegg and thanks to a couple combo discounts this build was less than $500 including shipping and applicable tax. It was a tough decision. For example, I switched from a NVIDIA GeForce 9800 GT to a NVIDIA GeForce 8600 GTS, finally settling with a AMD Radeon HD 4830. Fortunately, most of the components are overclockable; with the addition of an aftermarket cooler, I will be flying in no time. As an added bonus, the CPU supports VT which will come in handy for running paravirtualised guests under Linux and Windows XP under Windows 7.

Some thoughts for the future: In the next build, the OCZ memory will be replaced by the Corsair XMS brand and I’m definitely going to consider the Antec Sonata III case.

Update: My build is complete! Although I haven’t installed Linux on it yet, I do get a WEI score of 5.5 (highest is 5.9). I’m quite impressed with the performance of this build as well as the ventilation of the case. Temperatures range from the low thirties (celsius) (for both the CPU and the GPU) under a light load to no higher than 50 degrees for a high load.

A tired mind cannot comprehend pointer arithmetic

One of the problems in K. N. King’s C Programming: A Modern Approach asks the reader to write a function that takes a string and, using two pointers, reverses it.

I spent about two hours fighting against this relatively simple problem. Why? Because the part of my mind that understands with pointer arithmetic wasn’t engaged. The solution is relatively simple:

Managing gpg keys across multiple computers

Manging a secret gpg key-pair across two computers is relatively simple.

Export the secret keys

gpg --export-secret-key -a > myprivate.key

Export your public keys

gpg --export -a > mypublic.key

Import the keys

gpg --import mypublic.key
gpg --import --allow-secret-key-import myprivate.key

That’s all there is to it.

Elinks advanced URI management

In the process of whipping elinks into a tame beast, I discovered several options that I wasn’t aware of.

URI rewriting: allows me to execute Google searches, dictionary lookups, and imdb queries within the ‘Goto URL’ dialog box. It should be enabled by default but if not, go to the Option manager -> Protocols -> URI rewriting and select either Dumb or Smart Prefixes. Once enabled, you can type ‘g search_term’ in the search box to quickly search Google for search_term. Look at the other prefixes to determine your options.

I wasn’t satisfied with having to use a prefix every time I wanted to search, so I modified the default template (Option manager -> Protocols -> URI rewriting -> Default template) to ‘’. This means that any entry in the ‘Goto URL’ dialog box that doesn’t look like a URL, a file, or an existing prefix will result in a Google search with that string!

Sessions: It turns out that elinks is a beast with many abilities, I wasn’t aware that it supported session saving/restoring (Option manager -> User interface -> Sessions).

URI passing: Often, when on the console, I’ll want to share a link with someone but I’ll be restricted by the atrocious lack of copy/paste. To solve the issue while using elinks, I enabled the link-external-command and tab-external-command options to save the highlighted link and current link, respectively, to a file.

To enable it, first go into the keybinding manager, toggle the display, and choose a keybinding for ‘main -> link-external-command’. This will be the keybinding you will press when you want to save the highlighted URL to a file. Likewise, choose a keybinding for ‘main -> tab-external-command.’ This is the keybinding you will press when you want to save the URL of the current tab to a file. After setting those shortcuts, go to ‘Option manager -> Document -> URI passing’ and create an entry with the contents ‘echo -n %c > ~/url’ (modify as you see fit). From now on, when you use (link|tab)-external-command the URL will be saved in ~/url.

For my inspiration, have a look at .