#!/usr/bin/ruby # contributed by Daniel Von Fange # # You must have an ssh key for the server for this to # work, since ssh will otherwise want a password. so = IO.new(1,"w") so.puts "%TITLE LOGWATCH" so.puts "Welcome" so.flush logfile = IO.popen("ssh user@mywebserver.net 'tail -n0 -f /var/log/httpd/access_log'","w+") while (line = logfile.gets) if line.include?("jpg") or line.include?("gif") then so.puts "%SOUND /System/Library/Sounds/Tink.aiff" so.flush sleep ((rand 1) + .25) else so.puts "%SOUND /Applications/Utilities/Disk\ Copy.app/Contents/Resources/page-turn.aiff" so.puts line so.flush sleep ((rand 2) + .5) end end