User Tools

Site Tools


distros:fedora_workstation_gnome

Table of Contents

Information

  • Fedora Workstation 1)
  • 28

Download

Workstation

Updated Live Images

Installation Notes

  • EFI/fedora/shimx64.efi 2)
  • Remove /home, set /boot and / to use XFS, expand /

Software Settings

Disable PackageKit

  • Package installations and upgrades are handled with dnf via command-line
  • This breaks GNOME Software Center
sudo systemctl mask 'packagekit' && sudo rm -Rf '/var/cache/PackageKit' && sudo pkill 'packagekitd' && sync

DNF Settings

  • Disables Delta RPMs
  • Downloads packages from fastest mirror
cat '/etc/dnf/dnf.conf' | grep -e 'deltarpm=false' -e 'fastestmirror=true' || echo -e "deltarpm=false\nfastestmirror=true" | sudo tee --append '/etc/dnf/dnf.conf' > '/dev/null' && cat '/etc/dnf/dnf.conf' | grep -e 'deltarpm=false' -e 'fastestmirror=true'

Repositories

RPM Fusion

Free

sudo rpm --import 'https://rpmfusion.org/keys?action=AttachFile&do=get&target=RPM-GPG-KEY-rpmfusion-free-fedora-28' && sync && sudo dnf install 'https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-28.noarch.rpm' -y

negativo17

Nvidia driver, CUDA tools and libraries

sudo rpm --import 'http://negativo17.org/repos/RPM-GPG-KEY-slaanesh'
sudo dnf config-manager --add-repo='http://negativo17.org/repos/fedora-nvidia.repo'

espionage724/wine Coprs

Software

Update

sudo dnf clean 'all' && sudo dnf distro-sync -y && sudo dnf autoremove -y && sync

GNU nano

  • Installs nano
  • Sets as system-wide default editor
  • Sets nowrap and nonewlines for current user
sudo dnf install 'nano' -y && export 'EDITOR=nano' && echo 'Defaults editor = /usr/bin/nano' | sudo tee '/etc/sudoers.d/nano' > '/dev/null' && sudo cat '/etc/sudoers.d/nano' && echo -e "set nowrap\nset nonewlines" | tee ~/'.nanorc' > '/dev/null' && cat ~/'.nanorc'

General

  • kernel-tools provides x86_energy_perf_policy
sudo dnf install filezilla keepassxc p7zip unar aria2 gimp transmission-gtk hdparm nano htop wget irqbalance kernel-tools

RPM Fusion

  • gstreamer1-libav and gstreamer1-plugins-ugly are needed to generate video thumbnails for more media
  • ffmpeg is for youtube-dl to correct DASH containers
mpv youtube-dl ffmpeg gstreamer1-libav gstreamer1-plugins-ugly

VA-API

gstreamer1-vaapi libva-utils
libva-intel-driver

Keybase

'https://prerelease.keybase.io/keybase_amd64.rpm'

Wine

  • libtxc_dxtn requires RPM Fusion repo
wine winetricks
libtxc_dxtn libtxc_dxtn.i686

Tor Browser

torbrowser-launcher

Google Chrome

sudo rpm --import 'https://dl-ssl.google.com/linux/linux_signing_key.pub' && sudo dnf install 'https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm'

Settings

Keyboard Shortcuts

  • gnome-shell --replace doesn't work on Wayland session
gnome-terminal
bash -c "secret-tool lookup 'keepass' 'default' | keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"
gnome-shell --replace
gnome-terminal --command "bash -c 'sudo dnf clean 'all' && sudo dnf distro-sync -y && sudo dnf autoremove -y && sync && read -n1'"

Keys

  • Listed respectively to above
  • Ctrl + Alt + T
  • Ctrl + Alt + Z
  • Ctrl + Alt + \
  • Pause or F7

gedit

  • 4 Tab width
  • Insert Spaces for Tab mode

Network

OpenNIC DNS

66.70.211.246,128.52.130.209,172.98.193.42,198.206.14.241
2607:5300:60:6d8d:207c::1,2001:470:1f06:10b::2,2a00:dcc0:dead:b242::42,2001:19f0:7402:d:5400:00ff:fe2a:7fb6

