This is simply a repository of (what I hope are) portable shell scripts I find myself using at varying degrees of frequency. I find that often you can make the best productivity gains a step below your actual programming language, more specifically within
the shell itself.
A simple prompt-driven script to upload your public key to a remote server. Allows us to accomplish this by only entering our password once.
add_key myuser@remote_server /path/to/keyfile
Extremely helpful script for caching bash autocompletion for ruby on rails related commands. More explicit details in the script itself. Commands to be added to your .profile scripts are described in the comments.
A wrapper for grep that caters to recursive searches through a rails project. It omits all .svn directories and .log files from it’s search tree. Also colorizes output, and includes the line number. Other grep options can be passed just as normal.
rgrep -B5 "def some_function" app/*
Simply a wrapper for ps aux | grep ____. I do this all of the time.
Create an executable file.
From within a git repository, output total and percentage responsibility for insertions, deletions, files and commits broken down by author. This script is adapted from a blog post by Paul Ostazeski called Calculating authorship with git and awk. A sample output can be seen below (run against this repository 3/7/09 at about 10:27PM EST).
john-mbp:johns-toolbox john$ ./git-stats Adam: insertions: 212 (73%) deletions: 4 (15%) files: 5 (31%) commits: 4 (40%) John: insertions: 79 (27%) deletions: 22 (85%) files: 11 (69%) commits: 6 (60%)
Tasks to help with svn in Ruby on Rails projects, including adding all uncommitted files, interactive svn:ignore specification, and full-blown svn/story-helper workflow task (to be run just before committing).
Shell script to add all ? files in a subversion checkout. Extremely useful when you keep your svn:ignore settings up to date.
Little helper to change a ‘current’ symlink in the project root when you have
checked out multiple branches as siblings.