Skip to content

Instantly share code, notes, and snippets.

View jessesanford's full-sized avatar

Jesse Sanford jessesanford

View GitHub Profile
@jessesanford
jessesanford / gist:9900893
Created March 31, 2014 19:59
Celluloid monitoring jobs on Supervised Pools for failure and restarting.
require 'celluloid'
require 'worker'
class Manager
include Celluloid
attr_reader :worker_supervisor, :workers
trap_exit :worker_died
def initialize(message)
puts "manager got #{message} when instantiated"
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
#!/bin/bash
# rbenv system wide installation script
# Forked from https://gist.github.com/jpfuentes2/2002954
JOB_PID=$$
# Installs rbenv system wide on CentOS 5/6 and Debian, also allows single user installs.
if command -v yum >/dev/null 2>&1; then
DISTRO="Redhat"
elif command -v aptitude >/dev/null 2>&1; then
@jessesanford
jessesanford / gist:1296078
Created October 18, 2011 17:40
mongoose/lib/types/embedded.js modification to cast Document's to embedded documents
**
* EmbeddedDocument constructor.
*
* @param {Object} object from db
* @param {MongooseDocumentArray} parent array
* @api private
*/
function EmbeddedDocument (obj, parentArr) {
//TODO We might save some time if instead we
@jessesanford
jessesanford / initial_data.json
Created January 18, 2012 20:51
django-jack (beanstalkd admin) initial_data.json username: root password: toor
[{"pk": 5, "model": "contenttypes.contenttype", "fields": {"model": "contenttype", "name": "content type", "app_label": "contenttypes"}}, {"pk": 2, "model": "contenttypes.contenttype", "fields": {"model": "group", "name": "group", "app_label": "auth"}}, {"pk": 8, "model": "contenttypes.contenttype", "fields": {"model": "logentry", "name": "log entry", "app_label": "admin"}}, {"pk": 4, "model": "contenttypes.contenttype", "fields": {"model": "message", "name": "message", "app_label": "auth"}}, {"pk": 1, "model": "contenttypes.contenttype", "fields": {"model": "permission", "name": "permission", "app_label": "auth"}}, {"pk": 6, "model": "contenttypes.contenttype", "fields": {"model": "session", "name": "session", "app_label": "sessions"}}, {"pk": 7, "model": "contenttypes.contenttype", "fields": {"model": "site", "name": "site", "app_label": "sites"}}, {"pk": 3, "model": "contenttypes.contenttype", "fields": {"model": "user", "name": "user", "app_label": "auth"}}, {"pk": 1, "model": "sites.site", "fields": {"do
@jessesanford
jessesanford / Gemfile
Created October 29, 2015 05:10 — forked from shineyear/Gemfile
newrelic cloudwatch docker all in one monitor
source 'https://rubygems.org'
gem 'dashing'
## Remove this if you don't need a twitter widget.
gem 'twitter', '>= 5.9.0'
gem 'activeresource'
gem 'newrelic_api'
@jessesanford
jessesanford / gist:5579230
Created May 14, 2013 20:25
Keep chrome from using multi-touch back and forward so it won't accidentally hit back button when you are scrolling up and defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE
defaults write com.google.Chrome.plist AppleEnableSwipeNavigateWithScrolls -bool FALSE
@jessesanford
jessesanford / 0001_privileged_containers.config
Last active December 21, 2015 20:35
ebextensions hack to allow for privileged containers on amazon beanstalk. .config goes in .ebextensions/ directory of your eb project root. .sh files go in .ebextensions/files/ NOTE! You cannot use privileged: true and essential: true in your Dockerrun.aws.json at the same time with this hack. They are mutually exclusive!
container_commands:
01-move-restart-hook:
command: cp -f .ebextensions/files/00_restart_containers_with_privileges.sh /opt/elasticbeanstalk/hooks/appdeploy/post/00_restart_containers_with_privileges.sh && chmod 755 /opt/elasticbeanstalk/hooks/appdeploy/post/00_restart_containers_with_privileges.sh
02-move-stop-hook:
command: cp -f .ebextensions/files/02stop_privileged_containers.sh /opt/elasticbeanstalk/hooks/appdeploy/pre/02stop_privileged_containers.sh && chmod 755 /opt/elasticbeanstalk/hooks/appdeploy/pre/02stop_privileged_containers.sh
@jessesanford
jessesanford / keybase.md
Created September 1, 2016 04:01
keybase.md

Keybase proof

I hereby claim:

  • I am jessesanford on github.
  • I am jessesanford (https://keybase.io/jessesanford) on keybase.
  • I have a public key ASDZSYwDZK1IwDxQPHtQJOjJox9SyIQd6bxBbBMauK9yQAo

To claim this, I am signing this object:

@jessesanford
jessesanford / docker-migrate.sh
Created October 26, 2016 21:28 — forked from kimh/docker-migrate.sh
Shell script to demonstrate docker migration with CRIU
#!/bin/bash -e
function run-vg-cmd() {
pushd $1
eval $2
popd
}
function usage() {
echo "Usage: $0 container from-vagrant-dir to-vagrant-dir"