User Tools

Site Tools


distros:ubuntu_desktop

This is an old revision of the document!


Table of Contents

Information

  • Ubuntu 1)
  • 19.10

Known Issues

  • None

Download

Installation Notes

  • EFI/ubuntu/shimx64.efi 2)
  • Minimal installation

HOSTS

sudo wget -O '/etc/hosts' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sync
cat '/etc/hosts' | grep 'Date:'
sudo -e '/etc/hosts'

Repositories

ckb-next

sudo add-apt-repository 'ppa:tatokis/ckb-next'

padoka PPA

  • Unstable/bleeding-edge PPA
sudo add-apt-repository 'ppa:paulo-miguel-dias/mesa' -y

Wine

  • :!: TODO: Update for 19.10
wget -O '/tmp/winehq-gpg.key' 'https://dl.winehq.org/wine-builds/Release.key' && sudo apt-key add '/tmp/winehq-gpg.key' && echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main' | sudo tee '/etc/apt/sources.list.d/winehq.list' > '/dev/null' && cat '/etc/apt/sources.list.d/winehq.list' && rm -f '/tmp/winehq-gpg.key' && sync

Lutris

  • :!: TODO: Update for 19.10
wget -O '/tmp/lutris-gpg.key' 'http://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04/Release.key' && sudo apt-key add '/tmp/lutris-gpg.key' && echo 'deb http://download.opensuse.org/repositories/home:/strycore/xUbuntu_18.04/ ./' | sudo tee '/etc/apt/sources.list.d/lutris.list' > '/dev/null' && cat '/etc/apt/sources.list.d/lutris.list' && rm -f '/tmp/lutris-gpg.key' && sync

Software

Update

System

sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean && sync

Firmware

sudo fwupdmgr refresh && sudo fwupdmgr update --verbose

Snaps

sudo snap refresh

General

sudo apt install evolution filezilla gimp keepassxc mpv transmission-gtk aria2 htop unar p7zip-full mesa-utils ffmpeg libsecret-tools libreoffice rhythmbox

wl

  • For a MacBook Pro with BCM4360 wireless
bcmwl-kernel-source

OpenVPN

network-manager-openvpn-gnome

VA-API

gstreamer1.0-vaapi
i965-va-driver

ckb-next

ckb-next

Keybase

wget -O '/tmp/keybase_amd64.deb' 'https://prerelease.keybase.io/keybase_amd64.deb' && sudo dpkg --install '/tmp/keybase_amd64.deb' && sudo apt install -f && rm '/tmp/keybase_amd64.deb' && sync && run_keybase

Wine

winetricks exe-thumbnailer winbind
winehq-staging
wine-d3d9-staging

Lutris

  • Even if using Lutris's Wine runners, Wine Staging should be installed system-wide in order to satisfy dependencies
winehq-staging lutris

Tor Browser

torbrowser-launcher

Google Chrome

wget -O '/tmp/google-chrome-stable_current_amd64.deb' 'https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb' && sudo dpkg --install '/tmp/google-chrome-stable_current_amd64.deb' || sudo apt install -f && rm '/tmp/google-chrome-stable_current_amd64.deb' && sync

Settings

Keyboard Shortcuts

bash -c "secret-tool lookup 'keepass' 'default' | keepassxc --pw-stdin ~/'Documents/keepass.kdbx'"
gnome-terminal --command "sudo sh -c 'apt update && apt full-upgrade -y && apt clean && apt autoremove -y && sync && fwupdmgr refresh && fwupdmgr update --verbose && snap refresh && rm -Rfv '/usr/lib/firefox/browser/features' '/home/'*'/.mozilla/firefox/'*'/features' && wget -O '/etc/hosts' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sync && fstrim --all --verbose && sync && sleep '2''"

Keys

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

Printer

  • :!: TODO: All 4 of the 8710 models have the same exact name…
  • Output Mode: Black Only Grayscale
  • Print Quality: High-Resolution Photo
  • Administration → Set As Server Default
socket://192.168.1.164:9100

gedit

  • 4 Tab width
  • Insert Spaces for Tab mode

Network

DNS

UncensoredDNS

89.233.43.71,91.239.100.100
2a01:3a0:53:53::,2001:67c:28a4::

OpenNIC Anycast

185.121.177.177,169.239.202.202
2a05:dfc7:5::53,2a05:dfc7:5::5353

VPN.AC

  • See VPN.AC
  • :!: If using this VPN, disable IPv6 from NetworkManager

Nautilus

  • Sort folders before files
  • 4096 MB File Previews

Rhythmbox

Terminal

  • 10-notch Transparency

Transmission

  • Blocklist
http://john.bitsurge.net/public/biglist.p2p.gz

GRUB

sudo -e '/etc/default/grub' && sudo update-grub

Old Parameters

GRUB

GRUB_TIMEOUT=1

AIO

Spinesnap

  • Last updated: 2019/10/22
i915.enable_fbc=1 i915.fastboot=1 pci=nocrs,pcie_bus_perf

i915

i915.enable_fbc=1 i915.fastboot=1
i915.enable_psr=1

amdgpu

  • Allows use of Overdrive options for overclocking
amdgpu.ppfeaturemask=0xffffffff

Test

amdgpu.mes=1 amdgpu.mcbp=1

Verify

cat '/sys/module/amdgpu/parameters/ppfeaturemask' | grep '4294967295'

PCI

pci=nocrs,pcie_bus_perf

IOMMU

  • :!: This may cause DMAR issues with the Intel iGPU
intel_iommu=on

GNOME

Disable Wayland

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

Root GUI Apps in Wayland

  • Run this before running GUI applications requiring root
  • This needs re-ran after session restart
  • TODO: Is this even needed anymore?
xhost +LOCAL:

Settings

All-in-one

  • Last updated: 2019/10/22
gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'true' && 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.desktop.peripherals.touchpad' 'click-method' 'areas' && gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true' && gsettings set 'org.gnome.software' 'download-updates' 'false'

Individual

  • Last updated: 2019/10/22
gsettings set 'org.gnome.desktop.interface' 'enable-animations' 'true'
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.desktop.peripherals.touchpad' 'click-method' 'areas'
gsettings set 'org.gnome.desktop.interface' 'clock-show-date' 'true'
gsettings set 'org.gnome.software' 'download-updates' 'false'

KeePassXC

Settings

  • General → [ ] Load previous databases on startup

Add Database Password to GNOME Keyring

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

mpv

mkdir -p ~/'.config/mpv' && echo -e "profile=gpu-hq\nscale=ewa_lanczossharp\ncscale=ewa_lanczossharp\nvideo-sync=display-resample\ninterpolation\ntscale=oversample" | tee ~/'.config/mpv/mpv.conf' > '/dev/null' && cat ~/'.config/mpv/mpv.conf'

NetworkManager

  • wifi.powersave is set to 3 in /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
  • :!: ethernet.cloned-mac-address=random breaks USB Tethering with iOS/iPhones
  • wl seems to work fine without having to disable randomized MAC scanning?
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

Secure Shell

Solo Key

Information

PAM

Dependencies

sudo dnf install pamu2fcfg pam-u2f

Centralized Key

pamu2fcfg > ~/'u2f_keys' && sudo mv ~/'u2f_keys' '/etc/u2f_mappings'

GDM

  • Add to line 2, under the pam_selinux_permit.so entry
sudo -e '/etc/pam.d/gdm-password'
auth sufficient pam_u2f.so authfile=/etc/u2f_mappings cue

sudo

  • Add to line 2, under the #%PAM-1.0 line
sudo -e '/etc/pam.d/sudo'
auth sufficient pam_u2f.so authfile=/etc/u2f_mappings cue

systemd

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

Uncomplicated Firewall

General

sudo ufw reset && sudo ufw default deny && sudo ufw logging off && sudo ufw enable && sudo systemctl enable 'ufw'

SSH

sudo ufw reset && sudo ufw default deny && sudo ufw logging off && sudo ufw allow 'ssh' && sudo ufw enable && sudo systemctl enable 'ufw'

TRIM

  • /swap is a swapfile on Ubuntu and doesn't need a specific discard mount option like other distros
sudo systemctl enable 'fstrim.timer' --now && sudo systemctl start 'fstrim' && sync && sudo systemctl status 'fstrim' -l

Wine

Computer-specific

Nightwane

Volume

alsamixer --card='1'

Fan Control

  • TODO: Change where this is; it's not specific to this computer nor fan control
sudo apt install lm-sensors fancontrol && sudo sensors-detect --auto

Custom Resolution

Generate Modeline

  • 4k@60Hz CVT-RB
  • Fixes unstable HDMI at 4K@60Hz, and overly-bright colors on DisplayPort
  • :!: The grep here confirms the expected Modeline 3)
  • :!: This cannot be used on Wayland currently
  • :!: This expects amdgpu DDX driver to be used 4)
cvt --verbose --reduced '3840' '2160' '60' | grep 'Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync'

xorg.conf Snippet

  • :!: HDMI-A-0 is used for the Identifier with the HDMI port on amdgpu
sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "Monitor"
    Identifier      "HDMI-A-0"
    Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync
    Option          "PreferredMode" "3840x2160R"
EndSection

Spinesnap

  • :!: Using an AMD eGPU with a display attached doesn't seem to work reliably if the intel driver is being used 5)
  • TODO: If intel offers no obvious benefit, remove the OutputClass section for it and let it default to modesetting
sudo apt install xserver-xorg-video-intel xserver-xorg-video-amdgpu -y && sudo mkdir -p '/etc/X11/xorg.conf.d' && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "Monitor"
    Identifier      "HDMI-A-0"
    Modeline "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync
    Option          "PreferredMode" "3840x2160R"
EndSection

Section "OutputClass"
    Identifier  "Intel Graphics"
    MatchDriver "i915"
    Driver      "intel"
    Option      "DRI"       "3"
    Option      "TearFree"  "0"
EndSection

Section "OutputClass"
    Identifier  "AMD Graphics"
    MatchDriver "amdgpu"
    Driver      "amdgpu"
    Option      "DRI"       "3"
    Option      "TearFree"  "0"
EndSection

Deep Color

  • The lack-of quotes around 30 is intentional and required syntax
  • :!: This may cause minor issues with programs not expecting 30-bit color 6)
  • :!: This can cause games in Wine to not start under some circumstances 7)
  • There is no known benefit to enabling this as of 2019/10/22
sudo mkdir -p '/etc/X11/xorg.conf.d' && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "Screen"
    Identifier      "Deep Color Screen"
    DefaultDepth    30
EndSection

Graphics xorg.conf

intel

sudo apt install 'xserver-xorg-video-intel' -y && sudo mkdir -p '/etc/X11/xorg.conf.d' && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "OutputClass"
    Identifier  "Intel Graphics"
    MatchDriver "i915"
    Driver      "intel"
    Option      "DRI"       "3"
    Option      "TearFree"  "0"
EndSection

amdgpu

sudo apt install 'xserver-xorg-video-amdgpu' -y && sudo mkdir -p '/etc/X11/xorg.conf.d' && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "OutputClass"
    Identifier  "AMD Graphics"
    MatchDriver "amdgpu"
    Driver      "amdgpu"
    Option      "DRI"       "3"
    Option      "TearFree"  "0"
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)
  • :!: This was changed to a new syntax and untested as of 2019/10/22
sudo apt install 'xserver-xorg-video-radeon' -y && sudo mkdir -p '/etc/X11/xorg.conf.d' && sudo -e '/etc/X11/xorg.conf.d/99-graphics.conf'
Section "OutputClass"
    Identifier  "AMD Graphics"
    MatchDriver "radeon"
    Driver      "radeon"
    Option      "DRI"               "3"
    Option      "SwapbuffersWait"   "0"
    Option      "TearFree"          "0"
    Option      "AccelMethod"       "EXA"
EndSection

Environment Variables

  • Enables hardware acceleration, use of WebRenderer, and smooth-scrolling
  • :!: WebRenderer requires the previous MOZ_ACCELERATED variable as well
echo -e 'export MOZ_ACCELERATED=1\nexport MOZ_WEBRENDER=1\nexport MOZ_USE_XINPUT2=1' | sudo tee '/etc/profile.d/firefox-hwaccel.sh' > '/dev/null' && cat '/etc/profile.d/firefox-hwaccel.sh'
sudo -e '/etc/profile.d/firefox-hwaccel.sh'

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: 2019/04/05
rm -fv '/tmp/user.js' && nano '/tmp/user.js'
/***********
 * General *
 ***********/

user_pref("extensions.screenshots.disabled", true);
user_pref("reader.parse-on-load.enabled", false);

user_pref("media.mediasource.experimental.enabled", true);
user_pref("media.mediasource.ignore_codecs", true);
user_pref("media.autoplay.enabled", false);

user_pref("webgl.disabled", true);
user_pref("webgl.enable-webgl2", false);
user_pref("accessibility.force_disabled", 1);
user_pref("mousewheel.min_line_scroll_amount", 40);
user_pref("browser.tabs.drawInTitlebar", true);

/*******
 * U2F *
 *******/

user_pref("security.webauth.u2f", true);

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

VPN

  • :!: Add if using a VPN in order to prevent local IP address leaking
  • :!: IPv6 is disabled in order to prevent WebRTC from grabbing an IPv6 address even though NetworkManager has it disabled…
  • :!: media.peerconnection.enabled disables WebRTC
