Skip to content

Instantly share code, notes, and snippets.

@sionide21
sionide21 / Rsync Backup
Created January 7, 2010 14:55
My home directory backup command
rsync -av --delete --exclude-from="$HOME/exclude.rsync" "$HOME" <server>:<backup dir>/
:w !sudo tee %
old()
{
command=$1
shift
$(which -a $command | head -n 2 | tail -n 1) $@
}
head -n 2 | tail -n 1
@sionide21
sionide21 / gist:362318
Created April 10, 2010 21:42
Finds an executable by wildcard
function find_command
{
i=1;
while [ $(echo $PATH | cut -d : -f "$i") ]; do
PATHITEM=$(echo $PATH | cut -d : -f "$i")
find $PATHITEM -name "$1"
let i="$i+1"
done
}
alias all_done="notify Config Done || notify Config Failed"
./configure && all_done
05-14 22:32:16.744: WARN/WindowManager(63): Attempted to add window with non-application token WindowToken{43ee9978 token=null}. Aborting.
05-14 22:32:16.764: WARN/dalvikvm(63): threadid=15: thread exiting with uncaught exception (group=0x4001b188)
05-14 22:32:16.764: ERROR/AndroidRuntime(63): Uncaught handler: thread android.server.ServerThread exiting due to uncaught exception
05-14 22:32:16.764: ERROR/AndroidRuntime(63): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
05-14 22:32:16.794: ERROR/AndroidRuntime(63): android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an application
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.ViewRoot.setView(ViewRoot.java:472)
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:177)
05-14 22:32:16.794: ERROR/AndroidRuntime(63): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
05-14 22:32:16.794: ERROR/AndroidRuntime(63):
@sionide21
sionide21 / gist:434547
Created June 11, 2010 14:37
Remove leading whitespace
${FOO##*( )}
@sionide21
sionide21 / gist:434550
Created June 11, 2010 14:40
FOO with whitespace
FOO=" Bar"
$(echo $FOO)