Skip to content

Instantly share code, notes, and snippets.

View whitmo's full-sized avatar
💭
state 26

Whit Morriss whitmo

💭
state 26
View GitHub Profile
@whitmo
whitmo / hooks.py
Last active August 29, 2015 14:19 — forked from lazypower/hooks.py
def register_machine(apiserver, retry=False):
parsed = urlparse.urlparse(apiserver)
# identity = hookenv.local_unit().replace('/', '-')
private_address = hookenv.unit_private_ip()
with open('/proc/meminfo') as fh:
info = fh.readline()
mem = info.strip().split(":")[1].strip().split()[0]
cpus = os.sysconf("SC_NPROCESSORS_ONLN")
FROM ubuntu:14.04
RUN apt-get update -qy
RUN apt-get install -qy software-properties-common
RUN apt-add-repository ppa:juju/stable
RUN apt-get install -qy lxc iptables
RUN apt-get -qy install juju-core juju-quickstart juju-deployer tmux charm-tools juju-local openssh-client
RUN apt-get install -qy python-pip git
RUN pip install git+git://github.com/juju-solutions/bundletester.git
RUN pip install blessings
RUN useradd ubuntu
@whitmo
whitmo / gist:1176336
Created August 28, 2011 07:00 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
class GitHubGiveAway(object):
questions = "day job",\
"fav python project",\
"fav conference",\
"python foo"
answers = "Python DevOps Ninja Janitor Monkey @ SurveyMonkey, "\
"ZDjangoGears by Ian Bicking or Starkiller or pythong.org, "\
"Snow or Castle or Mountain Sprints or Pylons Project MiniCon, "\
"so drunk when I wrote this I only had one eye I open".split(', ')