How to make transparent GIFs more easily sharable by adding a checkerboard background

I’m currently taking part in the "#hARToween" daily art challenge, as I want to work on my pixelart skills and drawing a 128x128px pixel drawing each day1 for a month seemed like a good idea. You can follow my posts in this thread. I’m using Aseprite, and recently came across the “record for aseprite” script for it that allows taking regular snapshots of what I’m currently drawing so a timelapse can be created from that....

October 15, 2024 · 2 min

How to check for cloud IPs in nginx

I’m currently busy mitigating a stats manipulation on OctoPrint, and one of the steps I’m taking is blocking off several cloud options from accessing the tracking endpoint - and only that. Since we are talking about several thousand of IPs here in at least 1.5k of CIDR ranges, I was looking for the best way to do that that wouldn’t cause a lot of performance impact - the tracking server needs to be fast....

July 1, 2024 · 2 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 automatically sync screenshots from the Steamdeck to Google Photos

As a follow-up to my earlier post about how to sync screenshots to Google Drive here’s how to achieve the same but with a dedicated “Steamdeck” album on Google Photos instead. Once again we are using rclone for syncing. First I created a new target gphoto by running ~/bin/rclone config again and then following these steps. Quick summary: New remote gphoto Empty application ID and secret Full access No advanced config Use web browser to authenticate I then created a new album:...

February 19, 2023 · 1 min

How to add a switch for a port forward on Unifi to Home Assistant

This is admittedly something I did not learn today but rather learned and adapted a couple years ago from this post on the Home Assistant forum, but I just had to use it again today and so I figured I’d write it down with all the bells and whistles just in case I ever need this information again - or anyone else does. First of all, in your unifi controller you should create a new user that Home Assistant will act as to manage your port forward(s) for you....

February 17, 2023 · 3 min

How to automatically sync screenshots from the Steamdeck to Google Drive

I wanted to automatically sync the screenshots I take on my Steamdeck to some cloud, without having to manually do it for every single one in the Steamdeck’s own uploader. I came across this gist by pegasd that accomplishes this via rclone, a path monitoring systemd service and some reconfiguration in Steam. However, I had to adjust things slightly for everything to really work - I could imagine that some past Steam update changed things slightly vs when the gist was created:...

February 11, 2023 · Updated February 19, 2023 · 3 min

How to use jq to extract new posts from a JSON Feed

I’m currently looking into ways to automate some stuff around new posts on this page (be it blog or TIL post) directly during the page build on GitHub Actions. For this, I first need to be able to reliably detect new posts, from a bash run step. So here’s how to do that with jq. The idea is to get the current feed.json prior to publishing the page, and then compare it to the one that was just generated during the build....

February 2, 2023 · 2 min

How to detect Termux in a script

If you need to detect whether you are running in Termux from a bash script, check if $PREFIX contains the string com.termux: echo $PREFIX | grep -o "com.termux" This can also be used to set a variable in a Taskfile: vars: TERMUX: '{{and .PREFIX (contains "com.termux" .PREFIX)}}' Source

January 23, 2023 · 1 min

How to determine an RPi kernel version and build without booting it

To figure out the kernel version and build without booting it, e.g. to install matching device drivers during an automated image build in something like CustoPiZer, use something like this: function version_and_build_for_kernelimg() { kernelimg=$1 # uncompressed kernel? output=$(strings $kernelimg | grep 'Linux version' || echo) if [ -z "$output" ]; then # compressed kernel, needs more work, see https://raspberrypi.stackexchange.com/a/108107 pos=$(LC_ALL=C grep -P -a -b -m 1 --only-matching '\x1f\x8b\x08' $kernelimg | cut -f 1 -d :) dd if=$kernelimg of=kernel....

June 16, 2022 · 1 min
Mastodon