Skip to content

Instantly share code, notes, and snippets.

@textarcana
Forked from anonymous/.profile
Created Jan 7, 2013
Embed
What would you like to do?
# Noah Sussman's CentOS .profile
if [ "$SSH_TTY" ]; then
# If this is a remote session, then start screen
if [ "$TERM" != "screen" ]; then
screen -xRRU
if [ "$?" = "0" ]; then
reset
exit
fi
fi
fi
export PATH=$PATH
export NODE_PATH=/usr/lib/node_modules/
RESET="\[\017\]"
NORMAL="\[\033[0m\]"
RED="\[\033[31;1m\]"
YELLOW="\[\033[33;1m\]"
GREEN="\[\033[32;1m\]"
WHITE="\[\033[37;1m\]"
SMILEY="${GREEN}:)${NORMAL}"
FROWNY="${RED}:(${NORMAL}"
EMOTE="if [ \$? = 0 ]; then echo \"${SMILEY}\"; else echo \"${FROWNY}\"; fi"
GIT_DIRTY="[[ \$(git status 2> /dev/null | tail -n1) != \"nothing to commit (working directory clean)\" ]] && echo \"${YELLOW}\" || echo \"${GREEN}\""
function parse_git_hash {
hash=$(git log --format="%h" -n1 2> /dev/null) || return
echo $hash
}
function parse_git_branch {
ref=$(git-symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function seconds_since_epoch {
echo `date +%s`
}
export PS1="${RESET}\n\`${EMOTE}\` \
\u@\h \
\`${GIT_DIRTY}\`\$(parse_git_branch) \$(parse_git_hash)${NORMAL} \
\w \
\n\t \D{%b %d %Y %z} \
\$(seconds_since_epoch) \
\`${GIT_DIRTY}\`\n\$ ${NORMAL}"
export EDITOR=emacs
export SVN_EDITOR=emacs
export GIT_EDITOR=emacs
export HISTCONTROL=ignoreboth
export HISTSIZE=10000
export HISTIGNORE="ls:exit:cd ..:cd -:cd ~:ls:pwd:fg:cls:svn st:git r:git rpull:git st:git info"
export RUBYOPT=rubygems
alias reload="source ~/.profile"
alias cls="clear"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment