Skip to content

Instantly share code, notes, and snippets.

View jamtur01's full-sized avatar
💭
I may be slow to respond.

James Turnbull jamtur01

💭
I may be slow to respond.
View GitHub Profile
@jamtur01
jamtur01 / gist:4385673
Created December 27, 2012 05:18
Postfix grok filters
grok {
tags => "postfix/smtpd"
pattern => [ "%{POSTFIXSMTPDCONNECTS}",
"%{POSTFIXSMTPDACTIONS}",
"%{POSTFIXSMTPDTIMEOUTS}",
"%{POSTFIXSMTPDLOGIN}",
"." ]
named_captures_only => true
}
@jamtur01
jamtur01 / postfix_patterns
Created December 27, 2012 05:17
Postfix LogStash patterns
# Postfix stuff
QUEUEID (?:[A-F0-9]+|NOQUEUE)
EMAILADDRESSPART [a-zA-Z0-9_.+-=:]+
EMAILADDRESS %{EMAILADDRESSPART:local}@%{EMAILADDRESSPART:remote}
RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?::[0-9]+(.[0-9]+)?)?)?)
#RELAY (?:%{HOSTNAME:relayhost}(?:\[%{IP:relayip}\](?:%{POSREAL:relayport})))
POSREAL [0-9]+(.[0-9]+)?
#DELAYS %{POSREAL:a}/%{POSREAL:b}/%{POSREAL:c}/%{POSREAL:d}
DELAYS (%{POSREAL}[/]*)+
DSN %{NONNEGINT}.%{NONNEGINT}.%{NONNEGINT}
@jamtur01
jamtur01 / gist:4384428
Created December 27, 2012 00:46
Java stack trace logstash regex
(^\d+\) .+)|(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)
$ java -verbose -jar build/logstash-1.1.6.dev-monolithic.jar web
...
[Loaded rubyjit.Module$$unresolved_deps_8A15E7251B80B0055F223148ACBDCB13FEAE83A7 from file:/root/logstash/build/logstash-1.1.6.dev-monolithic.jar]
[Loaded rubyjit.Kernel$$require_C75B74784C6C3A7DBEF22B75428A3430422985D5 from file:/root/logstash/build/logstash-1.1.6.dev-monolithic.jar]
Exception in thread "LogStash::Runner" org.jruby.exceptions.RaiseException: (LoadError) C extensions are disabled, can't load `jar:file:/root/logstash/build/logstash-1.1.6.dev-monolithic.jar!/gems/http_parser.rb-0.5.3/lib/ruby_http_parser.so'
at org.jruby.RubyKernel.require(org/jruby/RubyKernel.java:1019)
at Kernel.require(jar:file:/root/logstash/build/logstash-1.1.6.dev-monolithic.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/custom_require.rb:36)
at logstash.runner.require(logstash/runner.rb:10)
at RUBY.(root)(jar:file:/root/logstash/build/logstash-1.1.6.dev-monolithic.jar!/gems/http_parser.rb-0.5.3/lib/http_parser.rb:2)
at org.jruby.RubyKernel.requi
$ puppet-module build
/Library/Ruby/Gems/1.8/gems/puppet-3.0.0/lib/puppet/settings.rb:252:in `convert': Error converting value for param 'config': Could not find value for $confdir (Puppet::Settings::InterpolationError)
from /Library/Ruby/Gems/1.8/gems/puppet-3.0.0/lib/puppet/settings.rb:243:in `gsub'
from /Library/Ruby/Gems/1.8/gems/puppet-3.0.0/lib/puppet/settings.rb:243:in `convert'
from /Library/Ruby/Gems/1.8/gems/puppet-3.0.0/lib/puppet/settings.rb:971:in `value'
from /Library/Ruby/Gems/1.8/gems/puppet-3.0.0/lib/puppet/settings.rb:66:in `[]'
from /Library/Ruby/Gems/1.8/gems/puppet-module-0.3.4/bin/../lib/puppet/module/tool/cli.rb:15
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:55:in `gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:55:in `require'
from /Library/Ruby/Gems/1.8/gems/puppet-module-0.3.4/bin/../lib/puppet/module/tool.rb:121
@jamtur01
jamtur01 / gist:3805622
Created September 30, 2012 01:56
OSX 10.8 starting puppet master
absinthe ~ $ sudo puppet master --no-daemonize --verbose --debug
Debug: Failed to load library 'shadow' for feature 'libshadow'
Debug: Puppet::Type::User::ProviderPw: file pw does not exist
Debug: Puppet::Type::User::ProviderLdap: true value when expecting false
Debug: Puppet::Type::User::ProviderUseradd: file userdel does not exist
Debug: Puppet::Type::User::ProviderUser_role_add: file roleadd does not exist
Debug: Executing '/usr/bin/dscl -plist . -list /Users'
Debug: Executing '/usr/bin/dscl -plist . -read /Users/puppet'
Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /var/db/dslocal/nodes/Default/users/puppet.plist'
Debug: Converting binary plist to XML
@jamtur01
jamtur01 / model.rb
Created August 5, 2012 17:53
Datamapper hook hackery
class Item
include DataMapper::Resource
belongs_to :user
has n, :comments, :constraint => :destroy
has_tags
property :id, Serial
NoMethodError - undefined method `end_with?' for nil:NilClass:
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugins/check_classes.rb:21:in `block (2 levels) in <class:CheckClasses>'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugins/check_classes.rb:12:in `each'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugins/check_classes.rb:12:in `block in <class:CheckClasses>'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugin.rb:68:in `block in run'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugin.rb:63:in `each'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint/plugin.rb:63:in `run'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint.rb:158:in `block in run'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/puppet-lint-0.1.13/lib/puppet-lint.rb:157:in `each'
/Users/james/.rvm/gems/ruby-1.9.3-p0/gems/p
@jamtur01
jamtur01 / gist:3016110
Created June 29, 2012 05:57
puppet-lint trace
/Library/Ruby/Gems/1.8/gems/puppet-lint-0.1.13/lib/puppet-lint.rb:48:in `%'
/Library/Ruby/Gems/1.8/gems/puppet-lint-0.1.13/lib/puppet-lint.rb:48:in `call'
/Library/Ruby/Gems/1.8/gems/puppet-lint-0.1.13/lib/puppet-lint.rb:48:in `%'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/backports/uri/common_18.rb:55:in `decode_www_form_component'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/backports/uri/common_18.rb:53:in `times'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/backports/uri/common_18.rb:53:in `decode_www_form_component'
/Library/Ruby/Gems/1.8/gems/rack-1.4.1/lib/rack/utils.rb:43:in `unescape'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:847:in `static!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:884:in `dispatch!'
/Library/Ruby/Gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
stolen:~ root# puppet help
Usage: puppet <subcommand> [options] <action> [options]
Available subcommands, from Puppet Faces:
ca Local Puppet Certificate Authority management.
catalog Compile, save, view, and convert catalogs.
certificate Provide access to the CA for certificate management.
certificate_request Manage certificate requests.
certificate_revocation_list Manage the list of revoked certificates.
config Interact with Puppet's configuration options.