Skip to content

Instantly share code, notes, and snippets.

View bwhaley's full-sized avatar
🐋

Ben Whaley bwhaley

🐋
View GitHub Profile
@bwhaley
bwhaley / gist:6471649
Last active July 22, 2019 23:40
Use this little script as EC2 User Data to install a Sumo Logic collector. Be sure to base64 encode it.
curl -o /tmp/sumo.sh https://collectors.sumologic.com/rest/download/linux/64
sh /tmp/sumo.sh -q -dir "/usr/local/SumoCollector"
/etc/init.d/collector stop
cat > /usr/local/SumoCollector/config/custom_sources.json << END
{
"api.version": "v1",
"sources": [
{
"sourceType": "LocalFile",
"name": "LocalAuth",
@bwhaley
bwhaley / keybase.md
Last active July 22, 2019 22:28
keybase.md

Keybase proof

I hereby claim:

  • I am bwhaley on github.
  • I am bwhaley (https://keybase.io/bwhaley) on keybase.
  • I have a public key ASAGr9i5mf4DgT-_8dzadUkQ15dlyx9AjrxM7MdeqsWsrAo

To claim this, I am signing this object:

@bwhaley
bwhaley / kms_policy.json
Created April 14, 2016 16:43
AWS KMS policy
{
"Version": "2012-10-17",
"Id": "cassandra-key-policy",
"Statement": [
{
"Sid": "Enable IAM User Permissions",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::09876512345:root"
},
@bwhaley
bwhaley / elb-health-check.py
Last active February 22, 2019 00:33
Determine if the instances in an autoscaling group are InService in its ELBs attached to that group. Used in conjunction with Ansible's ec2_asg module.
#!/usr/bin/env python
"""Determine if the instances in an autoscaling group are InService in its ELBs
attached to that group.
"""
import sys
import boto.ec2.elb
import boto.ec2.autoscale
import argparse
sh ‘’’#!/bin/bash -l
cp do_image.txt pipeline/testing
cd pipeline/testing
terraform apply \\
-var do_image=\”\$(<do_image.txt)\” \\
-var do_token=\”\${DO_TOKEN}\” \\
-var ssh_fingerprint=\”\${SSH_FINGERPRINT}\”
terraform show terraform.tfstate \\
| grep ipv4_address | awk \”{print \$3}\” > ../../do_ip.txt
‘’’
Metadata-Version: 1.0
Name: carbon
Version: <%=graphite_ver%>
Summary: Backend data caching and persistence daemon for Graphite
Home-page: https://launchpad.net/graphite
Author: Chris Davis
Author-email: chrismd@gmail.com
License: Apache Software License 2.0
Description: UNKNOWN
Platform: UNKNOWN
@bwhaley
bwhaley / error_log
Created February 12, 2013 19:58
gdash errors with ruby 1.8.7
NoMethodError - undefined method `decode_www_form' for URI:Module:
./lib/gdash/sinatra_app.rb:208:in `link_to_print'
/home/bwhaley/gdash/lib/gdash/../../views/layout.erb:40:in `evaluate_source'
/usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
/usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
/usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:686:in `render'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:694:in `render'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:694:in `catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:694:in `render'
[query] 2015/10/28 19:07:12 SELECT mean(system) FROM "graphitedb"."graphite_1w".cpu WHERE app =~ /influxdb/ AND time > now() - 6h AND time < now() - 2m GROUP BY time(1m), app fill(0)
panic: runtime error: slice bounds out of range
goroutine 4202 [running]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*cursor).decodeBlock(0xc8202189a0, 0x783bfc610000a7b1)
/tmp/tmp.CBAd6vC3wi/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/cursor.go:475 +0x1c1
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*cursor).nextAscending(0xc8202189a0, 0xc8203e1110, 0x0, 0x0)
/tmp/tmp.CBAd6vC3wi/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/cursor.go:438 +0x4a0
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*cursor).Next(0xc8202189a0, 0xc81ffc03f9, 0x0, 0x0)
/tmp/tmp.CBAd6vC3wi/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/cursor.go:400 +0x36
[tsm1wal] 2015/10/28 17:52:18 idle flush of /data/db/graphitedb/graphite_1w/5 with 744 keys and 1542 total values of 24672 bytes
[tsm1] 2015/10/28 17:52:18 rewriting index file /data/db/graphitedb/graphite_1w/5/0000006.tsm1 with /data/db/graphitedb/graphite_1w/5/0000007.tsm1
panic: runtime error: slice bounds out of range [recovered]
panic: panic decoding file: /data/db/graphitedb/graphite_1w/5/0000006.tsm1 at position 56 for id 4509364959144281404 at time 0
goroutine 2587 [running]:
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*dataFile).block.func1(0xc82068ad20, 0xc800000038, 0xc8205bd658, 0xc8205bd660)
/tmp/tmp.CBAd6vC3wi/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/tsm1.go:2091 +0x31f
github.com/influxdb/influxdb/tsdb/engine/tsm1.(*dataFile).block(0xc82068ad20, 0xc800000038, 0x3e947b89e863853c, 0x0, 0x0, 0x0, 0x0)
/tmp/tmp.CBAd6vC3wi/src/github.com/influxdb/influxdb/tsdb/engine/tsm1/tsm1.go:2097 +0x577
@bwhaley
bwhaley / gist:bcf7f10dcd73d3b42b3b
Created October 22, 2015 21:22
influxd -config output (v0.9.5)
reporting-disabled = false
[meta]
dir = "/home/bwhaley/.influxdb/meta"
hostname = "localhost"
bind-address = ":8088"
retention-autocreate = true
election-timeout = "1s"
heartbeat-timeout = "1s"
leader-lease-timeout = "500ms"