Nautilus

  • Sort folders before files
  • 2GB File Previews

Rhythmbox

Terminal

  • 10-notch Transparency

GRUB

Anaconda Blacklist

  • nouveau may get automatically blacklisted; check this file and comment it out if it is
ls '/etc/modprobe.d/anaconda-blacklist.conf' && cat '/etc/modprobe.d/anaconda-blacklist.conf'
sudo -e '/etc/modprobe.d/anaconda-blacklist.conf'

UEFI

sudo -e '/etc/default/grub' && sudo grub2-mkconfig -o '/boot/efi/EFI/fedora/grub.cfg'

Legacy

sudo -e '/etc/default/grub' && sudo grub2-mkconfig -o '/boot/grub2/grub.cfg'

GRUB

GRUB_TIMEOUT=1

iwlwifi

iwlwifi.11n_disable='8' iwlwifi.amsdu_size='3'

intel_iommu

intel_iommu='on'

blk_mq

scsi_mod.use_blk_mq='y' dm_mod.use_blk_mq='y'

PCI-E ASPM

  • pcie_aspm can be off if ASPM causes problems
pcie_aspm='force' pcie_aspm.policy='powersupersave'

Available PCIe ASPM Policies

cat '/sys/module/pcie_aspm/parameters/policy'

Intel HDA

snd_hda_intel.power_save='1' snd_hda_intel.enable_msi='1'

Reboot

  • Can be efi, pci, acpi, or TODO: Other stuff
  • efi is likely ok for platforms using UEFI
  • pci is likely ok for non-UEFI platforms
  • On Spinesnap, reboot=efi mostly fixes Ethernet not working after a reboot
reboot='efi'
reboot='pci'

Linux

acpi_osi='Linux'

i915

  • GuC firmware loading/submission requires PAVP to be enabled in BIOS
i915.enable_fbc='1' i915.fastboot='1' i915.enable_guc='3'

Spinesnap

  • enable_psr at 1 and 3 cause issues 3) 4)
i915.enable_psr='2'

radeon

  • If audio over HDMI or DisplayPort is wanted, set radeon.audio to 1
radeon.audio='0' radeon.deep_color='1'

Blacklist Watchdogs

  • iTCO_wdt controls watchdog on some Intel platforms
  • sp5100_tco controls watchdog on some AMD platforms
  • nowatchdog disables both soft and hard generic watchdogs
  • I don't use watchdog features and apparently this reduces power usage slightly
modprobe.blacklist='iTCO_wdt,sp5100_tco' nowatchdog

Backlight

  • This prevents systemd from restoring previous backlight value on reboot
  • This is necessary for Power Management
systemd.restore_state='0'

DRM Debug

  • This may make lower-end machines become very unresponsive; be prepared to have some safe way of rebooting
drm.debug='0xe'

GNOME

Disable Wayland

cat '/etc/gdm/custom.conf' | grep '#WaylandEnable' > '/dev/null' && sudo sed -i 's/'#WaylandEnable'/'WaylandEnable'/g' '/etc/gdm/custom.conf' && cat '/etc/gdm/custom.conf' | grep 'WaylandEnable'
sudo -e '/etc/gdm/custom.conf'

Root GUI Apps in Wayland

  • Run this before running GUI applications requiring root
  • This needs re-ran after session restart
xhost +LOCAL:

Settings

All-in-one

  • Last updated: 2018/06/10
gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'send-events' 'disabled-on-external-mouse' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'natural-scroll' 'false' && gsettings set 'org.gnome.desktop.peripherals.mouse' 'accel-profile' 'flat' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-and-drag' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'disable-while-typing' 'false' && gsettings set 'org.gnome.software' 'download-updates' 'false' && gsettings set 'org.gnome.desktop.peripherals.touchpad' 'click-method' 'areas' && gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true'

Individual

  • Last updated: 2018/06/10
gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'send-events' 'disabled-on-external-mouse'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'natural-scroll' 'false'
gsettings set 'org.gnome.desktop.peripherals.mouse' 'accel-profile' 'flat'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-to-click' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'tap-and-drag' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'disable-while-typing' 'false'
gsettings set 'org.gnome.software' 'download-updates' 'false'
gsettings set 'org.gnome.desktop.peripherals.touchpad' 'click-method' 'areas'
gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true'

Hostname

  • Change x to computer name
hostnamectl set-hostname 'x'

KeePassXC

Add Database Password to GNOME Keyring

secret-tool store --label='KeePass' 'keepass' 'default'

Kernel Options

  • Enables kernel.dmesg_restrict, kernel.kptr_restrict, and kernel.sysrq
  • Sets vm.swappiness to 10 and vm.vfs_cache_pressure to 50
echo -e "kernel.dmesg_restrict = 1\nkernel.kptr_restrict = 1\nkernel.sysrq = 1\nvm.swappiness = 10\nvm.vfs_cache_pressure = 50" | sudo tee '/etc/sysctl.d/99-custom.conf' > '/dev/null' && cat '/etc/sysctl.d/99-custom.conf'

mpv

VA-API Xorg

  • This sets hwdec and vo to vaapi, ao to pulse, and hwdec-codecs to all
mkdir -p ~/'.config/mpv' && echo -e "hwdec=vaapi\nhwdec-codecs=all\nvo=vaapi\nao=pulse" | tee ~/'.config/mpv/mpv.conf' > '/dev/null' && cat ~/'.config/mpv/mpv.conf'
vainfo | grep -e 'Driver version'

VA-API Wayland

  • This sets hwdec to vaapi, vo to gpu, ao to pulse, hwdec-codecs to all, and gpu-context to wayland
  • If using AMD, vaapi-copy may need to be used for hwdec instead
mkdir -p ~/'.config/mpv' && echo -e "hwdec=vaapi\nhwdec-codecs=all\nvo=gpu\nao=pulse\ngpu-context=wayland" | tee ~/'.config/mpv/mpv.conf' > '/dev/null' && cat ~/'.config/mpv/mpv.conf'
vainfo | grep -e 'Driver version'

NetworkManager

  • wifi.powersave can be 2 for disabled, or 3 for enabled
sudo -e '/etc/NetworkManager/conf.d/99-custom.conf'
[device-mac-randomization]
wifi.scan-rand-mac-address=yes

[connection-mac-randomization]
ethernet.cloned-mac-address=random
wifi.cloned-mac-address=random

[connection]
wifi.powersave=2

Laptop Power Management

Notes

  • This expects a laptop with a battery
  • Do not use this for desktops

Testing

  • The following commands can be ran to see if they work on specific hardware
watch -n 0.1 grep \'cpu MHz\' '/proc/cpuinfo'
sudo x86_energy_perf_policy --all 'performance' --turbo-enable '1' --force
sudo x86_energy_perf_policy --all 'power' --turbo-enable '0' --force

Scripts

AC

  • Change the backlight sysfs as-needed (see backlight notes) or remove altogether
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/ac-power.sh' && sudo chmod +x '/etc/udev/scripts.d/ac-power.sh'
#!/usr/bin/bash
# AC
echo "$(cat '/sys/class/backlight/'*'/max_brightness')" | tee '/sys/class/backlight/'*'/brightness' > '/dev/null'
x86_energy_perf_policy --all 'balance-performance' --turbo-enable '1' --force

Battery

  • Change the backlight sysfs as-needed (see backlight notes) or remove altogether
  • Spinesnap's lowest visible brightness is 1
sudo mkdir -p '/etc/udev/scripts.d' && sudo -e '/etc/udev/scripts.d/battery-power.sh' && sudo chmod +x '/etc/udev/scripts.d/battery-power.sh'
#!/usr/bin/bash
# Battery
echo '376' | tee '/sys/class/backlight/'*'/brightness' > '/dev/null'
x86_energy_perf_policy --all 'balance-power' --turbo-enable '0' --force

udev Rule

  • Requires the above AC and Battery scripts
