-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.bash_profile.google
154 lines (132 loc) · 6.67 KB
/
.bash_profile.google
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
export ABBR_QUIET=1
# vi: ft=sh
# ---------------
# Google Specific
# ---------------
export PATH=$PATH:/google/src/head/depot/google3/experimental/users/cnieves/util
export PATH="${HOME}/.config/lsp/lua-language-server/bin:${PATH}"
export GOROOT=/usr/lib/google-golang
export PATH=$GOROOT/bin:$PATH
export JAVA_HOME=$(readlink -ne /usr/local/buildtools/java/jdk)
export CARGO_NET_GIT_FETCH_WITH_CLI=true
source ~/g3path.zsh
source ~/fzf-at-google.zsh
source /etc/bash_completion.d/hgd
gcertstatus --quiet || gcert && source /google/bin/releases/knock/knock.sh
# gcertstatus --quiet || gcert && source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
function gcert() {
if [[ -n $TMUX ]]; then
eval $(tmux show-environment -s)
fi
command gcert "$@"
source /google/bin/releases/knock/knock.sh
}
FORTUNES=/google/data/ro/users/di/diamondm/engfortunes/fortune.sh
if [ -f "$FORTUNES" ]; then
prodcertstatus &> /dev/null && $FORTUNES
fi
# Install fzf-query
export PATH="${PATH}:/google/bin/releases/editor-devtools"
# Preview code with pygmentize.
export FZF_CS_PREVIEW_COMMAND="python third_party/py/pygments/google/google_pygmentize.py -f terminal16m -O style=native"
# Preview highlight: foreground: RG(248, 248, 248) = #F8F8F8, background: RGB(81, 85, 89) = #515559.
export FZF_CS_PREVIEW_HIGHLIGHT="\x1b[38;2;248;248;248m\x1b[48;2;81;85;89m"
alias aapt2=/google/src/head/depot/google3/third_party/java/android/android_sdk_linux/platform-tools/aapt2
alias acid=/google/bin/releases/mobile-devx-platform/acid/acid
alias apido='/google/data/ro/teams/oneplatform/apido'
alias bugs=/google/data/rw/users/mk/mkannan/www/bin/bugs
alias cider='/google/src/head/depot/google3/experimental/cider_here/cider_here.sh'
alias crow=/google/bin/releases/mobile-devx-platform/crow/crow.par
alias er=/google/data/ro/users/ho/hooper/er
alias fixjs=/google/src/files/head/depot/google3/third_party/java_src/jscomp/java/com/google/javascript/jscomp/lint/fixjs.sh
alias fortune=/google/data/ro/users/di/diamondm/engfortunes/fortune.sh
alias hgcdg4='cd $(g4 g4d $(hg exportedcl))'
alias jadep=/google/data/ro/teams/jade/jadep
alias replace_string=/google/src/head/depot/google3/devtools/scripts/replace_string
alias safergcp=/google/bin/releases/safer-gcp/tools/safergcp
alias add_deps_to_usages='/google/src/head/depot/google3/apps/framework/tools/add_deps_to_usages.sh'
alias bloaty=/google/bin/releases/protobuf-team/bloaty/bloaty
alias bloaty-google3-diff=/google/bin/releases/protobuf-team/bloaty/bloaty-google3-diff
alias plxutil='/google/data/ro/teams/plx/plxutil'
export HGSHORT_CMDS="cat head tail mv cp rm chmod g4 diff merge patch meld trim less more nvim"
export HGSHORT_DIR='/google/src/head/depot/google3/experimental/fig_contrib/hgshort' # default
alias vim="source $HGSHORT_DIR/tobashargs.sh nvim"
alias hgd='source /google/src/head/depot/google3/experimental/fig_contrib/hgshort/hgd-local.sh'
alias builddoctor=/google/bin/releases/build-doctor/builddoctor
alias rudi=/google/data/ro/teams/lsc/bin/rudi-cli
alias rudi-cli=/google/data/ro/teams/lsc/bin/rudi-cli
alias graphviz=/google/data/ro/projects/graphviz-server/graphviz
alias xrefs=/google/bin/releases/grok/tools/xrefs
export ACID_STARTUP_SCRIPT_PATH=~/acid_startup.sh
export PATH=$PATH:/usr/local/google/home/cnieves/.local/binexport PATH=$PATH:/usr/local/google/home/cnieves/.local/bin
# Temporary definition for knock, which will override itself with the
# real implementation.
knock() {
if gcertstatus --nocheck_ssh &>/dev/null; then
source /google/bin/releases/knock/knock.sh
knock "$@" # Call the real implementation and pass any parameters.
else
echo "ERROR: Cannot invoke knock before gcert has been run" >&2
fi
}
build_gms() {
blaze build --config gmscore_arm64 //java/com/google/android/gmscore/integ:GmsCore_prodnext_xxhdpi_debug
}
abbr cdm = "adb shell am start -n com.google.android.gms/.chimera.debug.ChimeraDebugActivity"
jt() {
if [[ $PWD =~ '(.*)/javatests(.*)' ]]; then
cd "${match[1]}/java${match[2]}"
else
cd "${PWD/\/google3\/java//google3/javatests}"
fi
}
get_current_activity() {
adb shell dumpsys window | grep -E 'mCurrentFocus'
}
cl_search() {
# hg status -n --change . --template= | xargs -i sh -c "echo {} && grep '$1' {}"
rg --ignore-case $1 $(hg pstatus -ma -n --template= -- 2>/dev/null)
}
cl_replace() {
hg status -n --change . --template= | xargs -i sh -c "sed -i '$1' {}"
}
restart_gms() {
adb shell am force-stop com.google.android.gms
adb shell am broadcast -a com.google.android.gms.INITIALIZE
}
from_cloud(){
scp baggins.c.googlers.com:$1 ~/Downloads/
echo "Saved $1 to downloads"
}
to_cloud(){
scp $1 baggins.c.googlers.com:~/Downloads
echo "Saved $1 to downloads"
}
from_mac(){
scp cnieves-macbookpro.roam.internal:$1 ~/Downloads/
echo "Saved $1 to downloads"
}
to_mac(){
scp $1 cnieves-macbookpro.roam.internal:~/Downloads
echo "Saved $1 to downloads"
}
bdoctor() {
default=$(builddoctor analyze --blueprint //depot/google3/java/com/google/android/gmscore/tools/build_doctor/build_doctor.blueprint --cl $1 --analysis_type=PERIODIC --buildable_unit_type BUILD --buildable_unit gmscore.build_doctor.debug_container | grep http | sed 's/Created Analysis TaskSet (results will appear here): //')
hourly=$(builddoctor analyze --blueprint //depot/google3/java/com/google/android/gmscore/tools/build_doctor/build_doctor.blueprint --cl $1 --analysis_type=PERIODIC --analysis_name=hourly --buildable_unit_type BUILD --buildable_unit gmscore.build_doctor.debug_container | grep http | sed 's/Created Analysis TaskSet (results will appear here): //')
echo "DEFAULT(ANALYSIS): $default"
echo "HOURLY(EXECUTION): $hourly"
}
bdoctor_modules() {
default=$(builddoctor analyze --blueprint //depot/google3/java/com/google/android/gmscore/tools/build_doctor/build_doctor.blueprint --cl $1 --analysis_type=PERIODIC --buildable_unit_type BUILD --buildable_unit gmscore.build_doctor.large.chimera.modules | grep http)
hourly=$(builddoctor analyze --blueprint //depot/google3/java/com/google/android/gmscore/tools/build_doctor/build_doctor.blueprint --cl $1 --analysis_type=PERIODIC --analysis_name=hourly --buildable_unit_type BUILD --buildable_unit gmscore.build_doctor.large.chimera.modules | grep http)
echo "DEFAULT(ANALYSIS): $default"
echo "HOURLY(EXECUTION): $hourly"
}
alias bisect=/google/data/ro/teams/tetralight/bin/bisect
alias copybara='/google/bin/releases/copybara/public/copybara/copybara'
alias allow_ptrace='/google/bin/releases/cider/dbg/allow_ptrace'
alias bluze=/google/bin/releases/blueprint-bluze/public/bluze
source /google/bin/releases/gmscore-tools/cli/prod/setup_prod_gms.sh
abbr bq="blaze query"
abbr br="blaze run"
abbr bb="blaze build"