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/sh | |
BACKUP_TS=`date +%Y%m%d%H%S` | |
if [ -z "$1" ] | |
then | |
echo "What host/IP?" | |
exit 1 | |
fi |
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 | |
# | |
# Generate a random string and print it. Accepts an optional string length. | |
require 'base64' | |
string = '' | |
len = ARGV[0] ? ARGV[0].to_i : 8 |
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
module ViewHelpers | |
def paginate(collection, route) | |
cur = collection.current_page | |
tot = collection.total_pages | |
ret = '' | |
ret << prev_page(collection, route) + ' ' | |
if (1..8) === cur | |
1.upto(9) do |i| |
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 bash | |
function manage_user() | |
{ | |
user=$1 | |
password=$2 | |
shift; shift; | |
out=`ralsh user $user password='$password' ensure=present` | |
echo $out | grep 'notice.*changed password' |
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
scott@beatbox:~/tmp% ./haproxy-fetcher.rb -h | |
Usage: ./haproxy-fetcher.rb [options] | |
-1, --onetime Run only once | |
-i, --interval [SECONDS] Set interval to SECONDS (default: 10) | |
-v, --verbose Verbose | |
--haproxy-socket [SOCKET] Connect to HAProxy via SOCKET | |
--carbon-host [HOST] Connect to Carbon on HOST (default: localhost) | |
--carbon-port [PORT] Connect to Carbon on PORT (default: 2003) | |
--carbon-prefix [PREFIX] Carbon prefix PREFIX (default: haproxy) | |
-h, --help Display this help |
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
root# dpkg -i rubygem-mysql_2.8.1_amd64.deb | |
dpkg: error processing rubygem-mysql_2.8.1_amd64.deb (--install): | |
parse error, in file '/var/lib/dpkg/tmp.ci/control' near line 9 package 'rubygem-mysql': | |
field name `programs' must be followed by colon | |
Errors were encountered while processing: | |
rubygem-mysql_2.8.1_amd64.deb | |
root# dpkg --info rubygem-mysql_2.8.1_amd64.deb | |
new debian package, version 2.0. | |
size 278382 bytes: control archive= 429 bytes. | |
428 bytes, 13 lines control |
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
(scott@beatbox:helix)% curl -d 'name=time_server' -d 'value=time.mit.edu' http://localhost:7777/role/baserole/parameters | |
{ | |
"status": "OK", | |
"data": { | |
"baserole": { | |
"classes": [], | |
"parameters": { | |
"time_server": "time.mit.edu" | |
} | |
} |
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/helix --apikey [redacted] puppet $HOSTNAME | |
--- | |
name: server.bar.com | |
parameters: | |
is_puppetmaster: true | |
puppet_environment: development | |
classes: | |
- helix::server | |
- base | |
- puppet::master |
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
% while /bin/true; do iostat -x sdb; sleep 1; done | |
Linux 2.6.32-24-generic (host.com) 09/19/2011 _x86_64_ (4 CPU) | |
avg-cpu: %user %nice %system %iowait %steal %idle | |
19.06 0.00 5.66 4.34 0.00 70.94 | |
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util | |
sdb 0.02 352.57 11.73 905.94 290.62 10068.03 11.29 1.42 1.54 0.21 19.46 | |
Linux 2.6.32-24-generic (host.com) 09/19/2011 _x86_64_ (4 CPU) |
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
$redis_tpl = $environment ? { | |
"production" => "redis.production.conf.erb", | |
default => "redis.conf.erb" | |
} |
OlderNewer