Repository navigation
Expand file tree
/
Copy path_bashrc
More file actions
108 lines (95 loc) · 2.96 KB
/
Copy path_bashrc
File metadata and controls
108 lines (95 loc) · 2.96 KB
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
shopt -s globstar
set +o histexpand
bind '\C-w:backward-kill-word' 2>/dev/null
stty -ixon >/dev/null 2>&1 || true # disable flow control
_PS1() {
local pre= name="$1" len="$2";
[[ "$name" != "${name#$HOME/}" || -z "${name#$HOME}" ]] &&
pre=$pre'~' name="${name#$HOME}" len=$[len-1];
((${#name}>$len)) && name="/...${name:$[${#name}-len+4]}";
echo "$pre$name"
}
PS1='\[\e[1;92m\]\h\[\e[m\]\[\e[1;95m\]$(_PS1 "$PWD" 30)\[\e[m\] '
clearenv() {
local var
while IFS== read -rd '' var _; do
export -n "$var" 2>/dev/null || true
done < <(env -0)
export PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/games"
export BROWSER="firefox"
export EDITOR="vim"
export KEYID="5EEB8C8D5069C4E9B94AA852AFD1503A8C8FF42A"
export WINEDEBUG="-all"
export EMAIL="wellons@nullprogram.com"
export REALNAME="Christopher Wellons"
export DISPLAY HOME LANG SHELL TERM XAUTHORITY
export SSH_AGENT_PID SSH_AUTH_SOCK XDG_RUNTIME_DIR XDG_SESSION_TYPE
}
localenv() {
PATH="$HOME/.local/bin:$PATH"
export CPATH="$HOME/.local/include"
export LIBRARY_PATH="$HOME/.local/lib"
export LD_RUN_PATH="$HOME/.local/lib"
export CMAKE_BUILD_PARALLEL_LEVEL="$(nproc)"
export CMAKE_GENERATOR=Ninja
export CTEST_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL
export CTEST_OUTPUT_ON_FAILURE=1
export MANPATH="$HOME/.local/share/man:/usr/share/man"
export GOBIN="$HOME/.local/bin"
export GOTOOLCHAIN="local"
export PKG_CONFIG_PATH
PKG_CONFIG_PATH="$HOME/.local/lib/pkgconfig:$HOME/.local/share/pkgconfig"
if [[ "$(uname -m)" == *64* ]]; then
LIBRARY_PATH+=":$HOME/.local/lib64"
LD_LIBRARY_PATH+=":$HOME/.local/lib64"
LD_RUN_PATH+=":$HOME/.local/lib64"
else
LIBRARY_PATH+=":$HOME/.local/lib32"
LD_LIBRARY_PATH+=":$HOME/.local/lib32"
LD_RUN_PATH+=":$HOME/.local/lib32"
fi
}
sanenv() {
local common=abort_on_error=1:halt_on_error=1:allocator_may_return_null=1
ASAN_OPTIONS=$common
ASAN_OPTIONS+=:print_legend=0
ASAN_OPTIONS+=:detect_leaks=0
ASAN_OPTIONS+=:detect_stack_use_after_return=1
ASAN_OPTIONS+=:max_malloc_fill_size=$((1<<30))
UBSAN_OPTIONS=$common
TSAN_OPTIONS=$common
export ASAN_OPTIONS UBSAN_OPTIONS TSAN_OPTIONS
}
afl-fuzz() {
ASAN_OPTIONS="$ASAN_OPTIONS:symbolize=0" command afl-fuzz "$@"
}
afl-tmin() {
ASAN_OPTIONS="$ASAN_OPTIONS:symbolize=0" command afl-tmin "$@"
}
afl-cmin() {
AFL_ALLOW_TMP=1 \
ASAN_OPTIONS="$ASAN_OPTIONS:symbolize=0" command afl-cmin "$@"
}
if command -v keychain >/dev/null 2>&1; then
eval $(keychain --eval --quiet)
fi
clearenv
export LIBVIRT_DEFAULT_URI=qemu:///system
localenv
sanenv
title() {
printf "\e]2;%s\a" $1
}
loadssh() {
passphrase2pgp -fssh -c5106E713 -uwellons@p2 | ssh-add -
}
httpd() {
python3 -m http.server "${1:-8080}"
}
source ~/.bash_aliases
if [ -e /etc/bash_completion ]; then
source /etc/bash_completion
fi
if [ -f ~/.bash_local ]; then
. ~/.bash_local
fi