Fedora 33: font rendering

Packages from this repository improve font rendering in fedora a lot:

sudo dnf copr enable dawid/better_fonts -y
sudo dnf install fontconfig-font-replacements fontconfig-enhanced-defaults levien-inconsolata-fonts -y
gsettings set org.gnome.desktop.interface document-font-name "Cantarell 11"
gsettings set org.gnome.desktop.interface font-name "Cantarell 11"
gsettings set org.gnome.desktop.interface monospace-font-name "Inconsolata 13"
| 30 Dec 2020

i5-9400H CPU benchmark

CPU benchmark from Dell Precision 5540 i5-9400H

$ sysbench cpu run --time=5
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:  1352.90

General statistics:
    total time:                          5.0007s
    total number of events:              6767

Latency (ms):
         min:                                    0.70
         avg:                                    0.74
         max:                                    1.59
         95th percentile:                        0.77
         sum:                                 4999.03

Threads fairness:
    events (avg/stddev):           6767.0000/0.00
    execution time (avg/stddev):   4.9990/0.00


| 29 Dec 2020

i3-8100T CPU benchmark

CPU benchmark from Dell Optiplex 3060 micro i3-8100T

$ sysbench cpu run --time=5
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)

Running the test with following options:
Number of threads: 1
Initializing random number generator from current time


Prime numbers limit: 10000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:  1029.12

General statistics:
    total time:                          5.0007s
    total number of events:              5148

Latency (ms):
         min:                                    0.97
         avg:                                    0.97
         max:                                    1.11
         95th percentile:                        0.97
         sum:                                 4999.22

Threads fairness:
    events (avg/stddev):           5148.0000/0.00
    execution time (avg/stddev):   4.9992/0.00

| 29 Dec 2020

Log denied connections in firewalld

Edit file /etc/sysconfig/firewalld:

FIREWALLD_ARGS=--debug=10
| 1 Jan 2020

Debug route table

List all routes in system:

route -n

Get route for a specific IP:

ip route get 1.1.1.1
| 1 Jan 2020

Run command on suspend

Create a file located in /usr/lib/systemd/system-sleep directory:

#!/bin/sh
if [ "${1}" == "pre" ]; then
  nordvpn d
elif [ "${1}" == "post" ]; then
  echo "Hello"
fi
| 1 Jan 2020

Log executed command

14:27 $ (set -x; sleep 1 && sleep 2)
+ sleep 1
+ sleep 2
| 1 Jan 2020

Wait until able to connect

while ! nc -w5 -z 10.0.0.100 22; do echo "hello"; done
| 1 Jan 2020

Dell Precision 5540 - Battery drains in sleep mode

Run the following command to check the suspend mode:

cat /sys/power/mem_sleep

If the output looks like this:

[s2idle] deep

It means that very inefficient suspend mode is active (drains battery from 100% to 0 in 9 hours). To enable “deep” mode, edit file /etc/default/grub and append mem_sleep_default=deep to GRUB_CMDLINE_LINUX:

GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=fedora/root rd.lvm.lv=fedora/swap rhgb quiet mem_sleep_default=deep"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true

Apply changes:

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Restart your laptop and verify changes:

$ cat /sys/power/mem_sleep
s2idle [deep]
| 1 Jan 2020

fedora: Lockdown a kernel version

Fedora typically keeps 3 latest kernel versions. However, what if you want to keep an old specific kernel version which is known to work well with your system? First, we need to install a dnf plugin that allows us to keep a specific version of any package:

sudo dnf install python3-dnf-plugins-extras-versionlock

Lets find all available kernel versions for your system:

sudo dnf list kernel --showduplicates

Install that specific version of the kernel:

sudo dnf install kernel-5.3.7-301.fc31

And lock it:

sudo dnf versionlock add kernel-5.3.7-301.fc31

To remove the lock:

sudo dnf versionlock delete kernel-5.3.7-301.fc31
| 1 Jan 2020