-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathcli.sh
More file actions
68 lines (55 loc) · 1.93 KB
/
Copy pathcli.sh
File metadata and controls
68 lines (55 loc) · 1.93 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
# If not root
if [ `id -u` -ne 0 ]; then
# $PATH
export PATH="/opt/cs50/bin":"/opt/bin":"$PATH"
# $PS1
_cwdSlashAtEnd () {
TITLE="$(dirs +0)"
TITLE="${TITLE%/}"
echo -n "${TITLE}/"
}
if type __git_ps1 > /dev/null 2>&1; then
PS1='\[$(printf "\x0f")\033[01;34m\]$(_cwdSlashAtEnd)\[\033[00m\]$(__git_ps1 " (%s)") $ '
fi
# Aliases
alias cd="HOME=\"$WORKDIR\" cd"
alias cowsay="/usr/games/cowsay"
alias cp="cp -i"
alias curl="curl --http2"
alias gdb="gdb -q" # Suppress gdb's startup output
alias grep="grep --color" # Suppress gdb's startup output
alias ls="ls --color -F --ignore=lost+found" # Add trailing slashes
alias mv="mv -i"
alias pip="pip --no-cache-dir"
alias python="python -q"
alias rm="rm -i"
alias sudo="sudo " # Trailing space enables elevated command to be an alias
# Editor
export EDITOR="nano"
# File mode creation mask
umask 0077
# History
# https://www.shellhacks.com/tune-command-line-history-bash/
export HISTCONTROL='ignoredupes' # Ignore duplicates
export PROMPT_COMMAND='history -a' # Store Bash History Immediately
# Java
export JAVA_HOME="/opt/jdk"
# Make
export CC="clang"
export CFLAGS="-ferror-limit=1 -gdwarf-4 -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-gnu-folding-constant -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wno-unused-but-set-variable -Wshadow"
export LDLIBS="-lcrypt -lcs50 -lm"
# Node.js
export NODE_ENV="dev"
# Python
export PATH="$HOME"/.local/bin:"$PATH"
export PYTHONDONTWRITEBYTECODE="1"
# Ruby
export GEM_HOME="$HOME"/.gem
export PATH="$GEM_HOME"/bin:"$PATH"
# Valgrind
export VALGRIND_OPTS="--memcheck:leak-check=full --memcheck:show-leak-kinds=all --memcheck:track-origins=yes"
## TODO: Start help50 if enabled
if help50 is-enabled > /dev/null; then
help50 start
fi
fi