Knowledge Base

Preserving for the future: Shell scripts, AoC, and more

CoMaps: change about how maps are stored

CoMaps recently updated and added an interesting feature:

New in version 2026.06.05-11-FDroid

  • OpenStreetMap data as of June 3 and further weekly updates via "Check for updates" button

What that means for a comaps mirror is that you have to store the files in a slightly different directory structure.

Comaps might not have any separate instances of map updates yet. The app tries to fetch /mirror/comaps/meta/maps.json but the CDN doesn't have that. Now I have to run the script with:

CODE="2026.04.05/260603" /mnt/public/Support/Programs/comaps/fetch-latest-usual-maps.sh

The CODE includes a value from https://codeberg.org/bgstack15/comaps/src/branch/feature/trust-user-provided-root-certs/private.h string MAP_SERIES.

files/2026/listings/fetch-latest-usual-maps.sh (Source)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh
# Startdate: 2026-03-16-2 11:18
# Purpose: Download all the usual maps for CoMaps local mirror
# Documentation: comaps-README.md
#    I rate-limit to be nice, but it is a CDN so it probably doesn't matter.
# Alternatives:
#    rsync? Not sure if allowed

# code will be in YYMMDD format.
code="${CODE:-$( date -d "$( curl https://f-droid.org/en/packages/app.comaps.fdroid/ | grep -o -iE 'openstreetmap data as of \w+ \w+' | awk '{print $(NF-1),$NF}' )" "+%g%m%d" )}"
td="/mnt/mirror/comaps/maps/${code}"
mkdir -p "${td}" ; cd "${td}"
echo "Using path ${td}"
for word in "World" "WorldCoasts" \
    "US_Maryland_Baltimore" \
; # additional maps above
do
    wget --limit-rate=1.1M --continue "https://cdn-fi-1.comaps.app/maps/${code}/${word}.mwm"
done

My take on ai

This dcantrell fellow was quoted on LWN).

any code now that I've written and put on the internet is now in the belly of every LLM and can be spit back out at someone sans the copyright and licensing block does not one care about open source licensing anymore? did I not get the memo?

That's pretty much my conclusion on AI. Since Free Software licensing depends on copyright, and claiming you got something out of "AI" lets you do whatever you want regarding copyright, Free Software is probably going to be over as a concept. That's a huge shame.

For people who don't have problems with copy-pasting (which some might call plagiarizing), AI is pretty useful.

Darkflame Lego Universe: switch user faction

In a DarkFLame Lego Universe game server, a player can be a member of only one faction. You choose this early on in the game (maybe 2 hours into the gameplay). Each account can have up to 4 characters to play with, so you can play a full game with each faction.

What I have written is therefore not necessary for any user to be able to play every aspect of the game. It's overkill, and absurd, and silly. I did it because I can. And for those of you who have nothing better to do, can follow in my footsteps.

I have added two functions to dlu_lib which lets an admin adjust the factions on a user account.

I added function set_char_factions() which adjusts the bare "is sentinel" flags stored on a character. Here is an example usage:

cons = dlu_lib.Connections(use_db = True, char_id = 203)
cons.set_char_factions(["sentinel", "paradox"], True)

To remove faction(s), pass False as the second parameter.

cons.set_char_factions(["assembly"], False)

The second function sets the primary faction for a character. This affects which tokens get dropped as loot.

I don't have a solution yet for adjusting existing tokens into a different faction's tokens, or for an in-game converter.

Additional notes

Some of the server game code checks in a particular order if the player has various faction flags. If you were to give a character the completed missions for both "Join Assembly" and "Join Paradox," the tokens that would drop would be only assembly. Assembly is first in that list.

Useful files

New project: opengitfile

I was inspired by Opening a file from a git repository in the browser [ Hannes Leutloff - yeldiRium ] to write my own version of a script that lists the git forge URL for a given file. If I need to share a link with a colleague, of the open file, I can do that much more easily now.

My project lives at /cgit/opengitfile. I reimplemented all the code to match my own style, and because it's more fun to write than to read code.

To use this script, point it to a file.

opengitfile.sh ~/dev/serverlist/README.md
https://github.com/luanti-org/serverlist/blob/boost-domains/README.md

To use it in vim, put this in your .vimrc.

function! OpenGitFile()
   let a = system("opengitfile.sh " . bufname("%") . " " . line('.'))
   let b = system("dragon-drag-and-drop " . shellescape(a))
endfun
nmap <F7> :call OpenGitFile()<CR>
vmap <F7> <Esc>:call OpenGitFile()<CR>
imap <F7> <Esc>:call OpenGitFile()<CR>

