Skip to content

Instantly share code, notes, and snippets.

@gardner
gardner / colorize-maven.sh
Created April 26, 2012 05:00 — forked from mike-ensor/colorize-maven.sh
Colorize Maven output
#!/bin/sh
# Written by Mike Ensor (mike@ensor.cc)
# Copywrite 2012
# Use as needed, modify, have fun!
# This is intended to be used for Maven3 + Mac OSX
#
# To use:
# in your ".bashrc" or ".bash_profile" add the following line:
# source ~/<path to script>/colorize-maven.sh
@gardner
gardner / gist:2876561
Created June 5, 2012 17:54
Ctrl-Arrow Word Movement in OSX Terminal
open Terminal.app
Preferences | Settings | Keyboard
control cursor left = \033b
control cursor right = \033f
@gardner
gardner / gist:3850856
Created October 8, 2012 05:24
Make your terminal smile when exit code is zero
export PS1="\h: `if [ $? = 0 ]; then echo -e '\[\e[01;32m\]\n\xE2\x98\xBA'; else echo -e '\[\e[01;31m\]\n\xE2\x98\xB9'; fi` \[\e[01;34m\]\[\e[00m\] \W \u$ "
@gardner
gardner / gist:4332049
Created December 18, 2012 21:12
Enable turbo mode on your keyboard and stop waiting.
System Preferences -> Keyboard
Key Repeat = all the way "Fast"
Delay Until Repeat = one left of "short"
@gardner
gardner / renusb.sh
Last active January 1, 2016 16:39
Rename all files and directories for use with my janky bicycle mp3 player.
#!/bin/bash
function rename_usb() {
find . -type "$1" | while read -r file; do
if [ "$file" -eq ".."
newfile=$(echo "$file" | sed 's/[[:space:]]?/_/g
#replace " - " with a single underscore.
s/[[:space:]]-[[:space:]]/_/g
#replace spaces with underscores
#replace "-" dashes with underscores.
@gardner
gardner / .bash_profile
Created March 13, 2014 00:55
~/.bash_profile
export TERM="xterm-color"
export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '
export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced
findcasei() {
find . -type f -print0 | xargs -n 1 -P 8 -0 grep -Hi "$1"
}
alias f=findcasei
bash -l -c "pbpaste | gist | pbcopy"
@gardner
gardner / -
Last active August 29, 2015 14:01
Allow jenkins user and apache to modify files in webserver directory
cd /Library/WebServer/Documents
sudo chown -R _www:_www .
sudo chmod -R u=rwX,g=rwX,o=r .
sudo /usr/sbin/dseditgroup -o edit -a jenkins -t user _www
sudo chmod -R +a "_www allow delete,chown,list,search,add_file,add_subdirectory,delete_child,file_inherit,directory_inherit"
beforeDestroy
difference.mp4