-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.bashrc
More file actions
123 lines (98 loc) · 2.84 KB
/
Copy path.bashrc
File metadata and controls
123 lines (98 loc) · 2.84 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# .bashrc
stty -ixon
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# start X session
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]] && command -v startx >/dev/null 2>&1; then
exec startx
fi
HISTSIZE=50000
HISTFILESIZE=10000000
#PS1='\[\e[34m\]\w\n\[\e[32m\]-> \[\e[0m\]'
PS1='\[\e[34m\]\w\n\[\e[32m\][\u@\h]-> \[\e[0m\]'
# Forces bash to save the command history immediately
# after each command is executed
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
export PATH="$HOME/.local/bin:$PATH"
fi
alias ls='ls --color=auto'
alias gcl='git clone --depth 1 --no-tags --single-branch'
alias gs='git status'
alias valgall='valgrind --leak-check=full --show-leak-kinds=all'
alias cp='cp -iv'
alias ln='ln -i'
alias mv='mv -iv'
alias rm='rm -iv'
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# mountpoints
export SSD="/run/media/serr/KINGSTON"
export HDD="/run/media/serr/KESU"
tmux3() {
tmux new-session -d -s main -n launcher
tmux new-window -t main -n home
tmux new-window -t main -n work
tmux select-window -t main:launcher
tmux attach -t main
}
pyvenv() {
if [ -n "$VIRTUAL_ENV" ]; then
echo "Already in virtual environment '$VIRTUAL_ENV'. Deactivating..."
deactivate
return
fi
if [ -d ".venv" ]; then
echo "Virtual environment '.venv' already exists. Activating..."
else
python3 -m venv .venv
echo "Virtual environment created!"
fi
source .venv/bin/activate
}
cacheclean() {
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
}
prettypath() {
echo "$PATH" | sed 's/:/\
/g'
}
mkcd() {
\mkdir -p "$1"
cd "$1"
}
gacp() {
if [ "$#" -eq 1 ]; then
git add . && git commit -m "$1" && git push
else
git add . && git commit -m "quick update" && git push
fi
}
gcf() {
if [ $# -lt 2 ]; then
echo "Usage: gcf <repository-url> <folder-path>"
echo "Example: gcf https://github.com/github/codeql.git java/ql/src/Security/CWE"
return 1
fi
local repo_url="$1"
local folder_path="$2"
local repo_name=$(basename "$repo_url" .git)
(
git clone -n --depth=1 --filter=tree:0 "$repo_url" "$repo_name"
cd "$repo_name"
git sparse-checkout set --no-cone "$folder_path"
git checkout
)
}
. "$HOME/.cargo/env"
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# Android SDK
export ANDROID_HOME=$HOME/software/android-sdk
export ANDROID_SDK_ROOT=$HOME/software/android-sdk
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/emulator