/***********
 * Privacy *
 ***********/

user_pref("network.dns.disableIPv6", true);
user_pref("media.peerconnection.enabled", false);

Apply Settings

  • Path should report the current user's username, and the text Custom Stuff should be visible
  • :!: If Firefox doesn't open automatically, firefox -p default must be ran the first time Firefox is started after this command
ls '/tmp/profiles.ini' '/tmp/user.js' && 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 'Custom Stuff' && sleep '1' && sync || firefox -p 'default'

Extensions

Download

  • Decentraleyes
  • HTTPS Everywhere
  • Privacy Possum
  • Cookie AutoDelete
  • uBlock Origin
gio open 'https://addons.mozilla.org/en-US/firefox/addon/decentraleyes/versions' && gio open 'https://www.eff.org/https-everywhere' && gio open 'https://addons.mozilla.org/en-US/firefox/addon/privacy-possum/versions' && 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'
  • [x] Enable Automatic Cleaning? Delay Before Cleaning
  • [x] Enable Cleanup on Domain Change
  • [ ] Enable Cleanup Log and Counter
  • [ ] Show Notification After Cookie Cleanup
  • [x] Clean Cookies from Open Tabs on Startup
  • [x] Localstorage Cleanup (Firefox 58+)

uBlock Origin

Settings

  • [x] Prevent WebRTC from leaking local IP addresses

Filter lists

  • [ ] Ads → EasyList 10)
  • [ ] Privacy → EasyPrivacy 11)
  • Multipurpose → [x] Dan Pollock's hosts file
  • Multipurpose → [x] hpHost's Ad and tracking servers
  • Multipurpose → [x] MVPS HOSTS
  • Custom → [x] Import

Custom 3rd-party filters

  • Last updated: 2018/11/23
https://www.fanboy.co.nz/fanboy-problematic-sites.txt
https://www.fanboy.co.nz/r/fanboy-ultimate.txt
https://www.fanboy.co.nz/fanboy-antifacebook.txt
https://www.fanboy.co.nz/fanboy-antifonts.txt
https://www.fanboy.co.nz/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

Testing Sites

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
sudo apt install 'p7zip-full'
7z x -o'D' -y x
7z x -o'/run/media/espionage724/1809 LTSC' -y '/home/espionage724/Downloads/en_windows_10_enterprise_ltsc_2019_x64_dvd_74865958.iso' && sync

youtube-dl

Download

rm -f '/tmp/youtube-dl' && wget -O '/tmp/youtube-dl' 'https://yt-dl.org/downloads/latest/youtube-dl' && chmod +x '/tmp/youtube-dl'

Show Formats

  • Change x to a URL
'/tmp/youtube-dl' --list-formats x

Download Media

  • Change x to a URL
  • bestaudio can be changed to bestvideo for just video, or best for best video with audio
'/tmp/youtube-dl' --extract-audio --format 'bestaudio' x

M4A Audio

  • Ideally for if iOS devices will be involved
'/tmp/youtube-dl' --extract-audio --format 'bestaudio' --audio-format 'm4a' x

MP3 Audio

'/tmp/youtube-dl' --extract-audio --format 'bestaudio' --audio-format 'mp3' x

Shortcuts

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

Icons

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

Repos

nano '/etc/apt/sources.list'
ls '/etc/apt/sources.list.d'

Keys

Check Keys

sudo apt-key list

Remove Keys

  • x is the last 8 characters of the pub for the specific repo
sudo apt-key del 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 --verbose --all

GNOME Monitors Reset

rm -f ~/'.config/monitors.xml' ~/'.config/monitors.xml~'

PulseAudio Reset

rm -f ~/'.config/pulse/'*

Xorg Debug

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

Verify DRI3

LIBGL_DEBUG='verbose' glxinfo | grep 'libgl'

GpuTest

Execute

HDTV

  • 1280×720
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1280' /height='720'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1280' /height='720'
/fullscreen /benchmark /benchmark_duration_ms='15000'

FHD

  • 1920×1080
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1920' /height='1080'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='1920' /height='1080'
/fullscreen /benchmark /benchmark_duration_ms='15000'

UHDTV1

  • 3840×2160
wget -O '/tmp/GpuTest_Linux_x64.zip' 'http://www.ozone3d.net/gputest/dl/GpuTest_Linux_x64_0.7.0.zip' && unzip '/tmp/GpuTest_Linux_x64.zip' -d '/tmp' && cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='3840' /height='2160'
cd '/tmp/GpuTest_Linux_x64_'* && ./GpuTest /test='fur' /width='3840' /height='2160'
/fullscreen /benchmark /benchmark_duration_ms='15000'