sudo -e '/etc/udev/rules.d/99-power.rules' && sudo udevadm control --reload
SUBSYSTEM=="power_supply", ATTR{online}=="1", RUN+="/etc/udev/scripts.d/ac-power.sh"
SUBSYSTEM=="power_supply", ATTR{online}=="0", RUN+="/etc/udev/scripts.d/battery-power.sh"

PulseAudio

Resampling

  • Sets resample-method to soxr-vhq for current user
echo 'resample-method = soxr-vhq' | tee ~/'.config/pulse/daemon.conf' > '/dev/null' && cat ~/'.config/pulse/daemon.conf' | grep -e 'resample-method = soxr-vhq'

Secure Shell

systemd

  • Max log file sizes of 50MB
sudo mkdir -p '/etc/systemd/journald.conf.d' && echo -e "[Journal]\nSystemMaxUse=50M\nRuntimeMaxUse=50M" | sudo tee '/etc/systemd/journald.conf.d/logging.conf' > '/dev/null' && cat '/etc/systemd/journald.conf.d/logging.conf'

TRIM

Swap

  • Add discard after defaults for the swap mountpoint 5)
sudo -e '/etc/fstab'
,discard

Service

sudo systemctl enable 'fstrim.timer' --now && sudo systemctl start 'fstrim' && sync && sudo systemctl status 'fstrim' -l

Environment Variables

Timezone

echo 'export TZ=:/etc/localtime' | sudo tee '/etc/profile.d/tz.sh' > '/dev/null' && cat '/etc/profile.d/tz.sh' | grep -e 'export TZ=:/etc/localtime'

Wine Staging

echo -e "export STAGING_SHARED_MEMORY=1\nexport STAGING_WRITECOPY=1\nexport STAGING_RT_PRIORITY_SERVER=90" | sudo tee '/etc/profile.d/wine-staging.sh' > '/dev/null' && cat '/etc/profile.d/wine-staging.sh'

Realtime Priority Permissions

  • For Wine to be able to use the STAGING_RT_PRIORITY_SERVER environment variable
  • Allows rtprio up to 90 and nice up to 10
  • May also allow Realtime priorities to be used with other applications
  • NOTE: This makes an assumption that the current user is in a group with the same name; this is default behavior on Fedora 7)
echo -e "@CHANGEME - rtprio 90\n@CHANGEME - nice -10" | sudo tee '/etc/security/limits.d/99-custom.conf' > '/dev/null' && sudo sed -i 's/'CHANGEME'/'$USER'/g' '/etc/security/limits.d/99-custom.conf' && cat '/etc/security/limits.d/99-custom.conf'

Computer-specific

Graphics xorg.conf

intel

sudo dnf install 'xorg-x11-drv-intel' -y && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "Device"
    Identifier  "Intel iGPU"
    Driver      "intel"
    Option      "DRI"           "3"
    Option      "TearFree"      "1"
EndSection

radeon

  • Expects pre-SI GPUs 8)
  • For SI, CIK, and newer GPUs, use amdgpu, along with enabling si_support and cik_support respectively for the amdgpu kernel module 9)
sudo dnf install 'xorg-x11-drv-ati' -y && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "Device"
    Identifier  "AMD GPU"
    Driver      "radeon"
    Option      "AccelMethod"   "EXA"
    Option      "DRI"           "3"
    Option      "TearFree"      "0"
EndSection

Other

  • If using Optimus or some other multi-GPU set-up, add the BusID option
    BusID      "PCI:0:2:0"

Spinesnap

Touchscreen

Firefox

echo -e "export MOZ_USE_XINPUT2=1" | sudo tee '/etc/profile.d/firefox.sh' > '/dev/null' && cat '/etc/profile.d/firefox.sh'

Update

mkdir -p ~/'.local/share/applications/utilities' && nano ~/'.local/share/applications/utilities/system-update.desktop'
[Desktop Entry]
Name=System Update
Comment=System Update
Exec=gnome-terminal --command "bash -c 'sudo dnf clean 'all' && sudo dnf distro-sync -y && sudo dnf autoremove -y && sync && read -n1'"
Type=Application
StartupNotify=true
Icon=system-run

