Log executed command
14:27 $ (set -x; sleep 1 && sleep 2)
+ sleep 1
+ sleep 2
14:27 $ (set -x; sleep 1 && sleep 2)
+ sleep 1
+ sleep 2
while ! nc -w5 -z 10.0.0.100 22; do echo "hello"; done
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]
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
To check:
[root@lxd-node3 ~]# netstat -i
Kernel Interface table
Iface MTU RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
ens10 1450 455 0 0 0 671 0 0 0 BMRU
eth0 1500 28 0 0 0 32 0 0 0 BMRU
lo 65536 0 0 0 0 0 0 0 0 LRU
Modify temporarily:
ifconfig eth0 mtu 1450
Permanently: edit /etc/sysconfig/network-scripts/ifcfg-eth0 file and add:
MTU=1450
Might be the reason why the system can establish HTTP connection but HTTPS
List used wifi frequencies
sudo iwlist wlp1s0 scan | grep Frequency | sort | uniq -c | sort -n
List available channels
iwlist channel
List wifi networks
nmcli d wifi
Fedora 31 has started to use cgroups v2 by default. According to Common F31 bugs it doesn’t play nice with Docker, lxd and others. To make fedora switch back to the old cgroups:
sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"
To check what command is assigned to the alias use type command:
$ type gl
gl is aliased to `git log --oneline`
One liner to monitor a process with the name /wshub:
top -p "$(pgrep -f /wshub)"