D'oh! moments

Kent Borg kentborg at borg.org
Sun Jun 1 14:33:00 EDT 2003


On Thu, May 15, 2003 at 02:27:24AM +0000, dsr at tao.merseine.nu wrote:
> On Wed, May 14, 2003 at 06:58:05PM -0400, Duane Morin wrote:
> > Today I did that from a terminal window and found myself saying
> > "Why is it taking so long?" before realizing that i had accidentally
> > done it in a window where I was ssh'd in to the server.  That smarts.
> 
> Preventative measure: when I do something routinely like that, I alias
> it to a mnemonic... only on the machines where it's a good idea to do
> it.
> 
> So:
> 
> alias gohome="sudo ifconfig eth0 down"
> 
> server$ gohome
> bash: gohome: command not found

My approach is similar.  I have a pair of suid programs called "neton"
and "netoff".  They are safe things to type as they only exist on my
notebook not on my basement server.  Once I, shortly before I was to
go out of town, I did this wrong and shutdown networking on my
basement server.  Luckily I was still at home and could go downstairs
and turn the network back on.  But if I had done it from out of town I
would have been screwed.

Similarly, I was once doing development on a Unix machine at a
previous job where I had to repeatedly reboot the OS.  And one evening
I accidentally typed the shutdown in the wrong window and shutdown a
shared server.  Luckily it was evening and I only screwed a few
co-workers.  Oops.

The key is to *not* teach your fingers to casually type something
which is benign on one machine but would be fatal on another machine.
If you have to repeatedly do something that is normally dangerous,
make up a new command for the casual circumstances and keep all the
usual warnings and protections on the standard command, even in the
circumstances when it would be safe.


-kb




More information about the Discuss mailing list