Skip to content

Instantly share code, notes, and snippets.

Brian Akins bakins

Block or report user

Report or block bakins

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
bakins /
Last active Aug 29, 2015
Get CoreOS AMI for an AWS region
function cores-image {
EXPRESSION=`printf '.amis|map(select(.name == "%s"))[0]["hvm"]' "$REGION"`
curl --fail -s -L http://$ | jq -r "$EXPRESSION"
View get-CoreOS-AMI
AWS_IMAGE=$(curl -s -L | python -c "import json,sys;obj=json.load(sys.stdin);print filter(lambda t: t['name']=='${ZONE}', obj['amis'])[0]['hvm']")
bakins / stoker.go
Last active Aug 29, 2015
stoker parser - very rough
View stoker.go
// - the stoker
// when you connect to telnet port, it is streaming updates about
// once per second. I was able to figure out which field was temperature
// and how to tell food and pit probes apart.
// Plan is to dump data to statsd(?) and/or into something like Circonus.
package main
import (

Keybase proof

I hereby claim:

  • I am bakins on github.
  • I am bakins ( on keybase.
  • I have a public key whose fingerprint is D8DF B5B1 00D5 DA8F 88CD 2FC5 877A 72F8 7C59 9ABB

To claim this, I am signing this object:

bakins / gist:bda46eff346c85aa3a17
Last active Aug 29, 2015
Horrible ohai workaround
View gist:bda46eff346c85aa3a17
# I need to support a few versions of chef and some custom ohai plugins
# our ohai 6 plugins didn't work in ohai 7, so here's a horrible hack to have a node
# sync/load the plugins based on ohai version if using the ohai cookbook
# this is in my cookbook "base". put ohai-6 plugins in files/default/ohai-6, and
# ohai-7 ones in files/default/ohai-7
node.default['ohai']['plugins']['base'] = 'ohai-' + (Ohai::VERSION.split('.')[0])
View gist:3838fb4fbb6432944cfc
===== LOGGING STARTED Sat May 3 13:53:24 UTC 2014
13:53:25.353 [error] You've tried to set max_parallel_uploads, but there is no setting with that name.
13:53:25.353 [error] Did you mean one of these?
13:53:25.357 [error] max_paralell_uploads
13:53:25.357 [error] parallel_uploads
13:53:25.357 [error] max_paralell_downloads
13:53:25.361 [error] Error generating configuration in phase transform_datatypes
13:53:25.361 [error] Conf file attempted to set unknown variable: max_parallel_uploads
bakins / gist:e62e9713ffa7c13b86da
Last active Aug 29, 2015
simple "synapse" type thing for consul
View gist:e62e9713ffa7c13b86da
already do healthchecks in consul - we even need haproxy?
No way to get metadata into service - maybe insert into k/v? ie, healthcheck url.
if used haproxy - maybe just port check? or use a healthcheck grabbed from kv. wrapper go program that uses a text/template and writes haproxy config
simple go program:
"watch" service endpoint like: http://localhost:8500/v1/health/service/web?wait=120s&index=66 then add "passing" nodes to a pool then hand out connections - use httputil.reverseproxy to start
View gist:9695834
$ riak-admin top
'riak@' 20:36:46
Load: cpu 692 Memory: total 301938 binary 17238
procs 9238 processes 53167 code 11491
runq 0 atom 1015 ets 167663
Pid Name or Initial Func Time Reds Memory MsgQ Current Function
while getopts "v:n" opt; do
case $opt in
bakins / worker.go
Created Jan 6, 2014
Silly worker to create a push queue for each chef role and add each node in that role as a subscriber. Just learning golang and Iron.IO
View worker.go
package main
import (
You can’t perform that action at this time.