Monday, August 24, 2026

Thinkpad 14s Snapdragon Elite X on Ubuntu 26.10

The Thinkpad 14s Gen 6 (Snapdragon Elite X) with 32GB/512GB now works adequately on Ubuntu 26.10 (Stonking Stingray). Previously, closing the lid when connected to an external monitor blue-screened the laptop. This now invokes the screensaver instead -- a bit of a hack but an adequate solution. Internal sound and camera both work, without recourse to copying Windows drivers. The kernel I tested with was 7.0.0-14.

However, there are a few sticking points that remain:

  • It doesn't support more than one external monitor, though I have tested it on an ultra-wide and 4K screen, both successfully.
  • It won't connect to an HDMI monitor via the HDMI connector, though you could do this via a docking station.
  • Some quirks of display remain. Occasionally it seems to blur bits of text. Hopefully this will cure itself in later updates.

Lenovo have released Gen 7 Snapdragon laptops with more advanced processors, but they are limited to 12 cores. I haven't tested on one of those yet.

Monday, April 6, 2026

Thinkpad T14s Gen 6 Snapdragon X Elite vs Thinkpad T14 Gen 6 AMD

Summary

In general Ubuntu support for ARM laptops is improving with each new release of the kernel. At the moment sound, camera, wifi and most other features work. However, twin displays with the dock, boot from dock and external HDMI are not yet supported. Power management is also sub-optimal.

ModelT14s Gen 6 ARMT14 Gen 6 AMDARM vs AMD
Weight1.23kg1.47kgbetter
Dimensions312x220x20mm315x225x20mmtie
Screen (diagonal)357357tie
PortsLeft 2xUSBC, right 2xUSBALeft 2xUSBC,USBA, right: RJ45,USBA, microSDworse
Battery58Wh57Whbetter
Geekbench 6.4Single core 2347, Multi-core: 14312Single Core 2893, Multi-core: 12324tie
Speakers+microphoneworksworkstie
External headsetworksworkstie
Cameras (internal and external USB)worksworkstie
Dockpartial (one screen only)worksworse
Boot from docknoworksworse
LUKS encryptionworksworkstie
Firmware updaternoworksworse
Hibernate/wake upworksworkstie
Kernel upgradableworksworkstie
wifiworksworkstie
Hibernation for 1 hourlost 4%lost 1%worse
SSDM.2 2242M.2 2280Worse
HDMInot detectedworksWorse

For the tests I used two models of the Lenovo Thinkpad:

  1. T14s Gen 6 Snapdragon Elite X

  2. T14 Gen 6 AMD Ryzen 7 Pro AI

Operating systems

For laptop 1 I used Ubuntu 26.04
For laptop 2 I used Ubuntu 26.04

Kernels

For laptop 1 7.0.0-10
For laptop 2 7.0.0-10

Processor

Laptop 1: Snapdragon X Elite X1E78100 Qualcomm Oryon 3.417 GHz, 12 physical cores (no hyperthreading)
Laptop 2: AMD Ryzen 7 350 (8 cores with hyperthreading) 2 to 5 GHz, w/Radeon 860M x 16

Battery

Laptop 1: 58Wh.
Laptop 2: 57Wh.

When put into hibernation laptop 1 lost 4% of power per hour. Laptop 2 lost 1%. The difference may be down either to the default sleep mode not being “deep” or for deep sleep not working at all. I will investigate.

Installation

Installation of Ubuntu 26.04 was successful with all options on both machines.

Thunderbird

Installation was successful and worked the same on both machines, including calendars.

Speakers and microphone

Internal speakers and microphone work on the ARM machine from kernel 7.0.0-10 and onwards.

Function keys

Brightness and sound controls now work on both machines.

Cameras

Both the internal camera and external Logitech 720P camera worked fine on both laptops.

Firmware Updater

This now works on both ARM and AMD machines.

Upgrading the kernel

You can install mainline as per the instructions on the mainline git repo with either machine.

Wifi

This works as expected on both laptops since kernel 6.18.6.

External monitors

Tested with a twin UHD display via Thinkpad USB-C Dock Gen 2.

This worked fine on laptop 2.

On laptop 1, however, closing the lid did not assign the main screen to one of the external monitors.

The first UHD external monitor was recognised at full resolution. The second external UHD monitor was not recognised, but was mirrored from the first. It does not appear as Display 3 in Displays control panel. Only the laptop (1) and first external monitor (2) appear. If you close the laptop the video on the external monitor freezes.

The same behaviour was observed with twin FHD monitors.

Changing the primary monitor to the internal display or vice versa worked, but it did not register the change in the Displays settings panel, which always shows the external monitor as primary.

HDMI

This doesn't work on laptop 1 at all.

With dock

On laptop 1, boot from the dock led to a fuzzy grub menu. On selecting Ubuntu the screen went black and did not boot. On laptop 2 this works fine.

Upgradeable Storage

Laptop 2 takes standard M.2 2280 drives, of which there are plenty of models up to 4TB. Laptop 1, however, accepts only M.2 2242, a 42mm long drive which is harder to source. I found only one model that has 4TB capacity. Most are 512GB-1TB. The 2230 drives can be used in a 2242 slot with an adaptor but 2280 drives are simply too large.

Monday, June 30, 2025

ThinkPad T14s Gen 6 vs Thinkpad T14 Gen 5 with Linux

Summary

Model

T14s Gen 6

T14 Gen 5

Gen6 vs Gen 5

Weight

1.23kg

1.47kg

better

Dimensions

312x220x20mm

315x225x20mm

tie

Screen (diagonal)

357

357

tie

Ports

Left 2xUSBC, right 2xUSBA

Left 2xUSBC,USBA, right: RJ45,USBA, microSD

worse

Battery

58Wh

52.5Wh

better

Geekbench 6.4

Single core 2347 Win (2349 Linux), Multi-core: 14312 Win (13587 Linux)

Single Core 2386, Multi-core: 10956

better

Speakers+microphone

not detected

works

worse

External headset

works

works

tie

Cameras (internal and external USB)

works

works

tie

Dock

partial (one screen only)

works

worse

Boot from dock

no

works

worse

LUKS encryption

works

works

tie

Firmware updater

no

works

worse

Hibernate/wake up

works

works

tie

Kernel upgradable

works

works

tie

wifi

works (with kernel 6.16.0)

works

tie

Hibernation for 1 hourlost 2.9%lost 6.7%Better
SSDM.2 2242M.2 2280Worse
HDMInot detectedworksWorse

For the tests I used two models of the Lenovo Thinkpad:

  1. T14s Gen 6 Snapdragon Elite X
  2. T14 Gen 5 AMD Ryzen 7 Pro 8840U

Operating systems

For laptop 1 I used Ubuntu 25.10 ARM
For laptop 2 I used Ubuntu 24.04.2

Kernels

For laptop 1 6.14.0-15
For laptop 2 6.11-0-17

Processor

Laptop 1: Snapdragon X Elite X1E78100 Qualcomm Oryon 3.417 GHz, 12 physical cores (no hyperthreading)
Laptop 2: AMD Ryzen 7 Pro 8840u with Radeon 780m graphics x 8 cores (16 hyperthreaded) 3.3 - 5.1 GHz

Battery

Laptop 1: upower -i reports 58Wh capacity.
Laptop 2: 52.5Wh.

When put into hibernation laptop 1 lost 2.7 to 2.9% of power per hour. Laptop 2 lost 6.7%

Installation

Installation of Ubuntu 24.04.2 was successful with all options.

Installation of Ubuntu 25.10 on the ARM machine however, was much more buggy. First you had to disable Secure boot, which is normal. However, retaining the Windows partition as recommended then required a recovery key from the Microsoft site to boot into Windows, which was necessary to turn off BitLocker. After that it was possible to install Ubuntu alongside the Windows NTFS partition. With the latest version of the installer image LUKS now works, although it does not yet have a graphical prompt for the luks password, you can enter this on the commanline and all is well.

Thunderbird

When installing Thunderbird in the terminal multiple lines are producing instead of overwriting the previous line. So some terminal emulation here doesn’t work, but the installation succeeded.

Speakers and microphone

The internal speakers and mircophone were not recognised on Laptop 1 at all, not even after running qcom-firmware-extract. However, after running that command an external headset, an Edifier K800 USB worked perfectly, but only when plugged directly into the laptop.

Function keys

Brightness controls now work on kernel 6.16.

Cameras

Both the internal camera and external Logitech 720P camera worked fine on both laptops.

Firmware Updater

I tried installing the firmware-updater snap, but it won’t run.

As a regular user: error sending Activate message to application: GDBus.Error:org.freedesktop.Dbus.Error.NoReply: Message recipient disconnected from message bus without replying.

As root: touch: cannot touch ‘/root/snap/firmware-updater/common/.cache/desktop-runtime-date: No such file or directory.

Upgrading the kernel

You have to install by building the source, as per the instructions on the mainline git repo

Wifi

This works as expected on both laptops. The VPN works as expected. However, on laptop 1, after upgrade to kernel 6.15-03, via the software updater tool, the wifi no longer works. It seems that qcom-firmware-extract only works with kernel 6.14.0-15. After running this tool again it says it updated the 6.14 kernel, but that the latest is 6.15.

External monitors

Tested with a twin UHD display via Thinkpad USB-C Dock Gen 2.

This worked fine on laptop 2.

On laptop 1, however, closing the lid did not assign the main screen to one of the external monitors.

The first UHD external monitor was recognised at full resolution. The second external UHD monitor was not recognised, but was mirrored from the first. It does not appear as Display 3 in Displays control panel. Only the laptop (1) and first external monitor (2) appear. If you close the laptop the video on the external monitor freezes.

The same behaviour was observed with twin FHD monitors. Attempting to set an external monitor as the primary did not work, and the cursor disappeared from the laptop monitor, making it useless.

HDMI

This doesn't work on the Snapdragon X Elite laptop at all.

With dock

Boot button on dock started the laptop. It then displayed the blurred grub menu.

Selection of first item Ubuntu in grub menu produced error: “Failed to boot either main or alternate entries.” It returned to grub and after selecting Ubuntu again crashed.

Booting from the laptop directly worked.

Shutdown while connected to the dock failed: USB cable bad?

Hibernation

Laptop 1 declined 2.7-2.9% after 1 hour of hibernation.
Laptop 2 declined by 6.77% after one hour of hibernation

Upgradeable Storage

Laptop 2 takes standard M.2 2280 drives, of which there are plenty of models up to 4TB. Laptop 1, however, accepts only M.2 2242, a 45mm long drive not yet made by Crucial. I found only one model that boasts 4TB. Most are 512GB-1TB.

Applications

Laptop 1 does not have an available arm64 build of the Chrome browser available.

Monday, July 22, 2024

Defining a user for Sabre Dav (calendar)

Sabre is an open-source calendar server. It is well written and moderately powerful, being used by Nextcloud open-source groupware. However, setting up a Sabre calendar server is not that easy. As the documentation says, there is no web interface for creating users. Instead, it advises that you create them directly in the database. According to the instructions you need to:

  1. Add an entry to the users table, specifying the user name and the digest of the password (it is pretty unclear what to do for this)
  2. Add a corresponding entry to the principals table -- but no details are given

Looking at the two tables in question, users has three columns: id, username and digesta1. The first is the primary key and doesn't need to be set. The second and third columns are varbinary. that is, you specify them as hexidecimal strings preceded by '0x' and they will be defined and displayed in that form.

The principals table has id, uri, email and displayname columns. displayname is text, uri and email are varbinary. It is pretty simple if you know SQL to add entries to the princpals table. I'll concentrate on the format of the digesta1. According to the php source code it is an md5 hash of a string of the format:

username:realm:password

There is one user already defined: admin user. It is unclear what the realm is set to. Stepping through the debugger I discovered that it is set by default to SabreDAV. I tried creating the hash using md5sum on the commandline, but this didn't give the correct answer. You need to create it using the php function md5. Once I generated it that way, and plugged in the value to the digesta1 column of the users table I could login using my own password.

Stick a file with this content on your web-server and it will print out the digesta1 field value for the user username with password foobar:

<?php
echo('hash='.md5('username:SabreDAV:foobar'));
?>

Tuesday, February 20, 2024

Upgrading Ubuntu 22.04 to 24.04

The latest version of Ubuntu Noble Numbat is coming, and many will be tempted to upgrade as advised on the ask-ubuntu site. I would warn anyone trying to do this to hold off for now. Although Noble Numbat itself is getting there, only a fresh install of 24.04 works for now. Currently on 21 February 2024 using sudo do-release-upgrade -d will likely brick your machine. I've tried the upgrade on several different models (all Lenovo) with fresh installs of Ubuntu 22.04 upgraded to the latest versions of everything and the do-release-upgrade -d crashes either at tracker-extract or, if you manage to disable it, at networkd-dispatcher. The machine freezes during the upgrade and can't be reused after that. I had to copy all my files off onto an external drive and reinstall everything. The strange thing is they had the same problem with 20.04->22.04, but somehow they fixed it. I wait for the corresponding update for 22.04->24.04.

Update 4 April 2024: Now sudo do-release-upgrade -d does nothing. It says "There is no development version of an LTS available". So it looks like they are preventing people from running the upgrade while it is known to be broken, but haven't fixed it yet.

Update 17 April 2024: sudo do-release-upgrade -d is back! I tried this on a clean install of 22.04, fully upgraded, rebooted, and ran the do-release-upgrade -d. It welcomes you to Ubuntu 24.04, but still fails. The laptop is still bricked and is unusable after that. The crash file in /var/crash says it was in netplan.script. So I guess this is still a library incompatibility between 22.04 and 24.04, related to networking.

Update 30 April 2024: Upgrading in two steps, from 22.04 to 23.10 using sudo do-release upgrade then once that upgrade is complete, you can upgrade to 24.04 using sudo do-release-upgrade -d. Even though the process got stuck a couple of times on one model of laptop, after retsrting it was possible to pick up where the installer had left off and so the laptop was not ruined. In the other cases, the dual upgrade went smoothly, but took about an hour overall.

