Skip to main content

screen session windows with remote hostname

Thanks to this blog I have now found a solution to something i have looked for for a long time. I had in fact left the search thinking there is no solution!! So i will just copy-paste his post here!


The following tip's handy for me as it renames your window's title to the remote hostname. Combined with a hardstatus "tab-bar", it makes finding open sessions easier.
Create ~/.ssh_hostname and chmod +x:
#!/bin/sh
echo -ne "\033k$1\033\\"
And then add to ~/.ssh/config (if you have Host sections, put it above them):
PermitLocalCommand yes
LocalCommand ~/.ssh_hostname %h
You can also do this via a function in your shell profile, though that has the disadvantage that you have to parse SSH arguments, or assume the last is always the hostname. Similarly, you can add the magic echo statement into the remote shell profile (or your remote shell prompt) on every machine/account.

Comments

Popular posts from this blog

best educational experiences..

The best educational experiences are when we work hard for it, when we apply ourselves and think over solutions/possibilities and try to infer things if we are not sure. In college, there were friends with whom we discussed topics, debated possible approaches to problems. Today, I attend interviews! What better ways to know your weaknesses, strengths and different perspectives on technology or implementation!

mount points with space in fstab

Just something i came across recently. I had a space in the filesystem mount point, something like "New Volume" which was a windows filesystem detected and auto-mounted by ubuntu. So how do you add this to fstab? Lookup on the fstab man page says: The second field (fs_file). This field describes the mount point for the filesystem. For swap partitions, this field should be specified as `none'. If the name of the mount point contains spaces these can be escaped as `\040'. Ex: /dev/sda5     /media/New\040Volume     ntfs     defaults     0     2

virtualbox ubuntu and getting the image to work!

problems 1. network access! not a fix yet.. I had to add two interfaces one NAT and one HOST only 2. keyboard layout dpkg-reconfigure console-setup # this works across reboots! console-data is just for the session 3. fixing eth1/2 numbers to have eth0/1 Modify the entries in /etc/udev/rules.d/70-persistent-cd.rules and reboot OR sudo udevadm trigger