Archive

All published posts

2518 posts latest post 2026-07-10 simple view
Publishing rhythm
Jun 2026 | 26 posts
Check out volfpeter [1] and their project fasthx [2]. FastAPI [3] server-side rendering with built-in HTMX [4] support. References: [1]: https://github.com/volfpeter [2]: https://github.com/volfpeter/fasthx [3]: /fastapi/ [4]: /htmx/
FastHX - FastHX volfpeter.github.io [1] Very interesting approach to htmx [2] and fast api. It uses separate decorators for returning template partials and json that can be stacked to include both options on a single route. The templates are explicitly set in the decorator. Separate decorators are used for full page and partial pages. I don’t see an example of full and partial pages being combined. I think the demo app must be behaving in a spa like fashion where it does not get all of the data when it calls index and index will ask for user-list. Definitely going to keep my eye on this project and ponder on it. from fastapi import FastAPI from fastapi.templating import Jinja2Templates from fasthx import Jinja from pydantic import BaseModel # Pydantic model of the data the example API is using. class User(BaseModel): first_name: str last_name: str # Create the app. app = FastAPI() # Create a FastAPI Jinja2Templates instance and use it to create a # FastHX Jinja instance that will serve as your decorator. jinja = Jinja(Jinja2Templates("templates")) @app.get("/") @jinja.page("index.html") def index() -> None: ... @app.get("/user-list") @jinja.hx("user-list.html") async...
FastHX - FastHX volfpeter.github.io [1] Very interesting approach to htmx [2] and fast api. It uses separate decorators for returning template partials and json that can be stacked to include both options on a single route. The templates are explicitly set in the decorator. Separate decorators are used for full page and partial pages. I don’t see an example of full and partial pages being combined. I think the demo app must be behaving in a spa like fashion where it does not get all of the data when it calls index and index will ask for user-list. Definitely going to keep my eye on this project and ponder on it. from fastapi import FastAPI from fastapi.templating import Jinja2Templates from fasthx import Jinja from pydantic import BaseModel # Pydantic model of the data the example API is using. class User(BaseModel): first_name: str last_name: str # Create the app. app = FastAPI() # Create a FastAPI Jinja2Templates instance and use it to create a # FastHX Jinja instance that will serve as your decorator. jinja = Jinja(Jinja2Templates("templates")) @app.get("/") @jinja.page("index.html") def index() -> None: ... @app.get("/user-list") @jinja.hx("user-list.html") async...
Pinout and Schematic - nice!nano Pinout and schematic for the nice!nano nicekeyboards.com [1] Pinout for nice!nano boards. Note that P0.15 means gpio port 0 pin 15, they can be referenced in zmk when setting column and row pins. #include <dt-bindings/zmk/matrix_transform.h> / { chosen { zmk,kscan = &default_kscan; zmk,matrix_transform = &default_transform; /delete-property/ zephyr,console; /delete-property/ zephyr,shell-uart; }; default_kscan: kscan { compatible = "zmk,kscan-gpio-matrix"; label = "default_kscan"; diode-direction = "col2row"; col-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH> , <&gpio0 29 GPIO_ACTIVE_HIGH> , <&gpio0 2 GPIO_ACTIVE_HIGH> ; row-gpios = <&gpio1 15 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> , <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> ; }; default_transform: matrix_transform { compatible = "zmk,matrix-transform"; columns = <3>; rows = <3>; map = < RC(0,0) RC(0,1) RC(0,2) RC(1,0) RC(1,1) RC(1,2) RC(2,0) RC(2,1) RC(2,2) >; }; }; References: [1]: https://nicekeyboards.com/docs/nice-nano/pinout-schematic/
I’m impressed by shmux [1] from typecraft-dev [2]. the shell-script tmux management you didn’t know you needed. baby References: [1]: https://github.com/typecraft-dev/shmux [2]: https://github.com/typecraft-dev
I like iximiuz’s [1] project awesome-container-tinkering [2]. List of awesome tools to tinker with containers. References: [1]: https://github.com/iximiuz [2]: https://github.com/iximiuz/awesome-container-tinkering
GitHub - svenstaro/miniserve: 🌟 For when you really just want to serve some files over HTTP right now! 🌟 For when you really just want to serve some files over HTTP right now! - svenstaro/miniserve GitHub · github.com [1] miniserve is a sweet http server, replacement for python -m http.server. It’s fast, runs off a small binary, but why would I want to use it over something that already exists on most machines, because it includes a bunch of features like qr codes, pretty themes, and uploads. I’ve used python -m http.server many times to transfer files from one machine to another in a pinch, like at a family members house. But what if they have an android, windows, or something not easy to get a python repl running on, you can run miniserve and upload from their device rather than hosting from their device. References: [1]: https://github.com/svenstaro/miniserve
Looking for inspiration? miniserve [1] by svenstaro [2]. 🌟 For when you really just want to serve some files over HTTP right now! References: [1]: https://github.com/svenstaro/miniserve [2]: https://github.com/svenstaro
pacman/Tips and tricks - ArchWiki wiki.archlinux.org [1] The arch wiki is always full of good content, and pacman tips and tricks does not disappoint. Today I discovered this command to remove orphaned dependencies on my system. pacman -Qdtq | pacman -Rns - References: [1]: https://wiki.archlinux.org/title/pacman/Tips_and_tricks
Inside 22,734 Steam games About a year ago I blogged about games that use curl. In that post I listed a bunch of well-known titles I knew use curl and there was a list of 136 additional games giving credit to curl. Kind of ... daniel.haxx.se · daniel.haxx.se [1] Interesting to see that curl is used in so many places. I often think of things like games being so windows centric and curl being so linux centric I don’t even think of these things crossing paths as much as they do. References: [1]: https://daniel.haxx.se/blog/2024/06/20/inside-22734-steam-games/
wcurl is here Users tell us that remembering what curl options to use when they just want to download the contents of a URL is hard. This is one often repeated reason why some users reach for wget instead of cur... daniel.haxx.se · daniel.haxx.se [1] interesting, seems like such a simple way to completely remove the need of a whole other cli. No offense to anyone working on wget, but generally I use it out of lazyness or something wierd is happening and I am looking for a second opinion. Cool to know that wcurl exists and will start shipping with curl. References: [1]: https://daniel.haxx.se/blog/2024/07/03/wcurl-is-here/

