I'm blogging about Emacs, Drupal, php and exciting subjects

· Lars Nielsen

Near-Duplicate Search Results: Collapsing by Canonical URL and Finding Fuzzy Copies With SimHash Bands

Every search engine has to decide what to do with pages that are the same page, or nearly. Mine had two separate problems with them in July. Paginated variants of one page showed up as separate results, and pages that were copies of each other with small edits weren't recognised as copies at all.

Read article Near-Duplicate Search Results: Collapsing by Canonical URL and Finding Fuzzy Copies With SimHash Bands
· Lars Nielsen

Cleaning Up composer.json Before a Drupal Upgrade: Dead Modules, Their Dependencies, and Devel in Production

Before upgrading this site to Drupal 11, I spent an afternoon in August making composer.json describe the site that actually exists. Over the years it had collected modules and themes that were no longer installed, and a development module that was being shipped to production. Five small commits fixed that.

Read article Cleaning Up composer.json Before a Drupal Upgrade: Dead Modules, Their Dependencies, and Devel in Production
· Lars Nielsen

Vite Build-Time vs Runtime Config: Moving Demo Credentials Out of the Frontend Image

CaRMen, my CRM, runs as two instances from the same code: the real one, served at the root of its domain, and a public demo under /demo/ on another site. The demo's login page shows its shared login and has a button to fill it in, so visitors can try it with one click. The first version of that put the demo credentials into the frontend build.

Read article Vite Build-Time vs Runtime Config: Moving Demo Credentials Out of the Frontend Image
· Lars Nielsen

Downloads in an Unattended Linux From Scratch Build: A Dead GNU Server, 404 Pages Saved as Patches, and Checksums With Gaps

My Linux From Scratch build downloads every source tarball and patch itself, with curl, from a Makefile, and it's meant to run unattended from an empty directory to a finished system. Downloads turned out to be one of the least reliable parts of that.

Read article Downloads in an Unattended Linux From Scratch Build: A Dead GNU Server, 404 Pages Saved as Patches, and Checksums With Gaps
· Lars Nielsen

Self-Hosted Gitea Behind Caddy and an SSH Tunnel: HTTP Through the Proxy, SSH Straight Through

My search engine project hosted its own git server, a Gitea instance on one of its four machines. Until July, the only way to reach it was an SSH tunnel I started by hand in a terminal, which disappeared whenever that terminal did. In July, it got a proper public address, with HTTPS from Caddy and SSH for clone and push.

Read article Self-Hosted Gitea Behind Caddy and an SSH Tunnel: HTTP Through the Proxy, SSH Straight Through
· Lars Nielsen

From Ivy and Counsel to Vertico, Consult and Orderless: Moving Emacs Completion Onto the Built-in Interfaces

In an article about my Emacs config this summer, I wrote that my completion stack was Ivy, Counsel and Swiper rather than "the newer Vertico-and-consult combination everyone reaches for now", because the old stack still did the job and switching wasn't worth the churn.

Read article From Ivy and Counsel to Vertico, Consult and Orderless: Moving Emacs Completion Onto the Built-in Interfaces
· Lars Nielsen

composer-patches 2.0 on a Drupal Site: patches.lock.json, relock and repatch, and a Leftover From Version 1

"How do I apply a patch with Composer?" is one of the most-viewed Drupal questions on Stack Exchange, and the plugin behind the usual answer, cweagans/composer-patches, changed its workflow in version 2. This site upgraded to version 2.0 in August, as one of the build-tool upgrades before Drupal 11.

Read article composer-patches 2.0 on a Drupal Site: patches.lock.json, relock and repatch, and a Leftover From Version 1
· Lars Nielsen

Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File

My search engine's servers were configured with Ansible, and their secrets lived in Ansible Vault files: database passwords, the admin password, API keys, encrypted in the repository and decrypted at deploy time. In mid-August, I cleaned up two problems in those files. Neither was a leak, but each was the kind of thing that makes the next leak, or the next outage, more likely.

Read article Ansible Vault Problems That Weren't Leaks: A Placeholder That Broke Every Deploy and a Password in the Wrong File
· Lars Nielsen

Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading

In July my search engine's MySQL server, running in Docker on the pipeline server, was replaced with Percona Server. The reason was a plan to move the biggest table, the link graph, to the RocksDB storage engine later, and Percona Server ships it as MyRocks; the image includes the ha_rocksdb.so plugin.

Read article Swapping MySQL for Percona Server in Docker: The Config File It Silently Stopped Reading
Subscribe to Linkhub