NCweb, serve static website content from Nextcloud

NCweb is a reasonably small (ish) PHP “application” that will allow you to expose a given folder of a Nextcloud instance and serve documents from it as if it would have been a regular website. The folder does not have to be shared in Nextcloud. You can serve .html (HTML) or .md (Markdown) files. NCweb can be configured to render Markdown files to HTML.

Get it from Github here:

Installing the correct Intel NIC driver for Windows PE and a bare-metal restore situation

When disaster strikes, a real bare-metal restore bootable USB drive may be your only rescue. And most decent manufacturers of NAS and SAN (Synology in this case) units will have some sort of “bootable media creation tool” available for you. These typically create a minimal bootable environment, from which you bootstrap the computer and then load the bare-metal restore data from a NAS or a SAN.

One issue you may encounter is actually finding the correct network card (NIC) driver so that your about-to-be-restored computer can actually talk to the rest of the world, or at least to the rest of your world. This is painfully obvious in Windows and Windows PE environments.

I recently ran into such a case and thought “How hard could it be to just check the motherboard manufacturer information, find the exact name of the NIC, and then download the driver from the web?” Well, it turns out this can get quite messy for a number of reasons.

In many cases, the operating system will know where to find NIC drivers, and which one to load for a given hardware setup. When you need to manually choose from a list of tens or hundreds of adapters, it not so much fun anymore.

Having checked the web for “Intel I219-V” wasn’t all that exciting, and downloading a “driver package for Windows 10 x64” from Intel wasn’t much better. But Intel does include, in my case, some useful software in their downloads. Most executables in the Intel driver package cannot be executed from within Windows PE. But one, really useful tool, turned out to be SetupBD.exe. It’s located in \APPS\SETUP\SETUPBD in the (executable) archive, and it can run in the Windows PE environment.

Suprisingly enough, all I had to do to get the proper driver loaded was to run SETUPBD.EXE from the CLI, and it proceeded to load the correct driver. My bare-metal Windows PE environment could now talk to the NAS and the bare-metal restore could begin.

(I had previously extracted the contents of the PROWinxt64.exe file to \INTEL on the bootable USB drive. So the actual location of SetupBD.exe in my case was \INTEL\APPS\SETUP\SETUPBD.)

Image credit:

Nextcloud and WebDAV “SEARCH” requests

Using WebDAV to access Nextcloud resources is a pretty nice way to write integrations for Nextcloud. While adding support for Nextcloud file browsing in a service we’re constantly improving, I ran into a minor snag: How to format the WebDAV “SEARCH” request when interfacing with Nextcloud.

1. The example in the official documentation is correct. You just have to read it carefully. In particular, pay attention to this:

Search requests can be made by sending a SEARCH http request to with a content type of text/xml and the query as xml in the request body.

2. Make sure you structure your XML data properly, in particular, you need to make sure you include a d:prop of which “field” you want your search data to be applied to.

<d:searchrequest xmlns:d="DAV:" xmlns:oc="">

This would search for files beginning with Nextcloud and return fileid, displayname, and the content type; the search will be made in the folders that testuser has access to.

And that’s that.


Webmin, Virtualmin and APT for Ubuntu and Debian

I often use Webmin and Virtualmin to manage basic stuff on Linux servers, mostly so because others sometime need to change minor settings on these servers, and they may or may not be very familiar with doing things from the CLI.

You can, of course, update Webmin and Virtualmin manually, from within Webmin. But if you’re using APT, there is an automated, better, way of keeping these lovely software packages up to date.


Create a file in /etc/apt/sources.list.d/ like webmin.list

Add the following line to that file:

deb sarge contrib

Add Jamie Cameron’s GPG key for the repository like so:

cd /root
apt-key add jcameron-key.asc

Finalize everything with

apt-get install apt-transport-https
apt-get update

You may now install/update Webmin with via APT (apt-get, aptitude, etc).


Create a file in /etc/apt/sources.list.d/ like virtualmin.list

For Ubuntu 18.04.LTS (“Xenial”), add the following to that file:

deb virtualmin-xenial main
deb virtualmin-universal main

