Skip to content

Instantly share code, notes, and snippets.

Avatar

Jeff Lindsay progrium

View GitHub Profile
View Dockerfile
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"]
View gist:215e210851fbcff7d1b6
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"
View gist:4076ca225b5d58037154
-----> 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>
View file1.sh
#!/bin/bash
foo() {
echo "foo: exported from file1"
}
locals() {
bar() {
echo "bar: local to file1"
}
View gist:df329e591d3c873ea653
{
"ssl_certificate": {"$file": "/nginx/files/foobar"},
"user": ["nobody", "nogroup"],
"events": {
"worker_connections": 1024,
"accept_mutex": "on"
},
"http": {
"gzip_disable": "\"MSIE [1-6]\\.\"",
"upstream": {
View gist:ed34a00a7f84c09cd2bf
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 Aug 29, 2015
Prototype of Dokku-like deploys (with "zero downtime") using Nginx appliance and slugbuilder/slugrunner
View gist:aa2a42683dec1f0adf17
#!/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 -
View gist:43d9441f090a97501642
-------------------
HAProxy
Reference Manual
-------------------
version 1.3.15
willy tarreau
2008/04/19
!!!! NOTE: THIS DOCUMENT IS OUTDATED !!!!
View node1
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)
View gist:6536fc89af4a7dfeb6b1
#!/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 \