Thursday, 14 July 2011

Somethings to note about putty

Putty is very important tool for me. So in case you are going to format your windows machine or changing the machine. Then it is important to take backup of the host keys it asked you when first logging in to that *nix machine and then restore it on the new windows machine which you are going to use the new window machine to login to *nix with putty.
C:> regedit /e "%userprofile%\desktop\putty-registry.reg" HKEY_CURRENT_USER\Software\Simontatham
This way when you login to the same machines in your new PC it wont prompt you for storing keys. It will be like continutation of the old pc works in new pc.
Second thing is you set putty window title to soemthing other than default username@hostname title. But i would recommend that you set the tile through the *nix PS1 prompt rather changing it in the client side. if you want to set it in putty end instead of server end. Then make sure you
check the option "Disable remtoe contriolled title change" that appears in Terminal --> features.
Right nwo i am trying to find way to set uptime or top's first lsited process to appear in putty titlebar.
Will post back the results if i succeed.

edit:found soemthing close . Here it is

~> kernel_version=$(uname -r) ~> export PS1="\!|\h|$kernel_version|\$?> " 473|dev-db|2.6.25-14.fc9.i686|0>

here replacing the replacing the first lines "uname -r" with some other linux command will produce the desired effect. but I think it is impossible to putty the tons of stats that top provides in putty title. What i can do is put the o/p of uptime cmd in title bar . but it is not much usefull. So dropping this effort.