Skip to content

Instantly share code, notes, and snippets.

View rrichards's full-sized avatar
💭
Rocking the CLI

Ryan Richards rrichards

💭
Rocking the CLI
  • R3 Technologies, Inc.
  • Edmond, OK
  • 07:40 (UTC -12:00)
  • X @rrichards
View GitHub Profile
@rrichards
rrichards / README.md
Last active August 29, 2015 14:14 — forked from revett/README.md

Tutum Zero Downtime Re-deploy

cats.jpg

I tweeted Tutum last night asking if they're looking at implementing zero downtime re-deploys for a given service. Slightly surprised by their response as it seems like a critical feature if you want to use the service for a production environment.

"not a top priority, but by Spring :)"

As Tutum currently doesn't support graceful termination of containers within a service, I was experiencing a 5-10 second window of 503 errors, so decided to use the following hack (code below) until the feature is officially implemented.

#!/bin/bash
# This script is used by Nagios to post alerts into a Slack channel
# using the Incoming WebHooks integration. Create the channel, botname
# and integration first and then add this notification script in your
# Nagios configuration.
#
# All variables that start with NAGIOS_ are provided by Nagios as
# environment variables when an notification is generated.
# A list of the env variables is available here:

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/sh
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.require_version '>= 1.5.1'
Vagrant.configure('2') do |config|
config.vm.box = 'roots/bedrock'
# Required for NFS to work, pick any local IP
config.vm.network :private_network, ip: '192.168.50.5'
@rrichards
rrichards / Vagrantfile
Last active August 29, 2015 14:12 — forked from borgand/Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Landrush domain name suffix
# https://github.com/phinze/landrush
# For linux:
# sudo apt-get install -y resolvconf dnsmasq
# sudo sh -c 'echo "server=/vm/127.0.0.1#10053" > /etc/dnsmasq.d/vagrant-landrush'
# sudo service dnsmasq restart
#
# -*- mode: ruby -*-
# vi: set ft=ruby :
# inspired from https://gist.github.com/dlutzy/2469037
boxes = [
{ :name => :web, ip: '192.168.33.10', ssh_port: 2223 },
{ :name => :db, ip: '192.168.33.11', ssh_port: 2224 },
{ :name => :zookeeper, ip: '192.168.33.12', ssh_port: 2225 },
{ :name => :kafka, ip: '192.168.33.13', ssh_port: 2226 },
{ :name => :storm, ip: '192.168.33.14', ssh_port: 2227 },
# Please read the corosync.conf.5 manual page
compatibility: whitetank
aisexec {
user: root
group: root
}
service {
name: pacemaker

#MongoDB Install Script

echo -----------------------------------------------------------------
echo -                    Mongo - Ubuntu 14.04                       -
echo -----------------------------------------------------------------

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
#! /usr/bin/env bash
# Author: Damien Cassou
#
# This is the script I use to build Emacs packages for Ubuntu. These
# packages are uploaded to
# https://launchpad.net/~cassou/+archive/emacs/. Each package is
# either build from a Debian package or from
# http://emacs.naquadah.org/.