-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
121 lines (100 loc) · 4.16 KB
/
.bashrc
File metadata and controls
121 lines (100 loc) · 4.16 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
tmux-ssh() {
KEY=$1
shift
USER=$1
shift
HOSTS=$*
if [[ -z "$HOSTS" || -z "$KEY" || -z "$USER" ]]; then
# if [[ -z "$HOSTS" ]]; then
echo "Usage: tmux-ssh <ssh-key> <user> <hostlist>"
else
hosts=($HOSTS)
echo "Opening session to ${hosts[0]} with key $KEY and user $USER..."
# echo "Opening session to ${hosts[0]} "
tmux new-window "ssh -i ${KEY} ${USER}@${hosts[0]}"
unset hosts[0];
for i in "${hosts[@]}"; do
echo "Opening session to $i ..."
tmux split-window -v "ssh -i ${KEY} ${USER}@$i"
tmux select-layout tiled > /dev/null
done
tmux select-pane -t 0
tmux set-window-option synchronize-panes on >/dev/null
fi
}
# Get mem about a process.
mem()
{
ps -eo rss,pid,euser,args:100 --sort %mem | grep -v grep | grep -i $@ | awk '{printf $1/1024 "MB"; $1=""; print }'
}
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
export HISTCONTROL=ignoredups
# ... and ignore same sucessive entries.
export HISTCONTROL=ignoreboth
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
# some more ls aliases
alias ls='ls -F'
#alias la='ls -A'
#alias l='ls -CF'
alias iml='sudo /usr/local/bin/naclient login -profile 4315_PHX01_PHX01T01-VC01 -user joshua@imyourdoc.com'
alias imq='sudo /usr/local/bin/naclient logout'
alias ims='sudo /usr/local/bin/naclient status'
export EDITOR=vim
# Use keychain to keep track of ssh-agents
/usr/bin/env keychain $HOME/.ssh/id_rsa
. $HOME/.keychain/${HOSTNAME}-sh > /dev/null
. $HOME/.keychain/${HOSTNAME}-sh-gpg > /dev/null
# Add perlbrew to your path
[[ -s $HOME/perl5/perlbrew/etc/bashrc ]] && source $HOME/perl5/perlbrew/etc/bashrc
export TERM=screen-256color
PS1='\[\e[37;0m\][\[\e[37;1m\]\u\[\e[37;0m\]@\[\e[31;1m\]\h\[\e[37;0m\]:\[\e[33;1m\]\W\[\e[37;0m\]]\\$ '
# Git prompt fun!
GIT_PROMPT_THEME=Solarized_UserHost
GIT_PROMPT_ONLY_IN_REPO=1
if [ command -v brew >/dev/null 2>&1 ]; then
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
fi
PATH=/usr/local/opt/python/libexec/bin:$PATH:/usr/local/bin:/usr/local/sbin:$HOME/.bin:$HOME/.rvm/bin # Add RVM to PATH for scripting
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
# The next line updates PATH for the Google Cloud SDK.
if [ -f $HOME/sourcecode/google-cloud-sdk/path.bash.inc ]; then
source "$HOME/sourcecode/google-cloud-sdk/path.bash.inc"
fi
# The next line enables shell command completion for gcloud.
if [ -f $HOME/soucecode/google-cloud-sdk/completion.bash.inc ]; then
source "$HOME/sourcecode/google-cloud-sdk/completion.bash.inc"
fi
GIT_BASH_COMPLETION="/etc/bash_completion.d/git-prompt"
if [ -e "$GIT_BASH_COMPLETION" ]
then
source "$GIT_BASH_COMPLETION"
export PS1='\[\e[37;0m\][\[\e[37;1m\]\u\[\e[37;0m\]@\[\e[31;1m\]\h\[\e[37;0m\]:\[\e[33;1m\]\W\[\e[37;0m\]$(__git_ps1 "\[\033[0;32m\] (%s)\[\033[0m\]")]\\$ '
else
export PS1='\[\e[37;0m\][\[\e[37;1m\]\u\[\e[37;0m\]@\[\e[31;1m\]\h\[\e[37;0m\]:\[\e[33;1m\]\W\[\e[37;0m\]]\\$ '
fi
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
if [ -f "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh" ]; then
__GIT_PROMPT_DIR=$(brew --prefix)/opt/bash-git-prompt/share
source "$(brew --prefix)/opt/bash-git-prompt/share/gitprompt.sh"
fi
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
alias kv='kill -9 $(ps auxww | grep [v]irt | awk "{ print $2 }")'