Skip to content

Instantly share code, notes, and snippets.

View blt's full-sized avatar

Brian L. Troutwine blt

View GitHub Profile
(walden) ~/projects/com/github/mindreframer/riemann-vagrant
blt> vagrant up
[default] Importing base box 'precise64'...
[default] The guest additions on this VM do not match the install version of
VirtualBox! This may cause things such as forwarded ports, shared
folders, and more to not work properly. If any of those things fail on
this machine, please update the guest additions and repackage the
box.
Guest Additions Version: 4.2.0
@blt
blt / beaver_globstar_problem.md
Created December 21, 2012 07:03
A description of a problem I'm having with [beaver](https://github.com/josegonzalez/beaver).

I'd like beaver to monitor /var/log with the following concerns:

  • applications will create arbitrary trees of logs under /var/log
  • I cannot know ahead of time what logs will be present under /var/log

For instance, let's say I have an erlang application with lager logs to /var/log/erl_app/lags.log, webmachine logs to /var/log/erl_app/webmachine/YEAR_MONTH_DAY_access and a console log to /var/log/erl_app/console.log. The webmachine logs are not rotated, but are rather created at midnight each day. The console and lager logs are rotated periodically. As I add apps to this erlang application they may begin logging under /var/log/erl_app.

What I'd like to do is start beaver once, have it recursiely ship all the logs under /var/log which presently exist and are created in the future. It seems to me that only the path configuration option will suit my needs as the files option assumes I know the filenames I want to ship.

Here's my beaver.conf:

/*
* 2012 -- updated to make use of an 8-core machine by Brian L. Troutwine
*
* THC/2003
*
* Simple ssh-private key cracker. Tries to brute force (dictionary
* attack) almost any ssh private key file format.
*
* This is just a quick tool from THC. Using OpenSSL is not really
* fast...
$ autoconf --version
autoconf (GNU Autoconf) 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
-- Unless I'm mistaken the default line width is 1, presumably pixels. Straight
-- one-pixel lines are invisible in my setup.
function love.draw()
-- Invisible
love.graphics.setLineWidth(1)
love.graphics.rectangle("line", 64, 64, 32, 32)
-- Visible
#/etc/puppet/config.ru
# a config.ru, for use with every rack-compatible webserver.
# SSL needs to be handled outside this, though.
# if puppet is not in your RUBYLIB:
# $:.unshift('/opt/puppet/lib')
$0 = "master"
# /etc/nginx/sites-enabled/default
upstream puppet-production {
server unix:/var/run/puppet/master.00.sock;
server unix:/var/run/puppet/master.01.sock;
server unix:/var/run/puppet/master.02.sock;
}
server {
listen puppet:8140;
include conf.d/puppet_ssl.conf;
require 'eventmachine'
EM.run do
EM.system '/usr/bin/md5sum', proc{ |p| p.send_data("hashme") } do |stdout, status|
puts stdout
EM.stop
end
end
$ bundle list
Gems included by the bundle:
* activesupport (3.1.1)
* addressable (2.2.6)
* bundler (1.0.21)
* chunky_png (1.2.5)
* coffee-script (2.2.0)
* coffee-script-source (1.1.2)
* compass (0.11.5)
* daemons (1.1.4)
#!/usr/bin/env ruby
require 'rubygems'
require 'optparse'
require 'net/ssh'
require 'json'
require 'yaml'
require 'amqp'
require 'logger'