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
  • 11:07 (UTC -12:00)
  • X @rrichards
View GitHub Profile
@rrichards
rrichards / .bashrc
Created May 18, 2016 23:51 — forked from vsouza/.bashrc
Golang 1.5 setup in Mac OSX with HomeBrew. Set `GOPATH` and `GOROOT` variables in zshell or bash.
# Set variables in .bashrc file
# don't forget to change your path correctly!
export GOPATH=$HOME/golang
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
@rrichards
rrichards / dev-machine.sh
Created April 4, 2016 08:30
Install all the necessary tools for a developer machine on Ubuntu 14.04
#!/bin/bash
# All the configuration settings described below were found on the internet,
# and this script just automates it
# Generating locales
sudo locale-gen en_US en_US.UTF-8 pt_BR pt_BR.UTF-8 es_ES es_ES.UTF-8
# Installing base packages
sudo apt-get update
@rrichards
rrichards / gist:fa44988d7ba6656f8a48
Created January 4, 2016 10:44 — forked from simonmorley/gist:d16261a1b45e28af6455
Google Cloud Compute Create Snapshot with Rotate
#!/bin/ruby
require 'json'
require 'time'
require 'syslog'
class Snapshot
def initialize()
@format = 'json'
@rrichards
rrichards / ssh-multi.sh
Last active August 29, 2015 14:16 — forked from dmytro/ssh-multi.sh
#!/bin/bash
# ssh-multi
# D.Kovalov
# Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html
# a script to ssh multiple servers over multiple tmux panes
starttmux() {
if [ -z "$HOSTS" ]; then
#!/bin/bash
description="
fence_ec2 is an I/O Fencing agent which can be used with Amazon EC2 instances.
In order to function, the agent needs the private key and cert used by the Amazon EC2 API.
API functions used by this agent:
- ec2-describe-tags
- ec2-describe-instances
- ec2-stop-instances
@rrichards
rrichards / elastic-ip
Last active August 29, 2015 14:16 — forked from therobot/elastic-ip
#!/bin/bash
###############################################################################
# CONFIG
# AWS config
export AWS_SECRET_KEY="XXXX"
export AWS_ACCESS_KEY="XXXX"
export PATH=$PATH:/usr/local/aws/ec2/bin
export EC2_HOME=/usr/local/aws/ec2/
(*
Jered Benoit
jeredb.com
Omnifocus -> Day One Daily Completed Task Log
Based upon [Version 1.0] [1] of [OmniFocus - Weekly Project Report Generator] [2]
Originally Authored by Chris Brogan and Rob Trew
February 5, 2012
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@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: