Skip to content

Instantly share code, notes, and snippets.

View anotherjesse's full-sized avatar

Jesse Andrews anotherjesse

View GitHub Profile
@anotherjesse
anotherjesse / localrc
Created September 20, 2012 23:00
my nova-network devstack localrc
# Networking - create a local network instead of using eth/wlan
which tunctl || sudo apt-get install uml-utilities
ifconfig tap0 || sudo tunctl -u `whoami`
sudo ifconfig tap0 192.168.42.2 up
sudo iptables -I POSTROUTING -s 10.0.0.0/24 -j MASQUERADE -t nat
SERVICE_HOST=192.168.42.2
HOST_IP=192.168.42.2
FLAT_INTERFACE=tap0
@anotherjesse
anotherjesse / token.py
Created September 28, 2012 18:31
generate initial tokens for cassandra
#!/usr/bin/env python
# based on http://journal.paul.querna.org/articles/2010/09/24/cassandra-token-selection/
import sys
RING_SIZE = 2**127
def token(x, n):
return RING_SIZE / n * x
@anotherjesse
anotherjesse / gist:3999036
Created November 2, 2012 06:16
ansible.patch
diff --git a/plugins/inventory/nova.py b/plugins/inventory/nova.py
index 227ccdb..b072815 100755
--- a/plugins/inventory/nova.py
+++ b/plugins/inventory/nova.py
@@ -178,14 +178,15 @@ if len(sys.argv) == 2 and (sys.argv[1] == '--list'):
# Cycle on servers
for f in client.servers.list():
# Define group (or set to empty string)
- group = f.metadata['group'] if f.metadata.has_key('group') else 'undefined'
-
@anotherjesse
anotherjesse / upstart
Created March 12, 2013 19:59
upstart + unicorn + capistrano
description "site"
start on runlevel [2]
stop on runlevel [016]
console owner
respawn
script
@anotherjesse
anotherjesse / gist:7796319
Last active July 9, 2018 17:17
ansible push current sha to all hosts
---
- name: push / deploy a local git repo
hosts: all
user: jesse
tasks:
# ensure git exists and deploy branch has our current HEAD
- command: git init --bare /tmp/repo_mirror creates=/tmp/repo_mirror
- command: git push -f ${ansible_ssh_user}@${inventory_hostname}:/tmp/repo_mirror HEAD:deploy
connection: local
@anotherjesse
anotherjesse / readme.md
Last active August 29, 2015 14:01
logstash elasticsearch spot instances

install logstash 1.4 / elasticsearch-1.1.0

bin/elasticsearch

logstash web

bin/logstash web

run logstash ingestor

@anotherjesse
anotherjesse / block.clj
Last active August 29, 2015 14:10
blocks scad
(ns threed.core
(:use [scad-clj.scad])
(:use [scad-clj.model]))
(centering! false)
(defn lego-single
[]
(difference
(union
@anotherjesse
anotherjesse / ergodox.md
Created December 23, 2014 22:56
ergodox
@anotherjesse
anotherjesse / commit.diff
Created February 23, 2017 22:48
webpack-plus-flask
commit 45f8b56d252df8b9f7b6209068e1eddd2f6fee2b
Author: jesse andrews <anotherjesse@gmail.com>
Date: Fri Feb 10 10:57:28 2017 -0800
add proxy to 5000
diff --git a/package.json b/package.json
index 492dd54..39797a7 100644
--- a/package.json
+++ b/package.json