And now F7 will run the script and open a dialog box with the url.

Session_app now accepts passkey auth

I have updated my old demo app session_app to support passkey authentication! I was recently forced to use passkeys, and I wanted to learn more about them.

I found it mildly entertaining to configure an application to use it, but I hate how the implementation mostly requires hiding information from the user. It sounds like passkeys are diametrically opposed to user freedoms.

Here are a few more of my previous posts that talk about my session_app, if you're bored.

Flask 3 and flask-kerberos

While attempting to uplift session_app in preparation for adding passkey authentication, I discovered that Flask 3 broke flask-kerberos which appears abandoned by upstream. It cannot load _request_ctx_stack which is gone now.

I searched the Internet for a little while, and came across add support to most recent Flask versions by PauloLuna · Pull Request #16 · deshaw/flask-kerberos which pulls from PauloLuna/flask-kerberos: Kerberos Authentication for Flask. So I'm at least the second person in the world using Flask and kerberos together!

So now I have to vendor flask-kerberos direclty in my app, which I can live with.

Dosbox-X: run Signing Exact English

I did a deep-dive for running a long-gone Windows 95-era program in modern desktop Linux. A user needed to run "Signing Exact English," which was the old desktop version rather than their web app. Here's how I did it.

Requirements

  • Run the program with all features
  • Print to pdf

Steps to reproduce

These steps assume the username is public. I previously tried the application in Wine, but Wine didn't play nicely with the Adobe Director plugin PrintOMatic.x32, due to some problem listing a default printer.

  1. Explode SEE.zip to /home/public/.wine/drive_c/SEE2

    mkdir -p ~/.wine/drive_c/SEE2 ; cd ~/.wine/drive_c/SEE2
    7za x /mnt/public/Support/Programs/Signing-Exact-English/SEE.zip
    
  2. Adjust Dosbox-X win98.conf with [autoexec] entry:

    MOUNT -t dir G "/home/public/.wine/drive_c/SEE2" -label SEE
    
  3. Prepare the pdf995 files.

    cp -pi ~/Downloads/pdf995s-9.5.exe ~/Downloads/ps2pdf995.exe ~/.wine/drive_c/SEE2
    
  4. Install ps2pdf995

    Read more…

Useful Dosbox-X config values

I've recently had to switch even my Windows 3.1 Dosbox guest to Dosbox-X. I was getting weird display glitches even just loading Windows 3.1, not even any of the games yet.

I've come across some very useful settings that I want to use for any DOSBox-X instances.

[sdl]
# Capture the mouse
autolock  = true
# Hide the KRNL386 garbage data in the titlebar
showbasic = false
[dosbox]
# Show this in the titlebar
title     = win31games
[render]
# Keep the 4:3 aspect ratio at all times, which makes full-screening the application still look nice.
aspect    = true

On a Devuan system, the useful document files are these.

  • /usr/share/dosbox-x/dosbox-x.reference.conf
  • /usr/share/dosbox-x/dosbox-x.reference.full.conf

Xbright: adjust X11 brightness

Years ago I found a small program on the Internet that makes it easier to adjust screen brightness within X11. You can of course use xrandr, but this makes it easier when you're not thinking that deeply.

It isn't sufficient for adjusting gamma. I need to adjust gamma for playing games like Portal that are just too dark.

xgamma -gamma 1.5

Maybe I should add it as a slider, but I haven't bothered to do that yet.

Keepass2: fix puffy ui and fonts

It feels like the tech I wish to use wants to fight me. It's getting frustrating. (Or maybe I'm just getting old.)

I did a medium-dive into DPI on Linux again, because the Mono-based application keepass2 wanted to look really puffy and bloated. I have a 1920x1080 display, with no special scaling at all. I know I've had to tell QT applications what scaling to use, because they apparently guess wrong on basic 1920x1080.

Wrong view (bloated):

Right view (not bloated):

This time, for some dumb reason KeePass wanted everything to look like it's scaled up kinda big and puffy. The solution to this is to uncheck the setting "Force usage of system font (Unix only)."

The setting:

I don't know why it sometimes flips. Maybe it's like that other setting that magically changes.

Aborted research

GDK_SCALE=1 GDK_DPI_SCALE=1
xrdb -override <<< "Xft.dpi:96"
xrdb -query
MONO_MWF_NATIVE=1
MONO_OPTIONS="--debug"

Unhelpful references

  1. HiDPI - ArchWiki#Mono applications
  2. MonitorDPI - Debian Wiki
  3. KeePass 2.28 released - KeePass