personal website

Commit bf49b3f0

bf49b3f0a43fMerged

Justin Dorfman <[email protected]> · 10 years ago · 2 files · +1 added · ~1 modified

Description

Added .bash_profile for VPS

Details

Commit
bf49b3f0a43f
Parent
ff96cddb92b3

conf/.bash_profileaddedView file

1+export TERM=xterm-256color
2+export LC_ALL=en_US.UTF-8
3+export LANG=en_US.UTF-8
4+export LANGUAGE=en_US.UTF-8
5+export EDITOR=vim
6+
7+### History Handling
8+export HISTCONTROL=erasedups
9+export HISTSIZE=10000
10+shopt -s histappend
11+bind '"\e[A"':history-search-backward
12+bind '"\e[B"':history-search-forward
13+
14+## Web Dev
15+alias sha384="openssl dgst -sha384 -binary | openssl base64"
16+sri384() { hash=`curl -s $1 |sha384`; echo sha384-$hash;}
17+alias icurl="curl -I"
18+alias spy80="tcpdump -X -s 1024 -i en0 port 80"
19+alias canhazip="curl -s canhazip.com"
20+alias jpp="python -m json.tool" #json pretty print
21+alias md5sum='openssl dgst -md5'
22+alias md5='md5sum'
23+
24+## Git
25+alias gs="git status"
26+alias gb="git branch"
27+alias gc="git commit"
28+alias gr="git checkout"
29+alias ga="git add"
30+alias gl="git lola"
31+alias ghr="git reset --hard origin/master"
32+alias grho="git reset --hard origin/master"
33+alias motherfucker="git reset --hard origin/master"
34+alias gp="git pull"
35+alias gitcom="git-commander"
36+
37+## Directories
38+
39+alias ll="ls -alh"
40+alias l="ls -alhtr"
41+alias home="cd ~"
42+alias github="cd ~/github"
43+alias ..="cd .."
44+cd() { builtin cd "$@"; l; }
45+alias f='open -a Finder ./'
46+alias temp="cd /tmp/"
47+
48+### ---------
49+### Functions
50+### ---------
51+
52+_git_prompt() {
53+ local git_status="`git status -unormal 2>&1`"
54+ if ! [[ "$git_status" =~ Not\ a\ git\ repo ]]; then
55+ if [[ "$git_status" =~ nothing\ to\ commit ]]; then
56+ local ansi=42
57+ elif [[ "$git_status" =~ nothing\ added\ to\ commit\ but\ untracked\ files\ present ]]; then
58+ local ansi=43
59+ else
60+ local ansi=45
61+ fi
62+ if [[ "$git_status" =~ On\ branch\ ([^[:space:]]+) ]]; then
63+ branch=${BASH_REMATCH[1]}
64+ test "$branch" != master || branch=' '
65+ else
66+ # Detached HEAD. (branch=HEAD is a faster alternative.)
67+ branch="(`git describe --all --contains --abbrev=4 HEAD 2> /dev/null ||
68+ echo HEAD`)"
69+ fi
70+ echo -n '\[\e[0;37;'"$ansi"';1m\]'"$branch"'\[\e[0m\] '
71+ fi
72+}
73+
74+_prompt_command() {
75+ PS1="`_git_prompt`"'\[\e[0;94m\]\u\[\e[97m\]@\[\e[0;94m\]DO.NY\[\e[0m\]:\[\e[0;90m\]\w\[\e[0m\]\$ '
76+# PS1="`_git_prompt`"'$ '
77+}
78+PROMPT_COMMAND=_prompt_command
79+
80+###End Git_prompt
81+
82+checkgzip() { curl -sI -H 'Accept-Encoding: gzip,deflate' $1 |grep Content-Encoding --color; }