Updated Ubuntu Installation script

I’ve made some major changes to my Ubuntu installation script over the last few weeks. Mostly because I finally replaced the hard drive in my laptop and needed to do a clean installation, but also because I wanted to try and get DisplayLink drivers installed by default, which has historically been a pain.

for the latter I’m now using a lot of someone else’s work, and a little bit of my own:

install_displaylink() {
    git clone https://github.com/AdnanHodzic/displaylink-debian.git
    cd displaylink-debian
    sudo ./displaylink-debian.sh
    wget -q https://raw.githubusercontent.com/teknostatik/debian/master/20-displaylink.conf -O /etc/X11/xorg.conf.d/20-displaylink.conf
    cd ..
}

One day there will be a more elegant solution, but for now this will do.

Since writing the original draft of this post I decided that having these drivers on all my computers really isn’t required, and I would generally just plug a HDMI cable in and use the dock for just the standard I/O. But it’s still there in a script as an optional setting, in case anyone else might find it useful. I’ve also added a few more optional settings, for QMK installation and enabling the firewall by default. I tested all this on a clean install of both 24.04 and 24.10 and it all seems to work fine.

Living through history – thoughts on the XZ vulnerability

I have been following the XZ backdoor vulnerability story with interest. Not just because I use Linux and therefore it affects the technology I rely on, but also because I’m interested in the people and processes that underpin open source software, and software development in general.

Linux has relied on volunteer contributions from the start, and in general that fosters a collective sense of responsibility for delivering a great product that meets the needs of the people who use it. But there is also a risk that there won’t be sufficiently skilled volunteers to do what needs to be done, or that the expectations of users cannot be reasonably delivered by volunteers who are likely to also be juggling a paid job and family responsibilities.

This issue has highlighted those risks, but also been a great example of a community coming together to quickly fix an issue in a way a commercial organisation probably never would. By working in public, being transparent, and delivering value quickly, the community has proved that this development and support model can work, but also that there are lessons we can learn about culture, contributor burn out, and how we can continue to release value at pace whilst at the same time maintaining the integrity of the product.

I don’t have answers, but it’s good to see people pulling together, and I do think we’re probably living through history right now.

I also think the standard is being set for documentation related to this kind of issue. These are the pages I’ve bookmarked in relation to this, either to keep up to speed with developments, or to highlight what good practice looks like when it comes to being curious enough to shine a light on things that don’t look right:

Ubuntu 23.10

I upgraded to Ubuntu 23.10 on my laptop last night. It took less than 20 minutes, and so far everything has just worked.

This is the kind of user experience I want on all my devices, and also the kind of experience I strive to deliver to others.

My NixOS Experiments

I have been experimenting with NixOS for a few weeks, and whilst I’m not ready to run it on my main machine, I think I could if I had to. These notes are all the things I had to search, or experiment with, and are largely here for my reference, although if they help someone else then that is great.

Snippets from my configuration.nix file

# Enable the GNOME Desktop Environment.
services.xserver.displayManager.gdm.enable = true;
# services.xserver.desktopManager.gnome.enable = true;

# Enable i3
services.xserver.windowManager.i3.enable = true;

# Configure keymap in X11
services.xserver = {
  layout = "gb";
  xkbVariant = "";
};

# Configure console keymap
console.keyMap = "uk";

# Enable sound with pipewire.
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire = {
  enable = true;
  alsa.enable = true;
  alsa.support32Bit = true;
  pulse.enable = true;
  # If you want to use JACK applications, uncomment this
  #jack.enable = true;

  # use the example session manager (no others are packaged yet so this is enabled by default,
  # no need to redefine it in your config for now)
  #media-session.enable = true;
};

# Enable touchpad support (enabled default in most desktopManager).
# services.xserver.libinput.enable = true;
};

# Allow unfree packages
nixpkgs.config.allowUnfree = true;

# Allow QMK to write to keyboards

hardware.keyboard.qmk.enable = true;

# needed for store VS Code auth token 
services.gnome.gnome-keyring.enable = true;

# List packages installed in system profile. 
environment.systemPackages = with pkgs; [
git
featherpad
pandoc
dropbox
dmenu
feh
i3lock
kitty
i3blocks
arandr 
scrot 
xautolock 
barrier
imagemagick
neofetch
zathura
pcmanfm
htop
blueman
cowsay
fortune
shellcheck
abiword
rhythmbox
brasero
sound-juicer
transmission
byobu
tmux
screen
qmk
networkmanagerapplet
protonvpn-gui
protonvpn-cli
protonmail-bridge
unixbench
zerotierone
zoom-us
caffeine-ng
copyq
vscode
];

A script to automate changes

#!/bin/sh
# Standard error mitigation
set -euo pipefail
# Replace existing config
cd /etc/nixos/
sudo mv configuration.nix configuration.nix.old
# download new config
sudo wget https://raw.githubusercontent.com/teknostatik/nixos/master/configuration.nix
# Test
sudo nixos-rebuild test
# Deploy
sudo nixos-rebuild switch --upgrade
# Clean up and then go home
nix-collect-garbage -d
cd $HOME 

Making DVDs from video files

Recently I found myself needing to make a DVD from a recorded stream (of a family funeral that my Mum couldn’t attend because of covid). This is not a task I normally do, and I thought it was worth writing up how I did it in case I ever need to do it again.

Most of these instructions were put together using this wiki page, and assume you are using Ubuntu or some other Debian derivative.

Dependencies

  • ffmpeg
  • dvdauthor
  • mkisofs
  • k3b

The command line stuff

ffmpeg -i video_file_name.mkv -aspect 16:9 -target pal-dvd  -b 1800000 dvd.mpg
dvdauthor -o dvd/ -t dvd.mpg
export VIDEO_FORMAT=PAL
dvdauthor -o dvd/ -T
mkisofs -dvd-video -o dvd.iso dvd/

The GUI stuff

Take dvd.iso and burn it to DVD using K3B (or your burning software of choice – I really should investigate doing this on the command line next time).

Testing

Put the DVD into a normal DVD player and check it plays. The video should load automatically with no menus.

This worked for me. Hopefully if I have to do it again it will be in better circumstances.

Debconf21

I’ve managed to attend a lot of the talks at Debconf21. This was also true of Debconf20, but I very much feel like I’ve understood a lot more of what is being talked about this time, and I’m also very happy that I was sent a conference T-shirt and badge so I can participate fully in the experience.

Talks I’ve attended (with hyperlinks to the video of the talk if they currently exist) are:

Videos of all the talks I missed are also available so there is plenty for me to watch during my long holiday-at-home that starts in less than a week.

It’s interesting to see the different presentation styles as well as the content they are delivering, and I hope I’ve also learned a bit more about what works and what doesn’t when presenting content to a virtual audience.

I’m not sure I would attend a physical Debconf unless I was a little more involved with the project, but I’ve certainly enjoyed doing it virtually this year.

Reddit, IT support, and home offices

I used Reddit quite a bit around a decade ago. Mostly for keeping up to date with Linux and other computer-related things, but also to understand the kind of things people were generally interested in and talking about (became small talk is a thing, and I’m terrible at it). I drifted away a few year ago, but since the first lockdown started I’ve found it a useful source of information about things I’m interested in.

This started when I was researching computer parts for my new desktop PC. I’ve not built a desktop for a long time, so I wanted to see what other people were doing, and how the parts shortage was going to affect the choices I made. I have my PC now, and I’m very pleased with it, but I also didn’t stop using Reddit at that point; I just stopped caring about PC hardware and tapped into the community expertise around my other current hobbies (customising the i3 window manager, Linux in general, mechanical keyboards, cycling, music). It’s interesting to see how other people are customising their computers and their keyboards, and it gives me ideas for changes I want to make to my own setup.

The time I’ve spent on Reddit has also reminded me of how much it’s used as a general support forum for all sorts of things. I try not to get too involved in that side of it, but I am very interested in the way people ask for help with their IT issues and it gives me some useful data to reflect on when I’m thinking about these things as part of my day job.

I’m in no way surprised that people are generally quite bad at describing the issues they are having, and also that they are very bad at choosing the right place to ask for help. I do have vague intentions to write up long answers to things that people seem to struggle with, probably starting with my insights on how people switching to Linux invariably start off with doing something really hard as part of their initial switch (dual-boot, Nvidia drivers, getting Windows software to work in the same way it does on Windows) and give up soon afterwards, not realising that everything else they will ever do isn’t going to be that hard to set up. That’s an essay for another day, but this is definitely a statement of intent.

I’m also starting to get quite interested in the way people have their home offices set up. After 18 months of mostly remote working, I’ll be returning part-time to the office next week, but am still very interested in seeing how other people set their home offices up for maximum productivity. I’ve made a lot of changes since the start of last year, and I suspect many other people have as well. I have intentions to make a long list of people who have inspired me with their setups, but that’s also a job for another day.

Debian Post-installation Script

Yesterday I spent the day working on a script to install my usual working environment on top of a clean install of the (soon to be) current version of Debian. This is a fork of my Ubuntu scripts that I use to set up all my machines.

It’s very much a work in progress, and I wouldn’t recommend running this on a machine you care about, but I thought it was worth documenting in case it’s of use to anyone else.

Pre-installation

Before you run this script ensure that you have sudo installed and that your user is in the group. To do this run the following as root (replacing <your username> with your username)

apt install -y sudo
sudo usermod -aG sudo <your username>

You will also need some extra repositories enabled. My /etc/apt/sources.list looks like this:

deb http://deb.debian.org/debian bullseye main contrib
deb http://security.debian.org/debian-security bullseye/updates main contrib

Installation

Download the script, make it executable, and run it:

wget https://raw.githubusercontent.com/teknostatik/debian/master/deploy_debian.sh
chmod 755 deploy_debian.sh
./deploy_debian.sh

