Archive

All published posts

2606 posts latest post 2026-10-25
Publishing rhythm
Sep 2026 | 28 posts

Jul 1 – Jul 7, 20242 years ago

Featured this weekWriting

Writing

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.

Writing

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

Writing

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

Writing

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 How I setup a sqlite cache in python

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,
        )

Writing

kind cluster

kind {.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…

Writing

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

Link

Looking for inspiration? miniserve by svenstaro. 🌟 For when you really just want to serve some files over HTTP right now!

Link

I recently discovered pydantic-sqlite by Phil997, and it’s truly impressive. Simple package for storing pydantic BaseModels in an in-memory SQLite database.

Link

Link

learn-pdm by pypeaday 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

Link

Link

Link

Note

Note

Note

Note

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 Interesting to see that curl is used in so many places. I ofte…

Note

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 interesting, seems like such a simple way to completely remove the need o…

Note

Note

Background Tasks - FastAPI FastAPI framework, high performance, easy to learn, fast to code, ready for production fastapi.tiangolo.com fastapi 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…

Note

Client Challenge pypi.org 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 c…

Note

Note

Note

Note

Jun 24 – Jun 30, 20242 years ago

Featured this weekWriting

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}}'`"

Note

Note

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…

Note

Found: OverlayKey X Designed by @yfuku_, a keyboard to place on top of your laptop. Thomas Baart's Microblog · micro.thomasbaart.nl 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 pr…

Note

Note

Note

- 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 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…

Note

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 pyannotate is a tool that uses runtime types to suggest type annotations to use. Test runners such as pytest can be used to…

Note

Note

Note

Note

Note

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 Super cool idea, kinda breaking the rules by talking about it here, b…

Note

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…

Note

Note

Jun 17 – Jun 23, 20242 years ago

Featured this weekLink

Just starred TinyLlama by jzhang38. 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.

Link

Note

Jun 10 – Jun 16, 20242 years ago

Featured this weekLink

Link

Check out sqlsync by orbitinghail. It’s a well-crafted project with great potential. SQLSync is a collaborative offline-first wrapper around SQLite. It is designed to synchronize web application state between users, devices, and the edge.

Note

Note

Homelabbers have been some of the best co-workers I have ever had. Typically have a get shit done, If there’s a way I will find it kind of mentality. If you are struggling to get a job in tech right now its tough. Starting a homelab on a pc you pull out of the trash is a good way to get some experience that you can tal…

Note

Note

Note

Note

Blogmarks that use markdown I needed to attach a correction to an older blogmark (my 20-year old name for short-form links with commentary on my blog) today - but the commentary field has always … Simon Willison’s Weblog · simonwillison.net Oh I kinda like the name blogmark, as opposed to thoughts like I have chose for…

Note

A Link Blog in the Year 2024 Kellan Elliott-McCrea has started a new link blog: Like many people I’ve been dealing with the collapses of the various systems I relied on for information over the previous decades. … Simon Willison’s Weblog · simonwillison.net THIS! is the same reasons that I built thoughts {.hoverlink}.…

Note