-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc.in
191 lines (151 loc) · 4.99 KB
/
bashrc.in
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# .bashrc
# User specific aliases and functions
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# How to undefine a function:
# $ unset -f functionName
export PATH=/opt/homebrew/bin:$PATH
export BREW=/opt/homebrew/bin/brew
# User specific aliases and functions
export PS1='[\u@\h \W]$ '
export EDITOR=/usr/bin/vim
function completely() {
[ -f $($BREW --prefix)/etc/bash_completion ] &&
source $($BREW --prefix)/etc/bash_completion
[ -x $($BREW --prefix)/bin/aws_completer ] &&
complete -C $($BREW --prefix)/bin/aws_completer aws
for complete in \
ag.bashcomp.sh \
aws-vault.bash \
az \
brew \
cf-cli \
gh \
git-completion.bash \
git-prompt.sh \
gmt_completion.bash \
hub.bash_completion.sh \
pandoc \
;
do
[ -f $($BREW --prefix)/etc/bash_completion.d/$complete ] && \
source $($BREW --prefix)/etc/bash_completion.d/$complete
done
}
completely
set -o vi
## replaced with symlinks in ~/bin
## [ -d "/Applications/VMWare Fusion.app"] && \
## export PATH="$PATH:/Applications/VMware Fusion.app/Contents/Library"
##
## Age-old ALIASES:
alias mroe='more'
alias m='more'
alias psg='/bin/ps auxgw | egrep -i '
alias tvm='tail /var/log/messages'
alias ls='/bin/ls -F'
alias ll='/bin/ls -l'
alias be='sudo /bin/su - $@'
alias g='git'
# FUNCTIONS:
lh () { /bin/ls -lt $@ | /usr/bin/head; }
p() { pushd ${1}; }
P() { popd ${1}; }
export ENSCRIPT="--margins=::36:36"
##
## Google Cloud Stuff
##
alias wat='gcloud compute instances list; knife node list'
alias gce='gcloud compute'
##
## Highlighting
##
alias dark='pbpaste | highlight --syntax=rb -O rtf --style nightshimmer | pbcopy'
gceweb(){
gcloud compute instances list | grep web | perl -ane 'print "$F[0] $F[4]\n"'
}
##
## Everything below here is quite possibly obsolete:
##
# Set Xterm title: http://tldp.org/HOWTO/Xterm-Title-4.html#ss4.3
case "$TERM" in
screen)
PROMPT_COMMAND='echo -ne "\033k$HOSTNAME\033\\"'
;;
xterm)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}: ${PWD}\007"'
;;
esac
# FUNCTIONS:
hname () {
case `uname -o` in
Cygwin) hostname;;
*) hostname -s;;
esac
}
# sudo pip install virtualenvwrapper, then:
VIRTUALENV_SH=/usr/local/bin/virtualenvwrapper.sh
if [ -x $VIRTUALENV_SH ]; then
[ -d $HOME/.virtualenvs ] || mkdir $HOME/.virtualenvs
export WORKON_HOME=$HOME/.virtualenvs
source $VIRTUALENV_SH
fi
# CHEF stuff
alias fluxx='export CHEF_SERVER=fluxx'
alias pdbchef='export CHEF_SERVER=pdbchef'
alias pburkholder_com='export CHEFSERVER=pburkholder_com'
alias myaws='export AWS_DEFAULT_PROFILE=pburkholder'
alias gcaws='export AWS_DEFAULT_PROFILE=govcloud'
# alias chefaws='export AWS_DEFAULT_PROFILE=default'
# my bundle has my own CA
# export SSL_CERT_FILE=$HOME/.chef/bundle.crt
[ -r $HOME/.harvestrc ] && source $HOME/.harvestrc
# Volatility :::
# mkdir -p /Users/pburkholder/Library/Python/2.7/lib/python/site-packages
# echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >>
# /Users/pburkholder/Library/Python/2.7/lib/python/site-packages/homebrew.pth
#function vault-demo-ids() {
# aws autoscaling \
# describe-auto-scaling-groups --auto-scaling-group-names vault-provision |
# jq -r '[.AutoScalingGroups[].Instances[].InstanceId] | join(" ")'
# }
#function vault-demo-ips() {
# instance_ids=$(vault-demo-ids)
# aws ec2 describe-instances --instance-ids $instance_ids |
# jq -r '.Reservations[].Instances[].PublicIpAddress'
#}
#alias terminate-vault-id='aws autoscaling terminate-instance-in-auto-scaling-group --no-should-decrement-desired-capacity --instance-id '
#alias inspec_exec='inspec exec
#cookbooks/vault-demo/test/integration/default/serverspec/default_spec.rb
#
#--key-files ~/.ssh/pburkholder-one'
alias tf='terraform'
alias sandbox='cf target -o sandbox-gsa -s peter.burkholder'
alias sbox=sandbox
## put at end so not clobbered
#if [ -f "$($BREW --prefix bash-git-prompt)/share/gitprompt.sh" ]; then
# echo "Adding gitprompt"
# GIT_PROMPT_THEME=Default
# source "$($BREW --prefix bash-git-prompt)/share/gitprompt.sh"
#else
# echo "No gitprompt. Try 'brew install bash-git-prompt'"
#fi
# Not sure if this is needed
#export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export HISTTIMEFORMAT="%d/%m/%y %T "
# One time run:
# fly --target cloud.gov login --concourse-url https://ci.fr.cloud.gov
CLOUD_GOV_RC=$HOME/Projects/pburkholder/dotfiles/cloudgovrc
[ -r $CLOUD_GOV_RC ] && . $CLOUD_GOV_RC
which starship && eval "$(starship init bash)"
export GPG_TTY=$(tty)
alias wordle='curl -s https://gist.githubusercontent.com/bklaas/5f93da478e01af48016c1f3b5025281c/raw/485b2ed5e6d1f33e4041bc56809f0ea8cb0952b2/gistfile1.txt'
alias myip='dig +short myip.opendns.com @resolver1.opendns.com'
function noup() {
sudo kill $(pstree -s gov.gsa.software_update | tail -3 | awk 'BEGIN {ORS=" "} {print $2}')
}