This file contains 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 healthy_nodes(): | |
nodes = requests.get("http://localhost:8500/v1/health/nodes").json() | |
passing = requests.get("http://localhost:8500/v1/health/state/passing").json() | |
passing = [c["Node"] for c in passing if c["CheckID"] == "serfHealth"] | |
return [n for n in nodes if n["Node"] in passing] |
This file contains 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
++ export FLEETCTL_TUNNEL=54.68.57.250 | |
++ FLEETCTL_TUNNEL=54.68.57.250 | |
++ case "$cmd" in | |
++ fleetctl --debug=true --strict-host-key-checking=false list-units | |
I0918 03:22:13.988410 12217 client.go:353] etcd: sending HTTP request GET http://127.0.0.1:4001/v2/keys/_coreos.com/fleet/machines?consistent=true&recursive=true&sorted=true | |
I0918 03:22:14.271524 12217 client.go:360] etcd: recv response from GET http://127.0.0.1:4001/v2/keys/_coreos.com/fleet/machines?consistent=true&recursive=true&sorted=true: 200 OK | |
I0918 03:22:14.271917 12217 client.go:353] etcd: sending HTTP request GET http://127.0.0.1:4001/v2/keys/_coreos.com/fleet/state?consistent=true&recursive=true&sorted=false | |
I0918 03:22:14.331921 12217 client.go:360] etcd: recv response from GET http://127.0.0.1:4001/v2/keys/_coreos.com/fleet/state?consistent=true&recursive=true&sorted=false: 200 OK | |
I0918 03:22:14.332321 12217 client.go:353] etcd: sending HTTP request GET http://127.0.0.1:4001/v2/keys/_coreos.com/fleet/states?consistent=true&recursive=true&so |
This file contains 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
#!/usr/local/bin/bash | |
#nl2spc() { | |
# sed -e ':a' -e 'N' -e '$!ba' -e 's/\n/ /g' | |
#} | |
#set -x | |
fn-args() { | |
local argline=$(type $1 | grep declare | grep -v "declare desc" | head -1) |
This file contains 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
export PS1="\[\033[01;31m\]\$(status=\$?; [[ \$status -ne 0 ]] && echo \"[\$status] \")\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\n\$ \[\033[00m\]" | |
alias reload="curl -s https://gist.githubusercontent.com/progrium/6a24ae8d7ab93bc65579/raw/gistfile1.txt > ~/.profile.me; source ~/.profile" | |
alias g="git" | |
alias gpr="git pull --rebase origin" | |
alias gprr="git pull --rebase" | |
alias gpu="git push origin" | |
alias gpuu="git push" | |
alias gs="git status" |
This file contains 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
#include | |
https://cloud-init.gliderlabs.com/docker-cluster |
This file contains 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
#!/bin/sh | |
tail -n +6 $0 | tar -zx "$(uname -sm)" | |
mv "$(uname -sm)" $0 | |
exec $0 $@ | |
exit | |
( gzip data with different binaries named after output of uname -sm ) |
This file contains 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
curl -s "$url" | tar -zxC "$dest" |
This file contains 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 ( | |
"bytes" | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
// Field represents a two-dimensional field of cells. |
This file contains 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
render-template() { | |
declare filename="$1"; shift | |
local script k v | |
for var in "$@"; do | |
IFS='=' read k v <<< "$var" | |
script="s/\$\$$k/${var##${k}=}/;$script" | |
done | |
cat "$filename" | sed "$script" | |
} |
This file contains 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
docker run -L layer://buildlayer -L file:///tmp/appsrc.tgz build.sh | |
docker run --layer buildlayer --layer appsrc.tgz --export build.sh > output.tgz | |
docker run --layer buildlayer --layer appsrc.tgz --export-file myfile build.sh > myfile | |
docker start foobar "run.sh web" | |
docker stop foobar | |
docker restart foobar | |
docker info foobar | |
docker logs foobar | |
docker destroy foobar |