Skip to content

Instantly share code, notes, and snippets.

View bwhaley's full-sized avatar
🐋

Ben Whaley bwhaley

🐋
View GitHub Profile
[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"
@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 / 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
@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 / 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 / Install & Usage
Last active October 15, 2019 08:18
Download artifacts from Teamcity
# Installation
Download the file
$ wget https://gist.githubusercontent.com/bwhaley/490a1ee890c0f010b1f3/raw/b471e67138be484a0140e5ca420b0ffca7726ed1/artifactory.py
Install the requests library
$ pip install requests
Set TEAMCITY env vars
$ export TEAMCITY_USERNAME=ben
# 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 / 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