Skip to content

Instantly share code, notes, and snippets.

View codec's full-sized avatar

codec

  • Munich
  • 06:31 (UTC +01:00)
View GitHub Profile
@codec
codec / HOME.profile
Created May 29, 2012 12:40
screenrc for serial consoles ... screenrc from xen-shell
(screen -rUd || screen /dev/ttyUSB0 9600 8n1); exit $?
@codec
codec / foo.pp
Created May 27, 2012 04:22
Don't use "type" as variable in templates
class blah($type='woot') {
notify { "blah":
message => inline_template('<%= type %>')
}
}
class { 'blah': type => 'fnuh' }
class dhcp ($foo) {
notice {"foo is ${foo}":}
}
class dhcp::pool ($bar=$dhcp::foo) {
notice {"bar is ${bar}":}
notice {inline_template('has_variable is <%= has_variable?("dhcp::foo") %>'):}
}
class { 'dhcp':
stat("/usr/local/lib/site_ruby/1.8/puppet.rb", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_ruby/1.8/puppet.so", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_ruby/1.8/x86_64-linux/puppet.rb", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_ruby/1.8/x86_64-linux/puppet.so", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_ruby/puppet.rb", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/local/lib/site_ruby/puppet.so", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/vendor_ruby/1.8/puppet.rb", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/vendor_ruby/1.8/puppet.so", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux/puppet.rb", 0x7fff733e9c80) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/vendor_ruby/1.8/x86_64-linux/puppet.so", 0x
@codec
codec / jira-activity.coffee
Created January 26, 2012 09:33
JIRA Activity Stream script for Hubot - posts new stream activity to your jabber conference
FeedParser = require('feedparser')
ent = require('ent')
{EventEmitter} = require('events')
class ActivityStream extends EventEmitter
constructor: (@url, @robot) ->
@robot.logger.info("ActivityStream for #{@url}")
self = this
self.guid = "urn:uuid:a1c4b672-fc6d-3a82-8522-0e05350297de"
#!/usr/bin/ruby
require 'optparse'
require 'csv'
class StaticDhcpLease
attr_accessor :host, :mac, :ip
def initialize(hostname, mac, ip)
@host = hostname
@codec
codec / quagga_bgp.sh
Created January 22, 2011 19:39
munin plugin to show Quagga BGP prefix by IPv4 / IPv6
#!/bin/sh
#
# munin plugin to show Quagga BGP prefix by IPv4 / IPv6
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
echo 'graph_title Quagga BGP4 prefixes'