Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Shell scripts for applying default settings to UNIX-based operating systems.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
functions
home_files Added version release notes.
CHANGELOG.md
CONTRIBUTING.md
LICENSE.md Updated company links to be HTTPS instead of HTTP. [ci skip]
README.md
run.sh

README.md

Overview

Gittip

Shell scripts for applying default settings to UNIX-based operating systems.

By default, these are set to my preferences (namely for OSX) but you can change them to your liking by editing any of the *.txt files in the home_files directory. Read on to learn more.

Features

  • Configures the Bash .bashrc, .bash_profile, and .inputrc files.
  • Configures the Vim .vimrc file.
  • Configures the Git .gitconfig, .gitignore, and hook (i.e. .git_template) files.
  • Configures the Ruby Gems .gemrc file.
  • Configures the Ruby .irbrc file.
  • Configures the Pry .pryrc file.
  • Configures the Ruby Debugger .rdebugrc file.
  • Configures the Awesome Print .aprc file.
  • Configures the Mackup .mackup.cfg file.
  • Configures the Pow .powconfig file.
  • Configures the PostgreSQL .psqlrc file.
  • Configures the Xray .xrayconfig file.
  • Configures Sublime Text as the default editor.
  • Adds Bash Completion.
  • Adds Go Bash support.
  • Adds rbenv Bash support.
  • Adds rbenv-vars settings.
  • Adds NPM Bash support.
  • Adds Travis CI Bash support.
  • Adds Z Bash support.

Requirements

Setup

Open a terminal window and execute the following commands:

Current Version (stable)

git clone git://github.com/bkuhlmann/dotfiles.git
cd dotfiles
git checkout v15.0.0

Master Version (unstable)

git clone git://github.com/bkuhlmann/dotfiles.git
cd dotfiles

