Skip to content

Instantly share code, notes, and snippets.

[alias]
stage = !sh -c '[[ -z "$@" ]] && git add -u || git add "$@" && git add -u "$@" ' -
unstage = reset HEAD --
rewind = ![[ -z "$@" ]] && git reset --hard HEAD || git checkout HEAD
@jcarley
jcarley / gist:2045532
Created March 15, 2012 17:38 — forked from dx7/gist:1333785
Installing ruby-debug with ruby-1.9.3-p0
# Install with:
# bash < <(curl -L https://raw.github.com/gist/1333785)
#
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug
echo "Installing ruby-debug with ruby-1.9.3-p0 ..."
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem
curl -OL http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem
@jcarley
jcarley / gist:2570296
Created May 1, 2012 18:32 — forked from hipertracker/gist:214210
NGinx -> TorqueBox
/etc/hosts:
127.0.0.1 myhost jboss_server
NGINX:
server {
listen myhost:80;
server_name myhost;
location / {
proxy_set_header X-Real-IP $remote_addr;
@jcarley
jcarley / remote.md
Created November 24, 2012 14:37 — forked from reid/remote.md
Garage door opener with Arduino

iPhone Garage Remote

Instead of buying two door remotes, I bought one and control it with my iPhone.

Parts

First, I stole nearly everything from MyDoorOpener.com. Their version uses parts I could not find and requires a $6 iPhone app. Let's improve on that.

Almost everything can be found at RadioShack.

require 'celluloid'
class FuturePlexer
class DrainedError < StandardError; end
attr_accessor :futures
def initialize(futures)
self.futures = futures
end
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
#!/usr/bin/env bash
set -x
# Domain you wish to update
DOMAIN="example.com"
# Get the v4/v6 addresses from icanhazip.com [pretty reliable!]
IPV4_ADDR=`wget -4 -q -O - icanhazip.com`
IPV6_ADDR=`wget -6 -q -O - icanhazip.com`
@jcarley
jcarley / docker-machine-update-hosts.sh
Created January 28, 2016 15:19 — forked from ianlintner-wf/docker-machine-update-hosts.sh
A basic shell script to use a configuration file to update local development hosts ip running on docker-machine (virtual box) and Mac OSX
#!/usr/bin/env bash
#Usage docker-machine-update-hosts.sh hosts.conf default
#arg1 is a configuration file with hosts
#arg2 is the docker-machine name e.g. default
DOCKER_IP=$(docker-machine ip $2)
echo "$2 ip: $DOCKER_IP"
#Remove existing lines from hosts
while IFS='' read -r line || [[ -n "$line" ]]; do
#!/usr/bin/env bash
list=( $(docker-machine ls | grep Running | awk '{ print $1 }') )
for i in "${list[@]}"; do
ip=$(docker-machine ip $i)
#remove line matching ip
sudo sed -i '' '/'$ip'/d' /etc/hosts
#insert ip/host on last line
sudo sed -i -e '$a\
@jcarley
jcarley / gitflow-breakdown.md
Created August 22, 2016 19:42 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository