Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Bolero (just music)

by powerman (Friar)
on Apr 23, 2002 at 09:32 UTC ( #161246=CUFP: print w/replies, xml ) Need Help??

I use this music to wake-up my friend Nikita when I logged on his host remotely with SSH. :^)
To use this remotely you need uncomment two lines and create new device:
ln -s /dev/vc/63 /dev/beep or
ln -s /dev/tty31 /dev/beep.
#!/usr/bin/perl use Time::HiRes qw(sleep); # open BEEP, ">/dev/beep" or die $!; # select BEEP; $| = 1; sleep($_), print "\a" for (0, 0.45, 0.15, 0.15, 0.15, 0.45, 0.15, 0.15, 0.15, 0.45, 0.45, 0.45, 0.15, 0.15, 0.15, 0.45, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15);
WBR, Alex.

Replies are listed 'Best First'.
Re: Bolero (just music)
by Dragonfly (Priest) on Apr 24, 2002 at 05:19 UTC
    Hmm, this didn't work for me on OpenBSD for some reason (and it looks pretty fun so I wish it did!)

    What platform did you write this on? I'm guessing it has something to do with how BSD's /dev is set up. Any tips on getting this to work for me?

      I use Linux.
      This script is very simple, so it's possible to test every part quickly.
      1. Check about beep work in shell: echo -e '\a'
      2. Check about dev work in shell: echo -e '\a' >/dev/beep
      3. Check about Time::HiRes work: comment out open BEEP... and select BEEP... and replace "\a" to just "a"
      WBR, Alex.
        Do you use RedHat? I am running Debian with some help... I tried the script and your tests and installed Time::HiRes, but I still got run-time errors. Then SO came up with an interesting fact: There's no /dev/beep included in the standard kernal. I'd made a file called /dev/beep that bolero printed to, but no device. erg. There is a program called beep that might be useful for this script though. It's at this website . Can't say I've looked too deeply at it, though.

        -ljb

        Updated: to fix stupid wording

Re: Bolero (just music)
by n2linux (Initiate) on Apr 25, 2002 at 02:12 UTC
    Pretty dang schweet. I modified it a tad, adding a few more lines of music and looped it to make it really purty. Thanks for YACUFP (Yet Another Cool Use For Perl)! ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: CUFP [id://161246]
Approved by vagnerr
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2022-05-28 16:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (99 votes). Check out past polls.

    Notices?