Sunday, August 1, 2010

Garmin nüvi 255W Crashes On Choosing A Favorite POI

Garmin nüvi 255W GPS
I recently bought a recertified Garmin nüvi 255W GPS from - I've only had it a week and since I don't have a car yet, I've only tested it by using it on the bus and while walking; seems to be working fine so far.

Except for one thing – sometimes, when I selected a destination, the unit would inexplicably crash – it would just turn off. The first couple of times, I wrote it off as a random glitch and got the software update that was available at myGarmin. But that didn’t solve the problem.

I finally noticed that this only happened when I selected the entry for my home (saved in my favorites list). And it would only happen when I went through the steps really quickly. And when it did happen, the thumbnail for the entry hadn’t loaded completely on screen. That’s right, I had a photo of the apartment complex entrance set for this favorite POI.

So as it turns out, it seems that if you have a big image – mine is about 1.5 MB – you’ll likely have a problem. Reducing the size of the image or not associating a photo with the POI seems to fix the problem.

Monday, May 24, 2010

Metapost: Style Updates

Not much to report, just spent a while making minor changes to the look of blog posts -
  • Code snippets now use the excellent SyntaxHighlighter by Alex Gorbatchev (chances are you've seen this already, it's pretty popular, and with good reason!).
  • I've updated the CSS so error, warning, tip and note boxes are all styled. I also went back and updated the posts that were put up before I thought of these. If you want to see what these look like, take a look at the TortoiseSVN with SVN+SSH post or the Hacking the Cisco 7940 IP Phone post.
  • Some minor updates to content and to styles so that everything is more consistent

Saturday, May 1, 2010

Fix for Sony DSC-S40 Blank White LCD Screen

A little while ago, I turned on my Sony DSC-S40 camera and it gave me quite a fright – the LCD viewfinder was completely white! Turning the camera off and back on and changing batteries didn’t help.

So I decided to Google to see if there was something that could be done about it. As it turns out, there’s a simple solution (posted by a Bob Allen) which has helped a lot of owners and when I first read it, I thought it was a joke. The instructions read:

1. Hold camera firmly in left hand
2. Smartly rap front of camera with knuckles of right hand on the "Cyber-shot" logo.

That’s it. Really. And it does work.

According to this discussion on Camera Hacker, the underlying problem is that the LCD ribbon becomes loose and either pressing or tapping the panel at the right spot (the Cyber-shot logo) fixes the issue by pushing the connector back in place.

Saturday, April 24, 2010

Wikipedia Footnotes Bookmarklet And Greasemonkey Script

I’ve recently begun reading Lukas Mathis’ blog, ignore the code – it’s pretty interesting and insightful. I usually read posts from within my feed reader and rarely actually visit a site, so I missed this neat script he has, which pops up a small ‘floating’ div when the reader hovers over the footnote superscript number. He explains why he does this as well as how on his post titled Footnotes. He's also modified his script to create a bookmarklet for Daring Fireball.

The first thing I thought was, this would be pretty useful for Wikipedia articles, where there are usually tons of citations and references. So I adapted the bookmarklet for Wikipedia. Now you probably wouldn’t want to load the bookmarklet for every Wikipedia page, especially if you really do read the citations often. So I’ve also modified the script for use with Greasemonkey.

This is what you should get after you use either of these scripts:

You’ll find both scripts on the project page on my site (along with some basic instructions on setup). Or if that’s too many page views in a day for you, this is the bookmarklet which you should bookmark, and this is a direct link to install the Greasemonkey script from

The idea and most of the code, are both courtesy Lukas; I’ve only tweaked it a bit for use with Wikipedia. Any mistakes are mine. And JavaScript isn’t really my forte so the code is probably not as elegant as it could be. All the same, it works for me (the bookmarklet on Firefox and Chrome; the GM script on Firefox only, of course and Chrome 4. IE, with it’s non-standard event handling isn’t supported); if you do have some problems getting it to work, let me know.

 UPDATE [0006 01 May 2010]: Wow! The script was featured on everybody's favorite productivity and tips site Lifehacker, and I've been so busy with dead week, that I didn't even notice! That explains the 507 installs in one day!

 UPDATE [2210 02 May 2010]: Chrome 4 supports Greasemonkey scripts natively and most scripts should work properly; this one in particular does!