KeePassXC

mkdir -p ~/'.local/share/applications/utilities' && nano ~/'.local/share/applications/utilities/keepassxc-shortcut.desktop'
[Desktop Entry]
Name=KeePassXC Shortcut
Comment=Shortcut to open KeePass database with KeePassXC
Exec=bash -c "secret-tool lookup 'keepass' 'default' | keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"
Type=Application
StartupNotify=true
Icon=keepassxc

Nightwane

Full RGB over HDMI

  • Applies to intel on Xorg session
  • This does not work on Wayland session
mkdir -p ~/'.config/autostart' && nano ~/'.config/autostart/intel-full-rgb.desktop'
[Desktop Entry]
Type=Application
Name=Intel Full RGB
Comment=Set Broadcast RGB to Full on HDMI1 on Intel
Exec=xrandr --output 'HDMI1' --set 'Broadcast RGB' 'Full'
Terminal=false

Disable Audio over HDMI

  • Applies to intel on Xorg session
  • This does not work on Wayland session
mkdir -p ~/'.config/autostart' && nano ~/'.config/autostart/intel-audio-disable.desktop'
[Desktop Entry]
Type=Application
Name=Intel Audio Disable
Comment=Set audio to off on HDMI1 on Intel
Exec=xrandr --output 'HDMI1' --set 'audio' 'off'
Terminal=false

Mozilla Firefox

  • Use Disconnect.me strict protection Block List

YouTube HTML5

Settings

Default Profile

rm -fv '/tmp/profiles.ini' && nano '/tmp/profiles.ini' && sed -i 's/'CHANGEME'/'$USER'/g' '/tmp/profiles.ini'
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=1
Path=CHANGEME
Default=1

user.js

  • Last updated: 2018/05/07
rm -fv '/tmp/user.js' && nano '/tmp/user.js'
/******************************************************************************
 * SECTION: Custom Stuff                                                      *
 ******************************************************************************/

user_pref("mousewheel.min_line_scroll_amount", 40);
user_pref("browser.sessionstore.interval", 300000);
user_pref("extensions.pocket.enabled", false);
user_pref("reader.parse-on-load.enabled", false);
user_pref("privacy.popups.disable_from_plugins", 3);
user_pref("network.http.referer.userControlPolicy", 2);
user_pref("extensions.screenshots.system-disabled", true);
user_pref("media.autoplay.enabled", false);
user_pref("browser.tabs.drawInTitlebar", true);
user_pref("accessibility.force_disabled", 1);

/******************************************************************************
 * SECTION: GPU Acceleration                                                  *
 ******************************************************************************/

user_pref("layout.frame_rate.precise", true);
user_pref("gfx.canvas.azure.accelerated", true);
user_pref("layers.acceleration.force-enabled", true);
user_pref("browser.tabs.remote.autostart", true);
user_pref("browser.tabs.remote.force-enable", true);
user_pref("layout.css.servo.chrome.enabled", true);
user_pref("layers.omtp.enabled", true);

/******************************************************************************
 * SECTION: Privacy Settings Overrides                                        *
 ******************************************************************************/

user_pref("dom.storage.enabled",true);

/******************************************************************************
 * END                                                                        *
 ******************************************************************************/

Apply Settings

  • Path should report the current user's username, and the text Custom user.js file is present should be visible
pkill 'firefox' && rm -Rfv ~/'.mozilla' && sync && mkdir -p ~/'.mozilla/firefox/'$USER && mv '/tmp/profiles.ini' ~/'.mozilla/firefox/profiles.ini' && mv '/tmp/user.js' ~/'.mozilla/firefox/'$USER'/user.js' && sync && cat ~/'.mozilla/firefox/profiles.ini' | grep $USER && cat ~/'.mozilla/firefox/'$USER'/user.js' | grep 'user.js'

Extensions

Download

  • 7 extensions
gio open 'https://addons.mozilla.org/en-US/firefox/addon/privacy-settings/versions' && gio open 'https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/versions' && gio open 'https://www.eff.org/https-everywhere' && gio open 'https://www.eff.org/privacybadger' && gio open 'https://addons.mozilla.org/en-US/firefox/addon/cookie-autodelete/versions' && gio open 'https://addons.mozilla.org/en-US/firefox/addon/ublock-origin/versions' && gio open 'https://addons.mozilla.org/en-US/firefox/addon/canvasblocker/versions'

uBlock Origin

  • Enable Advanced Mode
  • Uncheck EasyPrivacy
  • Uncheck EasyList
  • Check MVPS HOSTS
  • Check hpHost's Ad and tracking servers
  • Check Dan Pollock's hosts file

Custom 3rd-party filters

  • Last updated: 2018/02/07 10)
https://secure.fanboy.co.nz/fanboy-problematic-sites.txt
https://secure.fanboy.co.nz/r/fanboy-ultimate.txt
https://secure.fanboy.co.nz/fanboy-antifacebook.txt
https://secure.fanboy.co.nz/fanboy-antifonts.txt
https://raw.githubusercontent.com/ryanbr/fanboy-adblock/master/fanboy-cookiemonster.txt
https://raw.githubusercontent.com/ryanbr/fanboy-adblock/master/popads-domains-list.txt
https://raw.githubusercontent.com/ryanbr/fanboy-adblock/master/fake-news.txt
https://raw.githubusercontent.com/ryanbr/fanboy-adblock/master/enhancedstats-addon.txt

Notable Folders and Commands

Extract ISO

  • D is the destination you want the extracted files to go
  • x is the ISO you want to extract files from
  • No space after the -o flag is intentional
  • This is primarily useful for copying Windows ISO images to a FAT32 flash drive
7z x -o'D' -y x

youtube-dl

Show Formats

  • Change x to a URL
youtube-dl -F x

Download Audio-only

  • Download the m4a audio only format shown from the above command
  • The format code is likely 140
  • Change x to a URL
youtube-dl -f 140 x

Shortcuts

/usr/share/applications
~/.local/share/applications

Icons

/usr/share/icons/hicolor
~/.local/share/icons/hicolor

Anaconda Module Blacklists

sudo -e '/etc/modprobe.d/anaconda-blacklist.conf'

YUM/DNF Repos

gio open '/etc/yum.repos.d'

DNF History

Transaction IDs

sudo dnf history

Undo

  • Change x to a transaction ID found above
sudo dnf history undo x

GPG Keys

Check Keys

rpm -q gpg-pubkey --qf '%{NAME}-%{VERSION}-%{RELEASE}\t%{SUMMARY}\n'

Remove Keys

sudo rpm -e x

Re-generate Thumbnails

rm -Rf ~/'.cache/thumbnails'

List GNOME gsettings

  • Change x to schema or omit it to show all settings
gsettings list-recursively 'x'

GNOME Software Maintenance

pkcon -c '1' refresh && pkcon update

fstrim

sudo fstrim -v --all

SELinux Re-label

sudo touch '/.autorelabel'

Xorg Debug

journalctl -e _COMM='gdm-x-session'
gio open ~/'.local/share/xorg/Xorg.1.log'

Verify DRI3

LIBGL_DEBUG='verbose' glxinfo | grep 'libgl'

Show CPU Frequency

grep 'MHz' '/proc/cpuinfo'
watch -n 0.1 grep \'cpu MHz\' '/proc/cpuinfo'

Partition Information

df -hT

Encryption Information

sudo cryptsetup -v status '/dev/dm-0'

hdparm Secure Erase

  • All hdparm commands below assume actions to be performed on /dev/sda
sudo dnf install 'hdparm' -y && sync
sudo hdparm -I '/dev/sda'
sudo systemctl suspend
sudo hdparm --user-master u --security-set-pass 'x' '/dev/sda' && sudo hdparm --user-master u --security-erase 'x' '/dev/sda' && sync
sudo hdparm --user-master u --security-set-pass 'x' '/dev/sda' && sudo hdparm --user-master u --security-erase-enhanced 'x' '/dev/sda' && sync

