POSTS
Linux Tips
This page may be updated with more tips in the future. It's mostly a skeleton for now.
Audio/Sound
Where does WirePlumber store application-specific volume levels?
They're in ~/.local/state/wireplumber/restore-stream
.
Text
Common (GUI) text editor shortcuts
- Left/Right: Previous/next character
- Ctrl+Left/Right: Previous/next word
- Up/Down: Previous/next line
- Home/End: Start/end of current line
- Ctrl+Home/End: Start/end of the whole text
- Shift+(any key that moves the cursor): Select text between the current and new cursor positions
Network
netstat
/ss
-ntuap
to show all TCP and UDP connections with process names. ss -ntuapl
to show listening connections only.
DNS
You can change your system's DNS server by editing resolvconf.conf and running resolvconf -u, but editing resolv.conf directly and removing resolvconf(the software that is called "resolvconf", not the resolv.conf file. Confusing.) is much easier.
Shell
In Bash, ${<variable name>%.*}
strips the extension from filenames. For example:
for i in *.png *.jpg; do cjxl -d 0 "$i" /dev/shm/"${i%.*}".jxl; done
transcodes all .png and .jpg files in the current directory into jxl and saves them in /dev/shm
.
GNU Parallel
Using the parallel command:
parallel cjxl -d 0 "{}" /dev/shm/"{.}".jxl ::: *.png *.jpg
does the same thing. {}
is the input filename. {.}
is the input filename without the extension.
Recommendations
Utilities
- Disk IO monitoring:
iotop
- CPU monitoring:
htop
- GPU monitoring:
nvtop
OOM
Consider using earlyoom
to prevent the whole system becoming unresponsive in OOM situations.
Config example(/etc/default/earlyoom
):
EARLYOOM_ARGS="-r 0 -m 2 -s 50 --avoid '(^|/)(init|systemd|Xorg|sshd|plasmashell)$'"