-
Notifications
You must be signed in to change notification settings - Fork 0
/
.aliases
151 lines (110 loc) · 4.65 KB
/
.aliases
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# _ _ ___ _ ___ ___ ___
# /_\ | | |_ _| /_\ / __|| __|/ __|
# _ / _ \ | |__ | | / _ \ \__ \| _| \__ \
# (_)/_/ \_\|____||___|/_/ \_\|___/|___||___/
#
# use dog > dig
alias dig="dog"
# make it easy to use Taskfiles
alias t="go-task"
alias sync_pacman_mirrors="reflector --country Denmark,Sweden,Norway,Germany --fastest 10 --protocol https --verbose"
alias lg="lazygit"
alias k="kubectl"
alias tfredep="echo '--> Destroying infrastructure ...' && terraform destroy -auto-approve && echo '--> Done destroying infrastructure!' && echo '--> Creating infrastructure ...' && terraform apply -auto-approve && echo '--> Done creating infrastructure!'"
# fix laptop keyboard
alias lk="setxkbmap us ; xmodmap ~/dotfiles/wkl_modmap ; xmodmap ~/dotfiles/wkl_modmap"
# in case being stuck with caps lock on...
alias LK="setxkbmap us"
# qtile logs
alias qtile_log="tail -f /home/zander/.local/share/qtile/qtile.log"
alias clean_qtile_log="truncate -s 0 /home/zander/.local/share/qtile/qtile.log"
alias qtile_log_full="tail -f -n 999999 /home/zander/.local/share/qtile/qtile.log"
# exit ranger in the current directory
alias ranger="source ranger"
# download youtube videoes
alias ytd="youtube-dl -f bestvideo+bestaudio"
# upgrade all pip packages
alias pip_upgrade_all="pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1 | xargs -n1 pip install -U"
# tail log files
alias tailf="tail -f -n 999999"
# update neovim
alias nvim_update="cd /home/zander/neovim-config/scripts && bash update.sh"
# read std.in to clipboard
alias to_clipboard="xclip -i -selection c"
# setup laptop screens
alias lts="bash /home/zander/dotfiles/xrandr/only_laptop"
alias xrandr_only_laptop="bash /home/zander/dotfiles/xrandr/only_laptop"
alias xrandr_office_desk="bash /home/zander/dotfiles/xrandr/office_desk.sh"
alias xrandr_office_desk2="bash /home/zander/dotfiles/xrandr/office_desk.sh"
alias xrandr_nr_desk="bash /home/zander/dotfiles/xrandr/nr_office_desk.sh"
# what is the weather?
alias weather="curl wttr.in"
# what is docker storing?
alias docker_status="echo -e \"\nContainers:\n\" && docker ps -a && echo -e \"\nImages:\n\" && docker image ls && echo -e \"\nVolumes:\n\" && docker volume ls"
# prune docker
alias docker_clean="docker volume prune -f && docker system prune -f"
# play background music from youtube
alias background_music="bash /home/zander/dotfiles/scripts/background_music.sh"
# generate password
function random_password {
for foo in $(seq 5) ; do
date +%s | sha256sum | base64 | head -c 50 ; echo ; sleep 1
done
}
# quick git status
alias gs="git status"
# start emacs in no-gui mode
# alias emacs="emacs -nw"
# gotop params
alias gotop="gotop -p -c vice"
# use ncdu > du
alias ncdu="ncdu --color dark -rr"
# fzf preview files
alias preview="fzf --preview 'bat --color \"always\" {}'"
# use prettyping > ping
alias ping="prettyping --nolegend"
# use bat > cat
alias cat="bat"
# use lsdeluxe
# alias ls="lsd"
# alias l="lsd -al"
# use exa
alias ls="exa --icons"
alias l="exa --icons --git -alh"
# use logo-ls
# alias ls="logo-ls --git-status"
# alias l="logo-ls -l --git-status"
# use zoxide over cd
# alias cd="z"
# add a newline before neofetch
alias neofetch="echo -e \"\n\" && neofetch"
# cat cheatsheet
alias cs="cat /home/zander/dotfiles/cheatsheet"
alias vimcs="cat /home/zander/neovim-config/cheatsheet"
# update grub after changes to kernel setup
alias update-grub="sudo grub-mkconfig -o /boot/grub/grub.cfg"
# connect to VPN ...
alias start_vpn="nmcli connection up 'PIA - Denmark'"
alias stop_vpn="nmcli connection down 'PIA - Denmark'"
# wifi config stuff
alias wifi_list="nmcli device wifi list"
alias wifi_off="nmcli device disconnect wlp4s0"
alias wifi_on="nmcli device connect wlp4s0"
alias wifi_disconnect="nmcli connection down"
alias wifi_connect="nmcli connection up"
alias wifi="nmcli radio && nmcli device && nmcli d wifi rescan && nmcli d wifi list && echo 'Connect to new wifi: nmcli -ask device wifi connect \"SSID-Name\"'"
# alias for neovim
alias n="nvim"
alias knr="kubectl describe nodes |grep '^ Resource' -A3"
# quick view current kubectl context and namespace
alias kx='f() { [ "$1" ] && kubectl config use-context $1 || kubectl config current-context ; } ; f'
alias kn='f() { [ "$1" ] && kubectl config set-context --current --namespace $1 || kubectl config view --minify | grep namespace | cut -d" " -f6 ; } ; f'
# some python dev aliases
alias rl="run_linters"
alias pt="pytest"
alias rlt="figlet 'run_linters' ; run_linters ; figlet 'pytest' ; pytest"
alias ruff_fix="ruff check . --config linting/.ruff.toml --fix"
alias b="black ."
# github cli aliases
alias ghre="gh repo view --web"
alias ghpr="gh pr view --web"