Table of Contents

1. Day 0, preparation

27th September 2024. Friday, working remotely. Let's go.

Save all your tabs in opened FFs into text files. Make sure you've committed all changes in the dots folder. Make sure you have a backup of your previous install OR MAKE SURE YOU REMOVE THE MEDIA WITH existing Ubuntu installation if you wish to try another Ubuntu installation. It became clear that having both old and the new boot drives in, makes it quite hard to boot the old system. I had to remove the nvme drive with new ubuntu completely from laptop in order to succeed booting from the old nvme. Also both old and new Ubuntus used same names for LVM stuff, I had to rename the LVM stuff using lv* utilities in order to be able to mount the old filesystem.

2. Day 1 of the system log, Friday mid-day

I have installed a new system - Ubuntu 24.04 LTS. Remove the existing Firefox installation:

sudo snap remove firefox

Install Firefox from official repos: https://support.mozilla.org/en-US/kb/install-firefox-linux Add the official repo, install from there.

Firefox installed from snap is sanboxed, thus it cannot launch zoom from browser. Firefox installed from official sources is not sanboxed, it will launch any external applications (including the gnome plugin manager, which plays an extremely important role in changing the entire Ubuntu user experience!).

On day 1 I installed firefox, copied the old home directory to a new backup location, migrated the FF profiles, installed slack. But the first thing I always do is to swap Ctrl and Caps. That's done via the gnome-tweak-tool.

sudo apt install gnome-tweak-tool

Also I have saved all open tabs from existing FF windows into a text file, to open them up in the new system. I saw that FF can send tabs to a device, maybe I should use that feature next time?

Copying files from the old home directory involved both using cryptsetup to decrypt the LVM partitions and to use LVM tools to enable and mount the partitions. In the hindsight, this appeared as the most complicated operation during this entire migration adventure. Also both ubuntus use the same "name" for the LVM partitions, so I had to give the old one a different name for this to work.

The biggest letdown for me was to discover that the occasional touchpad lag is still present in the new system =,(

2.1. Firefox remove the tabs bar

Source: https://gist.github.com/ruanbekker/f800e098936b27c7cf956c56005fe362

!!! WARNING !!! Be careful with opening the profile folder in FF, it always opens a wrong one. I've spend on hour before found the proper folder. Good folder: /home/saw/snap/firefox/common/.mozilla/firefox/n26fpmvd.bloomreach !!! WARNING !!!

Create a file named chrome/userChrome.css in your profile directory:

mkdir chrome && touch chrome/userChrome.css

Populate the following css code:

#main-window[tabsintitlebar="true"]:not([extradragspace="true"]) #TabsToolbar > .toolbar-items {
  opacity: 0;
  pointer-events: none;
}
#main-window:not([tabsintitlebar="true"]) #TabsToolbar {
    visibility: collapse !important;
}
#sidebar-box[sidebarcommand="treestyletab_piro_sakura_ne_jp-sidebar-action"] #sidebar-header {
  display: none;
}
.tab {
  margin-left: 1px;
  margin-right: 1px;
}

Then go to about:config in your address bar and set this to true:

toolkit.legacyUserProfileCustomizations.stylesheets

3. Day 2 of the system log

xset r rate 170 120

Is there a way to save this configuration for future X sessions?

sudo apt install tmux zsh alactritty stow emacs golang-go ack vlc tree podman guvcview feh emacs gimp xsel make

Install the office suite (optional) sudo apt install libreoffice

3.1. Fix the firefox scrolling.

Damn, this thing is the single biggest improvement ever.

sudo echo "MOZ_USE_XINPUT2=1" >> /etc/environment
sudo reboot

My goodness, touchpad scrolling in FF is so precise and smooth now!

To make scrolling smooth for the mouse wheel, change the following in the about:config:

general.smoothScroll.mouseWheel.durationMaxMS	1000
general.smoothScroll.mouseWheel.durationMinMS	200
mousewheel.acceleration.start	1
mousewheel.default.delta_multiplier_y	200
mousewheel.system_scroll_override.enabled	false

Update 7 Nov 2024: these settings interfere with touchpad scrolling. It becomes a bit jerky. For touchpad, the ideal value for mousewheel.default.delta_multiplier_y is 50.

Now the text does not jump, straining my eyes, when I scroll it with the mouse wheel.

3.2. Font: JetBrains Mono.

This is the font I use for all my terminal and coding work.

  1. Download and unpack the fonts
  2. cd JetBrainMono-2.304/fonts (there should be folders: ttf, variable, webfonts)
  3. sudo mv * /usr/local/share/fonts

The /usr/local/share/fonts is a better place to do it than the /usr/share/fonts, because the latter is the location where fonts from packages are installed to (or so they say). Tried setting JetBrains Mono in the gnome-tweak-tool system-wide, but for some reason it didn't render properly in the open editor, so maybe I'll do it later and then I need a system restart. The terminal look with JetBrain Mono: <insert screenshot>

3.3. Dot files

Now, time to install dots

cd dots
stow alacritty git tmux
ln -s ~/dots/zsh/.zshrc ~/.zshrc

3.4. .ssh folder

Move the contents of the old ~/.ssh to the new ~/.ssh

3.5. fzf

Install fzf by downloading a binary from github releases, copying it to /opt and linking in /usr/local/bin https://github.com/junegunn/fzf/releases

3.6. ripgrep

Download the deb file from the releases: https://github.com/BurntSushi/ripgrep/releases dpkg -i ...

4. Day 2, xset the settings after reboot

source of information: https://unix.stackexchange.com/questions/281858/difference-between-xinitrc-xsession-and-xsessionrc Order of execution: ~/.xinitrc - invoked by xinit, invoked by startx ~/.xsession - invoked after login to display manager ~/.xsessionrc - executed by Debian and derivatives

Unfortunately, .xsessionrc does execute on login, but "xset …" does no effect or is overriden by something different.

5. Day 3 - tweak the Gnome!

In FF, go to https://extensions.gnome.org/extension/3843/just-perfection/ Install the browser extension to install extensions. For the browser extension to work, you need the gnome-shell-extensions installed:

sudo apt install gnome-shell-extensions

Then install the Just Perfection from the FF browser.

Open the gnome extensions, open settings for Just Perfection: Behavior tab:

  • Window Demands For Attention Focus - disables the annoying "Application <X> is ready" popup
  • Popup Delay - removes the delay for all popups like Alt-Tab, kb layout etc.
  • Double Super to App Grid

Visibility tab:

  • Dash - disable it, it's the panel on the left side with "favourite" applications

Open Ubuntu Settings > Power:

  • Enable the battery percentage display.
  • Screen Blank - set Never
  • Dim Screen - disable brightness when computer is inactive - disable it!

Settings > Keyboard

  • Keyboard Shortcuts - disable Alt-Space to invoke context menu for windows. I use Alt-Space extensively inside emacs
    • disable Control-Meta-D to hide normal windows. I use C-M-d in emacs to go down the tre

6. Day 3 - install work-related things

6.1. Pritunl, twingate, saml2aws, aws-cli.

Pritunl installation: https://client.pritunl.com/ Was installed via an additional apt repository.

sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb https://repo.pritunl.com/stable/apt noble main
EOF

sudo apt --assume-yes install gnupg
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A
gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A | sudo tee /etc/apt/trusted.gpg.d/pritunl.asc
sudo apt update
sudo apt install pritunl-client-electron

Woah, the pritunl-client-electron is 700 MBs! What the heck, amigos?

saml2aws installation: https://github.com/Versent/saml2aws#ubuntu

