distros:ubuntu_desktop
Table of Contents
Information
Download
HOSTS
- Unified hosts + fakenews + gambling
Initial
Only run this once as it overwrites
/etc/hosts-bak
on subsequential runs
wget -O '/tmp/hosts-tmp' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sudo cp '/etc/hosts' '/etc/hosts-bak' && sudo mv '/tmp/hosts-tmp' '/etc/hosts' && sync
Update
wget -O '/tmp/hosts-tmp' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sudo mv '/tmp/hosts-tmp' '/etc/hosts' && sync
Verify
cat '/etc/hosts' | grep 'Date:'
sudo -e '/etc/hosts'
Restore
sudo cp '/etc/hosts-bak' '/etc/hosts' && sync
Repositories
oibaf/graphics-drivers
sudo add-apt-repository 'ppa:oibaf/graphics-drivers'
Keybase
This is only the signing key, see Keybase for client installation
wget -O '/tmp/code_signing_key.asc' 'https://keybase.io/docs/server_security/code_signing_key.asc' && sudo mv '/tmp/code_signing_key.asc' '/etc/apt/trusted.gpg.d/keybase.asc' && sync
WineHQ
wget -O '/tmp/winehq.key' 'https://dl.winehq.org/wine-builds/winehq.key' && sudo mv '/tmp/winehq.key' '/etc/apt/trusted.gpg.d/winehq.asc' && echo 'deb https://dl.winehq.org/wine-builds/ubuntu/ kinetic main' | sudo tee '/etc/apt/sources.list.d/winehq.list' > '/dev/null' && sync
Liquorix Kernel
sudo add-apt-repository 'ppa:damentz/liquorix'
XanMod Kernel
wget -O '/tmp/xanmod.key' 'https://dl.xanmod.org/gpg.key' && sudo mv '/tmp/xanmod.key' '/etc/apt/trusted.gpg.d/xanmod.asc' && echo 'deb http://deb.xanmod.org releases main' | sudo tee '/etc/apt/sources.list.d/xanmod.list' > '/dev/null' && sync
Software
Update
System
sudo apt update && sudo apt full-upgrade -y && sudo apt autoremove -y && sudo apt clean && sync
Firmware
sudo fwupdmgr refresh --force && sudo fwupdmgr update --verbose && sync
Snaps
sudo snap refresh && sync
General
sudo apt install --install-recommends 7zip aria2 chrome-gnome-shell evolution filezilla gimp keepassxc libreoffice libsecret-tools lm-sensors mesa-utils mpv rhythmbox transmission-gtk unar youtube-dl
ckb-next
ckb-next
Wine
winehq-staging winbind winetricks libgl1-mesa-dri:i386 mesa-vulkan-drivers mesa-vulkan-drivers:i386 libgl1:i386
Liquorix Kernel
linux-image-liquorix-amd64 linux-headers-liquorix-amd64
XanMod Kernel
linux-xanmod-x64v3
Intel Media Driver for VAAPI
intel-media-va-driver-non-free
Keybase
This needs ran as a separate command and not combined with the above package installations
On Fedora, Keybase used GPU in the background, and crashed
amdgpu
(see #25070); TODO: See if this still happens
rm -Rf '/tmp/keybase_amd64.deb' && wget -O '/tmp/keybase_amd64.deb' 'https://prerelease.keybase.io/keybase_amd64.deb' && sudo apt install '/tmp/keybase_amd64.deb' && rm '/tmp/keybase_amd64.deb' && sync && run_keybase
Tor Browser
torbrowser-launcher
Google Chrome
TODO: This may need updated to run with
apt
instead ofdpkg
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
- See game_performance for
Game.sh
script
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 && snap refresh && wget -O '/etc/hosts' 'https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling/hosts' && sync && fstrim --all --verbose && sync && sleep '5''"
gnome-terminal -- sh -c ~/'.local/scripts/Game.sh'
Keys
- Listed respectively to above
- Ctrl + Alt + Z
- Pause
- F6
Printer
- Internet Printing Protocol (ipps) → HP → IPP Everywhere ™
- Color Mode: Device Gray
- Administration → Set As Server Default
ipps://192.168.1.164/ipp/print
gedit
- 4 Tab width
- Insert Spaces for Tab mode
Network
Quad9 DNS
Nautilus
- Sort Folders Before Files
Rhythmbox
- See Internet Radio
Terminal
- 10-notch Transparency
Kernel Options
FQ-PIE Queuing Discipline
echo 'net.core.default_qdisc = fq_pie' | sudo tee '/etc/sysctl.d/99-fq-pie.conf' > '/dev/null' && cat '/etc/sysctl.d/99-fq-pie.conf'
tc qdisc show | grep 'fq_pie'
Intel Perf Counters
- TODO: See what else besides DXVK is affected by this
TODO: See if this is appropriate for Ubuntu as this is copy/pasted from Fedora notes
echo 'dev.i915.perf_stream_paranoid = 0' | sudo tee '/etc/sysctl.d/99-i915-perf.conf' > '/dev/null' && cat '/etc/sysctl.d/99-i915-perf.conf'
Swappiness
echo 'vm.swappiness = 0' | sudo tee '/etc/sysctl.d/99-swappiness.conf' > '/dev/null' && cat '/etc/sysctl.d/99-swappiness.conf'
GRUB
Config
- Add options in
GRUB_CMDLINE_LINUX_DEFAULT=
sudo -e '/etc/default/grub' && sudo update-grub
PCI
pci=pcie_bus_perf
CPU BIOS Limit Ignore
processor.ignore_ppc=1
AMDGPU Overclocking
- Allows use of Overdrive options for overclocking and increasing the Power Limit
amdgpu.ppfeaturemask=0xffffffff
Verify
cat '/sys/module/amdgpu/parameters/ppfeaturemask' | grep '0xffffffff'
Intel Optimization
- This enables Framebuffer compression, Panel self-refresh, and i915 Fastboot
- This also enables GuC and HuC firmware loading if supported by the hardware
i915.enable_fbc=1 i915.enable_psr=1 i915.fastboot=1 i915.enable_guc=3
GNOME
Notes
Disable color calibration for the monitor in GNOME Settings 3)
Hide Top Bar
External Monitor Settings
- This copies the configured monitor settings from the current user to
gdm
and also applies it to the log-in screen - Notably useful for setting a laptop's built-in screen as disabled for the log-in screen
TODO: Test on Ubuntu
sudo cp ~/'.config/monitors.xml' ~gdm/'.config/monitors.xml' && sudo chown 'gdm':'gdm' ~gdm/'.config/monitors.xml'
Undo
sudo rm ~gdm/'.config/monitors.xml' && sync
Wayland
ckb-next auto light shutoff requires Xorg
GPU scaling for resolution requires Xorg
Steam and various games through Wine work better through Xorg
- Xorg can be selected at log-in 4)
Tweaks
echo 'MUTTER_DEBUG_FORCE_KMS_MODE=simple' | sudo tee '/etc/environment.d/99-mutter-tweaks.conf' > '/dev/null' && cat '/etc/environment.d/99-mutter-tweaks.conf'
echo 'CLUTTER_PAINT=disable-dynamic-max-render-time=1' | sudo tee '/etc/environment.d/99-clutter-tweaks.conf' > '/dev/null' && cat '/etc/environment.d/99-clutter-tweaks.conf'
Settings
All-in-one
- Last updated: 2022/06/08
gsettings reset 'org.gnome.shell' 'app-picker-layout' && 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.desktop.interface' 'clock-show-weekday' 'true'
Individual
- Last updated: 2022/06/08
gsettings reset 'org.gnome.shell' 'app-picker-layout'
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.desktop.interface' 'clock-show-weekday' 'true'
KeePassXC
Settings
- General → [ ] Load previous databases on startup
- Security → [x] Use DuckDuckGo service to download website icons
Add Database Password to GNOME Keyring
secret-tool store --label='KeePass' 'keepass' 'default'
lm_sensors
--auto
can be used here, but if modules need to be added to/etc/modules
, not using-auto
will allow sensors to do it
sudo sensors-detect
mpv
mkdir -p ~/'.config/mpv' && nano ~/'.config/mpv/mpv.conf'
profile=gpu-hq scale=ewa_lanczossharp cscale=ewa_lanczossharp video-sync=display-resample interpolation tscale=oversample
Laptop Power Management
Secure Shell
- See Client notes to generate/restore public key
Uncomplicated Firewall
- See ufw for more notes
sudo ufw reset && sudo ufw default deny && sudo ufw logging off && sudo ufw enable && sudo systemctl enable 'ufw'
sudo ufw allow 'ssh'
Drive Maintenance
Trim
sudo systemctl enable 'fstrim.timer' --now && sudo systemctl start 'fstrim' && sync && sudo systemctl status 'fstrim' -l
XFS Scrub
This is only necessary if XFS is being used on any persistent drives such as a NAS, and requires
xfsprogs
to be installed
sudo apt install 'xfsprogs'
sudo systemctl enable 'xfs_scrub_all.timer' --now && sudo systemctl start 'xfs_scrub_all' && sync && sudo systemctl status 'xfs_scrub_all' -l
UTC
- Set RTC to UTC
Needed if Windows is installed first
Windows should also be set to UTC
sudo timedatectl set-local-rtc '0'
Verify
timedatectl | grep local
Wine
- See Wine
Custom EDID
TODO: Some hint about how to get EDID
- Ubuntu doesn't need an initramfs regen
sudo install -Dm644 ~/'Downloads/S271HL-75Hz-RB2/S271HL-75Hz-RB2.bin' '/usr/lib/firmware/edid/S271HL-75Hz-RB2.bin'
ls '/usr/lib/firmware/edid'
drm.edid_firmware=edid/S271HL-75Hz-RB2.bin
sudo dmesg | grep 'edid'
Wayland
i915 HDMI
- This sets RGB Full on HDMI, and the content type to
Game
on HDMI for low-latency - TODO: How this was figured out, and where to put it
- TODO: Verify dri/card number or wildcard it; was 1 on Fedora, but 0 on Ubuntu
proptest -M 'i915' -D '/dev/dri/card1' '103' 'connector' '98' '1'
proptest -M 'i915' -D '/dev/dri/card1' '103' 'connector' '107' '4'
Xorg
Do not force a Xorg DDX driver 5)
NVIDIA
Run Xorg as Root
- This is required to allow overclocking and fan control
TODO: See if this is needed on Ubuntu
echo 'needs_root_rights = yes' | sudo tee --append '/etc/X11/Xwrapper.config' > '/dev/null' && cat '/etc/X11/Xwrapper.config'
Mozilla Firefox
- See Firefox if old configuration is needed, otherwise use Firefox Sync
Tweaks
- Allows Firefox to use Wayland
- Enables smooth-scrolling
echo 'MOZ_ENABLE_WAYLAND=1' | sudo tee '/etc/environment.d/99-firefox-wayland.conf' > '/dev/null' && cat '/etc/environment.d/99-firefox-wayland.conf'
echo 'MOZ_USE_XINPUT2=1' | sudo tee '/etc/environment.d/99-firefox-xinput2.conf' > '/dev/null' && cat '/etc/environment.d/99-firefox-xinput2.conf'
DNS over HTTPS
https://dns.quad9.net/dns-query
Server
- For workstations that run servers as a secondary directive
- For headless servers, use Ubuntu Server
Automatic Updates
Service
sudo -e '/etc/systemd/system/ubuntu-up.service'
[Service] Type=oneshot ExecStartPre='/usr/bin/apt' clean ExecStart='/usr/bin/apt' update ExecStart='/usr/bin/apt' full-upgrade -y ExecStart='/usr/bin/apt' autoremove -y ExecStartPost='/usr/bin/sync' ExecStartPost='/usr/bin/systemctl' reboot
Timer
- 03:00 Oak
sudo -e '/etc/systemd/system/ubuntu-up.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'ubuntu-up.timer' --now
[Unit] Description=Software Package Maintenance and Updater After=network-online.target Wants=network-online.target [Timer] OnCalendar=*-*-* 03:00:00 Persistent=true [Install] WantedBy=timers.target
Notable Folders and Commands
Extract ISO
D
is the destination you want the extracted files to gox
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
7z x -o'/run/media/espionage724/LTSC 2019' -y '/home/espionage724/Downloads/en_windows_10_enterprise_ltsc_2019_x64_dvd_be3c8ffb.iso' && sync && sync
yt-dlp
Download
rm -f '/tmp/yt-dlp' && wget -O '/tmp/yt-dlp' 'https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp' && chmod +x '/tmp/yt-dlp'
Show Formats
- Change
x
to a URL
'/tmp/yt-dlp' --list-formats x
Download Media
- Change
x
to a URL bestaudio
can be changed tobestvideo
for just video, orbest
for best video with audio
'/tmp/yt-dlp' --extract-audio --format 'bestaudio' x
M4A Audio
- Ideally for if iOS devices will be involved
'/tmp/yt-dlp' --extract-audio --format 'bestaudio' --audio-format 'm4a' x
MP3 Audio
'/tmp/yt-dlp' --extract-audio --format 'bestaudio' --audio-format 'mp3' x
Shortcuts
/usr/share/applications
~/.local/share/applications
Icons
/usr/share/icons/hicolor
~/.local/share/icons/hicolor
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
List GNOME gsettings
- Change
x
to schema or omit it to show all settings
gsettings list-recursively 'x'
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'
GpuTest
Execute
720p
- 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'
1080p
- 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'
4K
- 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 Sensors
sudo apt install 'lm-sensors' -y && sudo sensors-detect --auto && sudo watch --interval '0.5' sensors
Show CPU Frequency
grep 'MHz' '/proc/cpuinfo'
watch --interval '0.5' grep \'cpu MHz\' '/proc/cpuinfo'
OpenSSL Supported Ciphers
openssl ciphers -v | awk '{print $2}' | sort | uniq
Partition Information
- Both commands present the same information
df -hT
df --human-readable --print-type
Encryption Information
sudo cryptsetup -v status '/dev/dm-0'
ATA Secure Erase
- See Drive Wipe notes
RAID
Controller Details
- This can be used to get the Oprom version for Intel RST
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 withWindows
andLinux
sudo apt install 'acpica-tools'
sudo cp --force '/sys/firmware/acpi/tables/DSDT' ~/'dsdt.dat'
cd ~ && iasl -d ~/'dsdt.dat'
gio open ~/'dsdt.dsl'
sudo apt autoremove --purge 'acpica-tools' && sync
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'
HT/SMT 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
7ZIPNAME
in7ZIPNAME.7z
to the desired archive name - Change
PASS
in-pPASS
to the desired password - Change
x
to the file or folder to add to the archive
7za a '7ZIPNAME.7z' -p'PASS' 'x'
7za a 'x.7z' -p'x' 'x'
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
/var/www/wiki/data/pages/distros/ubuntu_desktop.txt · Last modified: 2023/03/30 15:36 by Sean Rhone