Wait for Port to Close Using Ansible

Sometimes it is useful to wait for a port to be closed, for example when updating an app that can’t always properly be shut down using other Ansible modules.

This can easily be achieved using the ansible.builtin.wait_for or ansible.builtin.win_wait_for module.

[Read More]

PicoCSS

My preferred minimalistic CSS framework, which is usually enough for small websites and even simple SaaS apps. It feels like a super power to write almost plain HTML and get something that looks presentable, supports dark mode and has just enough components to cover most use cases for me.

Navigate to Script Directory

Often times when writing scripts I want to reference files in the same directory, but keep the script portable in case it is part of a git repository being checked out somewhere else or just the folder getting moved.

[Read More]

My First Show Hacker News

Experiences & Statistics

A while back I built tech-playground.com, which I describe like this: A playground that runs your config on real servers for you, a bit like CodePen for server tech. At the time of writing this includes nginx, HAProxy, Jinja, Django Template Engine and Go Template. Having released the project to the public back in June of 2023, through my social media channels and some private groups, it got moderate usage - about 2-3 requests per day that were not me using it in my daily work. [Read More]

CLI fuzzy search

I often whish to search through large bodies of text, like my knowledge base or source code repositories, from the command line.

I use fuz for this and I’m quite happy with it.

I also have it aliased to my knowledge base folder for even easier searching.

alias search="fuz -p /path/to/knowledge-base/"

Render Plain HTML with Hugo

Hugo is my favorite tool for publishing markdown to the internet, but sometimes I want to do something a little bit more advanced with my posts.

With this shortcode I can always just fall back to plain old HTML.

[Read More]
hugo 

Ansible and cowsay

Cowsay is one of those packages you just end up installing randomly on just about any client over time.

And if your using ansible you may be in for a little surprise:

[Read More]

Django: CSRF exempt view

Django’s CSRF protection is usually a great thing, but when building (API) endpoints meant to be accessed by scripts/third parties it gets in the way of that.

This is how to disable it:

For a class based view

from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt

@method_decorator(csrf_exempt, name='dispatch')
class MyView(View):
    pass

For a function based view

from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def my_view(request):
    pass

My Publishing Pipeline

I write an extensive personal knowledge base using markdown, code-server and a variety of other tools. Originally, in 2021, I wanted to have something like Obsidian Publish but self-hosted, so I created it.

Over time my knowledge base evolved more into a second brain, tracking not only my technical notes and journal, but also things like recipes and hikes. With this my publishing pipeline, and the script at it’s core, extended in a multitude of ways.

[Read More]