This is a collection of various Linux system tweaks I've accumulated over the years.
Freetype, since version 2.7 in 2016, enables the v40 interpreter by default, which does less hinting. While more accurate, fonts no longer snap to the pixel grid and appear smudgy. We can enable the old interpreter that has sharper font rendering by using the FREETYPE_PROPERTIES environment variable. Put this in a .sh script within /etc/profile.d to enable globally
export FREETYPE_PROPERTIES="truetype:interpreter-version=35"
The DejaVu and Ubuntu fonts work very well with this setting and are a good choice for your GUI.
By default, Linux gives memory to processes much like how a bank gives money. Processes can ask for as much memory as they could ever dream of, and Linux will happily tell them that the memory is available for use, even if it ends up exceeding the total virtual memory (physical RAM and swap) in the system. When enough processes try to do this, the system grinds to a halt becoming completely unresponsive for several minutes until the OOM killer kills the process that is hogging memory. So, instead of malloc
failing when not enough memory is available, it will always succeed, and your process will get killed at some arbitrary, inconvenient time. To prevent this and use the sane behavior where memory allocations can fail, add these two lines to /etc/sysctl.conf
vm.overcommit_memory = 2
vm.overcommit_ratio = 100
You will often come across some piece of software that isn't available in your distro's package manager and must be installed from source. /usr/local is a common place to install such software, but I personally install such programs to the ~/.local directory and add export PATH="$HOME/.local/bin:$PATH"
to my .bashrc file. Installing software here does not require root and will never mess up packages installed through your package manager.
lsof -p PID
or
lsof -p $(pgrep PROCESS_NAME)