Disable CPU mitigations on Linux Mint

To disable mitigations on Linux Mint, you need to edit the GRUB configuration file and add a kernel parameter. Here are the steps to do that:

  1. Open Terminal: You can open the terminal by searching for it in the application menu or by pressing Ctrl + Alt + T.
  2. Edit GRUB Configuration:
    sudo nano /etc/default/grub
    
  3. Modify the GRUB_CMDLINE_LINUX_DEFAULT Line: Find the line that starts with GRUB_CMDLINE_LINUX_DEFAULT. It usually looks something like this:
    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    

    Add mitigations=off to this line. After editing, it should look like this:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash mitigations=off"
    
  4. Update GRUB: Save the file and exit the editor (in nano, you can do this by pressing Ctrl + X, then Y, and Enter). Then update GRUB with the following command:
    sudo update-grub
    
  5. Reboot: Reboot your system for the changes to take effect:
    sudo reboot
    

After rebooting, the mitigations should be disabled. You can verify this by checking the kernel command line:

cat /proc/cmdline

You should see mitigations=off in the output.

Optimize Intel WiFi Driver Settings in Linux

# Disable 802.11n to potentially improve stability
options iwlwifi 11n_disable=1

# Disable hardware encryption to offload encryption to the CPU
options iwlwifi swcrypto=0

# Disable Bluetooth coexistence to potentially improve WiFi performance
options iwlwifi bt_coex_active=0

# Disable power saving features to improve performance at the cost of higher power consumption
options iwlwifi power_save=0

# Disable Unscheduled Automatic Power Save Delivery (U-APSD)
options iwlwifi uapsd_disable=1

# Set power scheme to maximum performance
options iwlmvm power_scheme=1

# Enable antenna aggregation to potentially improve WiFi performance
options iwlwifi 11n_disable=8

To apply these settings, you would typically place them in a configuration file under /etc/modprobe.d/. For example, you could create a file called iwlwifi.conf:

sudo nano /etc/modprobe.d/iwlwifi.conf

Then, paste the configuration options into this file and save it.

Finally, to apply these changes, you will need to reload the iwlwifi module:

sudo modprobe -r iwlwifi
sudo modprobe iwlwifi

Or, you can simply reboot your system for the changes to take effect.

Set Battery Charge Limit in Ubuntu

ls /sys/class/power_supply/
ls /sys/class/power_supply/BAT0
sudo sh -c "echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold"
cat /sys/class/power_supply/BAT0/status

Create Battery Charge Threshold Service

sudo nano /etc/systemd/system/battery-charge-end-threshold.service
[Unit]
Description=Set Battery Charge Maximum Limit
After=multi-user.target
StartLimitBurst=0

[Service]
Type=oneshot
Restart=on-failure
ExecStart=/bin/bash -c 'echo 60 > /sys/class/power_supply/BAT0/charge_control_end_threshold'

[Install]
WantedBy=multi-user.target
sudo systemctl enable battery-charge-end-threshold.service
sudo systemctl daemon-reload
sudo systemctl start battery-charge-end-threshold.service

References
https://ubuntuhandbook.org/index.php/2024/02/limit-battery-charge-ubuntu/

Fedora 40 Post Install

Making dnf a little faster

sudo nano /etc/dnf/dnf.conf
max_parallel_downloads=8

Firmware

sudo fwupdmgr get-devices 
sudo fwupdmgr refresh --force 
sudo fwupdmgr get-updates 
sudo fwupdmgr update

Media Codecs

sudo dnf groupupdate 'core' 'multimedia' 'sound-and-video' --setopt='install_weak_deps=False' --exclude='PackageKit-gstreamer-plugin' --allowerasing && sync
sudo dnf swap 'ffmpeg-free' 'ffmpeg' --allowerasing
sudo dnf install gstreamer1-plugins-{bad-\*,good-\*,base} gstreamer1-plugin-openh264 gstreamer1-libav --exclude=gstreamer1-plugins-bad-free-devel ffmpeg gstreamer-ffmpeg
sudo dnf install lame\* --exclude=lame-devel
sudo dnf group upgrade --with-optional Multimedia

H/W Video Acceleration

sudo dnf install ffmpeg ffmpeg-libs libva libva-utils
sudo dnf swap libva-intel-media-driver intel-media-driver --allowerasing

Set Hostname

hostnamectl set-hostname YOUR_HOSTNAME

Disable Mitigations

sudo grubby --update-kernel=ALL --args="mitigations=off"

Modern Standby

sudo grubby --update-kernel=ALL --args="mem_sleep_default=s2idle"

Enable nvidia-modeset

sudo grubby --update-kernel=ALL --args="nvidia-drm.modeset=1"

Disable NetworkManager-wait-online.service

sudo systemctl disable NetworkManager-wait-online.service

Disable SELinux

sudo grubby --update-kernel ALL --args selinux=0
sudo nano /etc/selinux/config
SELINUX=disabled

References
https://github.com/devangshekhawat/Fedora-40-Post-Install-Guide