ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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 python | |
import fileinput | |
import argparse | |
from operator import itemgetter | |
parser = argparse.ArgumentParser() | |
parser.add_argument('--target-mb', action = 'store', dest = 'target_mb', default = 61000, type = int) | |
parser.add_argument('vmtouch_output_file', action = 'store', nargs = '+') | |
args = parser.parse_args() |
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 | |
Dir.chdir File.join(__FILE__, "../..") | |
unless ENV['EDITOR'] | |
puts "No EDITOR found. Try:" | |
puts "export EDITOR=vim" | |
exit 1 | |
end | |
unless ARGV.count == 2 |
⇐ back to the gist-blog at jrw.fi
Backing stuff up is a bit of a hassle, to set up and to maintain. While full-blown backup suites such as duplicity or CrashPlan will do all kinds of clever things for you (and I'd recommend either for more complex setups), sometimes you just want to put that daily database dump somewhere off-site and be done with it. This is what I've done, with an Amazon S3 bucket and curl
. Hold onto your hats, there's some Bucket Policy acrobatics ahead.
There's also a tl;dr at the very end if you just want the delicious copy-pasta.
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
Notes of Scale Summit 2015 what's changed since last year. | |
Things last year: | |
- “Big Data is a thing”; Big Data is now pointless | |
- “Is CouchDB dead?” npm were? Fairly sure couchdb is now dead, despite more funding | |
- Under still going: Mongo, Riak. Mongo's not dead? Guardian, GDS, MOJ. Mongo on the rise again? Mongo *might* be dead; we don't know. | |
- Websockets were "standard" but weren't really… except for certain browsers, proxies, etc. | |
- HTML5 video still doesn't really work | |
- Flash is still dying… Unless you count CVEs. Lots of flash-based ads. | |
- WebGL has taken hold? Still true, apparently. |
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
""" | |
Copies all keys from the source Redis host to the destination Redis host. | |
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are | |
restricted (e.g. on Amazon ElastiCache). | |
The script scans through the keyspace of the given database number and uses | |
a pipeline of DUMP and RESTORE commands to migrate the keys. | |
Requires Redis 2.8.0 or higher. |
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
create_resources("mail::domain", $domains) |
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
["update-puppet.sh", "run-puppet.sh"].each |$file| { | |
file{"/usr/local/bin/${file}": | |
owner => "root", | |
group => "root", | |
mode => "0700", | |
source => "puppet:///modules/puppet/${file}" | |
} | |
} |
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 | |
instanceID=$1 | |
date=$(date +%Y%m%d) | |
function downloadLog () { | |
local log=$1 | |
aws rds download-db-log-file-portion \ | |
--output text \ |
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
import boto3 | |
print(boto3.client('sts').get_caller_identity()['Account']) |
OlderNewer