Skip to content

Instantly share code, notes, and snippets.

View codec's full-sized avatar

codec

  • Munich
  • 17:47 (UTC +01:00)
View GitHub Profile
@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'
#!/usr/bin/ruby
require 'optparse'
require 'csv'
class StaticDhcpLease
attr_accessor :host, :mac, :ip
def initialize(hostname, mac, ip)
@host = hostname
@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"
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
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':
@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' }
@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 / fpm-gitlabhq.sh
Created July 11, 2012 09:20
Jenkins Execute shell step for gitlab
mkdir -p ${WORKSPACE}/build/etc/init
mkdir -p ${WORKSPACE}/build/etc/init.d
mkdir -p ${WORKSPACE}/build/srv/gitlabhq
mkdir -p ${WORKSPACE}/build/etc/apache2/sites-available
cat >${WORKSPACE}/build/etc/apache2/sites-available/gitlabhq <<EOF
<VirtualHost *:80>
# Passenger options that can be set in a virtual host
# configuration block.
PassengerHighPerformance on
@codec
codec / ubuntu-amd64-installer.ipxe
Created November 22, 2012 15:32 — forked from robinsmidsrod/ubuntu-amd64-installer.ipxe
Boot Ubuntu x64 installer directly from the network. Only iPXE needed
#!ipxe
dhcp
echo Starting Ubuntu x64 installer for ${hostname}
set base-url http://archive.ubuntu.com/ubuntu/dists/lucid/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
kernel ${base-url}/linux
initrd ${base-url}/initrd.gz
#imgargs linux auto=true url=http://yourserver/some/path/preseed.cfg
boot ||
# If everything failed, give the user some options
echo Boot from ${base-url} failed
Setting up puppet-common (2.7.20-1puppetlabs1) ...
Setting up puppet (2.7.20-1puppetlabs1) ...
* Starting puppet agent /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- puppet/util/command_line (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/bin/puppet:3:in `<main>'
[fail]
invoke-rc.d: initscript puppet, action "start" failed.