-
Notifications
You must be signed in to change notification settings - Fork 0
/
.usrrc
64 lines (50 loc) · 2.48 KB
/
.usrrc
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
### User Configuration File ###
## Tools Auto-Complete ##
autoload -U compinit; compinit
## System Overrides ##
export LC_ALL=en_IE.UTF-8
# Select default editor
export EDITOR="$(which nvim || which vim || which vi)"
export PATH="$HOME/.local/bin:$PATH"
# Set correct password entry for SSH Sessions
export GPG_TTY=$(tty)
if [[ -n "$SSH_CONNECTION" ]] ;then
export PINENTRY_USER_DATA="USE_CURSES=1"
fi
## General Aliases ##
alias datetime="date +%Y%m%dT%H%M%SZ"
alias datetimel="date +%Y-%m-%dT%H:%M:%S%:z"
alias ll="ls -lAuhF"
alias plz="sudo "
alias sudo="sudo "
alias whale-quote="docker run --rm --name whale-say renegademaster/docker-whale"
## System Administration
alias d2u="find . -type f -print0 | xargs -0 -n 1 -P \$(getconf _NPROCESSORS_ONLN) dos2unix"
alias diskspace="du -k * 2>/dev/null | sort -nr | cut -f2 | xargs -d '\n' du -sh 2>/dev/null | less"
alias reset-network="sudo nmcli networking off; sudo nmcli networking on"
alias reset-plasma="{ kquitapp5 plasmashell && kstart5 plasmashell } > /dev/null 2>&1 &"
alias tmuxd="tmux new-session \; split-window -h \; send-keys 'htop' C-m \; split-window -v \; send-keys 'update' C-m \;"
alias tmuxr="tmux -S /tmp/socket; chmod 777 /tmp/socket"
alias update-firefox="curl -L --output - 'https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=en-GB' | sudo tar -jx -C /usr/share/firefox-dev/ --strip-components=1"
## Development ##
alias docker-remove-all="docker stop \$(docker ps -q); docker rm \$(docker ps -aq); docker system prune --volumes"
alias git-refresh="git add .; git reset --hard; git fetch -a; git pull --ff-only; git submodule deinit --all --force; git submodule update --init --recursive; git submodule sync"
alias git-update="git submodule update --init --recursive; git fetch; git pull --ff-only; git submodule foreach git fetch; git submodule foreach git pull --ff-only"
## Functions ##
# GitIgnore API
function gi() { curl -sLw n "https://www.toptal.com/developers/gitignore/api/$*" ; }
# Update any package manager
function update() {
printf '\n--- Updating ---\n'
sudo apt update
printf '\n--- Upgrading Packages ---\n'
sudo apt full-upgrade -y
printf '\n--- Upgrading OS ---\n'
sudo apt dist-upgrade -y
printf '\n--- Cleaning Up ---\n'
sudo apt autoremove -y
printf '\n--- Updating Oh-My-ZSH ---\n'
omz update
}
# Remote Kubectl switcher
function remote-kube() { rm "$HOME/.kube/config"; ln -s "$HOME/.kube/config-$*" "$HOME/.kube/config"; ssh -fN "kube-cloud$*"; }