This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubernetes-master: | |
charm: local:trusty/kubernetes-master-2 | |
exposed: true | |
relations: | |
etcd: | |
- etcd | |
minions-api: | |
- kubernetes | |
units: | |
kubernetes-master/0: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"type": "MetronAgent", | |
"index": 0, | |
"host": "172.31.22.170:1508", | |
"uuid": "0-", | |
"credentials": [ | |
"e89YHtH-je6s1cBDXFBSspS7CGGqz9_dtavq_km5pXTkIqx2cN4qyav_", | |
"gtzFXKMSlooZQ_UIfhr5DsYAIbN41NwHmN0wazKlz7vciZKD8XvQrQnF" | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/apcera/nats" | |
"os" | |
"strings" | |
"time" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |