set :application, `basename $(pwd)`.chomp
set :commit_sha, `git rev-parse --short "HEAD"`.chomp
set :default_environment, {
"RATIONALE_CLIENT" => "capistrano",
"RATIONALE" => "'Deploying #{application} #{commit_sha}'"
}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ghanity () | |
{ | |
local code="$1" url="$2"; | |
echo 'creating vanity GitHub URL... '; | |
ghurl=$(curl -s -i http://git.io -F "url=$url" -F "code=$code" | grep Location | awk '{print $2}'); | |
echo $ghurl | pbcopy; | |
echo "copied to clipboard: ${ghurl}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
{ | |
cd /path/to/unzip || exit | |
while read line; do | |
case $line in | |
"exit 0") break;; | |
esac | |
done | |
tar zxf - | |
} < "$0" |
I hereby claim:
- I am erichs on github.
- I am erichs (https://keybase.io/erichs) on keybase.
- I have a public key whose fingerprint is 688D B17A 9CCD EA27 8C9E F6A4 91CC 9E0A 4A75 C982
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wut () { | |
local needle="$*" | |
local out file key OIFS | |
OIFS=$IFS | |
IFS=$'\n' out=($(ag -il $needle | fzf --reverse \ | |
--preview="ag --color -C 5 $needle {}" \ | |
--prompt '(ctrl-{l,o,e,g} to link, open, edit, or browse in github)> ' \ | |
--expect=ctrl-l,ctrl-o,ctrl-e,ctrl-g)) | |
IFS=$OIFS | |
if [ -z "$out" ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# backup_mysql_databases.rb - pulls data from various database hosts and dbs, | |
# and stores these in a centrally mounted location | |
# for offsite backup | |
# | |
# Erich Smith | |
# | |
# This script is intended to be run via daily CRON task, and will generate a | |
# single set of zipped backup files per day, one file per defined host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# coding: utf-8 | |
require 'rb-fsevent' | |
CLEAR = "\n----\n" | |
YELLOW, BLUE, GREY, HIGHLIGHT = '0;33', '0;34', '0;90', '1;30;47' | |
SHORTEST_MESSAGE = 12 | |
LOG_CMD = %{git log --pretty=format':%C(yellow)%h%Creset %s'} | |
LOG_REGEX = /(.*)\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003\u0002(.*)\u0003/ | |
HEAD_CMD = %{git log -1 --pretty='%Cred%d%Creset'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pb() { | |
if [[ -p /dev/stdin ]]; then # STDIN is attached to a pipe | |
pbcopy | |
fi | |
if [[ ! -t 0 && ! -p /dev/stdin ]]; then # STDIN is attached to a redirect | |
pbcopy | |
fi | |
if [[ -t 1 ]]; then # STDOUT is attached to a TTY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo do_whatnot_first | |
tail -n +8 $0 | tar -zxf - -C /tmp | |
cd /tmp/my_extracted_tarfile_location | |
./configure && make && sudo make install | |
exit 0 | |
#//EOF | |
$ cat myprog.tar.gz >> binary.sh |
This configuration works with Upstart on Ubuntu 12.04 LTS
The reason why it needs to be done this way (i.e. with the pre-start
and post-stop
stanzas), is because Upstart
is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys
and run Unicorn in foreground also, it then only needs one exec stanza.
This presumes you are not using RVM, so no voodoo dances.
NewerOlder