« Managing GlassFish... | Main | OpenJDK Mercurial... »

Remote access “life hack”

Oct 21 2007, 15:50 MSD |  [  Life hack  ]

Suppose that every time when you log in to some (possibly remote) machine using ssh you need to recall the path of some important directory, or that you want to be reminded to do something once you log in the next time. I recently found that this is a very usual scenario for me (because I ssh a lot and my memory is already stuffed with lots of things). So I invented a simple solution.

I added the following lines to my .zshrc file in my home directory:

if [ -f ~/.motd ]; then
  echo ----------------------------------------------------------
  cat ~/.motd
  echo ----------------------------------------------------------
fi
which simply cat's the contents of the .motd file whenever I log in. Now, if I want to be reminded of something, I can do
$ echo RTJ binaries are here: /net/xxx/yyy/zzz/nightly-build/build-abc/arch/bin >> ~/.motd
and the next time I log in, I'd get a message from which I can copy the useful path. It is also useful for setting up the reminders like “feed the cat, you lazy sod!”, although there is a risk for a cat to starve if you need to work at a single host without logging in for a long time.

You can simply remove a file once the validity of the notification expires or edit it using your favorite text editor to change/remove the bits of the contents.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed