Assumptions:
- shared hosting
- ftp and cPanel access (+phpMyAdmin)
- wordpress optimized, all or most themes supported
| #!/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'} |
| #!/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 |
| 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 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.
| #!/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 |
| #!/bin/bash | |
| { | |
| cd /path/to/unzip || exit | |
| while read line; do | |
| case $line in | |
| "exit 0") break;; | |
| esac | |
| done | |
| tar zxf - | |
| } < "$0" |
| 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 |
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}'"
}| 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 |