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:
I hereby claim:
To claim this, I am signing this object:
| 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 |
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}'"
}| 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 |
| #!/bin/bash | |
| { | |
| cd /path/to/unzip || exit | |
| while read line; do | |
| case $line in | |
| "exit 0") break;; | |
| esac | |
| done | |
| tar zxf - | |
| } < "$0" |
| #!/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.
| 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}" | |
| } |
| #!/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 |