Thursday, February 15, 2024

Replace Firefox snap with non-snap version in Ubuntu

One of the problems with the snap package of Firefox is that it can't communicate with programs outside of its snap such as Keepassxc. Also if you don't like the idea of using the self-contained enviroments that snaps implement, and would prefer your applications to live together inside a single OS with its installed libraries rather than duplicating them inside each snap, then replacing the default Firefox snap in Ubuntu may appeal. I'm appending a script I wrote for Ubuntu 22.04, which also works for Ubuntu 24.04. It achives a few things:

  1. Deletes Firefox snap
  2. Installs Mozilla's latest Firefox binary
  3. Sets up apt so that it prefers Mozilla Firefox over snap Firefox when updating packages
  4. Adjusts apparmor to allow external programs like Keepassxc to communicate with Firefox

Sunday, December 3, 2023

Implementing a stack in bash

I needed to convert simplified HTML to wiki markup. For that I first needed to check the syntax of the HTML. A stack is perfect for that, but how to do it?

declare -a stack
# push
stack+=($tag)
#pop
unset stack[${#stack[@]}-1]

And that is all there is to it.

Sunday, July 9, 2023

Best laptops for Linux

Having owned a number of laptops over the years in my efforts to find the ideal one to run Linux I would recommend to anyone engaged in the same expensive and frustrating pursuit the following two machines/brands that firstly run Linux well, and secondly last more than 12 months before they fall apart.

Clevo L140MU or later models (also called Metabox, System 76 etc)

    Advantages
  • Comes without any operating system, so you can avoid the "Microsoft tax"
  • Runs Linux well
  • Is very light -- has magnesium body under 1kg
  • Very durable. I have had mine for three years still works mostly OK (see below)
  • Great 72 Wh battery
  • Great keyboard with backlight
  • Great trackpad though simple like Apple one
  • 180 degree lid
  • Can be charged from USB-C port using a generic 65W charger
    Disadvantages
  • The rubber feet eventually come off -- stuck them back on with superglue
  • Power supply hard to source and the connector failed after 12 months, had to use USB-C
  • Fan got a bit noisy after 3 years
  • Function keys only work when pressing Fn button as well

Lenovo T480, T14, P14s

    Advantages
  • The toughest laptops I have ever used. Still work perfectly after 5 years
  • P14s comes without Microsoft tax
  • Supports Linux well
  • Function keys work without pressing Fn
  • USB-C charging only
  • Splill-resistant keyboard
  • Rubber feet never come off
    Disadvantages
  • Heaver than the Clevo (1.6kg)
  • Battery not as good (50Wh)
  • P14s requires a patch from Radeon to support suspend/resume
  • Microsoft tax with T14
  • T480, T490 keyboard usually not backlit
  • The only major brand I haven't tried is Asus. The others I wouldn't reccommend.

Thursday, May 25, 2023

Migrating an openldap database to a new installation

If you are familiar with Openldap you may have become frustrated with the difficulty of migrating a database from one installation to a fresh instance of Openldap. There is an easy way to do this, using a combination of slapcat and slapadd. The only drawback is that it destroys the database at the destination. However, this is usually a new copy of Openldap, so it doesn't matter.

Ldap is a tree

It is important to realise that an ldap database is a tree. That is, there is only one node at the root, and every descendant node must have only one parent. When you install Openldap the tree consists of one node called "nodomain", which, if not destroyed, will likely conflict with anything you import. What you really want is for the root to consist of a "suffix" of your choice, such as mycompany.com, which ldap breaks down to dc=mycompany,dc=com.

Exporting your ldap tree

On your old Openldap installation you must first export the data. For this I recommend you use slapcat:

slapcat [-b suffix] -l output.ldif

You can specify a suffix, which will then export only that portion of the tree. This is useful when your old installation contains a sub-tree you want installed in standalone form on the new instance of Openldap. Or just omit it, and the entire tree will be exported to the file export.ldif.

Importing the exported tree to a new Openldap instance

slapadd is a simple utility that copies the exported database into an empty database. I provide here a script for doing this. Notice that it first deletes the old database (the one defining "nodomain" as the root) to avoid conflicts. To do this it must first stop the slapd service and restart it again afterwards.

If you install ldap-account-manager (in Debian/Ubuntu) you can see the tree it creates in Tools->Tree view, which should be identical to the one you exported.

Wednesday, May 24, 2023

Adding SSL/TLS certificates to Openldap on localhost using Ubuntu Linux 22.04.2

I wanted to install ssl/tls certificates on my openldap installation that I had running on localhost as a demo, but the information I found on the Web was mostly out of date. Another approach is to use letsencrypt, but that is for registered domain names and won't work with localhost, so I will be using self-signed certificates in this post.

Requirements

You will need to have installed openldap and openssl. If you haven't then do so now:

sudo apt install openssl slapd

Create a certificate authority (CA) to sign your certificates

There is a script in openssl for doing this. Nowadays it is called CA.pl. I found it in /usr/lib/ssl/misc/, but it might be somewhere else on your machine. You can find it with:

sudo find / -name CA.pl

Once you have the path to it, create a directory to hold the CA. I created one in /var/myca:

sudo mkdir -p /var/myca
cd /var/myca
Now invoke the script:

sudo /usr/lib/ssl/misc/CA.pl -newca

When it prompts for a certifcate filename just hit return. It will ask you some certificate type questions, including a passphrase. Give it something simple so you can remember it. (Remember this is just for testing. On production you'll need a secure passphrase.) It will create a directory called demoCA inside /var/myca.

Create a certificate for openldap using the CA

sudo   openssl req -new -nodes -keyout newreq.pem -out newreq.pem

Again, you have to answer all the tedious certificate questions. When it has finished you should have newreq.pem in the /var/myca directory. Now sign the request:

sudo /usr/lib/ssl/misc/CA.pl -sign

This creates newcert.pem

Copy the certificates and key to where openldap can find them

Create a directory to hold them for openldap. I chose /etc/openldap/certs. Create it if it is not there:

sudo mkdir -p /etc/openldap/certs

Now copy the certificates over:

cd /etc/openldap/certs
sudo cp /var/myca/demoCA/cacert.pem .
sudo mv /var/myca/newcert.pem servercrt.pem
sudo mv /var/myca/newreq.pem serverkey.pem
sudo chmod 600 serverkey.pem 
sudo chown openldap:openldap *
ls -l

This produces:

-rw-r--r-- 1 openldap openldap 4730 May 25 11:49 cacert.pem
-rw-r--r-- 1 openldap openldap 4751 May 25 11:50 servercrt.pem
-rw------- 1 openldap openldap 2843 May 25 10:22 serverkey.pem

Allow Openldap to read this directory

Nowadays Openldap is controlled by apparmor, which restricts which directories openldap, aka slapd, can access. So we have to tell it about this new directory of certificates we just created. In /etc/apparmor.d you should find a file called usr.sbin.slapd, which is divided into sections, one of which is called "# ldap files". After that are a couple of lines. Add this line in bold using your favourite editor to tell it about all the files in /etc/openldap/certs:

  # ldap files
  /etc/ldap/** kr,
  /etc/ldap/slapd.d/** rw,
  /etc/openldap/certs/* r,

Now restart slapd to get it to see the directory:

sudo systemctl restart slapd

Update the openldap config to point to the certificates and key

Create a file add_ssl.ldif using nano or vi, with this content:

dn: cn=config
changetype: modify
replace: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/openldap/certs/cacert.pem
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/openldap/certs/serverkey.pem
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: /etc/openldap/certs/servercrt.pem

Now load it:

sudo ldapmodify -Q -Y EXTERNAL -H ldapi:/// -f add_ssl.ldif -W

It will respond with:

[sudo] password for username: 
Enter LDAP Password: 
modifying entry "cn=config"

If it says:

ldap_modify: Other (e.g., implementation specific) error (80)

check in the last lines of syslog (tail /var/log/syslog) to see if apparmor is denying access. If so, check your steps in "Allow Openldap to read this directory" above.

Tell Openldap where the CA certificate is

Edit /etc/ldap/ldap.conf and set the variable TLS_CACERT to /etc/openldap/certs/cacert.pem, then restart slapd:

sudo systemctl restart slapd

Your Openldap installation should now be ready to use SSL!

Monday, February 13, 2023

Ubuntu 22.04.1 on Lenovo Thinkpad P14s (Ryzen R7 Pro 6850U)

I was a bit nervous about this as the Canonical site says that the latest version of Ubuntu may not run on the Thinkpad P14s:

Pre-installed in some regions with a custom Ubuntu image that takes advantage of the system’s hardware features and may include additional software. Standard images of Ubuntu may not work well, or at all.

Indeed, on booting up the laptop is indeed has a custom kernel 5.14.0-1047-oem and Ubuntu 20.04 (Focal Fossal). But I was determined to upgrade to 22.04. After upgrading the hard drive to 2TB PCIe 4.0 I noticed that in this model (21J5) there are NO slots for memory expansion. So you're stuck with the soldered 32GB it comes with. However, the installation went smoothly. I chose "Install 3rd party software for graphics and wifi". After installation I rebooted and tested wifi, sleep, suspend, closing the lid and connecting to a dock with two screens, keyboard and mouse. Also tested the function keys. All was fine. So I'd recommend this model for those of us who want a Linux laptop and don't want to pay the Microsoft tax.

Sunday, May 1, 2022

Ubuntu 22.04: Gdk-CRITICAL **... gdk_wayland_window_set_dbus_properties_libgtk_only: assertion 'GDK_IS_WAYLAND_WINDOW (window)' failed

I encountered this error when running the soffice commandline interface under Jammy Jellyfish (Ubuntu 22.04). Since there wasn't any window being generated I was puzzled. A little searching revealed that the library libgdk3.0-cil (CLI binding for GDK 3) was not installed, and so running:

sudo apt install libgdk3.0-cil

solved the problem.

Wednesday, March 23, 2022

Create a bootable .iso from a folder in Linux

If you have ever tried to modify a Linux installer you will know that you must mount the .iso file:

sudo mkdir /mnt/ubuntu
sudo mount -o loop ubuntu-xxx.iso /mnt/ubuntu

then copy it to another directory:

sudo cp -ra /mnt/ubuntu ~/ubuntu

because you can only mount it read-only. Then you can make your modifications to the files in the copied folder. In my case I provided a default value for the keyboard (US) to see if the installer would skip asking me for the setting. Then the bootable .iso must be recreated from the modified folder. But how to do it? I used xorriso:

sudo xorriso -as mkisofs \
   -J -R -V 'UNUNTU-20.04 [CUSTOM]' \
   -o ubuntu-20.04.custom.iso \
   -J -joliet-long -cache-inodes \
   -isohybrid-mbr isohdpfx.bin \
   -b isolinux/isolinux.bin \
   -c isolinux/boot.cat \
   -boot-load-size 4 -boot-info-table -no-emul-boot \
   -eltorito-alt-boot \
   -e boot/grub/efi.img \
   -no-emul-boot -isohybrid-gpt-basdat -isohybrid-apm-hfsplus \
   "ubuntu"

Note the use of the file isohdpfx.bin. I couldn't locate this in the Ubuntu distribution so I just copied the first 432 bytes of the existing Ubuntu .iso installer and saved it using hexedit. Without this it will fail to mount and hence won't be bootable. Now make an installable USB out of the .iso using a tool like Startup Disk Creator or Balena Etcher and it will boot happily from it.

Monday, October 25, 2021

Puppeteer page waitForSelector and visible:true option won't process click

I had a problem in Puppeteer where an initially hidden menu has to be invoked by clicking on the menu icon. I used await page.waitForSelector(selector) and then called page.click(selector), where 'selector' is a css selector and page is my page object in Puppeteer. Nothing happened. I figured that as the page had just loaded the menu icon might have been in the DOM but not yet visible. So I tried adding the visible:true option: page.waitForSelector(selector,{visible:true}). Again nothing happened. Then I added a short delay before page.click(selector) via page.waitForTimeout(2000) and it worked. But that's like a hack. I mean how long do you wait? So I figured that the menu icon is visible but the click-handler for it is not yet loaded, and waiting ensures that it usually is. But how to do it correctly? Then I tried this:

await page.waitForSelector(selector);
await page.$eval(selector, elem => elem.click());

And it worked.

Wednesday, September 1, 2021

Cure for crashing iPhone

My iPhone kept crashing. If I left it on overnight it would invariably crash by morning and drain the battery in the process. I tried all the cures suggested on the Internet, including wiping the phone and reinstalling everything from scratch. That worked for a while then it started crashing again. I tried shutting it down overnight, but it still crashed the same. So then I tried shutting it down AND wrapping it in aluminium foil. And hey presto -- it woke up the next morning and the battery was fine. So this tells me that there is some communication going on between even a 'shut down' iPhone and the service provider, since radio waves can't penetrate alfoil. Also that there is some kind of broken connection that it tries to re-establish overnight that fails repeatedly until it runs out of power. Miraculously, the foil also stopped it crashing -- for a while. So those broken connections appear to be marked as 'stale' and it doesn't try to remake them, though eventually new ones appear. So if you have the same problem it can't hurt to try the same remedy that worked for me -- shutting it down overnight and wrapping it in alfoil. It's a lot easier than reinstalling the software.

Wednesday, August 18, 2021

Installing 'tkinter' on Linux for Python3

I find it confusing that the python module 'tkinter', the interface module for the tk scripting language, is only installable via the Linux platform package manager. On Ubuntu I used:

sudo apt-get install python3-tk

and then in python3 I can import tkinter:

Python 3.9.5 (default, May 11 2021, 08:20:37) 
[GCC 10.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tkinter
>>> quit()

Using pip3 directly to install tkinter doesn't work, nor does pip3 install tk, which installs an unrelated module.

For python2 remove the '3' from the above commands.

Wednesday, July 21, 2021

Installing VLC on Ubuntu 21.04

There are plenty of guides on how to install VLC on Ubuntu, but rather few on how to do it on Ubuntu 21.04. If you believe what they say then you only need to install the vlc and ubuntu-restricted-extras packages. The first package is the VLC application itself and the ubuntu-restricted-extras is supposed to contain all the needed codecs to play encrypted dvds. Except it doesn't work. You also need libdvd-pkg. Install that and all will be fine.

Sunday, July 18, 2021

Disabling middle trackpad click on Ubuntu 21.04

Since Ubuntu 21.04 my fix to reassign the middle trackpad click using xinput to "left click" no longer works. Now whenever my hand drifts to the middle of the trackpad, and I click on an application icon, I open up a copy of the current application. Or if I am in a program I end up pasting something I didn't want to. So I tried instead gnome-tweaks, which you can easily install using apt-get in terminal:

sudo apt-get install gnome-tweaks

Now lauch gnome-tweaks (e.g. by typing gnome-tweaks in Terminal) and select "Keyboard and Mouse". There is a section there called "Mouse click emulation". There are three settings:

  1. Fingers: all single trackpad clicks are left-clicks but you can simulate a right click by tapping with two fingers. I find this the most comfortable setting.
  2. Area: this is the default. the trackpad is divided into three areas. The bottom middle of the trackpad is middle click, leaving very little space for left-click which is dominant.
  3. Disabled: all clicks on the trackpad are left-clicks. I find this useless as you must have right click in many cases.

There is also a setting to disable middle click paste. I turned that off as I do not want middle click at all. Middle click makes sense with a mouse where you have tactile feedback as to what you are pressing but on a featureless trackpad you can only middle-click reliably if you stare at it the whole time. For terminal copy and paste I use shift-control-c and shift-control-v. With option 1 above you can still have middle click paste with a three-finger tap.

Saturday, February 13, 2021

A dropdown menu for toolbars using standard HTML elements

I wanted a dropdown menu in HTML but without the tons of javascript and complex stylesheets usually associated with such designs. My dropdown menu is built from two standard HTML elements: an input of type button, and a select. It needs a little vanilla javascript and css to make it work, but it is not excessive. It works on all major browsers.

Why not just use an ordinary select element on its own? Because then the currently selected item would occupy a variable amount of horizontal space. This menu is intended for use in a toolbar where space is at a premium. This way the button driving the menu is always only 1-character or 1 icon wide. With a variable width select if you choose a long item then the other buttons may wrap around onto the next line. Of course in select you can set its width to be a fixed value but then the current value is often unreadable.

Here's the code:

The basic idea is to have a button on one line and a select on the next, separated by a <br>. The select menu is initially invisible. Clicking on the button makes it visible. Then it works like a normal select element, except that if you change the selected option or select the same one it makes the menu disappear. Enclosing the menu and its button in a div that is absolutely positioned makes the menu float over subsequent text, rather than pushing it down.

Here's the thing in action. (The label for the current value is for demo purposes, and in practice should be omitted or placed elsewhere on the page.)


And some more text here.

Tuesday, December 8, 2020

Ubuntu on Metabox (Clevo) L140MU

The Clevo L140MU uses the Intel 11th Gen i5 or i7 processor, which is an integrated SoC with wifi and Iris Xe graphics. The model I tested on has an extra 8GB of RAM, making 16GB in total, and a 512GB SSD. I chose the i5 model as the i7 is only 20% faster for a lot more money, and probably runs hotter. Both processors have 4 cores with hyperthreading. It comes with no operating system, so you don't have to pay the "Microsoft tax" -- a positive point for a Linux enthusiast. However, you can't buy direct from Clevo. You have to go to a reseller like Metabox, Sager or System76. (Their Lemur Pro seems to be this model.)

Physical characteristics

The laptop is extraordinarily light. The body is reportedly a magnesium alloy anodysed black. It's thicker than I was led to believe. It measures 15mm x 220mm x 323mm, excluding the rubber feet, which protrude a further 2mm. The base is not tapered and hence is fairly chunky for such a light laptop. This is to accomodate the 73 Wh battery. The build quality is good. The lid is mounted via a spindle-type hinge as on a Macbook, and looks really solid. It is very smooth, doesn't creak and goes back evenly with the same force all the way to 180 degrees as advertised. The lid is rigid, the screen is matte. The power cable goes in on the left hand side. The power brick is a fairly hefty 65 watt one. Ports on the left are thunderbolt, USB, HDMI and on the right, lock, USB, stereo audio jack, SD mini and power button. Ventilation is between the screen and the body. The fan is off or inaudible most of the time in normal use. When it does come on it is quiet and discreet.

The base has 12 screws deeply inset, and four rubber feet which seem firmly attached (so far) and are rather sharp. This is always a weak point with laptops and I remain sceptical that this new design will fare any better than usual. But let's hope I'm wrong.

The laptop comes with numerous ugly stickers, which have to be removed carefully without scratching the anodysed magnesium. I used a plastic spudger to lever up a corner and then pulled them off easily. You really don't want to use any kind of metal tool. And do it soon, before the glue sets hard.

Screen

The screen has a good range of brightness and although I can't measure it, it looks decently bright at full blast. It is of good quality and can be viewed at a sharp angle without dimming. Though they don't say it is IPS it looks like it is. It measures oddly 310mm x 175mm. This is a lot wider than your average 14 inch. However, a quick calculation reveals that this ratio: 1.77:1 is precisely that of FHD (1920x1080), so the proportions of all images displayed on it are true to life.

Keyboard and trackpad

The keyboard is a chiclet style with more than average travel. It is comfortable to use, though I wonder if too much of a gap has been left between keys and the surrounds for crumbs, fingernails and general rubbish to creep in. It has several intensities of backlighting reached by repeatedly hitting the keyboard backlight (fn-F4) key.

PgUp and PgDn are stupidly squeezed in above the left-arrow and right-arrow keys. This means that navigating via left or right arrow in a document frequently results in hitting PgUp or PgDn by mistake. The only way to make the left and right arrow keys usable is to disable PgUp and PgDn via xmodmap:

xmodmap -e 'keycode 117='
xmodmap -e 'keycode 112='

Making this permanent though may take a little more thought.

The trackpad is Elantec and as in my previous Clevo works well under Ubuntu. Two-fingered scroll works only in the "natural" way regardless of the setting in the Mouse and Touchpad control panel. To turn it off you need to type in the terminal:

gsettings set org.gnome.desktop.peripherals.touchpad natural-scroll false

The tapping areas need configuring as the default setting recognises the middle of the trackpad as the middle button of a mouse. This is easily fixed though:

sudo apt-get install xinput
xinput --list
xinput get-button-map 12
xinput set-button-map 12 1 1 3 4 5 6 7

The list command tells you the ID of the trackpad, which in my case is 12. The last command modifies the buttton-map for id 12 so that buttons 1 and 2 both do the job of button 1. I haven't yet managed to get this to persist between reboots, however.

Speakers

Another drawback with this model is the poor sound quality of its speakers. Maybe I am spoiled from having higher quality speakers found in mainstream laptops, but there is a definite reverberation between the speakers and the keyboard. You really need to use headphones to get decent sound.

Battery

After 12 hours of normal use including rest periods it went from 100% to 40%. It lost about 12% overnight while in suspend (I think).

Installing Ubuntu

For this model you need Ubuntu 20.10 with the 5.8 kernel. With 20.04 (kernel 5.4) the brightness controls didn't work. Installation was easy once you find out that the F7 key lets you choose the startup disk. The wifi works fine. The backlit keyboard button (fn-F4) works, as do volume controls (fn-F5 and F6), brightness (fn-F8 and F9). fn-F1 does nothing. fn-F2 and F3 work as expected. fn-F10 does nothing. fn-F11 enters airplane mode. fn-F12 puts the screen to sleep.

After a while I realised that having to hold down the fn-key when accessing things like screen brightness is really annoying. So I reprogrammed the F3, F5, F6, F8 and F9 keys to control sound and brightness directly. For this you need to install xdotool and program the keys via Settings->Keyboard shortcuts. For example I defined a custom shortcut called "mute" with the definition xdotool key XF86AudioMute.

One issue that only emerged after using it for a while was that auto-suspend, which kicked in every 5 minutes of idleness, tended to crash the machine. I upgraded the software using Software Update and also disabled auto-suspend and now all seems fine.

Conclusion

This is a good laptop for Linux, especially as it does not come preinstalled with Windows. The build quality and the battery are both positive points. In spite of a number of glitches, which can all be got around. I would recommend this laptop for Linux. Remember there are no perfect Linux machines out there.

Postscript

After using this machine now for just over 6 months a few minor problems have emerged. Early on in its life it crashed and could not be rebooted using the restart button. After talking with Metabox support the answer was simple: you need to take off the case bottom and pull out the battery cable and reinsert it. I'm confident that this problem, which hasn't recurred for some months is due to the Linux kernel not fully supporting this machine, because it seems OK now after updates were applied.

Also one of the rubber feet is a little bit loose, but they are still all on. A good cure if they do come off is to superglue them back on. The anodysing also can chip, so it is best to keep it in a sleeve.

Other than that I'm still very happy with the machine. The keyboard, trackpad, battery, hinges and screen are all really good. If you get those right you generally have a great laptop.