Skip to content

Instantly share code, notes, and snippets.

View bwhaley's full-sized avatar
🐋

Ben Whaley bwhaley

🐋
View GitHub Profile
@bwhaley
bwhaley / gist:10508449
Created April 11, 2014 23:03
ansible make webdocs error
rendering: slack
rendering: slurp
rendering: sns
rendering: stackdriver
Traceback (most recent call last):
File "../hacking/module_formatter.py", line 323, in <module>
main()
File "../hacking/module_formatter.py", line 318, in main
process_category(category, categories, options, env, template, outputname)
File "../hacking/module_formatter.py", line 268, in process_category
# Quick and dirty code to clone an AWS security group
# Examines a provided source group for all its rules and adds those to a specified destination group
# Caveats:
# - If the destination group does not exist, it will be created as an EC2 group (e.g. not in a VPC)
# - Existing rules in the destination group are NOT deleted
import sys
import argparse
import re
@bwhaley
bwhaley / poodle_shave.py
Created October 15, 2014 05:09
Remove SSLv3 from AWS ELBs
# poodle_shave.py
# It is YOUR responsibility to stop POODLE attacks by disabling SSLv3!
import os
import sys
import boto.ec2.elb
try:
os.environ["AWS_ACCESS_KEY_ID"]
os.environ["AWS_SECRET_ACCESS_KEY"]
@bwhaley
bwhaley / sshd_config
Created August 17, 2015 00:32
Secure OpenSSH server config
Port 22
Protocol 2
AddressFamily inet
#AllowUsers recommended
AllowUsers someuser,someotheruser
AllowGroups someadmingroup
AllowTcpForwarding yes
Banner /etc/banner
@bwhaley
bwhaley / gist:3318910
Created August 10, 2012 23:21
post-receive hook for updating git repos on multiple puppet masters
#!/bin/sh
set -e
git-update-server-info
#
# Hook to update the /etc/puppet with the lastest git changes
#
# To enable this hook, rename this file to "post-receive".
read oldrev newrev refname
@bwhaley
bwhaley / gist:3540422
Created August 30, 2012 20:43
collectd tcp connections exec script
#!/usr/bin/env ruby
require 'getoptlong'
PLUGIN_NAME = 'tcpconns'
def usage
puts("#{$0} -h <fqdn> [-i <sampling_interval>]")
exit
end
@bwhaley
bwhaley / gist:3540423
Created August 30, 2012 20:43
collectd tcp connections exec script
#!/usr/bin/env ruby
require 'getoptlong'
PLUGIN_NAME = 'tcpconns'
def usage
puts("#{$0} -h <fqdn> [-i <sampling_interval>]")
exit
end
set nocompatible
syntax enable
set encoding=utf-8
set showcmd " display incomplete commands
filetype plugin indent on " load file type plugins + indentation
"" Whitespace
set nowrap " don't wrap lines
set tabstop=2 shiftwidth=2 " a tab is two spaces
set expandtab " use spaces, not tabs
@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"
[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