This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/perl | |
use strict; | |
use Getopt::Std; | |
use Net::SNPP; | |
use Fcntl ':flock'; | |
use Sys::Syslog qw( :DEFAULT setlogsock ); | |
# This is some really ancient code I wrote in ~2003 to do 2-way SNPP | |
# with Nextel phones so a handset could ack notifications from Nagios | |
# before web access was widely available. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$: << 'lib' | |
require 'rubygems' | |
require 'gollum' | |
require 'gollum/frontend/app' | |
use Rack::ShowExceptions | |
Precious::App.set(:gollum_path, Dir.pwd) | |
Precious::App.set(:wiki_options, {}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# This script does minimal arg parsing to filter out SSH arguments to | |
# be mostly compatible with plain SSH command line syntax. It's not | |
# 100% but good enough. | |
# | |
# usage: nssh [-1246AaCfgKkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] | |
# [-D [bind_address:]port] [-e escape_char] [-F configfile] | |
# [-i identity_file] [-L [bind_address:]port:host:hostport] | |
# [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
al@al-dev1 ~/src/puppet $ git checkout 2.7.1 | |
HEAD is now at a23e391... Updating for 2.7.1 release. | |
# system puppet was built from this tree | |
# I also cleaned it out once to be sure all of the old 2.5 stuff was gone | |
al@al-dev1 ~/src/puppet $ bin/puppet agent -h | |
/usr/lib/ruby/1.8/puppet/application/agent.rb:5: undefined local variable or method `should_parse_config' for Puppet::Application::Agent:Class (NameError) | |
from /usr/lib/ruby/1.8/puppet/util/command_line.rb:54:in `require' | |
from /usr/lib/ruby/1.8/puppet/util/command_line.rb:54:in `require_application' | |
from /usr/lib/ruby/1.8/puppet/util/command_line.rb:59:in `execute' | |
from bin/puppet:4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
KeepAlive yes | |
ForwardAgent yes | |
ForwardX11 no | |
EscapeChar ` | |
ControlPath ~/.ssh/master-%r@%h:%p | |
ControlMaster auto | |
ControlPersist yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Compute partition sizes based on system memory (swap) and disk size. | |
# There is no /boot because grub2 uses the BIOS Boot Partition (EF02) | |
# to write out the payloads that used to have to be in /boot at the | |
# front of the disks. | |
# The EFI Partition will end up unused on all of our legacy BIOS-only | |
# systems, but it's only 128MB and can remain consistent as the EFI/UEFI | |
# systems take over. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default Linux filesystem permission rules. | |
# | |
# This is an experimental configuration format for applying filesystem permissions | |
# after pushing fs data from git. Since git doesn't support more than very simple permissions | |
# something like this is needed afterwards. The goals here are to be terse, parseable at a glance, | |
# and comprehensive for basic unix. The "unix" prefix is there so that other models like "pacl" | |
# (POSIX ACL) can be added in later if it becomes necessary. | |
# | |
# format: unix <path>:<dir mode>:<file mode>:<owner>:<group>:<depth> | |
# path, required, a path on the filesystem, must start with / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Ruby's GIL is a liability when actually doing CPU work | |
# on a large SMP machine, doubly so on NUMA. This works around it. | |
# Ruby processes are locked onto a single core + its HT sibling | |
# on intel machines, 2 cores on AMD. Ideally this would lock to | |
# one core on non-HT processors, but all of mine are HT so it WFM. | |
max_cpu=$(cat /proc/cpuinfo |awk -F ': ' '/processor/{print $2}' |tail -n 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put this fragment in a daemon's /etc/default/$NAME file to side-load | |
# putting that daemon into a cgroup automatically | |
ulimit -l unlimited | |
NOW=$(date +%s) | |
APPLICATION=$(basename $0 |sed -r -e 's/\.init$//' -e 's/-(dev|prod|staging|perf)$//') | |
INSTANCE=$(basename $0 |sed -r -e 's/\.init$//' -e 's/.*-(dev|prod|staging|perf)$/\1/') | |
# gross default that assumes unnamed instances are production |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lxc.utsname = test01.tobert.org | |
lxc.rootfs = /srv/md0/lxc/test01 | |
#lxc.tty = 1 | |
lxc.console = /tmp/test01-console.log | |
lxc.cgroup.cpuset.cpus = 0 | |
lxc.cgroup.cpu.shares = 100 | |
lxc.mount.entry=none proc proc nodev,noexec,nosuid 0 0 | |
lxc.mount.entry=none dev/shm tmpfs defaults 0 0 | |
lxc.mount.entry=none dev/pts devpts defaults 0 0 |