Skip to content

Instantly share code, notes, and snippets.

View rubic's full-sized avatar

Jeff Bauer rubic

  • Rubicon, Inc.
  • Nashville, Tennessee
View GitHub Profile
@rubic
rubic / ec2connection.py
Created January 21, 2012 17:44
Magic for working with EC2 instances interactively with IPython
# Magic imports for working interactively (ipython)
# ipython -i ec2connection.py
import re
import boto.ec2
RegionRegex = re.compile("^us-") # all regions starting with 'us-'
class EC2(object):
def __init__(self):
@rubic
rubic / master
Created January 21, 2012 10:36
salt configuration for the master daemon as an unprivileged (non-root) user
############################################################################
# My current salt configuration for the master daemon as an unprivileged
# non-root user.
# https://gist.github.com/1652306
############################################################################
##### Primary configuration settings #####
##########################################
# The address of the interface to bind to
#interface: 0.0.0.0
@rubic
rubic / gist:1644599
Created January 20, 2012 02:33
setuid via subprocess.Popen
#!/usr/bin/env python
import os, subprocess
uid, gid = 5, 60
def preexec_fn():
os.setgid(uid)
os.setuid(gid)
cmd = ['uname', '-a']
@rubic
rubic / gist:1618625
Created January 16, 2012 01:54
salt 0.9.4 traceback on master
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/local/lib/python2.7/dist-packages/salt/master.py", line 295, in run
self.__bind()
File "/usr/local/lib/python2.7/dist-packages/salt/master.py", line 251, in __bind
payload = salt.payload.unpackage(package)
File "/usr/local/lib/python2.7/dist-packages/salt/payload.py", line 21, in unpackage
return pickle.loads(package_)
ValueError: unregistered extension code 164
@rubic
rubic / salt-minion.conf
Created January 15, 2012 20:17
Upstart configuration file for salt-minion
# salt-minion.conf
description "salt-minion upstart daemon"
author "Jeff Bauer <jbauer@rubic.com>"
# copy this file to /etc/init
start on (net-device-up and local-filesystems)
stop on shutdown
expect fork