aud 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +132 -0
  2. data/lib/aud/cli.rb +1 -1
  3. data/lib/aud/version.rb +1 -1
  4. metadata +6 -7
data/README.md CHANGED
@@ -0,0 +1,132 @@
1
+ ## Listen to your log files with `aud`
2
+
3
+ `aud` is an open source command line utility that plays sounds in response to text-based input. Pipe, cat, or tail your files to `aud` and **audibilize** them. Here's some ways to use `aud`:
4
+
5
+ + Get an audio alert when exceptions happen.
6
+ + Learn the *rhythm* of a system, like you would a car engine.
7
+ + Sense the relationship between two or more concurrent components.
8
+
9
+ The human hearing system is remarkably good at [isolating sounds](http://physicsworld.com/cws/article/news/2013/jan/31/human-hearing-is-highly-nonlinear) and detecting patterns. Why not use it
10
+ to intuit more about how our information-processing systems work?
11
+
12
+ [The Sound of Sorting](http://panthema.net/2013/sound-of-sorting) uses video and sound to *show* you how sorting algorightms work, rather than just tell you. Bret Victor's talk [Inventing on Principle](http://vimeo.com/36579366) explains why creators need a physical, immediate connection to their creations. These and more inspired me to write `aud`.
13
+
14
+ ### Install aud
15
+
16
+ `aud` is a Ruby gem, and should work with most Ruby versions. Install it as follows:
17
+
18
+ ```
19
+ $ gem install aud
20
+ ```
21
+
22
+ Once installed, the `aud` command should be available on your path. You can print help information to be sure.
23
+
24
+ ```
25
+ $ aud help listen
26
+ ```
27
+
28
+ ### MIDI Setup
29
+
30
+ You won't hear anything until you configure a MIDI input and output. Here follows instructions for Mac OSX, but other operating systems should also work. If you get it working on your platform I'd love to know and add more instructions!
31
+
32
+ ##### Mac OSX Instructions
33
+
34
+ 1) *Enable the IAC Driver* - Open "Audio MIDI Setup" in your System Preferences. Choose "Open MIDI Window" from the "Windows" option in the Menu Bar. Double-click on "IAC Driver", and check "Device is online".
35
+
36
+ <img src="/images/audio_midi_setup.png" alt="Audio MIDI Setup">
37
+
38
+ 2) *Download SimpleSynth* - SimpleSynth will play aloud the signals coming across the IAC Driver virtual MIDI controller. Download it [here](http://notahat.com/simplesynth/) and install it. Run it, and make sure the IAC Driver is selected. (Note: You can also use GarageBand [as described here](http://tx81z.blogspot.com/2011/06/osx-unimidi-and-midi-patch-bay.html).)
39
+
40
+ <img src="/images/simple_synth.png" alt="SimpleSynth">
41
+
42
+ (Protip: Turn Channel 2 to "Fl.Key Click" as shown in the screenshot. It sounds cool :)
43
+
44
+ ### Usage
45
+
46
+ `aud` accepts input via STDIN, just like grep, awk, or sed. That means you can cat, echo, or tail lines of text to it. Here's an example:
47
+
48
+ ```
49
+ $ cat access.log | aud
50
+ ```
51
+
52
+ If everything is set up correctly, you should hear a note played for each line of the log file.
53
+
54
+ The pitch, octave, and duration of the note are configurable. Here's the full set of options, taken from `aud help listen`:
55
+
56
+ ```
57
+ -o, [--octave=Set an octave [1-5]]
58
+ # Default: 3
59
+ -n, [--note=The note to play [A-G]]
60
+ # Default: C
61
+ -f, [--file=A file to listen to]
62
+ -c, [--channel=Set a MIDI channel [1-16]]
63
+ # Default: 1
64
+ -d, [--delay=Minimum delay in milliseconds between sounds]
65
+ # Default: 50
66
+ -s, [--strategy=A strategy for making sounds, currently only tick]
67
+ # Default: tick
68
+ [--silent=Suppress printing of input]
69
+ ```
70
+
71
+ ### Real-world example
72
+
73
+ Listen to web logs and get a sense for traffic volume and error rates.
74
+
75
+ ```
76
+ $ tail -f access.log | grep 200 | aud -n C -d 10 &
77
+ $ tail -f access.log | grep 404 | aud -n B -d 100 &
78
+ $ tail -f access.log | grep 500 | aud -n F -d 500 &
79
+
80
+ ```
81
+
82
+ ##### Distributed systems
83
+
84
+ I use `aud` to understand and troubleshoot patterns within distributed systems, like the kind I work on at [Keen IO](https://keen.io).
85
+
86
+ Our distributed backend includes [Storm](http://storm-project.net/), [Cassandra](http://cassandra.apache.org/), [Kafka](https://kafka.apache.org/), [Zookeeper](http://zookeeper.apache.org/), and more. These applications form a complex realtime mesh of activity, and generate a *lot* of log files in doing so.
87
+
88
+ I use `ssh` and `aud` to listen to the whole system simultaneously. I get a more accurate **feeling** for what's happening by listening than by grepping for types of of text. As a result, I can detect errors and deviations in performance with just my ears. As you can imagine, this is way less exhausting than trying to read lines of text as they race by!
89
+
90
+ ### Contributing
91
+
92
+ `aud` is by no means a flag on a summit, but rather a trailhead for exploring the relationship between sound, systems, and humans. As such, your comments and contributions are very welcome.
93
+
94
+ To hack on `aud`, clone or fork this repository. Then:
95
+
96
+ ```
97
+ # install developement dependencies
98
+ $ bundle install
99
+
100
+ # run tests
101
+ $ bundle exec rake spec
102
+ ```
103
+
104
+ ### Credits and Acknowledgements
105
+
106
+ + The excellent [UNIMidi gem](https://github.com/arirusso/unimidi) and [micromidi gem](https://github.com/arirusso/micromidi), on which `aud` is built
107
+ + Bret Victor's talk [Inventing on Principle](http://vimeo.com/36579366), as inspiration
108
+ + [The Sound of Sorting](http://panthema.net/2013/sound-of-sorting), as inspiration, and [@dkador](https://github.com/dkador) for first sharing it with me
109
+
110
+ ### MIT License
111
+
112
+ Copyright (c) 2013 Josh Dzielak
113
+
114
+ Permission is hereby granted, free of charge, to any person obtaining
115
+ a copy of this software and associated documentation files (the
116
+ "Software"), to deal in the Software without restriction, including
117
+ without limitation the rights to use, copy, modify, merge, publish,
118
+ distribute, sublicense, and/or sell copies of the Software, and to
119
+ permit persons to whom the Software is furnished to do so, subject to
120
+ the following conditions:
121
+
122
+ The above copyright notice and this permission notice shall be
123
+ included in all copies or substantial portions of the Software.
124
+
125
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
126
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
127
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
128
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
129
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
130
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
131
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
132
+
@@ -41,7 +41,7 @@ module Aud
41
41
 
42
42
  method_option :silent,
43
43
  :type => :boolean,
44
- :banner => 'Silence printing of input'
44
+ :banner => 'Suppress printing of input'
45
45
 
46
46
  def listen
47
47
  case options[:strategy]
@@ -1,3 +1,3 @@
1
1
  module Aud
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aud
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-18 00:00:00.000000000 Z
12
+ date: 2014-01-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor
@@ -48,17 +48,17 @@ dependencies:
48
48
  requirement: !ruby/object:Gem::Requirement
49
49
  none: false
50
50
  requirements:
51
- - - ! '>='
51
+ - - ~>
52
52
  - !ruby/object:Gem::Version
53
- version: '0'
53
+ version: '2'
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ~>
60
60
  - !ruby/object:Gem::Version
61
- version: '0'
61
+ version: '2'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: guard
64
64
  requirement: !ruby/object:Gem::Requirement
@@ -146,4 +146,3 @@ signing_key:
146
146
  specification_version: 3
147
147
  summary: Audibilize text files
148
148
  test_files: []
149
- has_rdoc: