-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
85 lines (67 loc) · 2.25 KB
/
.bashrc
File metadata and controls
85 lines (67 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# .bashrc
# settings here will be sourced into .bash_profile
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
#
# Aliases
#
alias df='df -TP '
[[ ! $( which md5 ) ]] && alias md5="md5sum"
alias gimme='/usr/bin/find . -type f -name 2>/dev/null'
alias hover="watch -n 5 ps -o pid,user,etime,args -p "
alias ldapme="ldapsearch -h ldap.virginia.edu -D '' -w '' -x -v -b 'o=University of Virginia, c=US' '(uid=ms3uf)' cn '*'"
alias ll='ls -lahG'
alias ls='ls -aG'
alias rgrep="grep -R --exclude-dir=.svn "
alias myip="ifconfig | grep -o -E 'inet.*[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.*[bB].*cast' | grep --color -o -E '[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}'"
alias tping="ps -ef -l | grep -E '(tomcat|PPID)' | grep -v grep"
alias tpid='ps -U tomcat -eo pid,command | grep tomcat | grep -v ps | grep -v grep | grep -o -E '\''^[0-9]+'\'''
alias tomkill='sudo kill -9 `tpid`'
# the ever mysterious "sudo space" alias, which passes aliases to sudo
alias sudo='sudo '
# vim/vi alias
[[ $( which vim ) ]] && alias vi=$( which vim )
#
# Environment Variables
#
# need more history!
HISTFILESIZE=10000
HISTTIMEFORMAT='%F %T '
# editor vars
SVN_EDITOR=vim
EDITOR=vim
GREP_COLOR='01;37' # white
#
# PATH adjustments
#
PATH=$PATH:$HOME/bin
export PATH
#
# functions (mostly terminal look-and-feel)
#
function mdcd() { echo "mkdir $@ && cd $_"; mkdir -p "$@" && cd "${@:$#}"; }
function set_term_bg_color() {
: ${3?"Usage: $FUNCNAME RED GREEN BLUE"}
echo -ne "\033]6;1;bg;red;brightness;$1\a"
echo -ne "\033]6;1;bg;green;brightness;$2\a"
echo -ne "\033]6;1;bg;blue;brightness;$3\a"
return 0
}
function prompt_command() {
PS1="[\u]${yellow}$(ruby_version_prompt) ${white}\h${reset_color} in ${green}\w\n${bold_cyan}$(scm_char)${green}$(scm_prompt_info) ${green}→${reset_color} "
# sets title in iTerm2 tab/window
echo -ne "\033]0;`hostname -s`\007"
# tweaks color in same
set_term_bg_color 255 255 255
}
#
# Application-specific extensions
#
# Ruby
RUBYLIB="/usr/lib/ruby/gems/1.8/gems"
# Git helper
[[ -r $HOME/.git-completion.bash ]] && source $HOME/.git-completion.bash
# Rvm (only if installed, now primarily using rbenv)
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*