Giter Site home page Giter Site logo

logchimes's Introduction

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.

logchimes's People

Contributors

kennon avatar

Stargazers

Stanley Rost avatar Petrik de Heus avatar  avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.