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
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
#!/bin/bash | |
cmd-hello() { | |
declare desc="Displays a friendly hello" | |
declare firstname="$1" lastname="$2" | |
echo "Hello, $firstname $lastname." | |
} | |
cmd-help() { | |
declare desc="Shows help information for a command" |
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/bin/env bash | |
source ./$(dirname $BASH_SOURCE)/libs | |
function start_containers { | |
args="$@" | |
cat $DOCKER_CONTAINERS_FILE | grep "^${args// /\\|^}" | parallel \ | |
--onall \ | |
--sshloginfile docker_nodes_${ENVIRONMENT} \ | |
--controlmaster \ |
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
import requests | |
from checks import AgentCheck | |
class ConsulCheck(AgentCheck): | |
def should_check(self): | |
r = requests.get(self.init_config["consul_url"] + "/v1/agent/self") | |
if r.status_code != 200: | |
return False | |
agent = r.json() |
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
root@node1:~# $(docker run --rm progrium/consul cmd:run $PUBLIC_IP) | |
==> WARNING: Bootstrap mode enabled! Do not enable unless necessary | |
==> WARNING: It is highly recommended to set GOMAXPROCS higher than 1 | |
==> Starting Consul agent... | |
==> Starting Consul agent RPC... | |
==> Consul agent running! | |
Node name: 'node1' | |
Datacenter: 'dc1' | |
Server: true (bootstrap: true) | |
Client Addr: 0.0.0.0 (HTTP: 8500, DNS: 53, RPC: 8400) |
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
------------------- | |
HAProxy | |
Reference Manual | |
------------------- | |
version 1.3.15 | |
willy tarreau | |
2008/04/19 | |
!!!! NOTE: THIS DOCUMENT IS OUTDATED !!!! |
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/bash | |
set -eo pipefail | |
name="$1" | |
port="5000" | |
domain="$name.dokku.me" | |
vhost_config='{"upstream": {"%s": {"server": {"%s:%s": null}}}, "server": [{"listen": 80, "server_name": "%s", "location": {"/": {"proxy_pass": "http://%s"}}}]}' | |
mkdir -p "/tmp/$name" | |
cat | docker run -i -a stdin -a stdout -a stderr flynn/slugbuilder - | tar -C "/tmp/$name" -zxf - |
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
root@precise64:/tmp# docker run -it --rm ubuntu:12.04 bash -c "ls -la /dev" | |
total 4 | |
drwxr-xr-x 4 root root 240 Jun 19 15:47 . | |
drwxr-xr-x 48 root root 4096 Jun 19 15:47 .. | |
crw------- 1 root root 136, 3 Jun 19 15:47 console | |
crw-rw-rw- 1 root root 1, 7 Jun 19 15:47 full | |
crw-rw-rw- 1 root root 1, 3 Jun 19 15:47 null | |
lrwxrwxrwx 1 root root 8 Jun 19 15:47 ptmx -> pts/ptmx | |
drwxr-xr-x 2 root root 0 Jun 19 15:47 pts | |
crw-rw-rw- 1 root root 1, 8 Jun 19 15:47 random |
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/bash | |
codep() { | |
set -eo monitor | |
trap 'kill $(jobs -p) &> /dev/null' EXIT | |
trap 'exit 2' CHLD | |
for child in "$@"; do | |
$child & | |
done | |
wait |