Category Archives: Software

PuTTY and VI/VIM Cursor Keys Not Working in Insert Mode

When using PuTTY to SSH to a Linux server and edit files, I’ve encountered on several occasions where navigating in vim using the cursor (arrow) keys on the keyboard while in insert mode results in control characters and/or new lines being inserted. Here are a couple of ways to rectify the situation.

  1. Check if the vim command is pointing to the full version of vim or vim tiny.
    $ which vim

    Some Linux distros link vim to vim tiny. If it’s pointing to the normal vim, skip to step 4, below.

  2. If you’re using vim tiny and want to continue to do so, then edit /etc/vim/vimrc.tiny and add the command set nocompatible to turn off compatibility mode.
  3. If you’d rather have the normal vim editor, then install it. After installation, confirm that the vim command points to the correct version and continue with step 4, below.
  4. Check that /etc/vim/vimrc (or ~/.vimrc) contains the command, set no compatible, to turn off compatibility mode.

That should do it. If you still have trouble, be sure that your terminal is set correctly in PuTTY and on the remote system.

Have another way to fix this issue? Post it in the comments.

Open a Custom Menu Link in a New Window

If you’re using custom menus in WordPress, you may have run into a time when you wanted a menu item to open in a new window or tab instead of the current one. In recent versions of WordPress, various options in the admin screens are hidden in a panel called Screen Options. The target of a menu link is just such a hidden option. To turn it, and some others, on do the following:

  1. Click on Menus in the Appearance section.
  2. Near the top-right of the Menus page, click on Screen Options and check the box labelled Link Target under the Show advanced menu properties heading as shown below.
Screen Options panel for Menus

After enabling the option, the options available for each type of menu item will now contain a drop down list called Link Target where you can select whether the menu opens in the current window/tab or a new one.

Link Target option is now available for all menu items

The Screen Options panel has additional options that can be enabled. Explore the Screen Options panel in other areas of the WordPress admin interface for more hidden capabilities.

Missing Calendar Events after Android 2.2 Update on Samsung Epic

After upgrading the Samsung Epic 4G (SPH-D700) to Android 2.2 Froyo, did you find that all your synced Android calendar events disappeared? In my case, all the recurring calendar events were missing on the phone, but still appeared when I went to Google Calendar from my browser. Here are two ways to fix it.

Clear the cached calendar data

  1. From the Home screen, open the Menu and select Settings.
  2. Scroll down and select Applications, then Manage Applications.
  3. Select the Calendar Sync application.
  4. In the Storage section, click the Clear button.

Now, sync your Android calendar and all the events should come back. If they don’t, try the following fix.

Modify the missing events

If clearing the calendar cache, above, doesn’t work for you, then you can force the Android calendar data to update by modifying the contents of the missing events. Simply edit each event online in Google Calendar by changing the event name or other information about it. After modifying all the desired events, sync the calendar on the phone.

Which fix worked for you? Have another way to fix this problem? Post your findings in the comments.

Broken zcat on OS X

The zcat command line program in OS X has been broken for quite some time and is still that way in Snow Leopard. When trying to output the contents of a gzipped file, zcat appends .Z to the end of the file name that it’s given and outputs an error. The quick fix is to replace it with gzcat as follows:

$ cd /usr/bin
$ sudo mv zcat broken-zcat
$ sudo ln -s gzcat zcat

This process renames the original zcat program to broken-zcat and then creates a symbolic link called zcat that points to gzcat. This way, you don’t have to remember to specifically use gzcat. Running zcat will also use gzcat.

Thunderbird Can’t Create Mailbox Node When Archiving Email Messages

For quite some time, I’ve been getting an error whenever I tried to archive an email message on an IMAP server for the first time during a Thunderbird session (i.e., archiving the first email after starting Thunderbird). All subsequent archiving operations would be error-free until I restarted Thunderbird. (Note: I’m using Thunderbird 3)

After pressing Ctrl+A to archive an email message, Thunderbird’s Activity Manager would contain the following error:

“The current command did not succeed. The mail server for account Account Name: Can’t create mailbox node /path/to/mail/Archive/: File exists.”

Despite much searching, I wasn’t able to find anyone else who encountered this problem when archiving an email message. So, I worked around the problem by just remembering that the first message I archive had to be archived twice, because the first attempt would fail and the message wouldn’t leave the inbox.

Today, I discovered the solution. After setting up a new IMAP account, I didn’t receive any error archiving email messages from this new inbox. However, the Archive folder had a subfolder named 2010. Aha! So, Thunderbird must be trying to create a similar folder in my other account and failing. Well, I don’t need these annual subfolders, so turning off the behavior should take care of the problem.

Fortunately, it is possible to disable the annual folders created by Thunderbird’s archiving feature:

  1. Click on Options in the Tools menu
  2. Click on the Advanced tab icon
  3. Click the Config Editor button (if you receive a facetious warning about voiding your warranty, just accept it)
  4. In the Filter text box, enter granularity
  5. Double-click the preference mail.server.default.archive_granularity and enter the value 0

With the granularity set to zero, Thunderbird won’t create annual subfolders in the archive folder. This finally got rid of the error because the problematic server didn’t allow a mailbox folder to have subfolders.