-
Notifications
You must be signed in to change notification settings - Fork 5
/
.shrc
112 lines (90 loc) · 3.02 KB
/
.shrc
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
# clear out PATH so it's not duplicating parent shell
export PATH="/usr/bin:/bin:/usr/sbin:/sbin"
export PATH="/usr/local/bin:/usr/local/sbin:$PATH"
if [ -d "/Applications/Postgres.app/Contents/Versions/12/bin" ]; then
export PATH="/Applications/Postgres.app/Contents/Versions/12/bin:$PATH"
fi
if [ -d "/opt/homebrew/bin" ]; then
export PATH="/opt/homebrew/bin:$PATH"
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
fi
### Added by the Heroku Toolbelt
if [ -d "/usr/local/heroku/bin" ]; then
export PATH="/usr/local/heroku/bin:$PATH"
fi
if [ -d "/usr/local/share/npm/bin" ]; then
export PATH="/usr/local/share/npm/bin:$PATH"
fi
# golang
if [ "$CODESPACES" = true ] ; then
export PATH="/usr/lib/go-1.19/bin:$PATH"
else
export PATH="/usr/local/go/bin:$PATH"
fi
export GOPATH="$HOME/gocode"
export PATH="$PATH:$GOPATH/bin"
export PATH="$PATH:$GOBIN"
# I want my custom bin files ahead of rbenv shims
if [ -x "$(command -v rbenv)" ]; then
eval "$(rbenv init -)"
fi
export PATH="$HOME/bin:$PATH"
if [ -d "/usr/local/opt/python3/bin" ]; then
export PATH="/usr/local/opt/python3/bin:$PATH"
alias python=/usr/local/opt/python3/bin/python3
fi
if [ -d "/usr/local/opt/node@10/bin" ]; then
export PATH="/usr/local/opt/node@10/bin:$PATH"
fi
if [ -d "/usr/local/opt/openjdk/bin" ]; then
export PATH="/usr/local/opt/openjdk/bin:$PATH"
fi
export EDITOR=/usr/bin/vim
if [ -f ~/.secret ]; then
source ~/.secret
fi
#test "$(ps -ocommand= -p $PPID | awk '{print $1}')" == 'script' || (script -f $HOME/$(date +"%d-%b-%y_%H-%M-%S")_shell.log)
if [[ -z "${CODESPACES}" ]]; then
# at least until github can handle setting RAILS_PATH in a sane way
export CDPATH=".:$HOME/work:$HOME/ghwork"
fi
export LANG=en_US.UTF-8
# https://stackoverflow.com/questions/45405070/how-do-i-save-iex-history
export ERL_AFLAGS="-kernel shell_history enabled"
# Charles Proxy
# Show Current Settings
function proxy-show(){
echo "ALL_PROXY = ($ALL_PROXY)"
echo "HTTP_PROXY = ($HTTP_PROXY)"
echo "http_proxy = ($http_proxy)"
echo "HTTPS_PROXY = ($HTTPS_PROXY)"
echo "https_proxy = ($https_proxy)"
echo "ftp_proxy = ($ftp_proxy)"
echo "rsync_proxy = ($rsync_proxy)"
echo "no_proxy = ($no_proxy)"
echo "NO_PROXY = ($NO_PROXY)"
}
# Enable Proxy
function proxy-on(){
export ALL_PROXY=http://localhost:8888
export HTTP_PROXY=$ALL_PROXY
export http_proxy=$ALL_PROXY
export HTTPS_PROXY=$ALL_PROXY
export https_proxy=$ALL_PROXY
export ftp_proxy=$ALL_PROXY
export rsync_proxy=$ALL_PROXY
export NO_PROXY=localhost,.local,169.254.,127.0.0.1,10.0.2.,.bonusbits.com,/var/run/docker.sock
export no_proxy=$NO_PROXY
proxy-show
}
# Disable Proxy
function proxy-off(){
unset HTTP_PROXY HTTPS_PROXY http_proxy https_proxy ftp_proxy rsync_proxy ALL_PROXY NO_PROXY no_proxy
proxy-show
}
# Turn on by default
#proxy-on
export GPG_TTY=$(tty)
export RIPGREP_CONFIG_PATH="$HOME/.rgconfig"
# https://stackoverflow.com/questions/65612411/forcing-docker-to-use-linux-amd64-platform-by-default-on-macos
export DOCKER_DEFAULT_PLATFORM=linux/amd64