Skip to content

Instantly share code, notes, and snippets.

View ianunruh's full-sized avatar

Ian Unruh ianunruh

View GitHub Profile
@ianunruh
ianunruh / cfssl_certificate.py
Created November 3, 2015 21:41
Ansible module for generating SSL certs from cfssl
#!/usr/bin/env python
import json
import os
import requests
def main():
module = AnsibleModule(
argument_spec=dict(
cert_path=dict(required=True),
@ianunruh
ianunruh / gist:8392026
Last active December 17, 2020 15:38
Force10 S4810 configuration with LACP + graceful degradation
! Version 8.3.12.0
! Last configuration change at Sat Apr 26 09:22:44 2014 by admin
! Startup-config last updated at Sat Apr 26 11:01:20 2014 by admin
!
boot system stack-unit 0 primary system: A:
boot system stack-unit 0 secondary system: B:
boot system stack-unit 0 default system: A:
!
redundancy auto-synchronize full
!
@ianunruh
ianunruh / join-rabbitmq-cluster.rb
Last active September 27, 2020 17:54
Join RabbitMQ to cluster via Consul
#!/usr/bin/env ruby
require 'json'
require 'net/http'
require 'optparse'
require 'ostruct'
options = OpenStruct.new
options.service_name = "rabbitmq"
options.port = 8500
@ianunruh
ianunruh / install-redis.sh
Last active July 13, 2018 14:35
Install single instance of Redis on Ubuntu 14.04
#!/bin/bash
if [ "$#" -ne "2" ]; then
echo "Usage: ./install-redis-instance.sh NAME PORT"
exit 1
fi
if [ ! -x /usr/local/bin/redis-server ]; then
apt-get install -y build-essential
curl -O -L http://download.redis.io/releases/redis-2.8.9.tar.gz
@ianunruh
ianunruh / consul.sh
Last active December 26, 2017 15:58
Install Consul on Ubuntu 14.04
#!/bin/bash
apt-get install -y curl unzip
mkdir -p /var/lib/consul
mkdir -p /usr/share/consul
mkdir -p /etc/consul/conf.d
curl -OL https://dl.bintray.com/mitchellh/consul/0.3.1_linux_amd64.zip
unzip 0.3.1_linux_amd64.zip
mv consul /usr/local/bin/consul
#!/usr/bin/env python
from argparse import ArgumentParser
import json
import hashlib
import subprocess
import os
def main():
parser = ArgumentParser()
@ianunruh
ianunruh / quickstart-corosync.sh
Last active September 7, 2016 15:15
Corosync + Pacemaker basics on Ubuntu 14.04
#!/bin/bash
BIND_NETWORK="192.168.5.0"
SHARED_VIP="192.168.5.30"
apt-get update
apt-get install -y pacemaker ntp
# Configure Corosync
echo "START=yes" > /etc/default/corosync
sed -i "s/bindnetaddr: 127.0.0.1/bindnetaddr: $BIND_NETWORK/g" /etc/corosync/corosync.conf
@ianunruh
ianunruh / keybase.md
Created April 9, 2016 20:43
keybase.md

Keybase proof

I hereby claim:

  • I am ianunruh on github.
  • I am ianunruh (https://keybase.io/ianunruh) on keybase.
  • I have a public key whose fingerprint is 21E9 CA13 ADF1 4A36 A024 D119 218C 4656 0BED 3206

To claim this, I am signing this object:

@ianunruh
ianunruh / .zshrc
Created November 25, 2013 19:29
Vagrant aliases for ZSH
# Vagrant aliases
alias vs="vagrant ssh"
alias vu="vagrant up --no-provision"
alias vp="vagrant provision"
# Depends on the vagrant-vbox-snapshot plugin
alias vsb="vagrant snapshot back"
alias vst="vagrant snapshot take"
function vr() {
vagrant snapshot back $1
@ianunruh
ianunruh / happening.rb
Last active December 16, 2015 17:09
Port of my Happening bot to Cinch
require 'cinch'
class Happening
include Cinch::Plugin
match /is it happening/i, :method => :happening, :use_prefix => false
match /happening (.+)/, :method => :add_happening
def initialize(s)
super