Remote access “life hack”
|
[
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.
Thanks Ivan, have just tried it out and it looks extremely helpful!
P.S. less than a year has passed before you got the first comment :)
Posted by DmitryKan on August 28, 2008 at 01:10 PM MSD #