Subscribe:
    Subscribe Twitter Facebook

    Friday, October 9, 2009

    Use an Old Linux Computer to Put your Baby to Sleep

    If you are not a geek, let me explain the logic of this very simple program.

    The program will first auto-eject the CD-ROM drive of your computer and then it will close that open tray. This open-close loop will run forever unless you terminate the program manually.

    while [1 = 1]
    do
    #eject cdrom
    eject

    #pull cdrom tray back in
    eject -t
    done
    Now the interesting part -- using just these four lines of code, a geek turned his old Linux* computer into a baby rocker.



    He attached a string between the tray of the CD-ROM drive and the baby seat and as the tray would open and close repeatedly, the smooth movements were enough to put his baby to sleep. Awesome.

    [*] you are not on on Linux, you can build a similar Baby rocker program for Windows using Autohotkey software.

    Create a short cut for CD Ejecting in windows


    To assign and add a shortcut key to eject and open CD or DVD drive, firstly create a shortcut to eject CD or DVD drive according to this guide. Note that keyboard shortcut or hotkey can only be assigned to shortcut, and not on the executable (with .exe extension) itself.
    Once the “Eject CD” or “Eject DVD” shortcut has been created, right click on the icon and the select Properties. Go to Shortcut tab if you’re not already on the tab, and then click once on the text field of Shortcut Key.

    Press a keyboard sequence or hot key that you want to use to eject CD/DVD drive. The field will automatically reflect the keys that you press. When done, click “OK” button to apply the change.
    The trick works on windows XP


    , Windows Vista, Windows 2003, and Windows 2008, and other Windows versions too. In Windows Vista and XP, it’s possible to place the Eject CD/DVD shortcut in Quick Launch bar, and use Quick Launch bar built-in keyboard shortcut as an alternative to open or eject the optical drive.


    Later on Install Autohotkey in your machine

    Code:
    Create a infinite loop , inside the loop use the given below code

    Loop Loop  ; Since no number is specified with it, this is an infinite loop unless "break" or "return" is encountered inside.
    
    {
              Send ^+C
    
    }

    or u can use "Send {Ctrl}+{Shift}+C" instead of "Send ^+C"




    compile the code , it will create an Exe file , assiagn an shortcut to exe / just run the exe... thats it....!

    0 comments:

    Post a Comment

    Bidvertiser