Wg macros
This commit is contained in:
parent
83b51cd03f
commit
eec5708d33
@ -1,8 +1,9 @@
|
|||||||
|
# vim: nospell
|
||||||
# Global Rules
|
# Global Rules
|
||||||
Host * !*.github.com !github.com
|
Host * !*.github.com !github.com
|
||||||
IdentityFile %d/.ssh/id_ed25519_sk_rk_yk20572395
|
IdentityFile %d/.ssh/id_ed25519_sk_rk_yk20572395
|
||||||
IdentityFile %d/.ssh/id_ed25519
|
IdentityFile %d/.ssh/id_ed25519
|
||||||
IdentityFile %d/.ssh/id_rsa
|
# IdentityFile %d/.ssh/id_rsa
|
||||||
VisualHostKey yes
|
VisualHostKey yes
|
||||||
|
|
||||||
# Github SSH adapter for restricted networks
|
# Github SSH adapter for restricted networks
|
||||||
@ -12,7 +13,7 @@ Host github.com gist.github.com
|
|||||||
# This solves a VSCode bug
|
# This solves a VSCode bug
|
||||||
IdentityFile %d/.ssh/id_ed25519
|
IdentityFile %d/.ssh/id_ed25519
|
||||||
IdentityFile %d/.ssh/id_ed25519_sk_rk_yk20572395
|
IdentityFile %d/.ssh/id_ed25519_sk_rk_yk20572395
|
||||||
IdentityFile %d/.ssh/id_rsa
|
# IdentityFile %d/.ssh/id_rsa
|
||||||
|
|
||||||
# Home network
|
# Home network
|
||||||
Host unifi
|
Host unifi
|
||||||
|
@ -13,6 +13,7 @@ alias lsgrep="ls | grep"
|
|||||||
alias sheridan-rdp='firefox --new-window "ext+container:name=College&url=https://client.wvd.microsoft.com/arm/webclient/index.html"'
|
alias sheridan-rdp='firefox --new-window "ext+container:name=College&url=https://client.wvd.microsoft.com/arm/webclient/index.html"'
|
||||||
alias git-diff-nvim="git diff | nvim -R -d -c 'set filetype=diff' -"
|
alias git-diff-nvim="git diff | nvim -R -d -c 'set filetype=diff' -"
|
||||||
alias yk-totp="ykman oath accounts code"
|
alias yk-totp="ykman oath accounts code"
|
||||||
|
alias flush-dns-cache="sudo systemd-resolve --flush-caches"
|
||||||
|
|
||||||
# WHOIS macros
|
# WHOIS macros
|
||||||
alias whois-afrinic="whois -h whois.afrinic.net"
|
alias whois-afrinic="whois -h whois.afrinic.net"
|
||||||
@ -125,7 +126,8 @@ wg-restart() {
|
|||||||
if [ $# != 1 ]; then
|
if [ $# != 1 ]; then
|
||||||
echo "Usage: wg-restart <interface>"
|
echo "Usage: wg-restart <interface>"
|
||||||
else
|
else
|
||||||
wg-quick down $1 && wg-quick up $1
|
wg-quick down $1 || true;
|
||||||
|
wg-quick up $1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,3 +139,21 @@ wg-reload() {
|
|||||||
wg syncconf $1 <(wg-quick strip $1)
|
wg syncconf $1 <(wg-quick strip $1)
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Edit a wireguard config file
|
||||||
|
wg-edit() {
|
||||||
|
if [ $# != 1 ]; then
|
||||||
|
echo "Usage: wg-edit <interface>"
|
||||||
|
else
|
||||||
|
sudo nvim /etc/wireguard/$1.conf
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Print a wireguard config file
|
||||||
|
wg-cat() {
|
||||||
|
if [ $# != 1 ]; then
|
||||||
|
echo "Usage: wg-cat <interface>"
|
||||||
|
else
|
||||||
|
sudo cat /etc/wireguard/$1.conf
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user