Skip to content

Instantly share code, notes, and snippets.

View kevinkirkup's full-sized avatar

Kevin S Kirkup kevinkirkup

  • Digital Realty Trust
  • Raleigh, NC
View GitHub Profile
@kevinkirkup
kevinkirkup / gist:245187
Created November 30, 2009 01:27
Dynamically set the path to VIM
# Get Vim Path
export VIMRUNTIME=`vim -e -T dumb --cmd 'exe "set t_cm=\<C-M>"|echo $VIMRUNTIME|quit' | tr -d '\015' `
@kevinkirkup
kevinkirkup / gist:245186
Created November 30, 2009 01:26
Bash function to grep the command history
############################################################
# Function to grep the command history
function grep_history() {
if [ ! -z "$1" ] ; then
history | grep "$1" | grep -v histg
else
echo "Need a command to grep history for..."
fi
}
alias chg='grep_history'
@kevinkirkup
kevinkirkup / gist:245184
Created November 30, 2009 01:24
Bash function to grep the process list
############################################################
# Function to grep the list of precesses
function grep_process() {
if [ ! -z "$1" ] ; then
ps aux | grep -i "$1" | grep -v grep
else
echo "Need a process name to grep processes for..."
fi
}
@kevinkirkup
kevinkirkup / gist:245183
Created November 30, 2009 01:23
Bash function to extract and type of archive
############################################################
# Function to extract archives
function extract() {
case $1 in
*.tar.bz2) tar xjvf "$1" ;;
*.tar.gz) tar xvzf "$1" ;;
*.bz2) bunzip2 "$1" ;;
*.gz) gunzip "$1" ;;
*.tar) tar xvf "$1" ;;
*.tbz2) tar xjvf "$1" ;;