Handy Nix Shell Commands - Alarm Clock Oneliners and More


Some linux commands are fantastic!

I found some nice ones in a slashdot postings about surprising linux commands and others come from slashdot user tpwch.

Alarm Clocks and Notices

Want a simple alarm clock? Try this one:
echo "cat /dev/urandom > /dev/dsp" | at 7am tomorrow

Your food is in the oven?
sleep $((20*60)); xmessage "Dinner is done"

You can also use zenity to get a popup message:
sleep $((20*60)); zenity --info --text "Dinner is done"

Or, if you prefer a voice message, you can use espeak or festival, which I explain in Free Text-to-Speech.
sleep $((20*60)); echo "Take the food out of the oven" | espeak

Notification of events.

For example, notifying me when some specific thing changed on a website:
CHECKLINE="$(curl -s http://somewebsite.org/somepage.html [somewebsite.org] | grep "currently undergoing maintenence")"
while true; do
sleep 120
[ -z "$CHECKLINE" ] && xmessage "somewebsite is open again" && exit
done

Checking for changes on a website:
while true; do
OLD_MD5=${MD5}
CONTENT=$(elinks -dump 1 -dump-charset iso-8859-1 "http://someurl.com/track?id=someid")
MD5=$(echo -n $CONTENT | md5sum -)

[ "${MD5}" != "${OLD_MD5}" ] && {
xmessage "$(printf "New action: :\n\n${CONTENT}")"
}
sleep 120
done

Prank Greetings

Some nice greetings to your colleague?
cat /dev/random | write colleague

3 Responses to "Handy Nix Shell Commands - Alarm Clock Oneliners and More"

The brightness of the screen can be adjusted with a simple drag of your finger, up or down. This is great for being able to have it dim enough to let you sleep, but take a quick swipe up and see whatever info you’re looking for.

Very helpful news, I’ve been searching for posts on the topic of this blogging. Thanks for sharing! featured

Nice commands. Thanks!

  Subscribe to replies to this post

 
This conversation is missing your voice. Your feedback is appreciated.
Post a Comment


You can use some HTML tags, such as <b>, <i>, <a>

If you see a message that says "your request could not be processed" press preview first and then post.
 
You can follow the discussion of this post by subscribing.


 
You are free to include information from this article on your own site if you provide a backlink. You can use the following markup:
<a href="http://www.myoutsourcedbrain.com/2008/11/alarm-clock-in-linux.html">Handy Nix Shell Commands - Alarm Clock Oneliners and More</a>