in

Geeky Way of Putting Your Baby To Sleep

- - 9 comments
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 :-)

9 comments

  1. I've seen this somewhere b4.
    Can't remember where, but it's awesome!

    ReplyDelete
  2. It's a good example of how Linux amd Mac can do it with fewer lines of code .

    ReplyDelete
  3. Very nice one...
    Just an optimization for the linux script: eject -T /dev/cdrom is the only thing needed, as it opens if closed and closes if open...

    ReplyDelete
  4. Much better, and no scripting needed:

    http://simplynoise.com

    Out like a light!

    ReplyDelete
  5. All-right, another use for cdrom drives. Some people use 'em as cup holders. Who uses a those things to read CDs or DVDs anyway?

    ReplyDelete
  6. Will this work on my AuroraUX box?

    ReplyDelete
  7. Even geeks should not forget the evening breast milk: it contains substances to send the baby to sleep (not daytime milk)!

    ReplyDelete
  8. Sleeping in Maxi Cosi Car Seat is a very bad idea. This can cause back problems in the long run.

    ReplyDelete
  9. shaker instrument, light "egg shaker" or heavier maracas, or rainstick work just fine. Try it, or record it and play in a loop.

    ReplyDelete