Skip to content

jtrupiano/johns-toolbox

Repository files navigation

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

About

A set of shell scripts I use at varying frequencies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages