Skip to content

Instantly share code, notes, and snippets.

@timlinux
Last active June 13, 2023 11:44
Show Gist options
  • Save timlinux/22db986f27532550df2406539d959691 to your computer and use it in GitHub Desktop.
Save timlinux/22db986f27532550df2406539d959691 to your computer and use it in GitHub Desktop.
Fedora Workstation Setup Notes

Fedora Workstation Installation Notes

These are my notes for setting up my production workstation with QGIS dev environment and various other niceties.

Mounting encrypted drives

I have three 2TB SSD drives in addition to the system drive which is 250GB.

To get them to mount you need to not include them in the original setup of the computer disk scheme. Then after first log in to the system do the following:

vim /etc/crypttab

Add these lines after the existing line:

# Added by Tim - these unlocked luks devices will appear
# in /dev/mapper/timlinux and /dev/mapper/backups
timlinux /dev/sdb1       /root/lukskey-dev-sdb1
backups  /dev/sdd1       /root/lukskey-dev-sdd1
vim /etc/fstab

Add these lines after the existing /home line:

/dev/mapper/timlinux                       /home/timlinux         btrfs   subvol=timlinux,compress=zstd:1,x-systemd.device-timeout=0   0 0 
/dev/mapper/backups                        /home/backups          btrfs   subvol=backups,compress=zstd:1,x-systemd.device-timeout=0   0 0 
UUID=ec7da9cf-6a66-4ae3-a426-bde65b571e6e  /home/timlinux/gisdata ext4    defaults

Don't change the existing /home line, our mounts are grafted into home.

sudo su -
sudo mv /home/timlinux /home/timlinux_
sudo mkdir /home/timlinux /home/backups

Nvidia Driver

See installation guide at https://linuxhint.com/install-nvidia-drivers-on-fedora-35/

sudo dnf makecache
sudo dnf update
sudo reboot
sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf makecache
sudo dnf install akmod-nvidia
# Fix for https://www.reddit.com/r/Fedora/comments/sobsgb/anyone_experiencing_failure_with_nvidiapowerd/hwa7pr9/?utm_source=reddit&utm_medium=web2x&context=3
sudo dnf remove xorg-x11-drv-nvidia-power
sudo reboot

If you installed the nvidia drivers for fedora by mistake (e.g. on a workstation or laptop without an Nvidia card), you can uninstall them like this:

sudo dnf erase *nvidia*

BTRFS Snapshots

cd 
mkdir btrfs-snapshots
sudo btrfs subvolume snapshot /home/timlinux timlinux-$(date '+%d-%m-%Y')
# List subvolumes
sudo btrfs subvolume show .

Reset Gnome to Factory Defaults

In my last upgrade my gnome was behaving wierdly post upgrade. I remove all the gnome configs like this (so as your normal user).

dconf reset -f /org/gnome/

Gnome Extensions

I only use these extensions:

The last extension is a real life saver as it stops windows popping up behind the active window when they are spawned!

DNF Tweaks

sudo vim /etc/dnf/dnf.conf

Then add these lines:

fastestmirror=True
max_parallel_downloads=10
defaultyes=True

Bash Prompt Theming

I really like the theme described here: https://www.youtube.com/watch?v=iaXQdyHRL8M

But there is a nicer project that provides that and more here:

https://github.com/andresgongora/synth-shell

image

Git Log Prettification

git config --global alias.logline "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
echo "alias gitlog='git logline'" >> ~/.bashrc

Now you can use git log for long form git history and gitlog for a short form history.

Browsers

I install these extra browsers:

  • Google Chrome
  • Microsoft Edge

Software Installation

