14 July 2025
SQLite backup
As I mentioned earlier, it’s straightforward to use SQLite as the relational database in Go applications. Your data is stored in one single file with a well-defined format and there is no hassle with installing and configuring a separate database.
However, for any serious application you most likely want backup of your data. If your dataset is not very large, and it is OK to lose updates since the last backup, there is a very simple option.
12 July 2025
Simple web app with Go
I have been learning the Go programming language lately, and it’s remarkably easy to build simple web apps with it. In particular, with just a few simple tricks, you can make the deployment of such web apps super simple: just one single standalone statically linked binary which stores its data in one single file.
The Go standard library contains everything needed to build a basic web app:
A production-ready HTTP server An URL router Interface for SQL databases Parsing command line options Simple logging HTML templating HTTP client If you use the embed feature, you can embed templates and static resources (CSS, JavaScript, images) and produce one single self-contained binary.
2 January 2025
Simple HTML DSL for Kotlin
As I wrote a while ago, I have been trying different approaches for server-side HTML generation in Kotlin, with focus on good support for generating partials without a single root element (which is important for htmx).
Given Kotlin’s good support for internal DSLs, I decided to explore that route, and try kotlinx.html and HtmlFlow. They both make great promises of encoding the entire HTML standard and enforce valid HTML at compile time.
29 September 2024
Server-side HTML generation
I have been trying out htmx with Kotlin and http4k.
To use htmx, you need some way of generating HTML on the server. In Kotlin, you have plenty of options, both Kotlin specific ones and everything from the broader Java/JVM ecosystem. There are two main categories here, template languages and internal DSLs.
Given Kotlin’s good support for internal DSLs, I decided to explore that route, and try kotlinx.html and HtmlFlow. They both make great promises of encoding the entire HTML standard and enforce valid HTML at compile time.
14 September 2024
No streaming with pgJDBC
I am using PostgreSQL from a Kotlin (JVM) application with the pgJDBC driver.
According to the documentation, you can get results from a query based on a cursor to avoid loading the whole result set into the application’s memory at once by calling the setFetchSize() method with a positive value on the Statement before issuing the query.
I had a non-trivial query which generated a lot of rows (several thousands), and I only needed the first hundred or so.
2 September 2024
Linux in Linux with KVM
You can do quite a lot with Docker, but sometimes you want greater capabilities or increased security, then a proper virtual machine with KVM is a good alternative. An example is when you want to run Docker containers in the VM, it’s not easy to nest Docker without forgoing all security.
Just like Alpine Linux is suitable as a base for Docker images, it is also a good option as a guest in a virtual machine.
5 November 2023
Leafpad with access to system files
As I have explained earlier, I am using Leafpad instead of gedit in my Ubuntu system.
However, recent versions of Ubuntu does not have Leafpad available through APT any longer, you have to install it with Snap instead. This is quite annoying, since the Snap packaging of Leafpad is too restrictive, it cannot access hidden files in your home directory, nor anything in ~/bin/. This is not good, since I often want to use Leafpad to edit such files.
28 October 2023
From WordPress to Hugo
I have used self-hosted WordPress for this blog since its start in 2006, but I finally got fed up with having to frequently update WordPress itself and a bunch of plugins, or having to constantly worry about security issues. Since I am the only one publishing on this blog, I decided to switch to a static site generator instead, and I chose Hugo, mainly because it is easy to install and does not require any heavy runtime (most of its competitors require Python, Ruby or Node.
14 October 2023
From screen to tmux
I have written about how to configure screen in XTerm to support Ctrl-Tab and convenient scrolling back in history.
This has worked well for over a decade now, but it seems like screen is not developed very much any longer, and tmux has gained popularity as a more modern and actively developed alternative. So I decided to try it, and was able to replicate my setup with tmux instead of screen.
1 May 2023
In-memory database for testing
I have written about using an embedded database like HSQLDB or H2 for testing Java applications. This can still be useful (although JavaEE is not so popular any longer). But even though H2 claims to emulate PostgreSQL and several other popular production SQL databases, sometimes your application uses very specific features of a particular database and you need to test against the real thing to be really sure your application works correctly.