How to make Debian rescue and emergency runlevels work again

At some point along Debian's journey, rescue and emergency runlevels broke for anyone who has a locked root account and, say, uses sudo exclusively to run administrative commands. See the bug report and a proposed installer patch. This is not an atypical setup—it's a standard option of the Debian installer, and happens to be one I typically use.

To summarise what's going on, the system now prevents root from logging in due to it being a locked account (having no password, it cannot be authenticated), which means that the rescue and emergency runlevels always error and fail to bring up a shell. What bloody good are they, then, right?

Not too long ago things got to the point where the system can be configured to work as expected, again, but certain settings need to be enabled beforehand. This is described below. Note that doing so arguably introduces a security issue, but if you're happy to run Grub with editable boot entries (so that any user could, say, set init=/bin/bash on the kernel command line), then you're unlikely to have any reason to care.

First switch to root using “sudo su -”. Then:

for x in /etc/systemd/system [...]

Read this post

Severing independent email threads with KMail

I use KMail and it, like many other popular email clients, sorts messages into threads. It does this based on reference information embedded in the (usually hidden) headers of each message. Of course, sometimes those headers are off. Most commonly this happens because a sender uses a reply-to-all function to send a new message to an existing list of addresses—this new message has a completely different subject from the original (to which it's ostensibly replying), but the sorting at the receiver's email client still considers it part of the old thread because reply-to-all functions add headers referencing the original message, as well as others in the original thread.

Fortunately, KMail has the ability to remove those headers through manually applied filters. The bonus is that, once you do this, the corrected threading will propagate to other email clients—I use K-9 Mail (not related to KMail) on my phone, for example.

First, there are two email headers that are relevant, each serving a different purpose: In-Reply-To, which links to the previous email that the present one is a direct reply to, and References, which lists several emails that are considered part of the thread (according to reply-to-all). For a [...]

Read this post

How to make private git repositories open for public access

Some of my personal projects are tracked using private git repositories, hosted on this server. I can access these via ssh, but for a while I've had in mind to make at least a couple of them publicly accessible... somehow. After finally getting around to looking into it, this turns out to be deceptively simple using git-daemon (instructions for Debian distros):

  1. Install the git-daemon-sysvinit package.
  2. Enable the daemon by editing /etc/default/git-daemon. Reboot, or start the git-daemon service by hand.
  3. Add a symlink to each git repo you want to make public under /var/lib/git. These will then be accessible via git://<hostname>/git/<linkname>.
  4. Ensure the git protocol port (9418) forwards to the server.

Simple! The git protocol is faster than serving over http(s), and the standard configuration ensures that anonymous clients can pull, but not push, which is exactly what I was after.

Over the next little while I'll introduce the couple of projects that I'm opening up for public access.

Read this post

How to update Debian KDE packages to unstable

I use Debian with KDE's Plasma desktop environment. I usually track Debian's testing repository, but often I like to upgrade the version of KDE packages installed to more recent versions in the unstable repository. My preferred way:

sudo aptitude --visual-preview -t unstable install ~i~mkde

The action tends to be independent of anything else, but that's easy enough to work around—update per usual before running.

Read this post

Using Unison with Android over USB

For some time, I've been happily using Unison in conjunction with my Android phone's USB mass storage function to synchronize files between my phone and my desktop. It was simple: I'd plug in my phone with USB and enable the SD card to be used as a mass storage device, then mount it in Linux and run Unison as if the phone was a local folder (with appropriate tweaks to support the FAT filesystem).

Alas, my phone was getting on in years (or months, as it is in tech), and with support long dropped and capacity nigh exhausted, I had to upgrade. With my new phone I've been promoted to the “new hotness” that is Android 6 Marshmallow, but one of the functions that was dropped along the way was the ability to expose the SD card as mass storage over USB. Admittedly it wasn't a perfect solution, requiring unmounting the SD card within Android itself while using it over USB, but the current approaches introduce their own deficiencies. In any case, my previous workflow wasn't going to work anymore.

Of course I didn't want to stop using Unison, or have Unison re-copy everything, or even merely re-scan everything. I [...]

Read this post

Removing hostile Windows updates

As a consequence of their recent effort to boost the numbers of Windows 10 installs using any means possible, however questionable, and turn their paying customers into beta testers, Microsoft have been especially hostile to their users as of late, installing nag-screens and “telemetry” code (also known as “spyware”) under the guise of important updates to existing installs of previous versions of Windows. While I would happily eschew Windows for Linux on all the machines I use, and have largely done so, the idea of avoiding Windows in totality is, sadly, not yet practical―the common-use machines I maintain in our lab required it for various reasons, and even I still keep a Wintendo partition.

There are plenty of discussions around about what to do about this. Here's a fine example. Though this is intended for my own reference, I've had success with the following:

wusa /uninstall /kb:2952664 /norestart /quiet
wusa /uninstall /kb:2976978 /norestart /quiet
wusa /uninstall /kb:2977759 /norestart /quiet
wusa /uninstall /kb:2990214 /norestart /quiet
wusa /uninstall /kb:3021917 /norestart /quiet
wusa /uninstall /kb:3022345 /norestart /quiet
wusa /uninstall /kb:3035583 /norestart /quiet
wusa /uninstall /kb:3044374 /norestart /quiet
wusa /uninstall /kb:3068708 /norestart /quiet
wusa [...]

Read this post


← Previous | Page 2 of 3 | Next →