sudo dnf install obs-studio lftp xorg-x11-drv-nvidia-cuda python-sphinx-latex latexmk peek steam-devices synfigstudio
  • lftp - used for pulling remote backups locally over sftp
  • nvidia-cuda - cant remember why I needed that :-P
  • latex related - used in sphinx when generating pdfs
  • peek - screen recording for short clips in gif (don't use flatpak)
  • steam-devices - used for udev rules for game controllers etc
  • synfigstudio - nice 2d animation app you can use to make GIFs etc with.

Additionally all the packages from here for QGIS Development.

Wireguard

sudo dnf install wireguard-tools

Copy in wireguard config backups to /etc/wireguard

sudo systemctl enable wg-quick@wg-kartoza.service
sudo systemctl enable wg-quick@wg-osgs.service
sudo systemctl daemon-reload

SSHD Config

I have ssh running on my machines but set up so that it is only accessible from within the VPN.

sudo dnf install -y openssh-server

Add the following to /etc/ssh/sshd.conf

# Set this to your IP address so that we do not
# bind on the public interface
ListenAddress 192.168.6.2
# Set this to only allow specific users 
# to log in remotely
AllowUsers timlinux@192.168.6.0/24

Then start the service and enabled it on system boot.

sudo systemctl start sshd.service
sudo systemctl enable sshd.service

Nextcloud client

I tried the flatpack and RPM packages for Nextcloud. The RPMs seem to work better:

crest$ rpm -qa | grep next
nextcloud-client-libs-3.2.2-2.fc34.x86_64
nextcloud-client-3.2.2-2.fc34.x86_64

In my previous install, the experience was not great on Gnome - the sync app often did not run and it doesn't appear in the systray a lot of the time. One rememdy that seems to work is to install kde plasma, login to a plasma shell, run NC client, then log out and continue with Gnome. Then it seems to run stably, actually syncs properly and the tray icon doesnt disappear after starting.

When I reinstalled my system (maintaining my original home directory), I installed only gnome, but nextcloud works, so I don't know if that is a side effect of them fixing their app, or the residual effects of previously having run it under KDE in a previous install.

sudo dnf install nextcloud-client

Syncthing install

The second two lines below will ensure synthing runs on login for the current user

sudo dnf install syncthing
systemctl --user enable syncthing.service
systemctl --user start syncthing.service

Install QGIS

sudo dnf copr enable dani/qgis
sudo dnf install qgis python3-qgis qgis-grass python3-qgis-debuginfo qgis-devel
#sudo dnf install qgis-server

The QGIS Devel package should enable the QGIS widgets in QtDesigner automatically.

image

Security

Flathub

Add flathub

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Element matrix client:

https://flathub.org/apps/details/im.riot.Riot

flatpak install flathub im.riot.Riot

Add markets app for stock tracking

flatpak install flathub com.bitstower.Markets

Add telegram:

sudo flatpak install org.telegram

Xournal PDF Editor

flatpak install xournalpp

Add vscode

*NOTE Don't install like this if you want to use QGIS python in VSCODE - the flatpak will embed its own python interperter which will differ from the system version and the QGIS python paths (which should be in e.g. /usr/lib64/python3.10/site-packages) will be broken. For QGIS Python development rather get the rpm from the VSCode download site.

flatpak install com.visualstudio.code

Flameshot

Flameshot is my favourite screenshot tool. I bind it to Ctl-4 like this in gnome settings - keyboards - shortcuts:

imagem

It is hard to get the defaults to 'stick' so you can work around this by editing:

vim ~/.config/flameshot/flameshot.ini

drawThickness=3

Screen Brightness

When I tested out Deepin linux I was pleasantly surprised to see it included a screen brightness control. You can control screen brightness by installing xrandr (it doesnt come out the box on F35) and like this.

There is a nice gui app (unfortunately no package for fedora) that you can manage your screen brightness interactively with at:

https://github.com/LordAmit/Brightness

Just pip install the dependencies if needed and run it like this:

image

Kubernetes

I decided not to install docker on my workstation and rather force myself to learn kubernetes. On the advice of Rizky, one of our devops team, I went with minikube for my learning environment.

I followed mainly the guide here: https://minikube.sigs.k8s.io/docs/start/

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
sudo rpm -Uvh minikube-latest.x86_64.rpm
sudo dnf install @virtualization
sudo systemctl start libvirtd
sudo systemctl enable libvirtd
sudo usermod -a -G libvirt timlinux

If you want to allow access to your services on your workstation from other hosts in the network, you should follow the notes here https://wiki.libvirt.org/page/Networking

Add kubectl to your .bashrc

echo 'alias kubectl="minikube kubectl --"' >> ~/.bashrc

At this point you should log out of your gnome session and back in again for your group membership to take effect.

Now you can start minikube - the first time it will download a bunch of stuff.

minikube start

UxPlay

UxPlay lets you mirror your iphone screen to your PC - very useful for client presentations etc.

sudo dnf install openssl-devel avahi avahi-compat-libdns_sd avahi-compat-libdns_sd-devel gstreamer1-devel gstreamer1-plugins-base-devel gstreamer1-libav gstreamer1-vaapi libplist libplist-devel

Code is here, build using normal CMake steps: https://github.com/antimof/UxPlay

uxplay

Oculus Quest2 Casting

There are two ways to cast your quest:

  1. Use the casting function in your phone to cast to your PC (probably you should disable your WireGuard to wg-kartoza first). You can do this in conjunction with UnPlay described above.
  2. Use android debug bridge described below

Using ADB to cast your oculus quest 2

sudo dnf install adb
sudo dnf install snapd

sudo ln -s /var/lib/snapd/snap /snap
sudo snap install scrcpy

Then go to https://dashboard.oculus.com/organization/create to create a dummy org.

Follow this tutorial and this video for more info.

Gnome Theming

Icon Theme

I really like the Tela Icon Theme which looks like this when installed:

Before (gnome default)

imagem

After (Tela Black in this example)

imagem

To install icon themes do:

mkdir ~/.icons

imagem

Then extract to the themes folder (1) the inner themes directory (2) so that you have the (3) theme cache file inder ~/.icons/<theme name>/index.theme.

Next use the gnome tweak tool to select a different icon theme.

imagem

Gnome Shell Theme

Remember to enable the gnome shell themes extension (see above in extensions section).

I downloaded the Black Maia theme from gnome-look.

Then unpacked it into ~/.themes/

Then enabled in the shell themes option in gnome tweaks.

GTK Theme

I installed the Orchis theme from gnome-look and also placed it in ~/.themes.

Here is my desktop with the various tweaks and themes above installed:

imagem

Microsoft Onedrive

You can use onedrive on Fedora easily using the OneDrive Project

sudo dnf install onedrive

imagem

onedrive

Follow the prompts after doing the above to connect to your account. Now set things up (basically following the tutorial here:

# Display config
onedrive --display-config
# Perform an initial sync
onedrive --synchronize
# Run onedrive as a system service
systemctl --user enable onedrive
systemctl --user start onedrive
# Check logs
journalctl --user-unit=onedrive -f

Lastly I added a shortcut in my Nautilus file manager.

imagem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment