Please bear with us as we work to restore functionality to dotfiles.org.
samba
/.bash_aliases
A work in progress. Shortcuts to emulate 'vim' commands, and some handy shortcuts for manipulating/examining files/directories.
#!/bin/bash
# COLORIZING {{{
if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then
eval "`dircolors -b`"
alias ls='ls --color=auto'
alias dir='ls --color=auto --format=vertical'
alias vdir='ls --color=auto --format=long'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
fi
# }}}
# FILE LISTING {{{
alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'
# }}}
# VIM EMULATION - some friendly shortcuts {{{
alias :q='exit'
alias :s='history -a' # save the shell history
alias :m='pushd' # store a path
alias :d='popd' # pop a path
alias :marks='dirs -p' # show all paths
# }}}
# GNU SCREEN {{{
# set the terminal type properly
alias screen="screen -T ${TERM}"
# wrap to simplify work from multiple locations
alias scr="screen -T ${TERM} -rx -S default"
# }}}
# Process Listing {{{
# set my preferred PS output format
PS_FORMAT="pid,%cpu,%mem,euser:15,command"
PS_SORT="euser,%cpu"
alias ps="ps -o ${PS_FORMAT}" # list running processes more elegantly
# }}}
# find duplicate files without 'fdupes' {{{
function s.dupes () {
echo "Scanning for duplicates: $@">&2
find $@ -type f -exec md5sum {} \; | sort -k 1 | uniq -w 32 -D
}
# }}}
# for each stdin; execute this command... like xargs {{{
function each () {
singular=0; items=`mktemp`
while getopts ":s" Option; do
case $Option in
s) singular=1;;
esac
done
while read item; do
[ $singular -eq 0 ] && $@ $item || echo $item > $items;
done
[ $singular -ne 0 ] && $@ `cat $items`;
rm $items
}
# }}}
# friendly debian extractor... {{{
function deb.extract () {
while getopts ":f:d:" Option; do
case $Option in
f) debfile=$OPTARG;;
d) outputdir=$OPTARG;;
esac
done
if [[ -z $debfile || ! -f $debfile ]]; then
# usage
echo "deb.extract -f [ -d