-
Notifications
You must be signed in to change notification settings - Fork 1
/
specific.bash
59 lines (45 loc) · 2 KB
/
specific.bash
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
#### PROGRAM ALIASES ####
adb () { "$ADB" $@; }
alias subl="$SUBL_ALIAS"
alias cmake="$CMAKE"
alias taef="$TAEF"
alias dumpbin="$DUMPBIN"
alias yadm="$YADM/yadm"
# Alias to internal Windows error code lookup
alias err="//tkfiltoolbox/tools/839/1.7.2/x86/err "
alias updot="python $GIT_REPOS_WIN/updot/updot.py"
tracerpt_etl() { tracerpt $1.etl -of CSV -o $1.csv; }
parse_csv() { python $SCRIPTS_WIN\\parse_etl_csv.py $@ 2>&1; }
# Windows style newline characters can cause issues in Cygwin in certain files.
# Replacement for the command with the same. Removes trailing \r character
# that causes the error `'\r': command not found`
dos2unix () { sed -i 's/\r$//' $1; }
export PYTHONIOENCODING="utf-8"
function fuck () {
TF_PYTHONIOENCODING=$PYTHONIOENCODING;
export TF_ALIAS=fuck;
export TF_SHELL_ALIASES=$(alias);
export TF_HISTORY=$(fc -ln -10);
export PYTHONIOENCODING=utf-8;
TF_CMD=$(
thefuck THEFUCK_ARGUMENT_PLACEHOLDER $@
) && eval $(sed 's/\r$//' <<< $TF_CMD); # Remove the Windows EOL char[s]
unset TF_HISTORY;
export PYTHONIOENCODING=$TF_PYTHONIOENCODING;
history -s $TF_CMD;
}
#### CDP Traces ####
qsvc() { sc queryex cdpsvc; }
# Note: Requires Admin
stop_svc() { sc stop cdpsvc; }
start_svc() { sc start cdpsvc; }
disable_svc() { sc config cdpsvc start=disabled; }
enable_svc() { sc config cdpsvc start=demand; }
rm_sys_log () { stop_svc; rm $SYS_CDP_WIN\\\\CDPTraces.log && startsvc; };
rm_user_log () { rm $USER_CDP_WIN\\\\CDPTraces.log; };
sys_log () { $SUBL_ALIAS $SYS_CDP_WIN\\\\CDPTraces.log; };
user_log () { $SUBL_ALIAS $USER_CDP_WIN\\\\CDPTraces.log; };
set_cdp1() { CURR_CDP="$CDP_1" && CURR_CDP_WIN="$CDP_1_WIN" && set_variables; }
set_cdp2() { CURR_CDP="$CDP_2" && CURR_CDP_WIN="$CDP_2_WIN" && set_variables; }
set_cdp3() { CURR_CDP="$CDP_3" && CURR_CDP_WIN="$CDP_3_WIN" && set_variables; }
ping_gcm() { curl --header "Authorization: key=$1" --header "Content-Type: application/json" https://gcm-http.googleapis.com/gcm/send -d "{\"registration_ids\":[\"$2\"]}"; }