I’ve started leaning in on kubernetes kustomize to customize my manifests per deployment per environment. Today I learned that it comes with a diff command.

kubectl diff -k k8s/overlays/local

You can enable color diffs by using an external diff provider like colordiff.

export KUBECTL_EXTERNAL_DIFF="colordiff -N -u"

You might need to install colordiff if you don’t already have it.

sudo pacman -S colordiff

sudo apt install colordiff

Now I can try out kustomize changes and see the change with kustomize diff.

kubectl dash k

Kubernetes ships with a feature called kustomize that allows you to customize your manifests in a declarative way. It's a bit like helm, but easier to use. I...

1 min

Animal well does not let you remap keys, and really doesn’t even inform you that it is keyboard compatible. I had to play around and discover the keymap, which can be a bit tricky on a 40% board. This is what I found.

  • wasd - move
  • space - jump / a
  • enter - interact / b
  • x - throw
  • c - inventory
  • 1 - left item / rb
  • 2 - open item menu / triangle
  • 3 - right item / lb
I recently discovered pydantic-sqlite [1] by Phil997 [2], and it’s truly impressive. Simple package for storing pydantic BaseModels in an in-memory SQLite database. References: [1]: https://github.com/Phil997/pydantic-sqlite [2]: https://github.com/Phil997
Email Address Obfuscation Hide email addresses from bots while keeping them visible to visitors. Cloudflare Docs · developers.cloudflare.com [1] I recently started seeing email-decode.min.js show up on my blog posts, and I wondered what the heck ? I didn’t put it there. Turns out that cloudflare put it there from pages to safely serve email addresses for me. inspecting the page without js running we can see that the mailto email is swapped out for email protected. Neat feature. ❯ curl --silent https://waylonwalker.com/diskcache-as-debounce/ | grep email <a class="decoration-pink-500 hover:decoration-pink-300 hover:text-pink-100" href="/cdn-cgi/l/email-protection#a4ccc1c8c8cbe4d3c5ddc8cbcad3c5c8cfc1d68ac7cbc9" rel="me"><span class="__cf_email__" data-cfemail="630b060f0f0c2314021a0f0c0d14020f0806114d000c0e">[email&#160;protected]</span></a> <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script></body> Looking deeper into this article it looks like this feature comes from Scrape Shield and enabling Email Address Obfuscation. References: [1]: https://developers.cloudflare.com/waf/tools/scrape-shield/email-address-obfuscation/
Background Tasks - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com [1] fastapi [2] comes with a concept of background tasks which are functions that can be ran in the background after a function has been ran. This is handy for longer running functions that may take some time and you want to have fast response times. Here is an example from the docs from fastapi import BackgroundTasks, FastAPI app = FastAPI() def write_notification(email: str, message=""): with open("log.txt", mode="w") as email_file: content = f"notification for {email}: {message}" email_file.write(content) @app.post("/send-notification/{email}") async def send_notification(email: str, background_tasks: BackgroundTasks): background_tasks.add_task(write_notification, email, message="some notification") return {"message": "Notification sent in the background"} References: [1]: https://fastapi.tiangolo.com/tutorial/background-tasks/ [2]: /fastapi/
markdown-it-pyrs A Python interface for markdown-it.rs, using Rust for blazingly fast Markdown parsing ⚡️ PyPI · pypi.org [1] markdown it py running in rust claims to be 20x faster. I’ll definitely look into this if markdown it py is ever a bottleneck in my performance. At first glance it appears that plugins are written in rust not python, and there is no admonition plugin, so I’ll keep my eye on it for now, but I can’t use it. References: [1]: https://pypi.org/project/markdown-it-pyrs/
[1] diskcache has a peekitem method that allows you to lookup the expire_time of a cached item without changing it. I recently used this to implement debounce for fastapi [2] background tasks with multiple workers running. since all the workers I care about are on the same machine, but running in different processes diskcache was a great option. All workers have access to the same disk, but not the same variables in memory. References: [1]: /static/https://grantjenks.com/docs/diskcache/api.html#diskcache.Cache.peekitem [2]: /fastapi/