cd Downloads\
CURRENT_VERSION=$(curl -Ls https://api.github.com/repos/Versent/saml2aws/releases/latest | grep 'tag_name' | cut -d'v' -f2 | cut -d'"' -f1)\
wget https://github.com/Versent/saml2aws/releases/download/v${CURRENT_VERSION}/saml2aws_${CURRENT_VERSION}_linux_amd64.tar.gz\
tar -xzvf saml2aws_${CURRENT_VERSION}_linux_amd64.tar.gz
sudo mv saml2aws /opt/saml2aws-${CURRENT_VERSION}\
sudo ln -s /opt/saml2aws-${CURRENT_VERSION} /usr/local/bin/saml2aws

Install aws-cli on Ubuntu:

sudo snap install aws=cli --channel=v2/stable --classic

Move the old aws configs to current home:

mv /home/saw-ub204/.aws .
mv /home/saw-ub204/.awscliv2 .

6.2. Installing docker

We still have not switched from this corporate closed software to something community-driven, thus again I have to add deb repos. Source https://docs.docker.com/engine/install/ubuntu/

6.2.1. Remove any existing docker- and containerization-related packages

for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

6.2.2. Add the docker repository

Install the # Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

6.2.3. Install the docker packages

sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

6.2.4. Post-installation steps

The docker socket in run/docker.sock ownership is root:docker. It is advised not to add a user to the docker group because that grants the user root privileges. Instead, it is recommended to configure docker to run in a rootless mode: https://docs.docker.com/engine/security/rootless

But what I did instead of following that rootless tutorial is just to change permissions on the socker file to root:saw: sudo chown root:saw /run/docker.sock Fuck it.

6.3. Install kubectl

Full instructions: https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#install-using-native-package-management If you want to bump the k8s version, bump the version in the sources list.

sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.31/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg
# bump the version here if needed:
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.31/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update
sudo apt-get install kubectl

6.4. Install krew to install kubectx & kubens

Full krew instruction: https://krew.sigs.k8s.io/docs/user-guide/setup/install/ I just ran this and it somehow installed the krew plugin without any need for root privileges. No idea where does it install krew to.

(
  set -x; cd "$(mktemp -d)" &&
  OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
  ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
  KREW="krew-${OS}_${ARCH}" &&
  curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
  tar zxvf "${KREW}.tar.gz" &&
  ./"${KREW}" install krew
)

Install kind to create k8s clusters:

[ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
chmod 555 kind
./kind --version
sudo mv ./kind /opt/kind-v0.24.0
sudo ln -s /opt/kind-v0.24.0 /usr/local/lib/kind

7. Day 3, evening. Pairing Ubuntu 24.04 LTS with Bose QC 35

I tried enabling Bluetooth in the Ubuntu 24.04 settings and selecting my Bose headphones, but it never hooked up. I had to hook up my phone with the headphones, then use the Bose app on the phone to make headphones pair with Ubuntu. Lolwut.

Small notes after Day 3 - initially after I installed the new system, I was let down to discover that the touchpad lag persists. Now I can confidently say that the lag problem subjectively feels much less pronounced. Might that be because the root cause is less severe due to software updates? Or is it because I managed to install the `just-perfection` gnome plugin and make the entire system experience snappier? Is it because of the new NVMe drive, that maxes out the laptop's capabilities?

By the way, I am seriously surprised by how fast alacritty launches now. It is instantaneous! I recall on the superceded ubuntu 22.04 LTS and old nvme alacritty took a good second to launch. And tmux is suddenly instantaneous as well! All this tested with exact same old configs for the tested apps.

8. Day 3, time to sleep - Restoring the zsh as the primary shell

chsh -s $(which zsh)

And relogin!

9. Day X - Time to setup emacs

9.1. Colors

This is a nasty problem. After upgrading to Ubuntu 24.04 from 22.04 the colors in emacs in terminal were all wrong. Previously, emacs used the basic colors from the terminal, by basic I mean the first 16 colors in the palette - red, green, magenta, bright red etc. So in my terminal I defined red as #dc322f. Red in emacs used that as red. But after the upgrade, emacs' red was defined as #ff0000. I searched for ways to force emacs to respect the terminal colors, but the only thing I could find is everyone moving to 24-bit color support in emacs.

What I tried was to set font color to a precise hex value, say #dc322f. Emacs did not display that precise color, but instead picked something close to that.

I tried this in a couple of terminals - alacritty, gnome-terminal, konsole. And then I have noticed that this subsitution of the closest color happens only when I run emacs inside tmux! Aha! So this is not the terminal that screws my colors, this is tmux! Quick googling and now we have new lines in the .tmux.conf:

# Enable emacs to use 24-bit color support in the terminal
set -g default-terminal "xterm-256color"
set -ag terminal-overrides ",xterm-256color:RGB"

And running emacs in terminal as: COLORTERM=truecolor emacs -nw

Damn, now all colors can take precise 24-bit values.

10. Day Y - remember how to use the tools you just installed and configured

10.1. fzf

In .zshrc fzf is called and it overrides a bunc of keys. Notably:

  • C-R - search command history backwards
  • M-C - like broot, will search for files in the current folder
  • In the shell, type "$ emacs **<TAB>" - same as "$ emacs $(fzf)" - will fuzzy find files in the local directory and launch emacs
  • "rg . | fzf" - fuzzy find in all files

Based on: https://andrew-quinn.me/fzf/

11. Semi-intermittent issues

11.1. Sometimes the CPU frequency gets stuck at 800Mhz

Monitored with:

watch -n 1 "cat /proc/cpuinfo| grep -i hz"
Every 1.0s: cat /proc/cpuinfo| grep -i hz                                                                                                                                                                      sawmill: Thu Oct  3 14:10:34 2024

model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.070
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.082
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.113
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.005
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.006
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000
model name      : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
cpu MHz         : 800.000

Rebooting the machine usually helps. Otherwise I set the frequency from the command line:

sudo cpupower frequency-set -d 4.3Ghz

But then it jumps between 800Mhz and 4.3Ghz, without anything in-between.

12. Thoughts and further research

  • Could alacritty be so slow because of the slow font rendering? Could the default ubuntu mono be faster?

13. Day 42 of the system log.

I have ordered a MacBook.

Why?

13.1. Can't fix the occasional touchpad lag

I've installed Windows and as soon as it downloaded the latest drivers, this issue happened too, on Windows! I had to go to devices and revert the drivers back… My god, synaptics, what have you done…

13.2. Ubuntu 24.04 is a disaster

Despite being half-year old, it is a disaster.

13.2.1. Have to reboot several times a day

If previously I barely ever rebooted my machine, now I have to reboot several times a day!

13.2.2. Internal display always kicks in

This Gnome does not memorize to always use external display. After each reboot I have to open my laptop (because the laptop screen is the primary display with the login dialog), then login and disable the laptop screen. Never happened on previous Ubuntu 22.04.

13.2.3. Gnome issues after wakup

Very often after I wake up the laptop after a sleep, the Gnome session dies! It logs me out, killing all aplications. Never happened on the previous Ubuntu 22.04.

13.3. Hardware issues

13.3.1. One of the two fans sometimes stops working

Sometimes one of the fans goes 100% speed. Upon reboot, the system reports that one of the fans malfunctions. It started happening some time back in 2021.

13.3.2. Fan noise when the external monitor is attached

I've got a 4K 60Hz monitor, and when I attach it - this machine does feel the load. And I do hear the fans all the time.

13.3.3. Terrible experience in Zoom calls

Somehow running Zoom is a tough task for this machine. The CPU usage is high, 60-70% of a single core. When sharing desktop, the CPU usage goes up to ~120% of a single core. Fans go crazzy.

13.3.4. Google meet video calls from Firefox are next to impossible

This one is even worse than zoom. I mean yeah, I could join the call and stuff. Add a virtual background and the CPU load is high. God forbid one of the fans fail during the call, which did happen once…

Author: saw

Created: 2024-11-13 Wed 16:07

Validate