KISS πŸ‡ΊπŸ‡¦

Stop the war!

Stop the war in Ukraine! Fuck putin!

More information is at: https://war.ukraine.ua/.

There is a fund to support the Ukrainian Army: https://savelife.in.ua/en/donate/, and there is a special bank account that accepts funds in multiple currencies: https://bank.gov.ua/en/about/support-the-armed-forces. I donated to them. Please donate if you can!

Killer putin

Killer putin. Source: politico.eu.

Arrested putin

"It hasn't happened yet, but it will happen sooner or later. Beautiful photo, isn't it?" Source: twitter.

A postal code encoding question

| comments

USSR used a fixed stencil to write postal codes on mail envelopes. It’s similar to a seven-segment display, but had 9 segments with a standard way to write all 10 digits:

I stumbled upon an article (in Russian) claiming, and confirming, that only 4 of the 9 segments are enough to distinguish all 10 digits. The article had a small challenge to write a program to find out the number of different ways to pick 4 segments that allow to distinguish all the digits. It’s a small, yet interesting problem to solve; my program is in Haskell and is available at https://github.com/eunikolsky/postalcode.

Details about a Haskell puzzle

| comments

I’ve seen this “Haskell Puzzles” https://jaspervdj.be/posts/2023-06-19-haskell-puzzles.html page on Haskell Weekly and decided to see what it was about. It has puzzles where you need to rearrange the given tokens so that the final expression produces the needed value.

The first puzzle was easy, and the second one… was hard. The tokens are iterate ) 5 join !! 1 ( (+) with the goal value of 32. The puzzle also says: “What Monad are we looking for?”. I thought, of course, [] since we have join and !!. I also saw that 5 and 32 were most likely related: 2^5 = 32, but I couldn’t see a way of generating powers of two here.

How to split a line into equal segments in JOSM

| comments

Task: map a line of bollard nodes separating one-way directions of a road. You can certainly map them as a way w/o individual bollards as nodes. If you know the number, I think it’s worth it to map them individually; in my case, the line is straight and there are 12 bollards, with an equal distance between each pair. The challenge is to map them with the correct distance, and the solution is to use the terracer plugin.

Install the plugin first. I’ll show the process for an imagined road:

TIL about brace expansion with extra text

| comments

I knew about this neat shell expansion feature (very helpful for file selection):

1
2
$ echo {foo,ba{r,z}}
foo bar baz

Today I stumbled upon this stackoverflow answer containing the command (shortened here):

1
$ sudo rsync -avAX --delete --exclude={"/dev/*","/proc/*","/sys/*"} / /mnt/rootfs

I wondered how it would work since I thought it would expand to … --exclude="/dev/*" "/proc/*" "/sys/*" …, which wouldn’t exclude those other paths in rsync.

Reformatting old text books in vim

| comments

I’ve found a few old books from the 1990s, which are in the simple txt format. Since there is no explicit formatting possible, my PocketBook 740 Color e-reader formats the files not in the best way. Hard-wrapped paragraphs separated by empty lines are left-aligned and aren’t reflown in the reader, so a lot of space is wasted on the right. I couldn’t quickly find a program that would reformat such files; Calibre’s ebook converter didn’t do what I needed. In the end, I was able to cleanup such books in vim with a few commands.

The gfs program

| comments

I’ve open-sourced the first version of my tiny program gfs this week, at https://github.com/eunikolsky/gfs. It’s a CLI filter program to implement the Grandfather-Father-Son cleanup scheme for backups. The first version has the minimally necessary features such as user-definable time format to parse all the input strings. More user information is in the README at https://github.com/eunikolsky/gfs/blob/master/README.md; this post is about some history and technical details.

Fixing NTP client on a Mikrotik router

| comments

Correct system time is important, especially when you’re using encrypted network protocols (e.g. TLS, wireguard). On my mikrotik router, I enabled the NTP client with the europe.pool.ntp.org server in System > NTP Client, and waited for the updated system time. And waited. And nothing happened; I couldn’t even find a command to kick it to update the time on the official NTP (SNTP Client) page.

kexts for VirtualBox do not load

| comments

I tried running VirtualBox on the latest macos 12.4 and it’s getting harder with every macos release. Not the installation part (brew works perfectly here), but running it, which requires a kernel extension, which the user is supposed to approve in System Preferences. Well, the problem was I couldn’t because that option wouldn’t present itself, there wasn’t a button to approve the kext from “Oracle America” as blogs write.