<div>I'm going to play with this on my laptop when I get home. But if I'm up all night trying to write music for my pcspkr, I'm blaming you.</div><div><br></div><div>Thanks for sharing!</div><br clear="all">Chris Fritz<br>

<i>Founder & CEO<br>Power On, LLC<br><a href="http://poweronlansing.com" target="_blank">poweronlansing.com</a><br>(517) 798-6098<br><a href="http://maps.google.com/maps?q=114+W.+Allegan,+Lansing,+MI+48933" target="_blank">114 W. Allegan, Lansing, MI 48933</a></i><br>

<div><br></div><div><b>If you enjoy working with us, let your friends know </b></div><div><b>by </b><b><a href="http://www.facebook.com/pages/Power-On/181028965285517" target="_blank">liking us on Facebook</a> or <a href="http://twitter.com/#!/poweronlansing" target="_blank">tweeting us on Twitter</a>. </b></div>

<div><b>If there's an area where we can improve, <a href="https://docs.google.com/a/poweronlansing.com/spreadsheet/viewform?hl=en_US&formkey=dHJXcVhfTkMza1BpV0RkODEyNFdHbkE6MQ#gid=0" target="_blank">let us know</a>.</b></div>

<br><div class="gmail_quote">On Thu, Oct 13, 2011 at 5:49 PM, Karl Schuttler <span dir="ltr"><<a href="mailto:karl.schuttler@gmail.com">karl.schuttler@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Smoke.sh is just a batch script that runs the beep command multiple<br>
times and pauses inbetween beeps. Command arguments for beep command<br>
are -f (frequency) and -l (length in milliseconds)<br>
<br>
while true #loop forever<br>
 if `vmstat|tail -1|cut -d\" \" -f2`.to_i > 2 #vmstat dumps system<br>
info, the rest formats it to get just the processor queue. "If queue ><br>
2"<br>
   system("beep -f " + (200+rand(400)).to_s + " -l 150") #runs beep<br>
command with a random frequency between 200-600hz for 150ms.<br>
 end<br>
end<br>
<br>
To end program, do pkill ruby or ctrl-c. Program is ran by "$ruby wopr.rb"<br>
<div><div></div><div class="h5"><br>
On Thu, Oct 13, 2011 at 5:33 PM, Stanley C. Mortel <<a href="mailto:mortel@cyber-nos.com">mortel@cyber-nos.com</a>> wrote:<br>
> Karl,<br>
><br>
> As a public service, why don't you annotate, comment, explain what each<br>
> little bit of this thing is doing, for those of us to whom the syntax is not<br>
> particularly perspicuous.<br>
><br>
> Stan<br>
><br>
> On 10/13/2011 4:36 PM, Karl Schuttler wrote:<br>
><br>
> Hi all,<br>
><br>
> Some of you may remember my world famous beep scripts from back in the<br>
> day, including great beep hits like Smoke on the Water (attached), and<br>
> Iron Man. I felt inspired yesterday and wrote up this quick ruby<br>
> script which makes random beeping sounds reminiscent of old sci-fi<br>
> computers when your linux computer is doing anything that requires a<br>
> bit of processor. Required is the linux beep utility (apt-get install<br>
> beep), ruby (probably already installed), and your pc speaker turned<br>
> on (modprobe pcspkr and use alsamixer to pump up the volume).<br>
><br>
> wopr.rb<br>
> =========<br>
> while true<br>
>   if `vmstat|tail -1|cut -d\" \" -f2`.to_i > 2<br>
>     system("beep -f " + (200+rand(400)).to_s + " -l 150")<br>
>   end<br>
> end<br>
><br>
><br>
> Leave it running in the background and have a little fun. To test it,<br>
> you can always do a dd if=/dev/urandom of=/dev/null to generate some<br>
> processor cycles.<br>
><br>
> Enjoy,<br>
> Karl<br>
><br>
><br>
> _______________________________________________<br>
> linux-user mailing list<br>
> <a href="mailto:linux-user@egr.msu.edu">linux-user@egr.msu.edu</a><br>
> <a href="http://mailman.egr.msu.edu/mailman/listinfo/linux-user" target="_blank">http://mailman.egr.msu.edu/mailman/listinfo/linux-user</a><br>
><br>
> _______________________________________________<br>
> linux-user mailing list<br>
> <a href="mailto:linux-user@egr.msu.edu">linux-user@egr.msu.edu</a><br>
> <a href="http://mailman.egr.msu.edu/mailman/listinfo/linux-user" target="_blank">http://mailman.egr.msu.edu/mailman/listinfo/linux-user</a><br>
><br>
><br>
_______________________________________________<br>
linux-user mailing list<br>
<a href="mailto:linux-user@egr.msu.edu">linux-user@egr.msu.edu</a><br>
<a href="http://mailman.egr.msu.edu/mailman/listinfo/linux-user" target="_blank">http://mailman.egr.msu.edu/mailman/listinfo/linux-user</a><br>
</div></div></blockquote></div><br>