bash – using the vi mode more effectively.

Vi blogging bundle
Vi blogging bundle (Photo credit: pedro mg)

You can first set the bash mode to vi. This will enable some vim like features to bash. So, add this to .bashrc :

set -o vi

Once, you have done that then its time to get more out of the vi mode. First, check some things and set some interesting stuff.

#Display all the bindings :
bind -P

#Copy the current bindings and use it in inputrc:
bind -p |grep -v self-insert>~/.inputrc

In the inputrc, so generated, all the functions and macros not bound are commented with “#” and you can set them to your choice as in other examples.

And here is a link that can get you started.

http://www.catonmat.net/blog/bash-vi-editing-mode-cheat-sheet/

 

Enhanced by Zemanta

procmail filters – apply to received mails.

If you already have some mail in your maildir and you have set procmail filters, then it is difficult to apply the procmail filter, right? Not so, you just need to go to the Inbox directory and then execute the command.

for i in *; do cat $i|procmail; rm -f "$i"; done

This will pass all of your e-mail through procmail again and then your filters will get applied. Mails will go to their appropriate directory and you will be one happy man, I hope.

 

Enhanced by Zemanta

slow ssh connection

If you are experiencing slow ssh connections, then possibly your system is trying to do reverse lookup of the IP address. If that is the case, then you can add the below to “hosts” line in /etc/nsswitch.conf file.

‘[NOTFOUND=return]’

The other cause for slow connections can be GSSAPI authentication. If that is the case, then the simplest solution is to add the following in your “~/.ssh/config” file:

GSSAPIAuthentication no

 

Enhanced by Zemanta