I’ve been using fastapi more and more lately and one feature I just started using is background tasks [[ thoughts-333 ]].

Seealso

basic diskcache example <a href="/python-diskcache/" class="wikilink" data-title="How I setup a sqlite cache in python" data-description="When I need to cache some data between runs or share a cache accross multiple processes my go to library in python is . It&#39;s built on sqlite with just enough..." data-date="2022-03-29">How I setup a sqlite cache in python</a>

One Background Task per db entry #

I am using it for longer running tasks and I don’t want to give users the ability to spam these long running tasks with many duplicates running at the same time. And each fastapi worker will be running in a different process so I cannot keep track of work in memory, I have to do it in a distributed fashion. Since they are all running on the same machine with access to the same disk, diskcache is a good choice

What I need #

  • check if a job is running
  • automatically expire jobs

Less infrastructure complexity #

My brain first went to thinking I needed another service like redis running alongside fastapi for this, then it hit me that I can use diskcache.

How I used diskcache #

Here is how I used diskcache to debounce taking screenshots for a unique shot every 60 seconds.

from diskcache import Cache

jobs_cache = Cache("jobs-cache")

@shots_router.get("/shot/{shot_id}", responses={200: {"content": {"image/webp": {}}}})
@shots_router.get("/shot/{shot_id}/", responses={200: {"content": {"image/webp": {}}}})
async def get_shot_by_id(
    background_tasks: BackgroundTasks,
    request: Request,
    shot_id: int,
):
    shot = Shot.get(shot_id)
    # check if the shot exists and return it or continue to create it.



    is_running = jobs_cache.get(shot_id)

    if is_running:
        expire_time = datetime.fromtimestamp(jobs_cache.peekitem(expire_time=True)[1]) - datetime.now()
        console.print("[red]Already running store_shot: ", shot_id)
        console.print(f"[red]Can retry in {expire_time.seconds}s")
    else:
        jobs_cache.set(shot_id, True, 60)
        background_tasks.add_task(
            store_shot,
            shot_id=shot_id,
        )
I’m really excited about homelab-diagrams [1], an amazing project by Doomlab7 [2]. It’s worth exploring! A repository to house diagrams for my homelab [3] References: [1]: https://github.com/Doomlab7/homelab-diagrams [2]: https://github.com/Doomlab7 [3]: /homelab/
learn-pdm [1] by pypeaday [2] is a game-changer in its space. Excited to see how it evolves. A repository for learning and playing with the pdm package manager/system for python References: [1]: https://github.com/pypeaday/learn-pdm [2]: https://github.com/pypeaday
If you’re into interesting projects, don’t miss out on zmk-config-fourpad [1], created by wyattbubbylee [2]. my fourpad keybord References: [1]: https://github.com/wyattbubbylee/zmk-config-fourpad [2]: https://github.com/wyattbubbylee