There are, of course, sources available for other distributions too. Simply replace xenial above, with the name of the distribution you’re running. You can find a list of the Debian based distributions here:

Add the virtualmin GPG key for the repository like so:

cd /root
apt-key add RPM-GPG-KEY-virtualmin-6

Finalize everything with

apt-get update

You may now install/update Virtualmin via APT (apt-get, aptitude, etc). You can find some more information about this in relation to Virtualmin on the Virtualmin forum.

WordPress Plugin Stopsign 1.0.0

Using the APIs over at can yield some quite useful results. I needed to be able to display the commute stop departure times for public transport in a given place, so I wrote this WordPress plugin called Stopsign. It uses the API. The plugin is free (GPLv2) and open source.

Knock yourself out:

Talking to the Folding@Home client interface

There are a number of ways to control the Folding@Home client. For me, one of the more useful things I can do by sending a command to the web client interface is to pause and resume the operation of the client. In particular, this is useful when running other CPU consuming tasks in automated scripts, etc.

So, from the prompt on the host running the Folding@Home client you can, for example, issue:

echo -e "pause 0\nquit" | nc localhost 36330

to pause the client. And then issue:

echo -e "unpause 0\nquit" | nc localhost 36330

to unpause (resume) the client. You can also access the control interface via telnet with this:

telnet localhost 36330

Type help <Enter> at the prompt for a list of commands and options.

Forcing apt-get to use IPv4

When or if you run into trouble with apt-get and IPv6 connections timing out or not resolving properly at all, it may be a good idea to simply prevent apt-get from using IPv6.


-o Acquire::ForceIPv4=true

when running apt-get, or create /etc/apt/apt.conf.d/99force-ipv4 and put

Acquire::ForceIPv4 "true"

in it.

If this does not work for you, you may want to have a look at /etc/gai.conf (this will, however, affect your system on a deeper level for IPv4 vs IPv6 connectivity). If you’re not interested in IPv6, it should cause no problems.

See more from @geek1968 on Instagram

Please use proper message headers (FFS)

Writing software that deals with automated message processing on the Internet is, in a word, painful. The number of people who cannot seem to read simple specifications and/or proposals is staggering.

And one would think that if you can’t read specifications, you’d at least bother to “View message source” on a few thousand e-mail message to get a feel for how some other (well known) companies are doing it, INSTEAD OF INVENTING YOUR OWN STANDARD.

So, if you’re sending out automated e-mail messages, for example, please add one of these headers:


I’ll leave it as an exercise for the reader to look them up … and if you’re doing some kind of mailing list stuff, please add:


Thank you!

You may now resume sleep mode.

Using Thunderbird with Gmail and OAuth2

I’ve been using the Mozilla Thunderbird e-mail client for … a long time. Google has had a “Less secure apps” policy, where you explicitly have to enable a setting to allow external access to things like e-mail over IMAP, and so on. Google has also been warning their users about upcoming changes, where clients that cannot authenticate using “secure methods” (such as OAuth2), will no longer be able to access things like e-mail over IMAP.

Fortunately (for me), Mozilla Thunderbird can handle this just fine 🙂

Incoming settings

Make sure you are using IMAP and not POP3. Go to your account settings. Go to server settings. You should see the IMAP settings (, etc). Make sure connection security is set to SSL/TLS. Set the authentication method to OAuth2 and re-start Thunderbird. You will be prompted with a Google Login Page. Enter your credentials for the account. Once Google has successfully verified the credentials, it will tell you that Thunderbird wants to access certain things. Allow this, and … you’re done. To verify that everything worked out as it should, re-start Thunderbird once more. You should not be getting any prompts this time.

Outgoing settings

To access settings for outbound e-mail using Gmail, click on the account name in the list to the left of the Account settings window. At the bottom, to the right, you will see Outoing Server (SMTP). Choose to Edit SMTP Server. Again, check your settings to be (587), STARTTLS, and set the Authentication method to OAuth2, just like you did for IMAP. Re-start Thunderbird.

Repeat this procedure for all your Gmail accounts configured in Thunderbird.