Skip to content

Instantly share code, notes, and snippets.

@bakins
bakins / gist:6176680
Created August 7, 2013 17:59
ubuntu nginx dockerfile
FROM ubuntu:12.04
CMD curl -O http://www.akins.org/nginx/nginx_1.2.8-2.ubuntu.12.04_amd64.deb
CMD dpkg -i nginx_1.2.8-2.ubuntu.12.04_amd64.deb
@bakins
bakins / gist:6280468
Created August 20, 2013 11:55
horrible docker wrapper for runit/chef
#!/opt/chef/embedded/bin/ruby
require 'net/http'
require 'json'
require 'yaml'
STDOUT.sync = true
config = YAML.load_file(ARGV[0])
http = Net::HTTP.new("127.0.0.1", 4243)
@bakins
bakins / horrible-hack.rb
Created September 16, 2013 16:57
Horrible hack for some local heroku test environments
Vagrant.configure("2") do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.ssh.forward_agent = true
config.vm.provision :shell, :inline => <<EOF
apt-get update
apt-get install -y git-core redis-server curl libssl0.9.8 make g++
mkdir -p -m 0550 /root/.ssh/
echo -e "Host *\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
@bakins
bakins / worker.go
Created January 6, 2014 18:15
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
package main
import (
"fmt"
"github.com/bakins/chef-golang"
"github.com/bakins/iron_go/mq"
"github.com/iron-io/iron_go/config"
"os"
"encoding/json"
"io/ioutil"
#!/bin/bash
VERSION=""
NAME=""
DIR=""
while getopts "v:n" opt; do
case $opt in
v)
VERSION=$OPTARG
@bakins
bakins / gist:9695834
Created March 21, 2014 20:37
riak top
$ riak-admin top
===============================================================================================================================
'riak@10.165.23.16' 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
-------------------------------------------------------------------------------------------------------------------------------
@bakins
bakins / gist:e62e9713ffa7c13b86da
Last active August 29, 2015 14:00
simple "synapse" type thing for consul
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
=====
===== 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
bakins / gist:bda46eff346c85aa3a17
Last active August 29, 2015 14:01
Horrible ohai workaround
# 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])

Keybase proof

I hereby claim:

  • I am bakins on github.
  • I am bakins (https://keybase.io/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: