kennon / logchimes Goto Github PK
View Code? Open in Web Editor NEWA ruby script to generate harmonic chimes based on logfile output
A ruby script to generate harmonic chimes based on logfile output
Logchimes This is a quick and dirty proof of concept for an ambient sound generator based on tailing the status codes from a webserver log. "Normal" status codes (200, 304, etc) play notes from the major pentatonic scale, and "bad" codes such as 403 or 404 play clashing notes to draw attention to themselves. If you have a busy log, you can adjust the 'scaling factor' that sets how many requests per status code it should wait before playing a note. Logchimes uses net/ssh to ssh to a remote server and tail a filename you specify. It also assumes that you have pubkey passwordless auth set up for the remote server. By default, the apache2 combined logfile format puts the status code in column 8, but you can also change this if you use a different format. It probably only works on OSX because of the softsynth dependency in the midiator gem, but suggestions on how to make it more general would be appreciated. This requires the 'midiator' gem (gem install midiator) I threw this together in honor of Whyday 2010 (http://whyday.org), my contribution to the whimsical ruby community that _why supported and encouraged. Usage: ./logchimes.rb <server> <ssh username> <filename to tail> <scaling factor> <column in file with status code> Example: ./logchimes.rb my.awesomeserver.com myusername /var/log/apache2/access.log 1 8 Todo/Ideas: - I'd really like to figure out how to do the midi part better with midiator so I could hook it up to a nicer sound bank (such as windchimes) - Perhaps adaptively change the scaling factor so that rarer status codes are played immediately but common ones don't drown them out - Change volume based on frequency of status code - Clean up the ssh interface so that it works more generally - Consolidate the status code parsing based on http rfc so that error codes use one scale, non-errors use another, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.