Quick-command

  • Performs both security-erase and security-erase-enhanced on /dev/sda
sudo hdparm --user-master u --security-set-pass 'x' '/dev/sda' && sudo hdparm --user-master u --security-erase 'x' '/dev/sda' && sudo hdparm --user-master u --security-set-pass 'x' '/dev/sda' && sudo hdparm --user-master u --security-erase-enhanced 'x' '/dev/sda' && sync

NVMe Erase

  • NVMe Erase from the start page lands here and I usually use a Ubuntu LiveUSB to do this, hence the apt command
sudo apt install 'nvme-cli' -y && sync
sudo dnf install 'nvme-cli' -y && sync
sudo nvme format '/dev/nvme0' --reset --ses='1' --pil='0' --pi='0' --ms='0' && sync

Clean EFI Variables

  • This works fine on a few Acer and Dell laptops, but could potentially cause a brick with bad platform implementations, use at own risk
  • Safer way is to use efibootmgr to remove boot entries
sudo rm -f '/sys/firmware/efi/efivars/'* || sync && sudo efibootmgr -v

RAID

Controller Details

sudo mdadm --detail-platform

Create Software RAID

  • Came from old notes; I assume this worked at some point, but in any case, the syntax looks nice :p
sudo mdadm --create '/dev/md0' --name='RAID' --level='0' --raid-devices='3' '/dev/sda' '/dev/sdb' '/dev/sdc' --verbose

VGA Switcheroo Power States

sudo cat '/sys/kernel/debug/vgaswitcheroo/switch'

Backlight

Notes

  • The following commands with an asterisk expect only one backlight controller at /sys/class/backlight
  • This was only tested on one laptop with intel_backlight
  • See Power Management notes on how to add backlight changes to a udev script
  • See backlight for more details

Controller Name

ls '/sys/class/backlight'

Query Current Brightness

cat '/sys/class/backlight/'*'/brightness'

Query Max Brightness

cat '/sys/class/backlight/'*'/max_brightness'

Set Custom Brightness

  • Change 376 to desired brightness
  • Desired brightness must be under max_brightness value
echo "376" | sudo tee '/sys/class/backlight/'*'/brightness' > '/dev/null'

Set Max Brightness

echo "$(cat '/sys/class/backlight/'*'/max_brightness')" | sudo tee '/sys/class/backlight/'*'/brightness' > '/dev/null'

Intel GuC Firmware

sudo cat '/sys/kernel/debug/dri/0/i915_guc_info'
sudo cat '/sys/kernel/debug/dri/0/i915_guc_load_status'

Hyper-threading Information

grep -e "processor" -e "core id" -e "^$" /proc/cpuinfo

Optimal GCC compiler flags

gcc -v -E -x c -march=native -mtune=native - < /dev/null 2>&1 | grep cc1 | perl -pe 's/ -mno-\S+//g; s/^.* - //g;'

Privacy

Clear Terminal History

history -cw

Create 7z Password Archive

  • Change x in x.7z to the desired archive name
  • Change CHANGEME in -pCHANGEME to the desired password
7za a 'x.7z' -p'CHANGEME'

oathtool

  • x is a secret without &digits=6
sudo dnf install 'oathtool'
oathtool --totp -b 'x'

Remove EXIF data

sudo dnf install 'perl-Image-ExifTool'
exiftool -all= *.* -overwrite_original
2)
EFI file to boot and in the case of (quirky) InsydeH2O UEFI implementations, add to SecureBoot trust; doesn't matter if SecureBoot is enabled or not
3)
Suspend → Wake → Wait a little bit; dmesg reports potential broken atomic stuff
4)
2 is verified working from /sys/kernel/debug/dri/0/i915_edp_psr_status
5)
defaults,discard
6)
verify with wine --version
7)
in the event this fails to work, run groups to see what groups the user is a part of and pick one; likely can use wheel
8)
HD6000 series and lower, and non-SI HD7000 series
9)
see modinfo -p amdgpu
10)
not really, but need some kind of date reference
distros/fedora_workstation_gnome.txt · Last modified: 2018/06/10 21:31 by Sean Rhone