How to password protect Apache site or folder but still allow some IP ranges

There are cases where you’d want a particular site or subfolder to be easily accessible from specific locations (like the intranet) but apply a minimum protection from public eye for the wide internet.

Apache does support this mixed configuration for its sites through its htaccess functionality.

How to upgrade Virtualmin scripts when PHP version checks fail

When things have been running for long enough various updates and configuration changes start adding up with leftovers bound to cause an issue sooner or later.
With Virtualmin, one such issue is the system’s inability to automatically update its scripts to newer versions based on the incorrect detection that an older PHP version is running on the server instead of the actual one.

How to update OpenWRT while retaining existing configuration and all custom packages

OpenWRT upgrades itself by saving configuration files from known locations (plus manually defined files), overwriting the partition with the latest firmware and then restoring the saved configuration.

This usually works for the configuration itself, however the process doesn’t take care of any custom packages that were previously installed manually (either through LuCI or with opkg). These packages need to be noted down beforehand and then reinstalled.

How to serve custom DHCP configuration with OpenWRT’s dnsmasq

There are times when you need to filter out what some hosts in the network can or cannot do. When you have a router running OpenWRT this can be done at the firewall level.

But if you’re not much into advanced configuration and just want to completely block out some network hosts from reaching the internet (and hence phoning home) then it’s a lot simpler to do this directly from the DHCP and simply leave them without a DNS and gateway configuration.

How to optimize used space in flash storage images

Due to their write-sensitive nature, flash storage (both USB sticks and SD cards) normally don’t get zeroed out when data is deleted, making any images created for backup purposes contain random data in the empty sectors. This makes images take up the full size of the disk/card even if very little is actually used from it and also makes image poorly compressible.

The solution is to zero out the unused space in the image file before compressing it. Linux has all the tools necessary for this task readily built-in. If one is not available, a bootable self-contained system such as SystemRescue can be used instead.

How to filter SSH connections with hosts.allow on Rocky Linux / CentOS 8

The TCP Wrappers suite of programs is no longer included in RHEL 8, meaning the hosts.allow/deny files no longer exist nor work. This makes quick filtering SSH connections per IP address a bit more difficult as it requires configuring the firewall.

Luckily, the tcp_wrappers package is still available in the EPEL repository even for versions 8 so the previous functionality can be restored, albeit with some additional steps.

How to add (experimental) sensors support for IT8665E in CentOS

Due to lacking driver support for newer hardware I have been missing hardware monitoring on my home server for more than 4 years now, having access to only hard disks temperatures.

Now the time has come to upgrade the good ol’ machine to a new hardware configuration – and of course the new hardware is also unsupported in even the latest CentOS kernels.

How to play sounds (or run anything) on startup and shutdown with Raspbian

The Raspberry Pi is very handy for fun projects, and sometimes these projects require running specific events (like playing a sound) on startup or shutdown, or even in both instances – for an interactive machine that reacts to user input and presence, for example.

Sounds on startup and shutdown can also be used as a means of confirming those specific actions taking place – startup is complete and shutdown is taking place (and will complete in a very short while).

How to configure a proxy host in Apache

Proxy virtual hosts are very handy when you need to publicly access a tertiary system on your local network and you only have one IP address to use but there’s a master web server already configured.

If that server is running Apache, adding a proxy vhost to pass outside requests to the correct LAN system is as simple as adding a new virtual host to the configuration.