Skip to content

Instantly share code, notes, and snippets.

@adion
Created July 26, 2012 18:15
Show Gist options
  • Save adion/3183605 to your computer and use it in GitHub Desktop.
Save adion/3183605 to your computer and use it in GitHub Desktop.
André's dot files
### .aliases
# save some typing with often-used common options
alias vi='vim'
alias ls='ls -hF'
alias la='ls -Al'
alias ll='la'
alias mkdir='mkdir -p'
# shitcan Mac OS meta files
alias effapple='find . -name "._*" -print | xargs rm -f; find . -name ".DS_Store" -print | xargs rm -f; find . -name ".#*" -print | xargs rm -f;'
# useful when DHCP assigns a random IP
alias myip='ifconfig | grep "inet " | grep -v 127.0.0.1 | cut -d\ -f2'
# SVN has problems adding files with a '@' character in the filename
alias addretina='svn st | grep "^?" | grep @2x | sed -e "s/.png/.png@/" | awk "{print $2}" | xargs svn add'
# VNC/Screen Sharing
alias vnc='open /System/Library/CoreServices/Screen\ Sharing.app'
# Node server start/stop/reload
alias nodeon='node app.js &; echo $! > node.pid'
alias nodeoff='cat node.pid | xargs kill & rm -f node.pid'
alias renode='nodeoff && nodeon'
### .bashrc
# source aliases
if [ -f $HOME/.aliases ]
then
. $HOME/.aliases
fi
# don't put duplicate lines in the history
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# formatted in doubles as FB where F = Foreground, B = Background
#
# ***** ORDER *****
# 1. directory
# 2. symbolic link
# 3. socket
# 4. pipe
# 5. executable
# 6. block special
# 7. character special
# 8. executable with setuid bit set
# 9. executable with setgid bit set
# 10. directory writable to others, with sticky bit
# 11. directory writable to others, without sticky bit
#
# ***** COLORS *****
# a black
# b red
# c green
# d brown
# e blue
# f magenta
# g cyan
# h light grey
# A bold black, usually shows up as dark grey
# B bold red
# C bold green
# D bold brown, usually shows up as yellow
# E bold blue
# F bold magenta
# G bold cyan
# H bold light grey; looks like bright white
# x default foreground or background
export CLICOLOR=1
export LSCOLORS='Exgxcxdxbxegedabagacad'
export GREP_OPTIONS='--color=auto'
export SVN_SSH=/usr/bin/ssh
export SVN_EDITOR=/usr/bin/vim
# convenience variables
export SVN_ROOT=https://subversion.t4g.com/svn
export VMP=/Volumes/VMP/dev_files
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting
### .bash_profile
# ***** COLORS *****
function myprompt {
local BLACK="\[\033[0;30m\]"
local DARK_GRAY="\[\033[1;30m\]"
local BLUE="\[\033[0;34m\]"
local LIGHT_BLUE="\[\033[1;34m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local CYAN="\[\033[0;36m\]"
local LIGHT_CYAN="\[\033[1;36m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local MAGENTA="\[\033[0;35m\]"
local LIGHT_MAGENTA="\[\033[1;35m\]"
local YELLOW="\[\033[0;33m\]"
local LIGHT_YELLOW="\[\033[1;33m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
local WHITE="\[\033[1;37m\]"
local CLEAR="\[\033[0m\]"
USER_COLOR=$LIGHT_BLUE
HOST_COLOR=$LIGHT_YELLOW
# terminal...
case $TERM in
xterm*|rxvt*)
TITLEBAR='\[\033]0;\h:${PWD}\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}${USER_COLOR}\u$CLEAR@${HOST_COLOR}\h$CLEAR[\@]\$ "
PS2='> '
PS4='+ '
}
# source .bashrc
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# set some defaults
EDITOR=/usr/bin/vim
# User specific environment and startup programs
PATH=/usr/local/bin:/usr/local/mysql/bin:/opt/subversion:/Users/andredion/android-sdks/tools:/Users/andredion/android-sdks/platform-tools:$HOME/narwhal/bin:$HOME/local/node/bin:$HOME/bin:$PATH
NARWHAL_ENGINE=jsc
NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules
export EDITOR PATH NODE_PATH NARWHAL_ENGINE
unset USERNAME
myprompt
[[ -s "/Users/andredion/.rvm/scripts/rvm" ]] && source "/Users/andredion/.rvm/scripts/rvm" # This loads RVM into a shell session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment