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
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 + apt-get install -y python-pip
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 Reading package lists...
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 Building dependency tree...
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 Reading state information...
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 python-pip is already the newest version.
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 + pip install charmhelpers path.py
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 Traceback (most recent call last):
unit-etcd-1[18630]: 2015-05-26 16:49:17 INFO unit.etcd/1.install logger.go:40 File "/usr/bin/pip", line 9, in
@whitmo
whitmo / apt-update.sh
Last active August 29, 2015 14:21
conditional update
function conditional_apt_update(){
if expr $(date +%s) - $(stat -c %Y /var/lib/apt/periodic/update-success-stamp) > $0
then
echo HI
fi
}
conditional_apt_update 10
Kubernetes minions: 172.31.40.78 172.31.15.207
... calling validate-cluster
current-context: ""
Running: ./../cluster/../cluster/../_output/local/bin/linux/amd64/kubectl get nodes -o template -t {{range.items}}{{.metadata.name}}
{{end}} --api-version=v1beta3
Found 2 nodes.
1 172.31.15.207
2 172.31.40.78
current-context: ""
Running: ./../cluster/../cluster/../_output/local/bin/linux/amd64/kubectl get cs
@whitmo
whitmo / tidal-first-stabs.hs
Created April 17, 2015 04:07
orthogonal beatz
-- orthogonal beatz --
d4 $ sound ""
d4 $ slow 2 $ sound (brak "[wobble bleep kurt/1 ~, bend ~ dr ~ dr ~ dr dr, tok tok]") |+| slow 3 (cutoff sawwave1)
d2 $ slow 2 $ every 32 (0.75 <~) $ (sound ("[bd ~ sn ~ ~ bd sn ~, ~ cp ~ cp]")) |+| resonance sinewave1
d2 $ sound ""
d1 $ sound ""
@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")
DEBUG:bundletester.utils:Updating JUJU_ENV: "" -> "ec2-or"
DEBUG:root:Bootstrap environment: ec2-or
DEBUG:deployer.env:Connecting to environment...
DEBUG:deployer.env:Connected to environment
DEBUG:deployer.env: Destroying service squid-reverseproxy
DEBUG:deployer.env: Destroying service apache2
DEBUG:deployer.env: Resolving error on squid-reverseproxy/0
DEBUG:deployer.env: Resolving error on squid-reverseproxy/0
DEBUG:deployer.env: Resolving error on squid-reverseproxy/0
DEBUG:deployer.env: Resolving error on squid-reverseproxy/0
DEBUG:bundletester.utils:Updating JUJU_ENV: "" -> "ec2-or"
DEBUG:root:Bootstrap environment: ec2-or
DEBUG:deployer.env:Connecting to environment...
DEBUG:deployer.env:Connected to environment
DEBUG:deployer.env: Terminating machines
DEBUG:root:Waiting for services to be removed...
DEBUG:runner:call ['/home/ubuntu/.virtualenvs/charm-review/bin/charm-proof']
DEBUG:runner:Exit Code: 0
DEBUG:deployer.env: Terminating machines
DEBUG:root:Waiting for services to be removed...
@whitmo
whitmo / bndl.yaml
Created January 28, 2015 22:27
with annotations
kubernetes:
series: trusty
parent: {some url}
variations:
kubernetes_version: "0.8.0"
networking: "overlay"
services:
"kubernetes-master":
charm: cs:~kubernetes/trusty/kubernetes-master-1
options:
kubernetes:
series: trusty
services:
kubernetes-master:
charm: https://github.com/whitmo/kubernetes-master.git
annotations:
"gui-x": "1536.565185546875"
"gui-y": "280.21742248535156"
flannel:
charm: https://github.com/whitmo/flannel.git
@whitmo
whitmo / dir_into_dir.py
Last active August 29, 2015 14:13
dir_into_dir
def copy_into(directory, target_dir):
with directory.relpath():
for pth in path('./').walk():
tgt = target_dir.joinpath(*pth.splitpath())
if pth.isdir():
tgt.makedirs_p()
continue
if pth.islink():
link = pth.realpath().relpath()