kind cluster

kind [1]{.hoverlink} is a very useful tool to quickly standup and teardown kubernetes clusters. I use it to run clusters locally. Generally they are short lived clusters for trying, testing, and learning about kubernetes. Kind is Kubernetes in Docker, its very fast to get a new cluster up and running. Other than checking a box in docker desktop it is the easiest way currently to get a cluster up and running. I’ve used docker desktop for k8s before I really developed on k8s and it was buggy at the time and sometimes started and sometimes didn’t, when it didnt I had no idea how to fix it. I’d suggest kind as the best option to get a cluster up and running locally. Not Production # [2] If you are looking for a production ready cluster this is not it. I really like k3s [3]{.hoverlink}. At the time that I chose k3s it was the most lightweight option that easily supported multi-node clusters. Starting a kind cluster # [4] The first step, and maybe only one that you need is to create ...

Yesterday I realized that I have overlooked the default installation method of the sealed secrets controller for kubernetes kubeseal this whole time an jumped straight to the helm section. I spun up a quick kind cluster and had it up quickly. I can’t say this is any better or worse than helm as I have never needed to customize the install. According to the docs you can customize it with [[ kustomize ]] or helm.

# option if you don't have a cluster try with kind

kind create cluster

curl -L https://github.com/bitnami-labs/sealed-secrets/releases/download/v0.27.0/controller.yaml > controller.yaml

