Shallow Thoughts

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Sun, 28 Jun 2026

Overriding Emacs' Broken Bookmark Position Code (Updated)

(Note: I've updated this post: see the solution at the end.)

Emacs has a useful function called bookmarks, where you can make short names for files you visit often.

But bookmarks has one terrible misfeature: it also remembers your position in the file.

That sounds like a good thing, right? But the problem is that the bookmarks system only records these positions sporadically. So it's easy to get stuck on a position you were editing months ago.

For example: I have a bookmark for the file where I keep track of appointments and other calendar entries. But lately, every time I open this bookmark, it opens it with the cursor positioned on September 24. That's three months away; its not the part of the file I'm interested in right now.

Read more ...

Tags: ,
[ 13:09 Jun 28, 2026    More linux/editors | permalink to this entry | ]

Sun, 21 Jun 2026

Full Self Driving

[A paving truck, viewed from the right, showing that there's no one in the driver's seat in the cab] They're doing roadwork on the highway near the house.

This is the sort of paving where they melt the old pavement, chew it all up into little pieces, mix it with tar or something then smear it back on the road.

They do it all at one time: there's a procession of trucks that each does a different step, and they all move together at a slow walking pace.

We rode our bikes over to watch it happening, and we noticed something interesting.

[A procession of trucks repaving a road, with lots of tar smoke blowing around] There's no one driving any of the trucks! They all have a cab, but the driver's seat is empty.

There's a person walking alongside the lead truck. He isn't holding any obvious control mechanism, though.

I never knew that road paving was an application where they're already using "full self driving".

Tags:
[ 13:34 Jun 21, 2026    More misc | permalink to this entry | ]

Sat, 13 Jun 2026

Video Streaming from Linux

As part of a set-top video project, I looked into streaming. Just local streaming: we have a fileserver in one part of the house, running Linux, and the set-top box by the TV (also running Linux though that part is less important); how can I stream a video from the fileserver and play it using mpv on the set-top box?

I thought that would be a dead simple question to answer. But there's surprisingly little related to that that shows up in Google's increasingly broken web search, and what I found in the actual documentation for various programs I tried didn't work.

TL;DR It turns out I probably won't be using this, because it's actually much easier just to mount the fileserver's video directory with sshfs and pretend the video files are local files. Still, I'd been curious about how to do video streaming, and I did find several ways to do it. So here's what I learned.

Read more ...

Tags: ,
[ 14:18 Jun 13, 2026    More linux | permalink to this entry | ]

Mon, 08 Jun 2026

LineageOS on a Pixel 3a

I installed LineageOS on the old Pixel 3a that's been sitting in a drawer! I've been meaning to try that forever, but never got around to it. The installation experience was pretty good, and Lineage works great, giving a new lease on life to a device that otherwise could be leaching out toxic chemicals in a landfill. (Though I confess it was actually sitting in a drawer, in case I ever found a use for it, like all my other old phones and laptops.)

First, I want to stress how very old the Pixel 3a is. It was first released in 2019 and discontinued in 2020. It's wonderful that LineageOS still offers an OS that works on a phone this old. It means that rather than throwing old phones away, contributing to e-waste, an old phone can be repurposed to do something useful.

Installation was remarkably easy on the 3a, though not totally without hiccups.

Read more ...

Tags: , ,
[ 14:23 Jun 08, 2026    More tech | permalink to this entry | ]

Sat, 30 May 2026

ICE Detention Numbers

[Trump has more people imprisoned in US concentration camps  than the Nazis did at any time during the first six years of Hitler's rule.] This image, from Indivisible, has been floating around social media. I saw it on a Mastodon post though curiously, it doesn't seem to be on their website anywhere.

But is it true? I wasn't going to share it until I knew that. So I investigated.

A few people on mastodon asked, and other people (not whoever posted the image for Indivisible) replied with two links: a Common Dreams article about ICE planning to buy/rent lots more warehouses for more detention centers, and an MSN article about the history of concentration camps. Neither article addresses the "first six years" claim at all. The MSN link says that Hitler had around 50,000 people held in his roughly 70 concentration camps in his first year (that turns out to be way off according to Wikipedia; I'll address that later).

The first question: how many people is ICE currently holding?

Read more ...

Tags: ,
[ 13:24 May 30, 2026    More politics | permalink to this entry | ]

Fri, 08 May 2026

Unit Testing TkInter Apps

I've been making a lot of tweaks lately to MetaPho, in particular its Python/TkInter based replacement for my C/GTK2 image viewer Pho.

Pho has always had quite a few modes: it can be fullscreen, in a window sized for the current image, or in a fixed-size window; images can be scaled to the window/screen size, or you can zoom in/out, or you can view them at full size (pixel for pixel). It's fairly common that when I fix a bug in one mode, it introduces a new bug in a different mode because of the way the scaling code works.

Ideally, in a complicated program, you guard against problems like that with automated tests. But that's hard to do in a GUI (graphical user interface) app. A window comes up, but how do you make it do different things? How do you check whether it's showing the right thing, or if it's the right size?

I've tried a couple times to find hints on how to unit test Python scripts in either Tk or GTK, but there's not much help available. I think most people just give up and don't test their GUIs — just as I've always given up.

This time, I decided to really dive in and see if I could write a TkInter unit test script for testing all those different TkPho modes. It wasn't easy, but now I have a basic framework that I should be able to use for other GUI apps as well.

Read more ...

Tags: , ,
[ 13:55 May 08, 2026    More programming | permalink to this entry | ]

Sun, 03 May 2026

Coffee Shirts

[A man sitting on a down ponderosa in a canyon, wearing a t-shirt that looks like tie-dye except the dye is all brown] I'm not a major coffee drinker, but Dave is, and he's varied over the years in how he prefers to make his coffee. For a long time he used an espresso maker, then a French press, then cold press, but lately, he's been making a variety of cold press he calls "sun coffee". It's similar to "sun tea", where you mix tea leaves with water in a pitcher in a sunny window for a few days.

That means that eventually, it has to be filtered. We don't want to use disposable paper filters. There are lots of options, but I like the solution Dave came up with: he uses an old white t-shirt. Two layers of t-shirt material does a pretty decent job of filtering (you might need to shift to another place on the shirt halfway through, depending on how much coffee you brewed and how finely it's ground).

After filtering, you wring out the filter and dump the grounds in a bucket where eventually it can be transferred somewhere like a path out in the yard. (We used to use it in the garden or in the compost bin on the theory that plants like more acidic soil, but the plants didn't do well so we've stopped that.) The coffee gets stored in the fridge.

Read more ...

Tags:
[ 11:38 May 03, 2026    More misc | permalink to this entry | ]

Thu, 30 Apr 2026

How to Re-initialize a Stuck ESP32 (in CircuitPython)

I designed my particulate air quality sensor project around Adafruit's PyPortal. It uses a ESP32 coprocessor for networking.

Unfortunately, the ESP32 is a little flaky. It tends to lose track of the network after an hour or so:

ESP32 not responding
Traceback (most recent call last):
  File "code.py", line 182, in 
  File "adafruit_requests.py", line 725, in post
  File "adafruit_requests.py", line 649, in request
  File "adafruit_connection_manager.py", line 331, in get_socket
  File "adafruit_connection_manager.py", line 248, in _get_connected_socket
  File "adafruit_connection_manager.py", line 61, in connect
  File "adafruit_esp32spi/adafruit_esp32spi_socketpool.py", line 114, in connect
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 899, in socket_connect
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 801, in socket_open
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 422, in _send_command_get_response
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 378, in _wait_response_cmd
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 292, in _wait_for_ready
TimeoutError: ESP32 not responding

I tried re-initializing the network, but it didn't help: re-initializing always died with Timed out waiting for SPI char and SCK in use.

There are lots of people asking about this on the net, but I couldn't find a discussion that actually had a solution for how to re-initialize a stuck ESP32. So I asked Claude. I know, AI, eww ... but Claude seems to have access to CircuitPython code and discussions that Google doesn't index, so sometimes it's the best way to find out how to solve CircuitPython problems. It took a couple of iterations (each requiring a few hours of testing, since it typically takes an hour or so before the network stops working), but we got there. Here's what seems to work for me.

Read more ...

Tags: ,
[ 10:10 Apr 30, 2026    More hardware | permalink to this entry | ]