ESP8266: How to register partitions

Starting with v3.0, the ESP8266 NONOS SDK requires that partitions be registered in function void user_pre_init(void), like this: The code above initialises and registers a table of partitions, each having a type, a start address, and a size. Despite the documentation in ESP8266 Non-OS SDK API Reference and README, partitions can still be difficult to …

Fixing low sound volume in Linux

If your audio output suddenly sounds much lower than usual, check the volume settings of Advanced Linux Sound Architecture (ALSA). Run the command alsamixer on the console and verify that the volume is as expected. If you have more than one audio device on your computer (e.g., HDMI audio, built-in audio, USB audio, etc.) cycle …

Placement of -l options matters in GCC

I ran into an interesting puzzle with GCC this afternoon when trying to compile the code below. The first command that I used to compile the code failed: After about one hour of trying to resolve this error, I was resigned to reading the documentation. This is what I found from the section Options for …

Debian Linux, kernel 5.19, and crypttab

A Debian Linux system, running kernel 5.19 with Linux Unified Key Setup (LUKS) encryption, sometimes fails to boot from the suspend state, with the error message: Gave up waiting for suspend/resume device. This failure does not happen on kernel 5.18 and seems related to how the swap partition is set up in LVM volumes. For …

Two-finger scrolling in GNOME

For two-finger scrolling to work consistently in GNOME Wayland, I have to place one finger on the touchpad before the other. In addition, the point of contact of the second finger must be higher than the first’s. I observed this behaviour with a Lenovo ThinkPad. I cannot say whether it is unique to this laptop …

Solving error 1962 with Debian and UEFI on IdeaCentre K430

When setting up Debian Linux (Bullseye) on my Lenovo IdeaCentre K430 computer, I encountered problems related to UEFI. After the installation, the system did not boot and displayed the message Error 1962: No operating system found. It took three attempts before I found the solution, which I describe here. First, ensure that UEFI is enabled …

How to preserve custom /etc/resolv.conf entries with DHCP in Debian Linux

In Debian Linux, when a network interface is configured to obtain an IP address automatically, the DHCP client utility writes the values received from the server over the content of file /etc/resolv.conf. Thus, custom entries that you had saved in this file, typically domain suffixes and domain name servers, are lost. If you need DHCP …

Trap with `gmtime` and other time functions

From man gmtime: The gmtime() function converts the calendar time timep to broken-down time representation, expressed in Coordinated Universal Time (UTC). It may return NULL when the year does not fit into an integer. The return value points to a statically allocated struct which might be overwritten by subsequent calls to any of the date …