How to manage an idle ssh connection ?
Shell Tips
October 5, 2006 | COMMENTS

You probably already have an idle ssh connection that you can’t leave because of a tcp timeout somewhere on the network or a bad command that you executed. What to do with this idle session ? Easy, just use the exit sequence ~.(tilde and a period) then you could open a new session properly.

Moving quickly from anywhere with $CDPATH
Tips Shell
September 27, 2006 | COMMENTS

Do you know the environment variable $CDPATH? This variable let you define some path where to look for a directories when moving with the command CD. You can define multiple path in this variable. This can be usefull if you have some directories that you access more frequently than the others. As this variable define the order how you move from a directory to another, I suggest you to keep the "." directory in first position of your variable declaration. Of course, you can set this variable in your .bashrc

nicolas@grimm:~$ export CDPATH=.:/:~/  
nicolas@grimm:~$ cd usr<br />
/usr<br />
nicolas@grimm:/usr$ cd Desktop<br />
Deactivate windows firewall on startup
Tips Shell
September 27, 2006 | COMMENTS

On some computer that I have to manage remotly I can have some windows upgrade done. But in some case (new software install, or windows update to SP2) the windows firewall is automatically started and you can lost some software access (example : VNC). In my case, the firewalling is managed by another computer (A linux one) on the network and we need for some of our software to have full access to the network without the risk of a windows alert popup. So, I put a small batch file in the Start-up directory with the following line :


Now, I’m sure that the firewall will never restart at the boot of the computer. Of course, this configuration require a firewall somewhere on your network between your computer and the internet, don’t forget this or you probably regret it one day.

How will be interpreted a command
Tips Shell
September 27, 2006 | COMMENTS

You probably have set some personnal alias or function on your box. Most common is probably dir, ls, ll... If you forgot how you define your alias or function, the easiest way for get back the definition isn't to read your numerous .bashrc but using some bash built-in command : type or command.

type: usage: type [-afptP] name [name ...]
command: usage: command [-pVv] command [arg ...]

Command is generally used for running command with arguments ignoring any shell function named command. Instead of Type that describe a command, for each name, indicate how it would be interpreted if used as a command name. But both can be used, here is some examples :

[root@host ~]# alias -p
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
[root@host ~]# command -v rm
alias rm='rm -i'
[root@host ~]# command -V rm
rm is aliased to `rm -i'
[root@host ~]# type rm
rm is aliased to `rm -i'