Greetings everyone.
Long time no text! I have been quite busy with work and travelling abroad. I also live with Ankylosing Spondylitis, and some days are -very- painful. With all of this going on, sitting down to write something here kept getting postponed. This blog has stayed quiet for much longer than I intended.
There are a few things I’ve been meaning to share: some improvements to jstats, a small database administration tool called MariAdmin, and a script I made because I wanted an OpenBSD VPS on an OVHcloud instance. All very much within my usual interests; *BSD, servers, and small scripts that make everyday work a little easier.
Anyways, let’s start with the jails.
Some of you might remember my original jstats article from 2022. I had separate FreeBSD jails for nginx, PHP and MariaDB, and wanted a convenient way to see how much RAM, CPU and disk space they consumed. As the number of jails grew, checking them individually became rather tedious. Thus, a small shell script.
jstats is now at version 0.2, and quite a few things have improved since that first 0.1 release:
- Jails are identified internally by their numeric JIDs, making names containing spaces or special characters safer to handle.
- Numeric parsing works independently of the system locale.
- Memory values use the proper binary units: KiB, MiB and GiB, with consistent decimal formatting.
- There is a –help option, better temporary-file handling and cleanup, and regression tests covering failures and unusual inputs.
Some of the more useful changes are underneath the output. The script now collects one process snapshot and calculates the jail figures from it. RAM totals are calculated from the resident-memory values before rounding, avoiding the accumulated rounding errors of adding individual process percentages. Failed measurements show N/A and produce a failure exit status; a running jail with no processes correctly shows zero. These changes are in the updated script.
That last distinction matters. A command failing to collect information should never look like a jail happily consuming no resources.
Disk usage has also received attention since the original release. Thanks to @gakudva’s contribution, the default disk scan stays on the jail’s filesystem. Version 0.2 adds –include-mounts when you want the scan to include mounted filesystems beneath the jail directory, too. The option is documented in the README.
After downloading the script, run it as root on the FreeBSD host:
chmod +x jstats.sh
./jstats.sh
Or, to include mounted filesystems in the disk scan:
./jstats.sh --include-mounts
The purpose remains the same: a quick look at the resources your running jails consume, directly from the terminal.
Speaking of repetitive server chores, I also made MariAdmin.
Creating a database, creating its user, assigning privileges, changing a password.. These are ordinary tasks, but they involve typing much the same SQL commands again and again. MariAdmin puts those operations into a small terminal menu. That is the reason for it: making routine database administration more convenient while keeping the tooling simple. (Yes, there’s always phpMyAdmin, but hey, I’m an analogue guy — I like keeping things simple, with small scripts and fewer dependencies. Give me a terminal and I’m happy!)
It is a single POSIX shell script for MariaDB/MySQL administration on OpenBSD, FreeBSD and Linux. It uses the existing mariadb or mysql command-line client. You can list, create and remove databases and users, assign a user to a database, and change passwords. Its connections are limited to local database instances. The repository explains the requirements and available options.
After downloading it:
sh mariadmin.sh
Choose an option and follow the prompts. Quite straightforward.
The current version, 0.3, also improves the handling of credentials, privileges and errors. Password entry is hidden, supplied credentials are kept in a private temporary client configuration, and destructive operations require you to retype the target name. Database names containing underscores are handled literally when granting access, avoiding an unintentionally broader grant. These details are implemented in mariadmin.sh.
A small menu is useful, but the commands behind it still need careful handling.
Finally, something for the OpenBSD side.
I wanted to have an OpenBSD VPS on an OVHcloud instance, so I made openbsd-setup-ovh.
The idea is straightforward: start with an existing Debian or Ubuntu VPS using GRUB, then prepare it to boot the OpenBSD installer. The script downloads the installer ramdisk, checks its SHA256 checksum and adds an entry to the GRUB menu. It supports BIOS and 64-bit UEFI boot paths, without needing to attach an ISO.
The actual OpenBSD installation is completed manually through the VPS’s KVM console in the OVHcloud Control Panel. The script handles the preparation needed to reach that installer. The README walks through the console steps.
After downloading the script to the Linux VPS, you can first run its read-only checks:
sudo bash openbsd-setup-ovh.sh --check
Then prepare the installer entry:
sudo bash openbsd-setup-ovh.sh
The script currently selects OpenBSD 7.9 by default. Once preparation succeeds, open the KVM console from your OVHcloud dashboard, reboot manually and choose the OpenBSD installer entry.
For BIOS/Legacy, selecting the GRUB entry starts the installer directly. Here is an example of the menu:
For the UEFI path, enter the following at the OpenBSD boot> prompt:
boot esp:obsd79.rd
The screenshot below shows the command entered and ready to submit. Press Enter to start the installer:
From there, continue with the normal installation. Keep your VPS network details available, and back up anything you need before replacing the existing system; partitioning and network configuration remain part of the manual installation described in the guide.
Using this method, I successfully installed OpenBSD on my OVHcloud VPS (specifically, a VPS-4 from the 2027 range), with both IPv4 and IPv6 working without any issues.
These are the things I wanted to bring back to the blog after this long silence. Perhaps one of them will save you some repetitive work, or help you get another little *BSD machine running somewhere.
If you try them and find something that needs fixing, feedback is welcome.
Thank you for reading, and hopefully the next post will arrive a little sooner. 🙂
Özgür Konstantin
![Validate my RSS feed [Valid RSS]](/valid-rss.png)

