[GLLUG] Beep Toy-Program

Stanley C. Mortel mortel at cyber-nos.com
Thu Oct 13 17:33:33 EDT 2011


Karl,

As a public service, why don't you annotate, comment, explain what each 
little bit of this thing is doing, for those of us to whom the syntax is 
not particularly perspicuous.

Stan

On 10/13/2011 4:36 PM, Karl Schuttler wrote:
> Hi all,
>
> Some of you may remember my world famous beep scripts from back in the
> day, including great beep hits like Smoke on the Water (attached), and
> Iron Man. I felt inspired yesterday and wrote up this quick ruby
> script which makes random beeping sounds reminiscent of old sci-fi
> computers when your linux computer is doing anything that requires a
> bit of processor. Required is the linux beep utility (apt-get install
> beep), ruby (probably already installed), and your pc speaker turned
> on (modprobe pcspkr and use alsamixer to pump up the volume).
>
> wopr.rb
> =========
> while true
>    if `vmstat|tail -1|cut -d\" \" -f2`.to_i>  2
>      system("beep -f " + (200+rand(400)).to_s + " -l 150")
>    end
> end
>
>
> Leave it running in the background and have a little fun. To test it,
> you can always do a dd if=/dev/urandom of=/dev/null to generate some
> processor cycles.
>
> Enjoy,
> Karl
>
>
> _______________________________________________
> linux-user mailing list
> linux-user at egr.msu.edu
> http://mailman.egr.msu.edu/mailman/listinfo/linux-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.egr.msu.edu/mailman/public/linux-user/attachments/20111013/723e17f1/attachment.html>


More information about the linux-user mailing list