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
def copy_into(directory, target_dir):
with directory.relpath():
for pth in path('./').walk():
tgt = target_dir.joinpath(*pth.splitpath())
if pth.isdir():
tgt.mkdir_p()
continue
if pth.islink():
link = pth.realpath().relpath()
@whitmo
whitmo / func.py
Last active August 29, 2015 14:13
def overwrite_with_export(repo, output):
repo = path(repo)
output = path(output)
if not output.exists():
log.critical("Output dir does not exist: {}".format(output))
create = raw_input("Shall I create the output directory? [N/y] ")
if create is 'y' or create is 'Y':
output.mkdir()
for p in repo.files():
kubernetes-master:
charm: local:trusty/kubernetes-master-2
exposed: true
relations:
etcd:
- etcd
minions-api:
- kubernetes
units:
kubernetes-master/0:
@whitmo
whitmo / gist:19369d9498fdd3aaa693
Last active August 29, 2015 14:11
Failing juju bootstrap for local in a docker container
juju bootstrap --upload-tools
Bootstrapping environment "local"
Starting new instance for initial state server
Building tools to upload (1.21-beta4.1-trusty-amd64)
Installing Juju agent on bootstrap instance
Logging to /home/dev/.juju/local/cloud-init-output.log on remote host
Bootstrapping Juju machine agent
^CInterrupt signalled: waiting for bootstrap to exit
import json
from path import path
source = path('/home/whit/proj/workloadz/17c09d289f6e7c1f01f7/old.json')
data = json.loads(source.text())
from operator import itemgetter
pt = data['db'][0]['data']['posts_tags']
ti = itemgetter('tag_id')
[
{
"type": "MetronAgent",
"index": 0,
"host": "172.31.22.170:1508",
"uuid": "0-",
"credentials": [
"e89YHtH-je6s1cBDXFBSspS7CGGqz9_dtavq_km5pXTkIqx2cN4qyav_",
"gtzFXKMSlooZQ_UIfhr5DsYAIbN41NwHmN0wazKlz7vciZKD8XvQrQnF"
]
juju dhx rd/0
Customizing machine...ssh: connect to host 10.0.3.252 port 22: No route to host
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: unexplained error (code 255) at io.c(226) [sender=3.1.0]
ERROR subprocess encountered error code 255
@whitmo
whitmo / bosh-error.text
Last active August 29, 2015 14:10
error output
TASK: [run export] ************************************************************
<54.174.47.185> REMOTE_MODULE async_status jid=11837425011.15937
failed: [54.174.47.185] =>
{
"start": "2014-11-20 19:27:04.991713",
"rc": 1,
"finished": 1,
"end": "2014-11-20 19:27:06.243801",
package main
import (
"encoding/json"
"fmt"
"github.com/apcera/nats"
"os"
"strings"
"time"
)
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