public
Description: A set of shell scripts I use at varying frequencies.
Homepage:
Clone URL: git://github.com/jtrupiano/johns-toolbox.git
name age message
file README.textile Loading commit data...
file add_key Mon Jan 12 08:04:36 -0800 2009 [add_key]: Create ~/.ssh directory on remote se... [John Trupiano]
file dbyml
file gen-autocomplete.sh Tue Jan 20 17:54:48 -0800 2009 added gen-autocomplete.sh, autocompletion for r... [Adam Bachman]
file git-ownership.awk Sat Mar 07 19:30:21 -0800 2009 Add git-stats script. Update README with git-s... [jtrupiano]
file git-stats Sat Mar 07 19:30:21 -0800 2009 Add git-stats script. Update README with git-s... [jtrupiano]
file lncur
file psgrep Sun Dec 28 14:47:17 -0800 2008 add_key and psgrep added to toolbox. [John Trupiano]
file rgrep Fri Mar 06 20:22:31 -0800 2009 fix grep for osx, add touchx which creates an e... [jtrupiano]
file svn.rake Tue Jan 20 17:57:30 -0800 2009 Updated doc string. Signed-off-by: John Trupia... [Adam Bachman]
file svnadd Tue Jan 20 17:57:31 -0800 2009 added svnadd, modified rgrep. still don't reall... [Adam Bachman]
file touchx Fri Mar 06 20:22:31 -0800 2009 fix grep for osx, add touchx which creates an e... [jtrupiano]
README.textile

John’s Toolbox

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.

add_key

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

gen-autocomplete.sh

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.

rgrep

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/*

psgrep

Simply a wrapper for ps aux | grep ____. I do this all of the time.

$>psgrep ruby

touchx

Create an executable file.

git-stats

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%)

svn.rake

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).

svnadd

Shell script to add all ? files in a subversion checkout. Extremely useful when you keep your svn:ignore settings up to date.

lncur

Little helper to change a ‘current’ symlink in the project root when you have
checked out multiple branches as siblings.

john-mbp:TimeTracker john$ ls -l total 2864 lrwxr-xr-x 1 john staff 5 Nov 7 17:54 current → trunk drwxr-xr-x 18 john staff 612 Oct 24 16:53 task_finder drwxr-xr-x 18 john staff 612 Nov 7 17:12 trunk john-mbp:TimeTracker john$ lncur task_finder john-mbp:TimeTracker john$ ls -l total 2864 lrwxr-xr-x 1 john staff 5 Nov 7 17:54 current → task_finder drwxr-xr-x 18 john staff 612 Oct 24 16:53 task_finder drwxr-xr-x 18 john staff 612 Nov 7 17:12 trunk