[GLLUG] Beep Toy-Program

Karl Schuttler karl.schuttler at gmail.com
Thu Oct 13 16:36:44 EDT 2011


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smoke.sh
Type: application/x-sh
Size: 756 bytes
Desc: not available
URL: <http://mailman.egr.msu.edu/mailman/public/linux-user/attachments/20111013/6d501430/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wopr.rb
Type: application/octet-stream
Size: 133 bytes
Desc: not available
URL: <http://mailman.egr.msu.edu/mailman/public/linux-user/attachments/20111013/6d501430/attachment.obj>


More information about the linux-user mailing list