Skip to content

Instantly share code, notes, and snippets.

View joemiller's full-sized avatar

joe miller joemiller

View GitHub Profile
iam_user_policy = """
{
"Statement": [
{"Effect": "Allow",
"Action": ["s3:List*","s3:Put*","s3:Get*","s3:DeleteObject*"],
"Resource": ["arn:aws:s3:::%s","arn:aws:s3:::%s/*"]
},
{"Effect": "Deny",
"Action": "*",
"NotResource": ["arn:aws:s3:::%s","arn:aws:s3:::%s/*"]
group :development do
gem "warbler", ">= 0"
gem "rack-test", ">= 0"
gem "rspec", "~> 2.3.0"
gem "rspec-core", "~> 2.3.1"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.5.2"
gem "rcov", ">= 0"
end
@joemiller
joemiller / gist:1302529
Created October 20, 2011 22:06
graphite storage-schemas.conf that i use with collectd and collectd-graphite perl plugin
## keep 30-sec samples for 30 days,
## keep 1-min samples for 60 days,
## keep 5-min samples for 90 days,
## keep 15-min samples for 18 months
[30sec_30days_1min_60days_5min_90days_15min_18months]
priority = 100
pattern = servers.*
retentions = 30:86400,60:86400,300:25920,900:52512
$ fpm -s dir -t rpm -n whack -v 1.0 ~/.bashrc
tar: Removing leading `/' from member names
tar: Removing leading `/' from member names
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.79406
+ umask 022
+ cd /home/jmiller/build-rpm-whack-1.0.x86_64.rpm/BUILD
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.79406
+ umask 022
+ cd /home/jmiller/build-rpm-whack-1.0.x86_64.rpm/BUILD
@joemiller
joemiller / gist:1369829
Created November 16, 2011 11:01
example of `spark-ping`
macbook:spark-ping $ ./spark-ping google.com
▃▇▄▄▅▄▃▃▃▄▃▃▄▄▄▄▅▄▅▃▅▃▃▃▄▄▃▃▄▅▄▃▄▃ 24.731 ms
## retention settings for events.*, based on
## http://codeascraft.etsy.com/2010/12/08/track-every-release/
[events]
priority = 300
pattern = events.*
retentions = 10:120960,60:262974,600:262974
@joemiller
joemiller / gist:1374384
Created November 17, 2011 20:18
quick n dirty object model for opsource-cloud VIPs (implemented on cisco ACEs)
VIP:
name:
IP:
port:
protocol: (tcp | udp)
target-type: (serverfarm | persistence-profile)
target-name:
enabled: (true | false)
@joemiller
joemiller / gist:1387409
Created November 22, 2011 23:29
gem issue when attempting to use padrino + ripple orm
$ bundle install
Fetching source index for http://rubygems.org/
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
ripple (>= 0) ruby depends on
activesupport (= 3.0.0.beta) ruby
padrino (= 0.10.5) ruby depends on
activesupport (3.1.0)
@joemiller
joemiller / http_helpers.rb
Created November 28, 2011 19:25
infrastructure smoketest example (rspec)
require 'open-uri'
# simple wrapper around open-uri's open() that will
# fetch an HTTP or HTTPS resource including follow redirects.
# Returns a hash with 2 members:
#
# response[:meta] = the original open-uri response object. Use this to
# access metadata such as status code. See
# http://ruby-doc.org/stdlib-1.9.2/libdoc/open-uri/rdoc/OpenURI/Meta.html
# for a list of attributes and methods available.
Loaded suite /usr/local/rvm/gems/ruby-1.8.7-p352@sensu/bin/rake
Started
..E
Error:
test_client_socket(TestSensu):
Test::Unit::AssertionFailedError: <false> is not true.
/Volumes/1TB-HDD/Users/jmiller/Dropbox/sensu/test/sensu_test.rb:128:in `test_client_socket'
/usr/local/rvm/gems/ruby-1.8.7-p352@sensu/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:151:in `call'
/usr/local/rvm/gems/ruby-1.8.7-p352@sensu/gems/eventmachine-1.0.0.beta.4/lib/em/deferrable.rb:151:in `set_deferred_status'