Search Site

Feed Section

Friday, October 9, 2009



Geeky Way of Putting Your Baby To Sleep

Posted: 08 Oct 2009 11:45 PM PDT

Are you tired of manually rocking your baby to sleep? If your answer is yes, then you should read on.

First, let me show you the code that you will use and break it down a bit.

For Linux users, you can use this simple shell script to automatically open and close the CD-ROM drive of your computer:


#!/bin/sh

while [ 1 = 1 ]
do
#eject CDROM
eject

#pull CDROM tray back in
eject -t
done


When you run that script, the CD tray will close and open forever and it can only be stopped by quitting the program manually.

So how will that help you put your baby to sleep? Just check out this video for some inspiration:




That was pretty cool, right?


For Windows users, this Vbscript will do the job just the same:

Set oWMP = CreateObject("WMPlayer.OCX.7″ )
Set ArrCDROM = oWMP.cdromCollection
while (1)
wscript.sleep 3000
ArrCDROM.Item(0).Eject
wscript.sleep 3000
ArrCDROM.Item(0).Eject
wend


For those with Mac OS, you may use this:


#!/bin/sh
while true
do
sleep 3; drutil tray open
sleep 3; drutil tray close
done


If you have a more clever way of putting a baby to sleep, perhaps you can share it with us via comment :-)

No comments:

Post a Comment