Archive for April, 2010

Slow program startup after network cable unplug

Problem occured on: Ubuntu Linux 8.04

The problem is that once the network cable is unplugged, all programs take ages (at least 1-2 minutes) to start up.

The solution that worked here was adjusting the entry in the /etc/hosts file that says YourHostName

Change YourHostName to value that you see in /etc/hostname (or to what you see after the user@ on your command prompt).

Other possible solutions, if the above doesn’t help:

  • remove all IPv6-related entries in your /etc/hosts, if you are on an IPv4 network only
  • add a “ localhost” entry top the top of your /etc/hosts file, if such an entry is not present
  • put aliases for your localhost and localhost itself on the same line after the entry at the top of your /etc/hosts file


Sending mail via the GMail SMTP server with a custom from address

It is now possible to use the GMail SMTP server with a custom from address. The other address can be used from the message composition screen on the web interface, but also from an e-mail client.

To configure GMail to allow the use of another from e-mail address you can do the following:

  • Log into the GMail web interface
  • Click Settings
  • Click Accounts and Import
  • In the Send mail as section click Send mail from another address
  • Follow the procedure and confirm your mail address

You will now be able to use other from addresses from the web interface as well as your e-mail client.

If you have not yet configured the GMail SMTP server in your e-mail client and you want to do so then you can find the procedure how to do this here.

Saturday, April 10th, 2010 Uncategorized No Comments

Scripting VIM using python

In new versions of vim it is possible to use python to script vim actions, for example to convert the current line to upper case you could do the following (example taken from the manual page):

:py from vim import *
:py from string import upper
:py current.line = upper(current.line)
Another example is to use the ex command to replace “a” by “b” on the current line:
:py import vim
:py vim.command("s/a/b")
The VIM manual pages provide  more examples and additional documentation on vim scripting using python:
:help python


Thursday, April 8th, 2010 Uncategorized No Comments