test gist!
^ I need this to test '&' in headers
#!/usr/bin/env bash | |
source /etc/environment | |
# If I am able to contact etcd2 | |
/usr/bin/etcdctl mkdir /consul/leader | |
if [[ $? -eq 0 ]]; then | |
echo "Master lock created, bootstrapping" | |
/bin/bash -c "/usr/bin/docker run \ |
#!/usr/bin/env bash | |
mkdir -p /tmp/mkcert | |
openssl genrsa -des3 -passout pass:x -out /tmp/mkcert/server.pass.key 2048 | |
openssl rsa -passin pass:x -in /tmp/mkcert/server.pass.key -out /tmp/mkcert/server.key | |
rm /tmp/mkcert/server.pass.key | |
openssl req -new -key /tmp/mkcert/server.key -out /tmp/mkcert/server.csr \ | |
-subj "/C=US/ST=Massachusettes/L=Boston/O=Me/OU=Department of Departments/CN=$1" | |
openssl x509 -req -days 365 -in /tmp/mkcert/server.csr -signkey /tmp/mkcert/server.key -out /tmp/mkcert/server.crt | |
mv /tmp/mkcert/* `pwd` |
[Unit] | |
Description=Documentation for my app | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Environment="PROJECT_API_URL=https://path.to.place.com" | |
ExecStartPre=-/usr/bin/docker kill myapp | |
ExecStartPre=-/usr/bin/docker rm myapp |
#!/usr/bin/env bash | |
curl -H "Content-type: application/json" -X POST \ | |
-d '{ | |
"service_key": "--------YOURKEYHERE-------", | |
"event_type": "trigger", | |
"description": "A developer is in trouble!", | |
"client": "Geoff deployment cli", | |
"client_url": "http://butt.holdings", | |
"details": { |
expect = require('chai').expect | |
diff = require('diff') | |
require('colors').enabled = true; | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('readable', function(){ | |
var chunk = process.stdin.read(); | |
if (chunk !== null) { | |
try { | |
json = JSON.parse(chunk); |
set -g default-terminal "screen-256color" | |
# act like vim | |
setw -g mode-keys vi | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
bind-key -r C-h select-window -t :- | |
bind-key -r C-l select-window -t :+ |
#!/usr/bin/env bash | |
# Just for editor highlighting | |
### Kafka configuration | |
version=0.8.2.1 | |
scala_version=2.11 | |
install_dir=/usr/local/share | |
sudo -E su - --command "cd /tmp && wget http://archive.apache.org/dist/kafka/$version/kafka_$scala_version-$version.tgz" |
CREATE OR REPLACE FUNCTION update_modified_column() | |
RETURNS TRIGGER AS $$ | |
BEGIN | |
NEW.updated_at = now(); | |
RETURN NEW; | |
END; | |
$$ language 'plpgsql'; | |
ALTER TABLE consumer_offsets ADD COLUMN updated_at timestamp default current_timestamp; | |
CREATE TRIGGER update_consumer_offsets_modtime BEFORE UPDATE ON consumer_offsets FOR EACH ROW EXECUTE PROCEDURE update_modified_column(); |
#!/bin/bash | |
# Inspired by Brandon Philips' consul bootstrap script | |
# https://gist.github.com/philips/56fa3f5dae9060fbd100 | |
source /etc/environment | |
num_expected_nodes=$1 | |
do_join() { |