-
Notifications
You must be signed in to change notification settings - Fork 0
/
bashrc_ubuntu
147 lines (108 loc) · 5.6 KB
/
bashrc_ubuntu
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
# Run linux (not just ubuntu) code
#
# Determine OS platform
UNAME=$(uname | tr "[:upper:]" "[:lower:]")
# If Linux, try to determine specific distribution
# https://askubuntu.com/questions/459402/how-to-know-if-the-running-platform-is-ubuntu-or-centos-with-help-of-a-bash-scri
if [ "$UNAME" == "linux" ]; then
# If available, use LSB to identify distribution
if [ -f /etc/lsb-release -o -d /etc/lsb-release.d ]; then
export DISTRO=$(lsb_release -i | cut -d: -f2 | sed s/'^\t'//)
# Otherwise, use release info file
else
export DISTRO=$(ls -d /etc/[A-Za-z]*[_-][rv]e[lr]* | grep -v "lsb" | cut -d'/' -f3 | cut -d'-' -f1 | cut -d'_' -f1)
fi
fi
if [ "$DISTRO" == "CentOS" ]; then
echo "bashrc assuming Centos"
else
# echo "assuming Ubuntu"
. /etc/lsb-release
fi
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
if [[ $DISTRIB_RELEASE = 14.04 ]]; then
export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
elif [[ "$DISTRO" == "CentOS" ]]; then
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk
fi
export BOOST_LIBRARYDIR=/usr/lib/x86_64-linux-gnu
export LC_ALL="en_US.UTF-8"
# on ubuntu, go is in /usr/local
export GOROOT=/usr/local/go
a impala1='export IMPALA_HOME=$HOME/git/asf/Impala; export MYPROMPT=impala1 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a impala2='export IMPALA_HOME=$HOME/git/asf/Impala2; export MYPROMPT=impala2 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a impala3='export IMPALA_HOME=$HOME/git/asf/Impala3; export MYPROMPT=impala3 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a impala_cdh1='export IMPALA_HOME=$HOME/git/cdh/Impala; export MYPROMPT=cdh_impala1 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a cdh_impala1=impala_cdh1
a impala_cdh2='export IMPALA_HOME=$HOME/git/cdh/Impala2; export MYPROMPT=cdh_impala2 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a cdh_impala2=impala_cdh2
a impala_cdh3='export IMPALA_HOME=$HOME/git/cdh/Impala3; export MYPROMPT=cdh_impala3 ; . ~/scripts/my_impala.sh; cd $IMPALA_HOME'
a cdh_impala3=impala_cdh3
# dita
if [ "$HOSTNAME" == "asherman-desktop" ]; then
export PATH=$PATH:$HOME/bin/dita-ot-3.1.1/bin
else
export PATH=$PATH:$HOME/bin/dita-ot-3.7.3/bin
fi
# the default vnc client, already installed
alias vnc=remmina
# set this by default so the native toolchain build will not fail at the end
export PUBLISH_DEPENDENCIES=0
export SUBL=/usr/bin/subl
alias stingo='export GOPATH=$HOME/git/bartash/stingo; . ~/scripts/gosetup.sh; cd $GOPATH'
# for dwx GOPATH does not matter
# alias dwx1='export AADWX=dwx1; export GOPATH=$HOME/git/go; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
alias dwx-dev1='export AADWX=dwx-dev1; export GOPATH=$HOME/git/go; . ~/scripts/dwx_postgres.sh ; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
# alias dwx4='export AADWX=dwx4; export GOPATH=$HOME/git/go4; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
alias dwx-dev4='export AADWX=dwx-dev4; export GOPATH=$HOME/git/go4; . ~/scripts/dwx_postgres.sh ; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
alias dwx-dev5='export AADWX=dwx-dev5; export GOPATH=$HOME/git/go5; . ~/scripts/dwx_postgres.sh ; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
alias dwx-dev6='export AADWX=dwx-dev6; export GOPATH=$HOME/git/go6; . ~/scripts/dwx_postgres.sh ; . ~/scripts/my_dwx.sh; cd "$DWX_HOME"'
alias c1c-dev1='export AAC1C=c1c-dev1; export GOPATH=~/bin/c1cgo; . ~/scripts/my_c1c.sh; cd $C1C_HOME'
alias pvc-dev1='export AAPVC=pvc-dev1; . ~/scripts/cdw-dev.sh ; . ~/scripts/my_pvc.sh'
alias pvc-dev2='export AAPVC=pvc-dev2; . ~/scripts/dev-02.sh ; . ~/scripts/my_pvc.sh'
alias buildall='./buildall.sh -skiptests -noclean'
# start impala in local catalog mode
alias start-impala-local-catalog='start-impala-cluster.py --cluster_size=1 --impalad_args="--use_local_catalog=true" --catalogd_args="--catalog_topic_mode=minimal"'
# Start impala with a dedicated coordinator.
alias start-impala-dedicated-coordinator='start-impala-cluster.py --cluster_size=3 --num_coordinators=1 --use_exclusive_coordinators'
alias start-impala-dedicated-coordinator-statestore-ha='start-impala-cluster.py --cluster_size=3 --num_coordinators=1 --use_exclusive_coordinators --enable_statestored_ha'
# in case sl installed
alias sl=ls
alias impala-shell=impala-shell.sh
alias vpn='globalprotect launch-ui'
# https://github.com/yuezk/GlobalProtect-openconnect
alias vpn2=gpclient
if [ -x "$(command -v kubectl)" ]; then
source <(kubectl completion bash | sed s/kubectl/k/g)
source <(kubectl completion bash)
fi
PS1='[\w][$MYPROMPT]\$ '
# go get github.com/segmentio/aws-okta
# rm ~/go/bin/aws-okta
# export GO111MODULE=on
# go get github.com/segmentio/[email protected]
export PATH=$PATH:$HOME/go/bin
# https://cloudera.atlassian.net/wiki/spaces/ESRE/pages/30376051/SRE+Runbook+-+Cloud+Users+AWS-Okta+SSO
# . ~/git/sre/sre/terraform/modules/cloud-users/ao_config/AO_CONFIG.sh
# . ~/git/sre/sre/terraform/modules/cloud-users/ao_config/.bashrc_aws-okta
# alias aws-okta='aws-okta.exe --mfa-duo-device token'
alias ao='aws-okta.exe --mfa-duo-device token'
# push to dir with latest k9s output
alias to_latest_k9s='pu $(ls -td /tmp/k9s-screens-asherman/* | head -1)'
alias to_k9s_latest='pu $(ls -td /tmp/k9s-screens-asherman/* | head -1)'
# rev reverses characters, wtf use is that
alias rev=tac
# for dwx personal docker builds
export USER_TAG=asherman
# mostly obsolete part of throttling tooclhain downloads
export IMPALA_CONCURRENT_DOWNLOADS=1
#
#
# https://github.infra.cloudera.com/SRE/cloud-users/tree/master/scripts/cloudera-cloud-users
if [ "$HOSTNAME" == "asherman-22745" ]; then
source /usr/lib/cloudera-cloud-users.sh
export PATH=$PATH:/home/asherman/.local/bin
export BROWSER=google-chrome
fi
# Invoke script with 'switchCluster'
. ~/scripts/switchCluster.sh