Skip to content

Instantly share code, notes, and snippets.

Ian Unruh ianunruh

Block or report user

Report or block ianunruh

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
View pia-deluge-portforward.py
#!/usr/bin/env python
from argparse import ArgumentParser
import json
import hashlib
import subprocess
import os
def main():
parser = ArgumentParser()
View 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 / cfssl_certificate.py
Created Nov 3, 2015
Ansible module for generating SSL certs from cfssl
View cfssl_certificate.py
#!/usr/bin/env python
import json
import os
import requests
def main():
module = AnsibleModule(
argument_spec=dict(
cert_path=dict(required=True),
@ianunruh
ianunruh / ember-cli-build.js
Created Aug 26, 2015
Use Bootstrap Sass in Ember.js
View ember-cli-build.js
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
module.exports = function(defaults) {
var app = new EmberApp(defaults, {
// Add Bootstrap to Sass include path
sassOptions: {
includePaths: [
'bower_components/bootstrap-sass/assets/stylesheets'
]
View dvr.md

Neutron Distributed Virtual Router (DVR)

The L3 agent provided with Neutron uses the Linux networking stack to perform L3 forwarding and NAT between tenant networks and external networks. Before the Juno release of OpenStack, the L3 agent could only be made highly available using Pacemaker (active/passive). It could not be scaled out natively. However, in the Juno release, the concept of distributed routing was introduced. With distributed routing enabled, the L3 agent will on all the compute nodes and on a centralized "service" node.

On the compute nodes, the L3 agent provides NAT for instances that are associated with a floating IP address. This means that ingress traffic (traffic from external to tenant networks) capacity scales out with each additional compute node. It also means that when an instance is migrated off of a compute node (because of maintenance or failure), the floating IP address will be moved to the new compute node.

On the service nodes, the L3 agent provides NAT for egress traffic (

@ianunruh
ianunruh / join.ps
Created Sep 12, 2014
Join Windows to AD
View join.ps
#ps1_sysnative
$domain = "YOURDOMAIN"
$password = "YOURPASSWORD" | ConvertTo-SecureString -asPlainText -Force
$username = "$domain\Administrator"
$credential = New-Object System.Management.Automation.PSCredential($username,$password)
Add-Computer -DomainName $domain -Credential $credential
@ianunruh
ianunruh / onboard-tenant.py
Last active Aug 29, 2015
Onboard tenants to OpenStack
View onboard-tenant.py
#!/usr/bin/env python
from argparse import ArgumentParser, RawTextHelpFormatter
import os
import sys
import keystoneclient.v2_0
import neutronclient.v2_0.client
NEUTRON_ROUTER_FORMAT = '{}-router'
NEUTRON_NETWORK_FORMAT = '{}-network'
@ianunruh
ianunruh / quickstart-corosync.sh
Last active Sep 7, 2016
Corosync + Pacemaker basics on Ubuntu 14.04
View quickstart-corosync.sh
#!/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 / start-sharded-cluster.sh
Last active Aug 29, 2015
MongoDB sharded cluster on single box
View start-sharded-cluster.sh
#!/bin/bash
DATA_PATH=/tmp/sharded-cluster
HOSTNAME=$(hostname -f)
killall mongod > /dev/null 2>&1
killall mongos > /dev/null 2>&1
rm -rf $DATA_PATH
mkdir -p $DATA_PATH/rs{0,1}{a,b,c}
View martini.go
package main
import (
"net/http"
"github.com/go-martini/martini"
"github.com/martini-contrib/encoder"
"github.com/martini-contrib/strict"
)
You can’t perform that action at this time.