Category Archives: Howto’s

How to do stuff!

DNS names for Hyper-V client machines

So, running a couple of Hyper-V machines, and needing to determine their local IP addresses to connect to them. As long as the Hyper-V Integration Services are installed (apt-get install hyperv-daemons on Debian-based distributions), PowerShell on the host machine will have access to the IP addresses of the client machine. Without the Integration Services, PowerShell […]

Finding and killing stuck or mistyped postgresql queries

I’ve found these useful during development: Listing running queries: SELECT pid, now() – pg_stat_activity.query_start AS duration, query FROM pg_stat_activity WHERE state = ‘active’ AND pid <> pg_backend_pid(); Listing queries that have run for more than a full minute: SELECT pid, now() – pg_stat_activity.query_start AS duration, query FROM pg_stat_activity WHERE state = ‘active’ AND pid <> […]

Docker starts slowly on Raspberry Pi / Raspbian

After installing the latest stable version of docker-ce (5:18.09.0~3-0~raspbian-stretch as of the time of writing), Docker would take ages to start after a reboot. Commands would even time out waiting for it. /var/log/daemon.log shows a gap of almost 4 minutes between the attempt to start the Docker Application Container Engine and the first log line […]

Using external Certificate Authority certificates in a restricted or closed environment

In this example, we’ll be using a wildcard certificate from Let’s Encrypt, obtained through their recently released wildcard certificate offering. What we’re doing The use case is that we want, for one reason or another, to use this certificate in an environment that does not have unrestricted internet access, such as a health institution or […]

Shrinking a Windows 10 installation for small harddrives

Cheap Windows 10 capable devices often come with very limited internal storage space. To make use of this, it is of course crucial that Windows itself takes up as little space as possible. To combat the bloat, there’s a little known feature in compact.exe, the built-in disk compression tool, that compresses the operating system itself, […]

Shrinking a Raspbian installation and re-enabling auto expanding for distribution of customized images

UPDATE: See the automated script at https://blog.dhampir.no/content/script-for-creating-a-compressed-image-file-from-a-raspbian-sd-card Raspbian, by default, expands to fill the SD card it finds itself on, the first time it boots. After having customized an image to your liking it would be favourable to avoid copying 16 gigabytes of data, or however large your chosen SD card is, each time you […]