Edit any of the home_files/*.txt files as you see fit. Then open a terminal window and execute the following command to install:

cd dotfiles
./run.sh

Executing the run.sh script will present the following options:

s: Show managed dotfiles.
i: Install dotfiles (existing files are skipped).
l: Link dotfiles to this project (interactive per file, excludes: env.sh, .gemrc, and .gitconfig).
c: Check for differences between $HOME files and this project's files.
d: Delete dotfiles (interactive per file, excludes: env.sh, .gemrc, and .gitconfig).
q: Quit/Exit.

The options prompt can be skipped by passing the desired option directly to the run.sh script. For example, executing ./run.sh s will show all managed dotfiles by this project.

After install, the following files will require manual updating:

  • .bash/env.sh - Add secret/machine-specific environment settings (if any).
  • .gemrc - Uncomment the "gemcutter_key" line and add your own RubyGems key for publishing gems.
  • .gitconfig - Uncomment the name, email, and token lines within the [user] and [github] sections to replace with your own details.

Usage

Aliases

General
.. = "cd .."
... = "cd ../.."
cdb = "cd -"
c = "clear"
h = "history"
l = "ls -alh"
l1 = "ls -A1 | _copy_and_print 'n'"
p = 'pwd | tr -d "rn" | _copy_and_print'
o = "open"
home = "cd $HOME"
bashe = "$EDITOR .bash/env.sh"
bashs = "exec $SHELL"
pss = 'ps axu | grep --invert-match grep | grep "$@" --ignore-case --color=auto'
Network
sshe = "$EDITOR $HOME/.ssh/config"
key = "open /Applications/Utilities/Keychain Access.app"
ipa = 'curl -s checkip.dyndns.org | grep -Eo "[0-9.]+" | _copy_and_print'
sniff = "sudo ngrep -W byline -d 'en0' -t '^(GET|POST) ' 'tcp and port 80'"
dnsf = "sudo discoveryutil mdnsflushcache && sudo discoveryutil udnsflushcaches && printf 'DNS cache cleared.n'"
dnss = "sudo discoveryutil mdnscachestats && sudo discoveryutil udnscachestats"
tmux
tsl = "tmux list-sessions"
tsa = "tmux attach-session -t"
tsk = "tmux kill-session -t"
tsr = "tmux rename-session -t"
Homebrew
hb = "brew"
hbi = "brew install"
hbin = "brew info"
hbu = "brew uninstall"
hbl = "brew list"
hbs = "brew search"
hbsw = "brew switch"
hbup = "brew update"
hbug = "brew upgrade"
hbp = "brew pin"
hbpu = "brew unpin"
hbd = "brew doctor"
hbc = "brew cleanup"
hbrb = "brew uninstall ruby-build && brew install --HEAD ruby-build"
Git
gi = "git init"
gcle = "git config --local --edit"
gcge = "git config --global --edit"
gget = "git config"
gst = "git status --short --branch"
gl = 'git log --graph --pretty=format:"%C(yellow)%H%C(reset) %C(bold blue)%an%C(reset) %s%C(bold cyan)%d%C(reset) %C(green)(%cr)%C(reset)"'
gld = 'git log --stat --pretty=format:"%C(yellow)%H%C(reset) %C(bold blue)%an%C(reset) %s%C(bold cyan)%d%C(reset) %C(green)(%cr)%C(reset) %n%b"'
glh = 'git log --pretty=format:%H -1 | _copy_and_print'
glf = 'git fetch && git log --reverse --no-merges --pretty=format:"%C(yellow)%H%C(reset) %C(bold blue)%an%C(reset) %s%C(bold cyan)%d%C(reset) %C(green)(%cr)%C(reset)" ..@{upstream}'
gls = 'git log --pretty=format:"%C(yellow)%H%C(reset) %C(bold blue)%an%C(reset) %s%C(bold cyan)%d%C(reset) %C(green)(%cr)%C(reset)" -S'
glt = 'git log --tags --simplify-by-decoration --reverse --pretty = "format:%d (%ad)" --date=short | sed -e "s/ (tag: //" -e "s/)//" -e "/^ /d"'
grl = "git reflog"
gg = "git grep"
glast = "git show --decorate --stat"
guthors = "git log --format = '%an' | sort | uniq -c | sort --reverse"
gd = "git diff"
gdc = "git diff --cached"
gdm = "git diff origin/master"
gdw = "git diff --color-words"
gdt = "git difftool"
gdtc = "git difftool --cached"
gdtm = "git difftool origin/master"
glame = "git blame"
gb = "git branch --verbose"
gba = "git branch --all"
gbn = "_git_branch_name | _copy_and_print"
gbr = "git branch --move"
gm = "git merge"
gms = "git merge --squash"
gma = "git merge --abort"
gcl = "git clone"
gch = "git checkout"
gchm = "git checkout master"
ga = "git add"
gau = "git add --update"
gap = "git add --patch"
gall = "git add --all ."
gco = "git commit"
gca = "git commit --all"
gcm = "git commit --message"
gcam = "git commit --all --message"
gamend = "git commit --amend"
gamendh = "git commit --all --amend --no-edit"
gcf = "git commit --fixup"
gcp = "git cherry-pick"
gcpa = "git cherry-pick --abort"
gash = "git stash save --include-untracked"
gashc = "git stash clear"
gf = "git fetch"
gfp = "git fetch --prune"
gpu = "git pull"
gpur = "git pull --rebase" # Rebase the current branch on top of the upstream branch.
gpuro = "gpur origin" # Rebase the current branch on top of the upstream origin branch.
gpurom = "gpuro master" # Rebase the current branch on top of the upstream origin master branch.
grc = "git rebase --continue"
gra = "git rebase --abort"
ger = "git rerere"
gp = "git push"
gpo = "git push --set-upstream origin"
gpr = "git push review master"
gps = "git push stage stage:master"
gpp = "git push production production:master"
gtag = "git tag"
gtags = "git push --tags"
gr = "git reset" # Unstage staged files for commit.
grs = "git reset --soft HEAD^" # Undo previous commit.
grh = "git reset --hard HEAD" # Reset to HEAD, destroying all staged/unstaged changes. UNRECOVERABLE!
gdis = "git reset --hard" # Reset to commit, destroying all previous commits. UNRECOVERABLE!
grm = "git reset --merge ORIG_HEAD" # Reset to original HEAD prior to merge.
grom = "git fetch --all && git reset --hard origin/master" # Reset local branch to origin/master branch. UNRECOVERABLE!
gel = "git rm"
gelc = "git rm --cached" # Removes previously tracked file from index after being added to gitignore.
grev = "git revert" # Revert a commit.
glatest = "git for-each-ref --sort=-committerdate refs/heads --format = '%(committerdate:short) %(refname:short)'"
grp = "git remote prune origin"
Tar
bzc = "tar --use-compress-program=pigz --create --preserve-permissions --bzip2 --verbose --file"
bzx = "tar --extract --bzip2 --verbose --file"
PostgreSQL
pgi = "initdb /usr/local/var/postgres"
pgst = "pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start &"
pgsp = "pg_ctl -D /usr/local/var/postgres stop -s -m fast"
Redis
reds = "redis-server /usr/local/etc/redis.conf &"
redc = "redis-cli"
rbenv
rb = "rbenv"
rbg = "rbenv global"
rbl = "rbenv local"
rbs = "rbenv shell"
rbh = "rbenv rehash"
rbp = "rbenv which"
rbw = "rbenv whence"
rbv = "rbenv versions"
rbi = "rbenv install"
rbil = "rbenv install --list"
rbu = "rbenv uninstall"
rbvars = "rbenv vars"
Ruby
rd = "rdoc -a -o _doc"
rdo = "open _doc/index.html"
rdd = "rm -rf _doc"
Ruby Gems
geml = "gem list"
gemi = "gem install"
gemup = "gem update"
gemu = "gem uninstall"
gemc = "gem cleanup"
gems = "gem server"
gemp = "gem pristine"
geme = "gem environment"
gemuc = "gem update --system && gem update && gem cleanup"
Ruby Gems Whois
gemw = "gem whois"
Bundler
b = "bundle"
bi = "bundle install"
bu = "bundle update"
bo = "bundle outdated"
bcon = "bundle console"
be = "bundle exec"
bess = "bes spec"
bert = "ber test"
berts = "ber test | grep _test.rb"
bertv = "TESTOPTS=-v ber test"
bch = "rm -f Gemfile.lock; bundle check"
rebundle = "bch; bundle package"
Gemsmith
gs = "gemsmith"
gse = "gemsmith edit"
gsr = "gemsmith read"
gso = "gemsmith open"
Ruby on Rails
scs = "sc --sandbox"
sgc = "sg controller"
sgm = "sg model"
sgh = "sg helper"
sgs = "sg scaffold"
rdbd = "ber db:drop"
rdbc = "ber db:create"
rdbm = "ber db:migrate"
rdbmt = "ber db:migrate && ber db:rollback && ber db:migrate"
rassp = "ber assets:precompile"
rassc = "ber assets:clean"
bernt = "ber notes:custom ANNOTATION=TODO"
bernf = "ber notes:custom ANNOTATION=FIX"
taild = "tail -f log/development.log"
tailt = "tail -f log/test.log"
res = "touch tmp/restart.txt"
rprofile = "ruby-prof --printer=graph_html ./script/rails runner > profile.html"
rpaths = "ber routes | sed -e "1d" -e "s,^[^/]*,,g" | awk '{print $1}' | sort | uniq"
erd = "mkdir -p doc/design && ber erd attributes=primary_keys,foreign_keys,timestamps,inheritance,content inheritance=true orientation=vertical filename=doc/design/models"
dmodels = "mkdir -p doc/design && railroady --label --inheritance --specify --all-columns --join --transitive --output doc/design/models.dot --models"
dcontrollers = "mkdir -p doc/design && railroady --label --inheritance --output doc/design/controllers.dot --controllers"
dstate = "mkdir -p doc/design && railroady --label --inheritance --output doc/design/state.dot --aasm"
Rubocop
rcop = "rubocop --display-cop-names"
Rails Best Practices
rbest = "rails_best_practices"
Capistrano
caps = "bec stage deploy"
capp = "bec production deploy"
Node.js
nodejs! = "brew unlink iojs && brew link node && printf 'Switched: IO.js -> Node.jsn'"
IO.js
iojs! = "brew unlink node && brew link --force iojs && printf 'Switched: Node.js -> IO.jsn'"
Swift
swift = "/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift"
The Silver Surfer
agf = "ag --hidden --files-with-matches --file-search-regex"
Z
ez = "$EDITOR $HOME/.z"
Path Finder
pfo = 'open -a "Path Finder.app" "$PWD"'
Vim
v = "vim"
Sublime Text
e = "sublime"
Marked
mo = "open -a Marked"

Functions

General
t2s = Tabs to Spaces - Converts file from tab to space indendation.
less
lessi = lessi - Interactively inspect a file.
OpenSSL
sslc = sslc - SSL Certificate Creation
curl
curli = Curl Inspect - Inspect remote file with default editor.
lsof
port = Port - Lists file activity on a given port.
Git
gia = Git Init (all) - Initializes/re-initializes all Git repositories in current directory.
groot = Git Root - Changes to repository root directory (regardless of current depth).
ginfo = Git Info - Prints repository overview information.
ghurn = Git Churn - Answers the commit churn for project files (sorted highest to lowest).
gount = Git Commit Count - Answers total number of commits for current project.
gistory = Git File History - Walks through all revisions of a file's history (with optional diff support).
glamel = Git Blame Log - Answers the blame log (i.e. commit notes) for a specific file and lines (optional).
guthorsa = Git Authors (all) - Answers author commit activity per project (ranked highest to lowest).
gsta = Git Status (all) - Answers the status of projects with uncommited/unpushed changes.
gup = Git Update - Fetches latest commits, reviews each commit (with diff), and rebases (all steps are optional).
gseta = Git Set Config Value (all) - Sets key value for all projects in current directory.
ggeta = Git Get Config Value (all) - Answers key value for all projects in current directory.
gunseta = Git Unset (all) - Unsets key value for all projects in current directory.
gailsa = Git Email Set (all) - Sets user email for all projects in current directory.
gail = Git Email Get - Answers user email for current project.
gaila = Git Email Get (all) - Answers user email for all projects in current directory.
gince = Git Since - Answers a summarized list of Git activity since date/time for all projects in current directory.
gday = Git Day - Answers a summarized list of Git current day activity for all projects in current directory.
gweek = Git Week - Answers a summarized list of Git current week activity for all projects in current directory.
gmonth = Git Month - Answers a summarized list of Git current month activity for all projects in current directory.
gsup = Git Standup - Answers a summarized list of Git activity since yesterday for all projects in current directory.
gtail = Git Tail - Answers commit history since last tag for current project and copies results to clipboard.
gtaila = Git Tail (all) - Answers commit history count since last tag for all projects in current directory.
gashl = Git Stash List - Lists stashes (if any).
gashs = Git Stash Show - Shows stash or prompts for stash to show.
gashp = Git Stash Pop - Pops stash or prompts for stash to pop.
gashd = Git Stash Drop - Drops stash or prompts for stash to drop.
gasha = Git Stash (all) - Answers stash count for all projects within current directory.
gucca = Git Upstream Commit Count (all) - Answers upstream commit count (if any) since last pull for all projects in current directory.
gpua = Git Pull (all) - Pulls down new changes (if any) from remote branch for all projects in current directory.
gpa = Git Push (all) - Pushes changes for all projects within current directory.
galla = Git Add (all) - Applies file changes (including new files) for all projects within current directory.
gcama = Git Commit and Message (all) - Commits changes (modified and new), with message, for all projects within current directory.
gcap = Git Commit and Push (all) - Commits and pushes changes for all projects within current directory.
gri = Git Rebase (interactive) - Rebase commits, interactively (i.e. reword, fix, squash, etc.).
gbl = Git Branch List - Lists details about local and remote branches.
gbc = Git Branch Create - Creates and switches to branch.
gbs = Git Branch Switch - Switches between branches.
gbd = Git Branch Delete - Deletes local and remote branch (if found).
gbdm = Git Branch Delete Merged - Deletes locally merged branches (if any).
gtagd = Git Tag Delete - Deletes local and remote tag (if found).
ghd = Git Hook Delete - Deletes all Git hooks for current project.
ghda = Git Hook Delete (all) - Deletes all Git hooks for all projects in current directory.
gvac = Git Verify and Clean - Verifies and cleans Git objects for current project.
gvaca = Git Verify and Clean (all) - Verifies and cleans Git objects for all projects in current directory.
GitHub
gh = GitHub - View current GitHub project commits, branches, tags, etc. in default browser.
PostgreSQL
pguc = PostgreSQL User Create - Creates a PostgreSQL user.
pgud = PostgreSQL User Drop - Drops a PostgreSQL user.
pgt = PostgreSQL Template - Edits PostgreSQL template.
Bundler
bj = Bundler Jobs - Answers maximum Bundler job limit for current machine and automatically sets it if otherwise.
boa = Bundle Outdated (all) - Answers a list of outdated gems for all projects within current directory.
bua = Bundle Update (all) - Updates gems for all projects within current directory.
bca = Bundle Clean (all) - Cleans all projects of gem artifacts (i.e. pkg folder).
ber = Bundle Execute Rake - Executes Rake via binstub or Bundler.
bertt = Bundle Execute Rake Test - Executes a single Test::Unit test via binstub or Bundler.
bes = Bundle Execute RSpec - Executes RSpec via binstub or Bundler.
bessa = Bundle Execute RSpec (all) - Executes RSpec via binstub or Bundler for all projects within current directory.
beg = Bundle Execute Guard - Executes Guard via binstub or Bundler.
bec = Bundle Execute Capistrano - Executes Capistrano via binstub or Bundler.
Ruby
rua = Ruby Upgrade (all) - Upgrades all Ruby projects in current directory with new Ruby version information.
rserv = Ruby Server - Serves web content from current directory via WEBrick.
Ruby on Rails
rew = Rails New - Builds a new rails application skeleton for selected template.
sc = Rails Script Console - Launches the Rails console.
ss = Rails Script Server - Launches the Rails server.
sg = Rails Script Generator - Launches a Rails generator for controller, model, etc. scaffolds.
sdb = Rails Script Database Console - Launches the Rails database console for direct access to the current application database.
Travis CI
tcie = Travis CI Encrypt (all) - Encrypts a string for all Travis CI-enabled (.travis.yml) projects in current directory.
Site Validator
sv = Site Validator - Generates a validation report for a site using the W3C Validator.
Image Magick
sketch = Sketch - Converts a photo into a sketch. Inspired by [Whiteboard Cleaner Gist](https://gist.github.com/lelandbatey/8677901).
FFmpeg
gifize = Gifize - Converts a video into an animated GIF.
Dotfiles
dots = Dotfiles - Informational utility for learning more about dotfile aliases, functions, etc.

IRB, Pry, and Rails consoles

ConsoleKit.copy - Copies data to the MacOS clipboard.
ConsoleKit.paste - Pastes data from the MacOS clipboard.
ConsoleKit.http_codes - Prints Rails HTTP codes.
ConsoleKit.http_symbols - Prints Rails HTTP symbols.

Pry Aliases

'w' = "whereami"
'c' = "continue"
's' = "step"
'n' = "next"
'f' = "finish"
"bp" = "break"
"bpe" = "break --enable"
"bpd" = "break --disable"
"bpD" = "break --delete"
"bpc" = "break --disable-all"
"bpC" = "break --delete-all"
"bph" = "break --help"

Versioning

Read Semantic Versioning for details. Briefly, it means:

  • Patch (x.y.Z) - Incremented for small, backwards compatible bug fixes.
  • Minor (x.Y.z) - Incremented for new, backwards compatible public API enhancements and/or bug fixes.
  • Major (X.y.z) - Incremented for any backwards incompatible public API changes.

Contributions

Read CONTRIBUTING for details.

Credits

Developed by Brooke Kuhlmann at Alchemists

License

Copyright (c) 2010 Alchemists. Read the LICENSE for details.

History

Read the CHANGELOG for details.

Something went wrong with that request. Please try again.