I’ve tested this on top of a full desktop install and a command line only installation as well. My goal is to get a working i3 environment, so the latter is probably what I’m going to focus on going forward. I did get a few snaps working on my test machine, but that was non-trivial, and I’m still not confident enough about that aspect yet. I also suspect most people who choose Debian do not care for snaps anyway.

Investigating Launchers

Last night I was experimenting with ulauncher as a way of easily launching apps on my computer. After using it for a few hours it seems like something that I might want to start using all the time, but it also made me start looking at other launchers like Albert which seems a little harder to install but which promises to search across my applications, my local files, and the internet.

I think that as I try and use a keyboard for most things this is the sort of application I need. At the moment I’m using dmenu which does the job well enough but which is also quite basic and relies me to choose between knowing the package name or the name that would be displayed if I was using it in a more traditional menu (so files or naultilus but not both). The launchers I’m looking at now do both of these and more, but both of them require a little hoop-jumping to get them installed so may not be suitable for my default installation image (although there is at least a PPA for ulauncher so I may very well have a go at getting that added this afternoon)

It’s something I’ll come back to, but in the meantime it’s always fun trying out new software that may one day become part of my workflow.

Keyboard shortcuts

I use a fairly eclectic range of hardware and software, and keyboard shortcuts are required to get it to all work together. This list is mainly for me, but I’ve split it up by device/application in case it is of any use to other people with similar setups.

Epomaker SK61 keyboard shortcuts

I use a 61-key keyboard on my main computer. It doesn’t have some of the keys that I use occasionally, and whilst it’s perfect for writing there are a few keyboard shortcuts required to make some things I do a little bit easier. The main ones that I use are:

  • Up arrow – Fn + /
  • Down arrow – Fn + menu
  • Left arrow – Fn + Alt
  • Right arrow – Fn + Ctrl
  • Delete – Fn + M
  • Volume up –Fn + H
  • Volume down –Fn + G
  • Switch to layer 2 – Fn + W

There isn’t really much else I use that this keyboard doesn’t give me naturally, and the form factor and the way it handles more than make up for the lack of keys.

Motospeed CK61 keyboard shortcuts

My other keyboard is a Motospeed CK61, which seems to have increased dramatically in price since I got mine. The layout is the same as the SK61 (which is why I like it), but instead of layers it has shortcuts that translate specific parts of the keyboard to alternate keys, which I find quite useful sometimes. Shortcuts I use are:

  • Factory reset – Fn + Escape
  • Map /, alt, menu and ctrl to arrow keys – Fn + 3
  • Control brightness of backlight – Fn + U/I
  • Cycle through different lighting patterns – Fn + menu

i3 shortcuts

I’ve used i3 as my window manager for over a year now, and I find it fits my workflow perfectly. The main i3 shortcuts I find myself using are:

  • Open a terminal window – $mod + Enter
  • Open a different application – $mod + d then type the application name (eg firefox)
  • Open (or go to) a second desktop – $mod + 2
  • Send the focused application to that desktop – $mod + Shift + 2
  • Split a container vertically – $mod + v
  • Split a container horizontally – $mod + h
  • Move between containers – $mod + arrow keys
  • Switch to a tabbed layout – $mod + w
  • Switch to a stacked layout – $mod + s
  • Close a window – $mod + Shift + q
  • Exit i3 – $mod + Shift + e

I do have a few other custom shortcuts defined, which are detailed in my i3 config file.

Atom shortcuts

I use the Atom text editor for a lot of my workflow. My main shortcuts are:

  • Multi line editing – ctrl + alt (or shift on Linux) + arrow keys
  • Toggle markdown preview – ctrl + shift + m
  • Create a PDF of the current file – alt + ctrl + e
  • Open a terminal ctrl + alt + shift + i
  • Show a hidden menu bar – alt

Kitty shortcuts

I use Kitty as my terminal emulator on any computer that it works with, although I don’t really use too much advanced functionality. The main shortcuts I use in Kitty are:

  • New terminal within an existing session – ctrl + shift + enter
  • Toggle through windows – ctrl + shift + ]

There are lots more of these on the Kitty website

Qutebrowser shortcuts

I’ve just started experimenting with Qutebrowser. It’s very fast, but has a steep learning curve. The main shortcuts that I’ve found myself using so far are:

  • Open a URL in the current tab – o
  • Open a URL in a new tab – shift + o
  • Toggle through open tabs – shift + k and shift + J
  • Close the current tab – d
  • Back – shift + H

A lot of standard shortcuts (ctrl + t for a new tab, Fn + 5 to refresh) also work as expected.

Zathura shortcuts

Zathura is a lightweight PDF viewer, and something else I’ve been incorporating into my workflow over the last few months. I only ever really use it for reading PDFs, so just use the arrow key shortcuts detailed above, plus s to make what I’m reading fit the width on the window/container I’m reading it in. Zathura has a lot of other functionality which I really do need to explore at some point soon, at which point I’ll come back and update this guide with anything interesting I uncover.