duncan­lock­.net

Want “Reader Mode” for almost the entire web - and have every page load nearly instantly? Here’s how.

There are three main constellations of Web Browsers - ones based on Google’s Blink rendering engine (used in Google Chrome, MS Edge, Vivaldi, Brave and others), ones based on WebKit (used in Safari on MacOS & iOS 7 iPadOS) - and on Mozilla’s Geko engine (used by Firefox & Thunderbird).

There are also a few other, “non-mainstream browsers”, that have their own engines. Cosmic wanderers, not part of the main constellations, that chart their own course, building everything themselves: Flow, Servo, LadyBird, NetSurf - and Dillo-Plus.

Dillo Plus has a Tiny Superpower

Actually, the Dillo-Plus browser has quite a few tiny superpowers - but the one I’m interested in is its ability to ignore all the CSS styles from the website and load your CSS …

Continue reading “Super Fast Reader Mode for the Entire Web, with Dillo Plus”

How apy keys work, what .source files are and how to fix Key is stored in legacy trusted.gpg keyring Warnings


In this When Will We Learn post, Drew DeVault talks about supply chain attacks against language package managers (npm, PyPI, cargo, etc…​) - and compares them to official Linux distribution repositories (deb, rpm, etc…​).

The conclusion drawn was:

The correct way to ship packages is with your distribution’s package manager. These have a separate review step, completely side-stepping typo-squatting, establishing a long-term relationship of trust between the vendor and the distribution packagers, and providing a dispassionate third-party to act as an intermediary between users and vendors. Furthermore, they offer stable distributions which can be relied upon for an extended period of time, provide cohesive whole-system integration testing, and unified patch distribution and CVE notifications for your entire system.

I think I agree with this, essentially. We do need to change the way we do …

Continue reading “Supply Chain Attacks & Package Managers - a Solution?”

I’ve been using Linux exclusively for ~15 yrs. I’ve recently started a fantastic new job – the only wrinkle was that it came with a Windows 10 laptop. This is my first time using Windows after a 15-year break. This is how it’s been going.

First Impressions

Windows is such a mess! It’s sort of shocking how much of a mess it is. Desktop Linux is often criticized for this, but Windows is much worse, somehow! It’s really inconsistent. Half of it is “new” UI and half of it is old Win32/GDI type UI - just as bad as KDE/GTK - except worse, because you can’t configure them to use the same theme. Also, when you install a Linux distribution, it’ll start off either all KDE or all GTK, or whatever - but with Windows …

Continue reading “Using Windows after 15 years on Linux”

The Python Black formatter outputs to stderr, not stdout


How to template out JSON in Bash


We use CentOS VMs at work to emulate our production environment - and it took me a while to figure out how to get the VirtualBox Guest Additions to build reliably on CentOS 6.4/5. This is what I’ve currently settled on as a reliable method.

First, make sure that you’ve got the kernel headers and tools installed that you need to build stuff:

$ sudo yum update -y
$ sudo yum install gcc kernel-devel kernel-headers dkms make bzip2 perl

Make sure that you’ve only got the current set of kernel headers installed - the one for the kernel you’re actually running. Having more than one set installed prevents this working properly. Running this should show you one version of each kernel package:

$ rpm -qa | grep kernel | sort

It should look something like this:

dracut-kernel-004-336.el6_5.2.noarch …
Continue reading “Reliably Building VirtualBox Guest Additions on CentOS 6.x”

To create image thumbnails from a PDF document, run this in a terminal window:

$ convert -thumbnail x300 -background white -alpha remove input_file.pdf[0] output_thumbnail.png

The parameters to convert do the following things:

ParameterEffect
-thumbnailSimilar to -resize, but optimized for speed and strips metadata.
x300Make the thumbnail 300px tall, and whatever width maintains the aspect ratio.
-background whiteSets the thumbnail background to white.
-alpha removeRemoves the alpha channel from the thumbnail output.
input_file.pdfThe PDF file to use as input.
[0]The page number of the input file to use for the thumbnail.
output_thumbnail.pngThe output thumbnail file to create.

If you want larger thumbnails, just change the x300 parameter to match. If you want to output .jpg’s (or anything else, like .gif), just change the file …

Continue reading “How to create thumbnails for PDFs with ImageMagick on Linux”

I’m going to build on Jamie Zawinski’s excellent advice about backups, which you should read first. This is basically that, but with some extra bits. If this seems too complex, then just do what he says.

The plan is to use Backupninja to backup everything to an external USB drive – and also to Amazon S3 or Dropbox, depending on what it is. Backupninja provides a centralized way to configure and schedule many different backup utilities, just by dropping a few simple configuration files into /etc/backup.d/.

I have a multiple hard disk setup for my desktop Linux box - my /home folders live on one disk and / lives on another one. I don’t want to backup everything from the system disk - I can re-install it in 10 mins, and I don’t really want to complicate this …

Continue reading “Comprehensive Linux Backups with etckeeper & backupninja”

I recently needed to convert some FLAC music files from the increasingly common 48 bit encoding, down to 16 bit at 44100 kHz, so that they’ll play on my Sonos. Here’s how to do it:

If you don’t already have sox installed, do this to install it:

$ sudo apt-get install sox

Then run this to do the conversion, in the folder with music in:

$ mkdir resampled
$ for flac in *.flac; do sox -S "${flac}" -r 44100 -b 16 ./resampled/"${flac}"; done

And that’s it - it will convert all the .flac files in that folder to 16 bit at 44100 kHz and put the result into the ./resampled subfolder, preserving the metadata.

Continue reading “How to convert FLAC files from 24/48 bit to 16 bit on Ubuntu Linux”