Nov 6, 2008

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

21 comments:

  1. 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.

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

    ReplyDelete
  3. Nice commands. Thanks!

    ReplyDelete
  4. Great information I will tweet to my friends to get them to check it out. keep it up. Thanks for sharing!
    friv4 | friv 4 school | kizi4 | kizi 4|unblocked games| unblockedgames

    ReplyDelete
  5. This is what programming language. I want to learn game programming language.
    UnblockedGamesMania

    ReplyDelete
  6. This information will be very useful to my job, thank you very much.
    gamecr.com

    ReplyDelete
  7. I like your site content material and also publishing, I can declare i found precisely what When i telephone, I am going to talk about your articles with my own pals around my social consideration. friv40

    ReplyDelete
  8. Thanks for giving me the useful information. I think I need it!

    - Happy Wheels
    - FNAF
    - FNAF World

    ReplyDelete
  9. Let’s keep out sites for your child! click:
    brain games | puzzle games | tetris | happy wheels | agario | abcya | fnaf 4 | super mario games
    To play for free!

    ReplyDelete
  10. All the best blogs that is very useful for keeping me share the ideas
    of the future as well this is really what I was looking for, and I am
    very happy to come here. Thank you very much
    earn to die
    earn to die 2
    earn to die 3
    Hi! I’ve been reading your blog for a while now and finally got the
    earn to die 4
    courage to go ahead and give youu a shout out from
    earn to die 6
    Austin Texas! Just wanted to tell
    earn to die 5
    you keep up the fantastic work!my weblog
    age of war
    Hi! I’ve been reading your blog for a while now and finally got the
    happy wheels
    strike force heroes
    zslitherio
    good game empire

    ReplyDelete
  11. Let’s keep are safe place to play the very best free games for kids! Please click:
    slither.io | wings.io | happy wheels | abcya | fnaf 4 to play for free!

    ReplyDelete
  12. With a Hotmail account, you can send and receive emails quickly and easily as well as login and use all Microsoft services.
    hotmail login | login to hotmail
    This is the game so players feel very fierce , adventurous . You try to join and play this game , you will feel great like.
    happy wheels | fireboy and watergirl | goodgame empire
    learn to fly | slither io | gun mayhem | age of war
    io games | strike force heroes | strike force heroes 4

    ReplyDelete