kubectl apply -f controller.yaml
I like rothgar’s [1] project bashScheduler [2]. Kubernetes scheduler written in less than 100 lines of bash 😬 😆 References: [1]: https://github.com/rothgar [2]: https://github.com/rothgar/bashScheduler
Alternatives A Pro Micro alternative for wireless keyboards. Contribute to joric/nrfmicro development by creating an account on GitHub. GitHub · github.com [1] Huge list of micro controllers tried and used in keeb builds. References: [1]: https://github.com/joric/nrfmicro/wiki/Alternatives
I’m impressed by nrfmicro [1] from joric [2]. A Pro Micro alternative for wireless keyboards References: [1]: https://github.com/joric/nrfmicro [2]: https://github.com/joric
waylon walker (@_WaylonWalker) on X First bit of hand written gcode in 12 years let's go! X (formerly Twitter) · x.com [1] Not gonna lie, kinda pumped about this one. I manually did one, jotted down the coordinates, opened the gcode in vim, added markers between setup/teardown and print. then added the wipe, the copy pasted the print+wipe section a bunch of times. My printer tends to run a bit better on single prints than printing a dozen at once as it has less issues with retract start and stop. References: [1]: https://x.com/_WaylonWalker/status/1807594004453667134
[1] Damn, supply chain vector attacks are wild. Random guy in Primes stream was getting $40k offers to buy their open source project while in university and they have never made anything from it. What a social engineering attack this is. It would be so easy to make it look like a good deal and that the package was going to a good new owner who has real resources to maintain it. References: [1]: /static/https://www.youtube.com/watch?si=6NK4iCu1b1rCDo7a&amp;t=555&amp;v=mmlHQyMOK7Y&amp;feature=youtu.be
Found: OverlayKey X Designed by @yfuku_, a keyboard to place on top of your laptop. Thomas Baart's Microblog · micro.thomasbaart.nl [1] This is almost exactly what I have been thinking about building for quite awhile. I am going to give it a good try with a few $$ in filiment some cheap switches a microcontroller and go pretty bare bones, maybe open wiring on the bottom. References: [1]: https://micro.thomasbaart.nl/2024/06/12/overlaykey-x/
Queueing – An interactive study of queueing strategies In this blog, we go on an interactive journey to understand common queueing strategies for handling HTTP requests. encore.dev [1] Absolutely sick post. This is top tier animated blog posts. This posts demos how different queuing systems work with fantastic interactive demos. References: [1]: https://encore.dev/blog/queueing
- Supply chain attacks are so big these days engineers definitely need to take these into consideration. It’s wild that such a simple attack vector hit some really big applications. This particular vector is so easy to avoid. You are already hosting web content, just curl the file and self host [1] the script, then you own it. That eliminates this attack vector all together, but doesn’t completely remove supply chain attacks, the js file can still hit external apis internally. What I see has happened in this case is that the owner of the domain polyfill.io changed. so anyone who directly linked to them got a malware injected script used. I can only imagine the number of applicatons that are not even being maintained anymore getting hit by this. TLDR, if you are taking something to production, where you are goind to deploy it and let it run, host the js yourself. these cdns are great for prototyping, but tread with caution. References: [1]: /self-host/
- YouTube Enjoy the videos and music you love, upload original content, and share it all with friends, family, and the world on YouTube. youtube.com [1] Well spoken prime. Co-pilot is a fantastic tool for templating, boilerplate, or just getting something done that is just outside your knowledge or care to know. Bit if you really want to learn something, you need to use your hands. Reading the solution only gives you the happy path. This does not give you that path that most people would take, and completely misses debugging. If you are very new and learning it’s unlikely that you can write large blocks of code without running a test or a script to try it. Taking these shortcuts will hinder your ability to do it yourself. If I were to devils advocate here, copilot is still not the greatest at the big picture, you still have to drive, and tell it I want to use python, fastapi [2], I want to load settings from .env. taking these shortcuts can help you move quick and get the big picture. This is especially helpful for someone who might know one language or framework and is trying a different one, but at some point you need to do the work and learn if you are going to be effecti...
GitHub - dropbox/pyannotate: Auto-generate PEP-484 annotations Auto-generate PEP-484 annotations. Contribute to dropbox/pyannotate development by creating an account on GitHub. GitHub · github.com [1] pyannotate is a tool that uses runtime types to suggest type annotations to use. Test runners such as pytest can be used to generate the types. References: [1]: https://github.com/dropbox/pyannotate
[1] Interesting, linux supports 32 programmable buttons, special buttons that do nothing that hotkey programs like xbindkeys can pick up and run things, seems like it would be very intersting to use on a macro pad. You could easily do dynamic and complex tasks without clashing that keybinding with something else. I’m going to look into this for my next obs setup. No matter what I try to do with the hyper key it always tends to do odd things depending on the application I am in. typically its tmux, and it starts trying to do something I don’t want it to. References: [1]: /static/https://github.com/qmk/qmk_firmware/blob/master/docs/features/programmable_button.md
Where DOESN’T curl run with curl BDFL Daniel Stenberg (Changelog & Friends #49) Daniel Stenberg shares his guiding principles for BDFL'ing curl, gives us his perspective on the state of the internet, talks financial independence, ensuring curl won't be the next XZ & more! Changelog · changelog.com [1] Love how Daniel just brushed off the number of netflix tv installs as small beans for curl installs. overall great episode on open source, owning a major component to technology with such a small team. References: [1]: https://changelog.com/friends/49

I’ve long had issues with my qmk keyboard media keys on my arch install, I always thought it was on the keyboard end. Today I learned that playerctl fixes this.

paru -S playerctl

Once it is installed all of my media keys started working right away.

I played around with it a bit more and came up with a way to display the current playing title in my notifictations.

notify-send "`playerctl metadata --format '{{lc(status)}}:{{artist}}-{{album}}-{{title}}'`"
Welcome to RSS Club Congratulations on joining a secret society! If you’re reading this, that means my message has been transmitted successfully. This post is only available to you, Reader, through the ancient peer-... daverupert.com · daverupert.com [1] Super cool idea, kinda breaking the rules by talking about it here, but Its a cool idea to throw out posts to the core audience. Apparently its been around for quite while Dave started in 2018. References: [1]: https://daverupert.com/2018/01/welcome-to-rss-club/
GitHub - stackrox/kube-linter: KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices. KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices. - stackrox/kube-linter GitHub · github.com [1] A linter for linting kubernetes manifests and help charts. References: [1]: https://github.com/stackrox/kube-linter
Keycodes Overview | QMK Firmware Documentation for QMK Firmware docs.qmk.fm [1] Full reference to all of the qmk keycode list. Handy reference to refer to all of the keycodes that qmk has. References: [1]: https://docs.qmk.fm/keycodes
Just starred TinyLlama [1] by jzhang38 [2]. It’s an exciting project with a lot to offer. The TinyLlama project is an open endeavor to pretrain a 1.1B Llama model on 3 trillion tokens. References: [1]: https://github.com/jzhang38/TinyLlama [2]: https://github.com/jzhang38
Just starred packaged [1] by tusharsadhwani [2]. It’s an exciting project with a lot to offer. The easiest way to ship python applications. References: [1]: https://github.com/tusharsadhwani/packaged [2]: https://github.com/tusharsadhwani