Linux

Kommandos

Tastatur Layout laden
# https://wiki.archlinux.org/title/Linux_console/Keyboard_configuration
# find /usr/share/kbd/keymaps/ -type f -name "*search_term*"
loadkeys de-latin1-nodeadkeys
offene Ports mit Prozessen
ss -tulnp
zufällige Zeichenkette generieren
tr -dc A-Za-z0-9 </dev/urandom | head -c 8
Verzeichnis mit owner/group und permissions erstellen
install -d -o caddy -g caddy -m 0750 /var/log/caddy
Textzeile in mehrere Dateien einfügen
echo '/var/lib' | tee /etc/sv/caddy/envdir/{XDG_CONFIG_HOME,XDG_DATA_HOME} > /dev/null

nftables

reload
nft -f /etc/nftables.conf
sets
# nft list set [<family>] <table> <set>
nft list set ip crowdsec crowdsec-blacklists
nft add element crowdsec crowdsec-blacklists {1.2.3.4 timeout 30s}
chains
nft -n -a list chain inet filter input
nft add rule inet filter input position 8 tcp dport 65535 accept
redirect
table inet filter {
  chain input {
    type filter hook input priority 0;
    tcp dport 2222 ct status dnat accept
  }
}

table inet nat  {
  chain prerouting  {
    type nat hook prerouting priority dstnat; policy accept;
    tcp dport 22 redirect to :2222
  }
  chain postrouting {
    type nat hook postrouting priority 100; policy accept;
    oif eth0 masquerade persistent
  }
}
logging
tcp dport { 22, 65535 } log prefix "[nftables] SSH Accepted: " accept
tcp dport 2222 ct status dnat log prefix "[nftables] SSH dnat Accepted" accept

neovim

init.vim

systemd

DynamicUser

UIDs
61184-65519
RuntimeDirectory
/run (temp)
StateDirectory
/var/lib (pers)
LogsDirectory
/var/log (pers)
CacheDirectory
/var/cache (pers)

Distributionen

Referenzen