Cleanup

rm -Rf '/tmp/GpuTest_Linux_'* && cd ~ && sync

Show CPU Frequency

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

OpenSSL Supported Ciphers

openssl ciphers -v | awk '{print $2}' | sort | uniq

Partition Information

  • Both commands do the same things
df -hT
df --human-readable --print-type

Encryption Information

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

ATA Secure Erase

  • :!: All hdparm commands below assume actions to be performed on /dev/sda

Preparation

sudo apt install 'hdparm' -y && sync
sudo hdparm -I '/dev/sda'
systemctl suspend

ATA Secure Erase

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-commands

Standard

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 && sudo rm -f '/sys/firmware/efi/efivars/'* || sync && sudo efibootmgr -v

Mac

  • blkdiscards /dev/sda
  • security-erase /dev/sda
  • security-erase-enhanced /dev/sda
  • Clears EFI variables
  • :!: Unknown how this works on newer Macs with T2
sudo blkdiscard --verbose '/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' && sudo rm -f '/sys/firmware/efi/efivars/'* || sync

Dell

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 && sudo rm -f '/sys/firmware/efi/efivars/'* || sync && sudo efibootmgr -v

NVMe Erase

sudo apt install 'nvme-cli' -y && sync
sudo nvme format '/dev/nvme0' --reset --ses='1' --pil='0' --pi='0' --ms='0' && sync

Clean EFI Variables

  • :!: Could potentially cause a firmware brick or other issues with improper EFI implementations, use at own risk 13)
  • Safer way is to use efibootmgr to remove boot entries individually
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'

ACPI Tables

  • In dsdt.dsl, look for _OSI values, along with Windows and Linux
  • TODO: Fix for Ubuntu
sudo dnf install 'acpica-tools'
sudo cp --force '/sys/firmware/acpi/tables/DSDT' ~/'dsdt.dat'
cd ~ && iasl -d ~/'dsdt.dat'
gio open ~/'dsdt.dsl'
sudo dnf remove 'acpica-tools' && sync

Display EDID Info

sudo apt install 'read-edid'
sudo get-edid | parse-edid

Custom Resolutions

Generate Modeline

  • Use --reduced only for LCD/Non-CRT displays, and only as-needed 14)
  • Syntax is horizontal (width), vertical (height) and refresh rate
cvt '3840' '2160' '60'
cvt --reduced '3840' '2160' '60'
--reduced

Temporarily Apply

  • Changes are lost after reboot
  • Values after --newmode are from the above generate command, and is everything after Modeline
xrandr --newmode "3840x2160R"  533.00  3840 3888 3920 4000  2160 2163 2168 2222 +hsync -vsync
xrandr --addmode 'HDMI-A-0' '3840x2160R'
xrandr --output 'HDMI-A-0' --mode '3840x2160R'

Verify

xrandr --verbose | grep *current

Permanently Apply

  • Identifier is the output port the display is connected to
  • Modeline is from the above generate command, including the text Modeline
  • PreferredMode is the custom resolution name generated
Section "Monitor"
    Identifier  "HDMI-A-0"
    Modeline x
    Option      "PreferredMode" "3840x2160R"
EndSection

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
sudo apt install 'p7zip-full'
7za a 'x.7z' -p'CHANGEME'

oathtool

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

Remove EXIF data

sudo apt install 'libimage-exiftool-perl'
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)
if grep reports nothing, use whatever is reported instead
4)
modesetting has a 4K RB resolution without any settings on Xorg
5)
for a very specific scenario, the Intel iGPU has to be active, manually set to use the intel Xorg DDX driver, an AMD GPU plugged into a Thunderbolt eGPU using the amdgpu Xorg DDX driver, with a 4K display plugged into it via HDMI
6)
GpuTest's fur ring doesn't render right, RS's NXT client's splash screen is gray
7)
FFXIV crashes on start-up due to a DirectX error
8)
HD6000 series and lower, and non-SI HD7000 series
9)
see modinfo -p amdgpu
10) , 11)
uncheck; included in Fanboy Ultimate List
12)
Removes the first security-set-pass since this needs to be set ahead of time from firmware settings
13)
personally tested fine on several Acer and Dell computers
14)
useful for reducing amount of bandwidth over cables, particularly in-case of unstable 4k@60Hz set-ups
/var/www/wiki/data/attic/distros/ubuntu_desktop.1571755350.txt.gz · Last modified: 2019/10/22 10:42 by Sean Rhone