Skip to content

Instantly share code, notes, and snippets.

View progrium's full-sized avatar

Jeff Lindsay progrium

View GitHub Profile
FROM ubuntu:trusty
MAINTAINER Jeff Lindsay <progrium@gmail.com>
RUN apt-get -y install unzip
ADD https://dl.bintray.com/mitchellh/consul/0.2.0_linux_amd64.zip /tmp/consul.zip
RUN cd /usr/local/sbin && unzip /tmp/consul.zip && chmod +x /usr/local/sbin/consul
EXPOSE 8300 8301 8302
ENTRYPOINT ["/usr/local/sbin/consul", "agent", "-server", "-data-dir=/tmp/consul"]
destructuring_assignment_for_named_local_args() {
declare numbers letters words
read numbers letters words <<<"$@"
echo "$numbers"
echo "$letters"
echo "$words"
}
destructuring_assignment_for_named_local_args 123 abc "Hello world"
-----> Python app detected
-----> Preparing Python runtime (python-2.7.7)
Traceback (most recent call last):
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch", line 13, in <module>
import bp_cli
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch.zip/bp_cli.py", line 26, in <module>
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch.zip/logplex/__init__.py", line 1, in <module>
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch.zip/logplex/core.py", line 8, in <module>
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch.zip/logplex/packages/requests/__init__.py", line 58, in <module>
File "/tmp/buildpacks/heroku-buildpack-python/vendor/bpwatch/bpwatch.zip/logplex/packages/requests/utils.py", line 12, in <module>
#!/bin/bash
foo() {
echo "foo: exported from file1"
}
locals() {
bar() {
echo "bar: local to file1"
}
{
"ssl_certificate": {"$file": "/nginx/files/foobar"},
"user": ["nobody", "nogroup"],
"events": {
"worker_connections": 1024,
"accept_mutex": "on"
},
"http": {
"gzip_disable": "\"MSIE [1-6]\\.\"",
"upstream": {
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
@progrium
progrium / gist:aa2a42683dec1f0adf17
Last active August 29, 2015 14:02
Prototype of Dokku-like deploys (with "zero downtime") using Nginx appliance and slugbuilder/slugrunner
#!/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 -
-------------------
HAProxy
Reference Manual
-------------------
version 1.3.15
willy tarreau
2008/04/19
!!!! NOTE: THIS DOCUMENT IS OUTDATED !!!!
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)
#!/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 \