Friday, February 12, 2010

SVN+SSH With TortoiseSVN

First, a quick introduction to what's going on, if you haven't used SSH with keys before. The idea of using keys is to avoid using passwords - instead, your public key is on the server and when you connect, you identify yourself with your private key (which, as the name suggests, should only be available to you). You can read details of how it works and what it involves over at

A. Get your public and private keys
  1. Login to the machine to which you’ll be connecting (the host where the SVN server is running).
  2. Generate a key secured by a 1024-bit passphrase and the name mykey using the command ssh-keygen -b 1024 -t dsa -N passphrase -f mykey (replace passphrase with an actual passphrase of your choice – it needn’t be the same as your account password; in fact, it might make sense for it not to be).
  3. The files mykey and will be created – the private and public keys respectively.
  4. In your home directory, create a new directory named .ssh – and use the command chmod 700 .ssh to set the appropriate permissions on that folder.
  5. Copy the public key to this folder and rename it to authorized_keys (cp /home-directory/.ssh/authorized_keys) and then set the appropriate permissions (chmod 600 authorized_keys). In older implementations, authorized_keys2 was the name used for the key.
  6. Copy the private key (mykey) to the machine where you’ll make the connection (the client where TortoiseSVN will be used)
B. Test the connection with PuTTY, PuTTYgen and Pageant
  1. The problem here is that the key generated on the host isn’t directly usable by PuTTY; it must be converted using PuTTYgen. Use Conversions > Import key to import your private key (mykey) and then Save private key as mykey.ppk (or whatever you prefer).
  2. In PuTTY, create a new session with mykey.ppk as the private key under SSH > Auth > Private key file for authentication
  3. Try to connect – if you’ve not specified the username as part of the the host name (in the form username@host), you’ll be prompted for the username but not for the password. You should see something like
    Using username "username".           
    Authenticating with public key "imported-openssh-key" from agent            
    Last login: Fri Feb 12 17:21:41 2010 from
  4. Once you’ve verified that your key works, you can optionally begin using Pageant instead to save your keys (perhaps for multiple user names) instead of specifying a key within the session details – choose to Add Key, select the private key and specify the passphrase for it – they key should be added to your list.
  5. Try to connect via PuTTY, except this time, remove the private key from SSH > Auth > Private key file for authentication – PuTTY should then use the key details from Pageant.
 To avoid having TortoiseSVN (or PuTTY) prompt you for the username when connecting, you can use the form username@host/repo-path to attempt the connection with the login username.

C. Connecting with TortoiseSVN
You can specify different ways to tell TortoiseSVN how to connect to your repository – by giving the name of the PuTTY connection you created above or by using Pageant; I used Pageant
  1. Make sure you’ve got Pageant running and have imported the key as described above.
  2. The repository URL should be of the form svn+ssh://hostname/repo-path. For a PuTTY connection, the URL svn+ssh://PuTTY-Connection-Name/repo-path is supposed to be used.
  3. This should be enough to connect to the SVN server.

 If you keep getting a dialog titled TortoisePlink that asks you to 'login as', then you're probably seeing the bug described at The workaround that the poster described is to clear the value for the registry key HKEY_CURRENT_USER > Software > SimonTatham > Putty > Sessions > Default Settings > HostName.

Apparently if there is a hostname specified in the default connection in PuTTY, this problem manifests itself. Even if you don't see any value in the PuTTY interface, you should clear the key in the registry.

 As always, be warned that editing the registry is fraught with danger, so backup and think twice before changing anything.

 If you're not using keys, you'll probably see the dialogs asking for username and password pop-up over and over - with the repository I'm connecting to, I have to authenticate thrice when I first try to browse the repository and subsequently, once more for every new directory I select. So it seems like a new connection is setup for every request but I'm not sure.

 UPDATE [1630 18 Feb 2010]: I'd mixed up the permissions for the .ssh folder and the authorized_keys file. Also added some more information and a fix for the TortoisePlink 'login as' dialog.