waider: (Default)
waider ([personal profile] waider) wrote2004-01-26 12:42 pm
Entry tags:

briefly striking fear into my heart

emacs: command not found

[identity profile] odaiwai.livejournal.com 2004-01-26 09:20 am (UTC)(link)
Solution:
ln -s /usr/bin/vi /usr/bin/emacs

HTH. HAND.
ext_8707: Taken in front of Carnegie Hall (excitable)

[identity profile] ronebofh.livejournal.com 2004-01-26 01:02 pm (UTC)(link)
You'd best not be foolin' around, pal.

[identity profile] bitpuddle.livejournal.com 2004-01-26 11:03 am (UTC)(link)

Once had a friend who fancied himself a sysadmin. We wrote a script to back up an Oracle database. He put this script in /bin. It was designed to back up the contents of the databases to some folder. It used another temp directory for intermediate files. It was located somewhere odd, like /opt/foo.

The first line of his script was:

cd /opt/foo

The next line was:

rm -rf *

We can see where this is going.

One day, someone doesn't know what this /opt/foo directory is for, and deletes it. The script runs. It tries to cd to a non-existent directory. It doesn't check the return code from the cd. It then executes rm on everything in the current directory, which is...

/bin

It is so much fun to try to restore a system without ls.

[identity profile] candice.livejournal.com 2004-01-26 03:26 pm (UTC)(link)
all you really need is echo *

*duck and run*
ext_181967: (Default)

[identity profile] waider.livejournal.com 2004-01-26 04:37 pm (UTC)(link)
I have been there. I have done that. It was not fun, for very large values of NOT, even after I'd aliased "ls" to "echo *". I am casting pointy metal objects in the general direction of your ducking and running person.

[identity profile] candice.livejournal.com 2004-01-26 07:00 pm (UTC)(link)
I wuv j00!

I've done it too. I've also debugged boot code with nothing more
than ghetto printf, and other related adventures.
ext_181967: (Default)

[identity profile] waider.livejournal.com 2004-01-27 01:47 am (UTC)(link)
Actually, it occurs to me that the scenario could have been worse. If the working directory was /bin when the rm command failed, you just lost /bin, and the tools for restoration are generally in /sbin. If the script was running as root on a non-Linux system, however, and had simply been running in the default directory for a cron job, i.e. the owner's home directory, i.e. /...

[identity profile] bitpuddle.livejournal.com 2004-01-27 02:02 am (UTC)(link)
Yes -- I forgot the best part. The script, of course, ran as root.