The problem # Last time , I wrote about figuring out how to access my Android phone's filesystem from the command line. As I said, the actual problem I wanted to solve was to minimize the manual effort in regularly backing up the important files on my phone. The solution # I wrote a script, backup-phone.py to implement the logic I was following to backup my phone manually. My backup structure is…
The problem # When I plug my Android phone into my computer, I can browse the files on it in my file manager Thunar (once I enable access on the phone). But the path shown starts mtp:// , not / , so I can't interact with those files through another program (unless it has its own support for MTP ). The main reason I want to be able to do that is so backing up my photos, etc. to my local computer is…
The problem # In a shell script, I wanted to use inotifywait 's --monitor option to watch for changes to files, but I didn't care how many changes had been made, only whether or not changes had been made. I wanted to use --monitor as if more changes where made later, I still wanted to get notified of them. Since inotifywait outputs a line for each change, this is equivalent to collecting all of…
The problem # When writing confirm-module , my original design did the communication over a Unix socket. I spent a while trying to figure out how to implement a very simple client/server program that could send a query to a Unix socket and wait for a response as a shell script using socat and could not figure it out. And I couldn't find any example code showing how do to that. The solution # Using…
The problem # I went to resume a screen session I knew I had running and it failed: $ screen -r There is no screen to be resumed. Since that somewhat frequently happens because the session is still attached, I checked for all of the sessions with -list and to my surprise found no sessions at all: $ screen -list No Sockets found in /home/perelman/.screen. I had run updates recently, so I was…
The problem # I returned to my desktop to find an error message saying the screensaver was unable load, and it wouldn't show the password box to unlock the screen. When I logged in via SSH from a different device and reattached to a Screen session I had previously started from inside my X session, I saw the error Maximum number of clients reached xprop: unable to open display ':0.0' The solution #…
The problem # In recent weeks, there were multiple Linux security bugs discovered, "copy fail" , "dirty frag" , and "PinTheft" , which all involve a kernel module that most people were not using but an attacker could load and then exploit. Naturally, a common response was to talk about ways to limit the set of the modules that could be loaded. But Linux distributions ship a lot of kernel modules…
The problem # In my last post , I had a shell script that used a helper script written in Python which had dependencies, which meant it required a virtual environment . The standard solution is to use pipx 's pipx run or uv 's uv tool run , but I don't like putting that into a script because that obscures when the download happens and makes the script surprisingly dependent on internet access.…
The problem # I make heavy use of the virtual desktops (also called "workspaces") feature common to Linux desktop environments (also supported on modern versions of Windows and macOS). I try to keep each desktop to a single task, but that can get confused as sometimes I have spin-off tasks or simply don't initially realize something I'm doing is going to explode to many windows. Xfce provides some…
The problem # xprop will display all X property values and supports setting array values for some types but not for string and atom arrays (despite this misleading answer asserting otherwise). This leaves no easy way to set X property values that are an array of strings or atoms like the _NET_DESKTOP_NAMES property which can be changed to set the names of the virtual desktops . The solution # If…
The problem # I wanted a web page to always show the latest version, but the page is a static page that is auto-regenerated when new data is available, and I did not want to complicate my setup by involving server-side logic in accomplishing that. This can be done manually by clicking the refresh button regularly, which internally will ask the web server if there's an update and get back the HTTP…
The problem # JavaScript can access the last modified timestamp of the current page using document.lastModified , but the more precise identifier of a document version, the ETag , does not have a corresponding straightforward property on document . Furthermore, it's not sufficient to simply query the web server for the page to get the ETag header because it may have changed between the browser…
The problem # I wanted to maintain an SSH port forward to a Unix socket indefinitely. Such a connection would allow a specific user (or group) on the remote computer access to a network service running on the source computer that's not exposed to the public internet. The part where I want the forward to go to a Unix socket and not just a TCP port (that would be accessible by any user on the remote…
The problem # I had a script where at some point a program I did not directly control would create a file, but I wanted that file's permissions to be different than those it got created with. The simple solution was to run chmod in a loop waiting for it to succeed with a short sleep delay between iterations. But it seemed like there should be a way to wait exactly until the file is created and act…
The problem # Last time , I presented a script to make starting Discord less annoying as I wouldn't have go to through the update dance. While I was already automating opening Discord, I figured it would be straightforward to do one more thing in the script and have it set the newly opened Discord window to be visible on all desktops as I always intend to do that and sometimes forget and then need…
The problem # Discord releases new versions somewhat frequently. The standard way to update the Linux desktop application involves too many steps, and requires opening a browser to download the new package, so it's especially annoying if I don't have a browser open. The solution # Put the following script in the directory you want to store the Discord installation packages in (it will keep around…
The problem # I was writing a script that only sometimes needed a terminal. Since it was launching a graphical application, I didn't want it to run in a terminal that would stick around. But it sometimes needed to run a command with sudo and therefore provide a terminal for the user to enter a password into and see the results of that command. And furthermore, I wanted the rest of the script to…
The problem # I make heavy use of virtual desktops , so I use browser windows on multiple desktops. When logging into a site that uses passkeys , KeePassXC pops up a dialog on the desktop its main window is on, which is usually not the desktop my browser window is on. Then I have to switch over to that desktop to interact with the dialog and then back to the desktop I was working on. There is a…
The problem # I was working on a bugfix for a GUI application I use , but I didn't want my development to interfere with the instance I was actually running. The application stores state that I didn't want to be modified by the in-development code in a few different places (data, settings, cache) and also tries to be smart and refuses to open a second instance if it's already instead pointing to…
The problem # Last time , I described how I set up a way to stream a web cam attached to my desktop to a Home Assistant dashboard on my smartphone, so I could view it from anywhere on my local network. More specifically, I described the actual good solution I settled on and not the detour I took setting up different ways to set up video streaming that don't work as well. The solution # This is a…
The problem # I wanted to set up a way to get a live video stream of one part of my living space no matter where I was at home, and I wanted that stream to be easily viewable by any member of the household, but not by anyone else. Since where I wanted the camera pointed was near my desktop which I have a USB webcam for, I figured it should be easy to setup streaming from that webcam to my phone…
The problem # The actual filename structure of my blog posts contains the publishing date while the actual publishing date used by Pelican is in the file in a line starting Date: . For example, this file is content/2025/1026-lint-blog-dates.md and contains the header line Date : 2025 - 10 - 26 02 : 00 Since I write posts to be published in the future , sometimes I reschedule future posts, which…
The problem # As previously mentioned , I use Syncthing to synchronize various files between different computers within my household, some of which have owners who prefer to use Windows. I recently noticed the files weren't getting synchronized anymore, and upon checking on the Syncthing dashboard at http://localhost:8384/ , I saw errors similar to this Reddit post and these Syncthing forum posts…
The problem # A website that I had been using every day suddenly stopped loading. Connecting to it just timed out, like the server was completely down. I figured it was a temporary interuption in service, but several hours later, it was still not working and there was no status message on the organization's main site about an outage. So I was suspicious the problem was somehow on my side. The…
The problem # In a recent post , I wanted to include a large code block of a log. In order to not make the reader scroll past that long block, I put it in a footnote. But triple-backtick ( ``` ) syntax for code blocks doesn't work in Python Markdown footnotes: [ ^1 ]: Broken footnote, do not use: ```py print ( "Hello World!" ) ``` outputs the code block before the footnote, not inside it. The…
The problem # When writing a blog post like last time's , I often will be at least partway through the process before I realize it's interesting enough to write a post on. Then I need to somehow go back and reconstruct a narrative of the troubleshooting steps I performed. The solution # As long as I still have the terminals or screen sessions open, I can at least capture a snapshot of the…
The problem # I use Ubiquiti -branded network products for my switches and wireless access points and use the UniFi Network controller software to configure them. 1 I noticed the web interface wasn't working and checked the status the service and saw the logs showed it starting the service and no further information (and looking at the log files didn't show it generating any errors either): $ sudo…
The problem # I've somehow multiple times ended up with corrupted video files such that they're cut off at some point, apparently due to a copy being interrupted or similar. As a result, I'm a bit paranoid about my video files not being what I expect, so I wanted a way to quickly check the length and view the start and end of many videos. The solution # The following script check_video_length.sh ,…
The problem # For a compile-on-save workflow where some computation is done in response to every change to a file, if there may sometimes be many changes close together, it may be wasteful to respond to all of them. This is often handled by debouncing the events: instead of responding to every change, ignore changes that occur too close together in time. The solution # watch_todo_debounced.sh is a…
The problem # A common use of JavaScript is to change which content is displayed on a web page. In some simple cases this can actually be done without JavaScript. While there's some older articles on how to do this, some newer HTML/CSS features can help. The solution # The simplest case is the <details> tag which allows showing a foldable section without even requiring any CSS. But for more…
The problem # A few months ago, I wrote about using todo.txt to keep track of household tasks. The key word there being "household": many of the tasks I'm tracking are not performed on a computer. I mentioned this issue in the post, that I wanted to look into some way to view those tasks not from my computer. The solution # I wrote todotxt-to-html , a very simple script that takes a todo.txt file…
The problem # Kitchen timers are common tool used by many (most?) people while cooking. They come in many forms, but tend to have the same basic user interface: turn a dial (physical or digital) or type in a time and press a start button, and get a notification (usually some kind of beeping sound) that amount of time later. Very simple concept, your kitchen probably has multiple on different…
The problem # Schedule grids ( example ) are a way of displaying a collection of events, some of which occur at overlapping times. They are often used to show what is happening at a conference or other busy event with multiple things going on simultaneously. They are tables where the y-axis is time and the x-axis is sometimes arbitrary or sometimes some concept of location (e.g., which room the…
The problem # I had been playing a lot of the social-deduction game The Resistance (and the version with more roles The Resistance: Avalon ) and running into the problem that many players had trouble remembering exactly what had happened in previous rounds. Between the fact that there can be several votes throughout a game of the The Resistance and the game can sometimes take up to an hour, it can…
The problem # The board game Spirit Island has all of players playing more or less simultaneously, especially when acting on different parts of the map, but requires some bookkeeping to be kept among all of the players. For a normal game of at most four players, this isn't difficult, but the game has rules to allow combining multiple copies to a huge game. My friend group planned a 12-player game…
The problem # Sometimes I have a long video that I only want a shorter section of. Maybe it's a TV show that I want to clip a funny scene out of. Or a video of a concert that I want to clip the individual songs out of so I can put them into my music library. But figuring out exactly where to start and end the clip so there's no weird sounds or flashes due to accidentally including the surrounding…
The problem # When writing blog posts, I like to use Markdown's reference-style links which let you avoid writing URLs inline and instead provide a short name and define it elsewhere in the document. I always put them at the end, which results in the bottom of the Markdown file looking like a bibliography for the post. But then there's the extra task of making sure the references at the bottom of…
The problem # Last time , I presented a script read_keypress.sh which would read any single keypress in a shell script. For printable characters, it's straightforward what this means, but for keys like left arrow ( 🠈 ), it's not obvious how to deal with them. The solution # keytest.sh demonstrates using read_keypress.sh to respond to keypresses including 🠈 and Ctrl + c : #!/bin/bash esc = $(…
The problem # For certain applications it can be useful to get many quick responses from the computer, so we would like it to react to individual keypresses instead of requiring an entire command to be typed out and confirmed by pressing Enter . While this is a common feature of GUI and TUI toolkits (e.g., ncurses ), it can also be useful for very lightweight inactive experiences written as simple…
The problem # While I use the command-line and keyboard-based interfaces a lot to manage files, I also regularly use graphical and mouse-based interfaces. As with any time there's different ways of interacting with a system, there's some times when in one mode when you want the features of the other. The solution # Xfce 's file manager Thunar has a feature called custom actions , which lets you…
The problem # My Android phone's camera app has an option to take a " motion photo ", which, similar to the iOS " live photo " feature, records a short, silent video along with the photo. When viewing the photos on the phone, there's an option to play the video. But image viewer programs on my computer like Eye of GNOME ( eog ) do not support playing them. The solution # ExifTool (in Debian, the…
The problem # Signal is a privacy-focused instant messaging application which ensures end-to-end encryption on all messages and generally goes out of its way to avoid accidentally revealing your conversations to third parties. As is common with security mechanisms, this necessarily adds some friction some some tasks you actually want to do. In particular, this means viewing your message history…
The problem # Previously , I wrote a script for opening and immediately focusing xfce4-appfinder . But xfce4-appfinder will notice if it's already open and just assume you want to use the existing window. Even if it's on a different desktop. And therefore attempting to focus it will either do nothing or switch to that desktop, neither of which is desirable. The solution # The actual solution I…
The problem # The new year is a traditional time for adopting new organizational schemes, among other oft-broken promises to oneself of improved habits. In that vein, I recently adopted a new system for managing my TODO list. Managing a household involves a lot of infrequent tasks that are easy to forget like checking filters on various appliances every few months and similar invisible maintenance…
The problem # Last week , I mentioned that I needed a hack to kill xprop that seemed like it should be unnecessary. Specifically, I had its output piped to a Bash while read loop and once that had found a line to act on, there was no further need to get more lines from xprop , but break or exit didn't result in xprop exiting. The solution # Use $BASHPID to get the actual PID of the subshell, ps to…
The problem # I have my window manager set to not focus new windows because I dislike having a new window pop up while typing and having the keystrokes surprisingly sent to the new window instead of the one I thought I was typing in. While this is usually what I want, this does mean extra clicks when I did mean to open the new window. This is particularly bad for xfce4-appfinder (or any other…
The problem # I mostly use Gnumeric for my personal spreadsheets, which are generally quite simple. But recently I wanted do some analysis that required writing a formula more complicated than just using the SUM() function and found Gnumeric's function documentation quite lacking in sufficiently detailed explanations and examples to be able to figure out how to use any of the more complicated…
The problem # Previously, I figured out how to extract Tametsi's puzzles , but I wanted to make something user-friendly that made use of those puzzles, so I didn't want to require people to install something or run console commands. I had also figured out how to get Java programs running in a browser , so I figured it would be straightforward to combine the two. As you may have guessed from this…
The problem # Slashdot recently made a change to their ad code that made the site completely fail to load for me, showing the message Failed to load website properly since html-load.com is blocked. Please allow html-load.com and then blaming ad blocking: This page could not be loaded properly due to incorrect / bad filtering rule(s) of adblockers in use. Please disable all adblockers to continue…
The problem # I run a Discord community for a local hobby-focused friends group. Since it's theoretically people I know in person, I don't want it to be an open invite; I want confirmation that everyone that joins has a real in-person connection to the group. I handle by gating access to most of the channels behind a role that I grant to new users once I've identified them. As the group has grown,…