Skip to content

Instantly share code, notes, and snippets.

@gamefiend
Created May 7, 2012 22:55
Show Gist options
  • Save gamefiend/2631218 to your computer and use it in GitHub Desktop.
Save gamefiend/2631218 to your computer and use it in GitHub Desktop.
Dotfiles
# Dancer aliases to make life easier
# .bashrc
# ENVIRONMENT VARIABLES
#############################
PS1="\[$(tput setaf 1)\u$(tput sgr0)@\h:\e[1;31m\w \]\e[m\n"
# Source global definitions
#############################
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# ALIASES
#############################
alias esudo='sudo -e'
alias sudoe='sudo -E' #sudo, preserving my environment variables (including SSH forwarding)
alias sudoes='sudoe -s' #as above, but used for executing multiple commands
alias wudo='sudo su - www' # sudo to the www user.
alias du='du -h' #I never use du without h
alias df='df -h' #Same with df
alias h='history' #grab history quickly
alias hig='h | grep' #search history quickly
alias tu='top -o cpu' #top sorted by cpu
alias tm='top -o vsize' #top sorted by memory
alias ..='cd ..' #go up 1 directory quickly
alias cdd='cd -' #jump back to the last directory you were in.
alias vi='/usr/bin/vim'
alias ll='ls -alh'
# FUNCTIONS
#############################
function take {
mkdir $1
cd $1
}
# EXPORT & SOURCES
#############################
# IF the user logging in has my id, then source perlbrew. otherwise skip it.
source ~/perl5/perlbrew/etc/bashrc
export PS1
# Commands to make gitting easier
alias dotgit='cd ~/.dotfiles; git add .; git commit -m "$(date)";git push origin master; cd -'
# Working with logs
# shortcuts that are handy.
alias check-message='sudo tail /var/log/messages'
alias check-http='sudo tail /var/log/httpd/access_log'
alias check-http-error='sudo tail /var/log/httpd/error_log'
alias check-secure='sudo tail /var/log/secure'
function checklog {
tail $1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment