How to quickly create a header modifying reverse proxy with mitmproxy

I’m currently in the process of testing some changes on OctoPrint involving its automatic user login via request headers, and for that needed to quickly set up a reverse proxy that would modify the headers of the requests going to the development server for some quick testing. Specifically, I wanted a quick CLI tool that would allow me to set up a reverse proxy listening on port 5555, forwarding to http://localhost:5000 while also setting the headers X-Remote-User to remote and X-Remote-Host to localhost:5555....

March 12, 2024 · 1 min

How to print Deutsche Post stamps via the command line on a Brother QL label printer

Update from 2024-01-12: I’ve updated the scripts to support both 50mm and 62mm wide labels, and added some more whitespace trimming to the basic stamp. The post has been adjusted accordingly. I recently acquired a Brother QL-820NWB label printer to be able to quickly create labels for boxes and such, and ideally also print out Deutsche Post’s “print yourself” stamps with it. The Deutsche Post stamp shop allows me to download PDFs targeting the 62mm wide endless labels for that printer, for the two types of stamps I’m interested in (stamp, and address label with stamp)....

January 11, 2024 · Updated January 12, 2024 · 3 min

How to force paperless-ngx to consume signed PDFs

I use paperless-ngx to manage my documents, together with some rules that automaticaly ingest PDFs from my mail boxes. However, I noticed that a recently received invoice from AWS was not ingested as expected. Looking at the logs I found this error message for it: invoice.pdf: Error occurred while consuming document invoice.pdf: DigitalSignatureError: Input PDF has a digital signature. OCR would alter the document, invalidating the signature. I don’t know if a software update brought this refusal to run OCR on signed PDFs, or if AWS simply so long didn’t send me signed PDFs, but I needed to find a way to force paperless to ingest signed things as well as having all of that stuff stored in paperless is a vital part of my accounting workflow....

December 6, 2023 · 2 min

How to fix GRUB after a SteamOS update

My partner just ran into an issue after updating his SteamDeck to the latest SteamOS version (3.4.x to 3.5.7). He has a dual boot setup running using rEFInd, and while that survived the OS update just fine, when he wanted to return to SteamOS after a quick stint in Windows today, he was greeted by a GRUB boot menu. Detective foosel to the rescue. Attempting to boot the SteamOS entry in grub resulted in an error like this (with another device UUID):...

November 25, 2023 · 2 min

How to fix VirtualBox on Fedora 38 with Kernel 6.4.10+ by adding a missing include

I recently did a software update on my laptop running Fedora 38, and that also brought in a kernel update. Starting my Win10 VirtualBox VM afterwards no longer worked as it needed the kernel module to be recompiled. However, that failed: $ sudo /sbin/vboxconfig [sudo] password for gina: vboxdrv.sh: Stopping VirtualBox services. depmod: WARNING: could not open modules.order at /lib/modules/6.3.8-200.fc38.x86_64: No such file or directory depmod: WARNING: could not open modules....

September 7, 2023 · 2 min

How to monitor network traffic on my USG via Wireshark

I’m currently trying to figure out some internal network issues1 and for that need to monitor the traffic of a specific device on my network. I’m using a Unifi USG as my router (behind the ISP’s Fritzbox that I consider hostile since it’s not mine). I found this post on reddit that explains how to capture traffic on the USG via tcpdump and send it through the SSH session to Wireshark on my laptop:...

August 28, 2023 · 2 min

How to make MkDocs support site_url relative URLs

I’m currently finally back on converting the OctoPrint docs to using Markdown and MkDocs. Since I have some images in the docs that I want to be able to reference without having to use relative URLs (../../../../images/), especially since that would tie things in OctoPrint’s source tree structure too close to things in its documentation tree structure that might or might not end up being in a different repository in the future, I needed a way to use absolute URLs here (/images/)....

July 27, 2023 · Updated July 28, 2023 · 2 min

Why ESPHome might fail compiling a custom component with 'fatal error: string: No such file or directory'

I just spent several hours trying to figure out why ESPHome refused to compile a custom component I was working on. The error message I got was Compiling .pioenvs/datenzwerg-sleepy/src/esphome/components/sound_pressure/sound_pressure_sensor.c.o In file included from src/esphome/components/sound_pressure/sound_pressure_sensor.h:3, from src/esphome/components/sound_pressure/sound_pressure_sensor.c:1: src/esphome/core/component.h:3:10: fatal error: string: No such file or directory 3 | #include <string> | ^~~~~~~~ compilation terminated. Compiling .pioenvs/datenzwerg-sleepy/src/main.cpp.o *** [.pioenvs/datenzwerg-sleepy/src/esphome/components/sound_pressure/sound_pressure_sensor.c.o] Error 1 Other external and internal components compiled just fine, so that was quite a head scratcher, until I just finally noticed something in my source tree: my custom component’s source file had the file ending ....

July 14, 2023 · 1 min

How to fix VirtualBox on Fedora 38 with Kernel 6.3.5 by disabling IBT

For accounting and some windows only software (👋 Affinity Designer) I have a Windows 10 VM running in VirtualBox on my Framework running Fedora 38. Apparently I got a kernel update recently and as of this morning the VM refused to start. It just hung, and a look into journalctl showed something like this: Jun 13 10:23:50 draper kernel: traps: Missing ENDBR: 0xffff9b688c308f30 After some searching I came across this thread on the VirtualBox forums which explained the issue and also includes the solution....

June 13, 2023 · 1 min

How to export a Godot 4 game to run on the web on itch.io

On the Go Godot Jam 4 Discord I just saw some people having issues with how to get HTML5 exports from Godot 4 to work on itch.io, and since I just had to do this for my own game submission to the jam as well I decided to jot my steps down here (and on the Discord too) as it seems to be a bit of a pain for people....

May 14, 2023 · 1 min