Sunday, November 22, 2009

Timed Shutdown

We go on at great length about how great Linux is, how altruistic the community is and how much better the world becomes as more people switch to Ubuntu.

Our favorite OS does, however offer some opportunities to work mischief and you should take them when they appear.

The co-worker who's desk is adjacent to mine has an annoying habit of shutting down his computer and going to drop off his daily paperwork only to discover that he had a last email to send or somesuch. He then routinely asks to use mine with the assurance that it will "only take a minute."

The first thirty or forty times he did this, I wasn't bothered but he kept taking more and more time at this until I was often waiting twenty minutes or more past the end of my work day for him to finish dicking around on my machine.

Luckily for me, he's Ubuntu-Ignorant.

The standard terminal command to turn off a laptop* is:

sudo shutdown -h now

What that means in Personspeak is:

sudo(with admin authority), shutdown(duh), -h(turn off everything) now(duh)

To convince my colleague to stop using my machine, I would enter

sudo shutdown -h 5

And then close the terminal window.

Notice how I changed the "now" to "5". That means 'in five minutes.' The machine then runs as normal and, after five minutes, abruptly powers down without stopping to warn you.

My leech of a comrade would then freak out, thinking he had done something to my computer. I would huff and haw and pretend he had done something significant before turning the computer back on and pretending to remedy whatever he though he had done. After doing this three or four more times, he quit asking to use my computer.

You are thusly enlightened.

* If you're really conserving key-strokes, "sudo halt" and "sudo poweroff" do the same thing in most distributions. Also, "shutdown -r" in lieu of "shutdown -h" will reboot your computer. So will "sudo reboot".

No comments:

Post a Comment