Notes

Not quite blog posts, but still worth sharing! Somewhere between TIL and an engineers notebook.

My home office setup: 2023 edition

Notes | 2023-04-22 (updated 2025-10-25) | 3 min read
#homeoffice #personal #slashpage-uses

Since I spend more than 8 hours here most days I created a nice setup for myself. Thankfully I have a whole room just for my home office, so I take full advantage of that.

Besides my main desk I have a secondary desk, a couch, a couple of sideboards, a wall mounted whiteboard and a couple of shelves to display all the techy and nerdy things.

Main desk

My main desk is a custom build based on a FlexiSpot height adjustable electric frame. The tabletop is a 180x80x2.5cm pressed wood panel in a dark gray concrete look.

Read more…

Enable system extensions on Apple silicon Mac

Notes | 2023-04-20 (updated 2025-10-25) | 1 min read
#apple-silicon #macos

Think before you enable this, it could be a security risk

DigitalOcean CLI Cheat Sheet

Notes | 2023-04-15 (updated 2025-10-25) | 1 min read
#bash #digitalocean #doctl #infrastructure #productivity

Read more…

My hiking kit: 2023 edition

Notes | 2023-04-01 (updated 2025-10-25) | 3 min read
#hiking #personal

These days I enjoy hiking quite a lot. To make it easier to just “pick up the pack and go” I created two basic packs that are optimized for my needs and the environment I’m usually hiking in, the Swabian Alps.

Basics

I have some basics I duplicated and carry in both my packs, these are:

Prepared packs

Small pack

I’m currently using a Terra Peak Flex 20l in red for my smaller backpack. It’s a nice size for shorter hikes and fits me well.

Read more…

1Password CLI Cheatsheet

Notes | 2023-02-01 (updated 2025-10-25) | 1 min read
#1password #cheatsheet

The 1Password CLI op works either in connection with a client app, like on the Mac, or standalone, useful on a server.

# Login
eval $(op signin)

# Get favorites
op item list --vault "Private" --favorite

# Get a specific item
op item get <ID>

# !! Important: Sign out at the end
op signout

Some helper functions

Helpers to more easily work with the op cli.

1login() {
    eval $(op signin)
}

alias 1signout="op signout"

1search() {
    term=$1
    if [ -n "$2" ]
    then
      vault="$2"
    else
      vault="Private"
    fi
    echo "Searching for '$term' in vaut '$vault'"
    op item list --vault "$vault" --long | grep "$term" --ignore-case
}

1get() {
    op item get $*
}

Being a good code reviewee

Notes | 2023-01-13 (updated 2025-10-25) | 1 min read
#code-review #merge-requests

Things I do to be a good code reviewee.

Read more…

yamllint error: "invalid config: ignore should contain file patterns"

Notes | 2023-01-12 (updated 2025-10-25) | 1 min read
#linting #yaml #yamllint

Setting up a new repository for YAML linting today I was running in a bit of an issue with yamllint.

I was using a YAML list to specify ingores, as mentioned in the documentation:

ignore:
  - "*.dont-lint-me.yaml"
  - "/bin/"
  - "!/bin/*.lint-me-anyway.yaml"

This however did not work with the above mentioned error message. After a lot of debugging I found that they released a new version recently which introduced this feature.

My solution was to update my locally build container image to the latest version, as of writing 1.29.0, in which this feature is introduced.

Read more…

Hy-Fit App by Tenswall no longer working

Notes | 2023-01-11 (updated 2025-10-25) | 2 min read
#hy-fit #rant #tenswall

This is somewhere between a rant about the app and backing services no longer working, a collection of information I could find out about it and a possible search-result for others facing the same issues and not really finding anything online just like me.

Update: March 2023

The company seems to no longer exist.

I have switched to the eufy smart scales, which are made by Anker, a reputable manufacturer.

Read more…

ArgoCD Python Client

Notes | 2023-01-01 (updated 2025-10-25) | 3 min read
#argocd #python

A simple Python client to interact with ArgoCD.

Read more…

WSL2 & Keychain

Notes | 2022-12-08 (updated 2025-10-25) | 1 min read
#linux #ssh #wsl

The problem

If you use ssh-agent with an encrypted ssh key it does not persist when you open a new terminal window.

The solution

Use keychain instead.

  1. Install
    sudo apt install keychain
    
  2. Add to your shells rc file, eg. .bashrc or .zshrc
    # Repeat this line for all keys you want to unlock and use this way
    /usr/bin/keychain -q --nogui $HOME/.ssh/id_rsa
    source $HOME/.keychain/wsl-sh
    
  3. Unlock your keys on shell startup and enjoy

My Tools

Notes | 2022-11-25 (updated 2025-10-25) | 1 min read
#productivity #tools

Tools I use and recommend.

Audible book export

Notes | 2022-10-24 (updated 2025-10-25) | 2 min read
#archiving #audible #ebook

Read more…

Git: Add only changed files

Notes | 2022-09-29 (updated 2025-10-25) | 1 min read
#git

Sometimes you may want to commit only the files you have changed and not any newly created files, this can easily be achieved by this command: git commit -a

Read more…

A list of interesting things

Notes | 2022-09-29 (updated 2025-10-25) | 2 min read
#personal

This is a list of interesting blog posts, talks and such things that I found over the years.

Some of them may teach you something relevant, some may just further your general understanding of tech. From personal experience they can lead you down the rabbit hole really fast, enjoy with care!

Talks

Blog posts

Guides & Books

Other things

Publish new post checklist

Notes | 2022-08-21 (updated 2025-10-25) | 2 min read
#personal

This is my checklist for publishing a new post on my blog:

Preparation

Proofing

Read more…

GitLab: User owned projects report

Notes | 2022-08-17 (updated 2025-10-25) | 1 min read
#gitlab #python

Export a CSV formatted report of projects in user-namespace on a GitLab instance.

This is especially useful if you think about limiting or disabling this feature.

Read more…

Simple git changelog

Notes | 2022-07-08 (updated 2025-10-25) | 1 min read
#git #productivity

A simple changelog system on top of git commit messages.

The main idea is to generate “release notes” from a diff in commits before a release. It can easily be run manually or as part of a merge/pull CI pipeline.

In this case it looks for commit messages starting with one of these [ADD], [REMOVE], [INFO] and just outputs those, but those patters can be adjusted to fit any existing commit schema.

Read more…

yamllint: Ignore exisiting errors

Notes | 2022-01-14 (updated 2025-10-25) | 1 min read
#automation #cicd #yaml #yamllint

When adding yamllint to an existing project it can be hard to fix all the errors at once.

I wrote a simple script to create a rules block that simply ignores all rules that currently trigger for a file. This works by generating a rules block ignoring paths.

Read more…

Local User Management Polyfill

Notes | 2022-01-13 (updated 2025-10-25) | 1 min read
#powershell

Older Versions of Windows 10 and all Windows Server 2012 systems have no local user management commandlets.

This is a working polyfill to allow scripts using local user management to run on old systems.

Source code

PSGallery package

Local S3 with MinIO in Django

Notes | 2021-11-06 (updated 2025-10-25) | 2 min read
#django #minio #python #s3

In production I would consider it best practice to use a S3 solution for serving assets. Namely static files and user-generated media.

This describes my setup on how to do this locally too.

The main benefit for me is that there is less of a difference between environments and I can test S3 specific features in my app.

Setup

I will assume a already working Django project and MacOS with [[brew]] installed, but brew specific parts are easilly replicated on different systems using their native package managers.

Read more…

Windows Terminal: Open New WSL Tab In Linux Home Folder

Notes | 2021-08-30 (updated 2025-10-25) | 1 min read
#windows #windows-terminal #wsl

The path you are in when opening a new WSL tab is determined by startingDirectory. This parameter needs to be a valid Windows path, which isn’t great if we want to end up in /home/kamner inside WSL.

The nice thing about WSL is that it will resolve windows paths into their equivalent WSL/linux path if possible.

For example, C:\Scripts would resolve to /mnt/c/Scripts.

Using this and the neat trick that the WSL filesystem is exposed as a a hidden fileshare ([[technology/windows/wsl-hidden-fileshare]]) we can get to where we want.

Read more…

Hidden WSL Fileshare

Notes | 2021-08-30 (updated 2025-10-25) | 1 min read
#windows #wsl

WSL file systems get exposed as a hidden share network share: \\wsl$\<WSL Name>\<path\to\file>

For example, my Debian home folder is at: \\wsl$\Debian\home\kamner

Resolve .local Through Nameserver With Netplan

Notes | 2021-08-13 (updated 2025-10-25) | 1 min read
#dns #linux #netplan #sysadmin

When using netplan it is easy to force .local DNS requests to go to you nameservers instead of being only resolved locally (the default and standard).

This also works with all other strange .WHATEVER domains you may have lying around in your organization.

Snippet from netplan configuration:

 nameservers:
        addresses:
          - X
          - Y
        search:
          - local
          - myotherstupiddomain

MongoDB Logrotate

Notes | 2021-08-12 (updated 2025-10-25) | 2 min read
#ansible #linux #logs #mongodb

MongoDB does not rotate it’s log on it’s own.

To get it to ratet we will use logrotate.

First, we need to configure some things in mongod.conf to get the desired behaviour when we utilize logrotate.

systemLog:
 destination: file
 path: /var/log/mongodb/mongod.log
 logAppend: true
 logRotate: reopen

Afterwards, we can create a logroatet configuration going in /etc/logrotate.d/mongodb.

/var/log/mongodb/mongod.log
{
 rotate 5 # Keep the last 5 rotated logs, so 6 files including the currently active
 size 10M # Rotate once the log reaches 10MB in size, depending on your envrionment you could instead use daily, weekly, monthly, etc
 missingok # It's ok if the log file does not exist
 create 0600 mongodb mongodb # Permissions and ownership for the roatetd logs
 delaycompress # Don't compress on first rotation, so we have the current log and log.1 uncompressed
 compress  # Compress everything else
 sharedscripts # Run this script only once and not for every matching file
 postrotate # Script to run after rotating
 /bin/kill -SIGUSR1 $(systemctl show --property MainPID --value mongod.service)
 endscript # End of script
}

The postrotate script simply finds the PID of mongod.service: systemctl show --property MainPID --value mongod.service and sends it a SIGUSR1 which is the signal MongoDB expects if you wish to rotate the log.

Read more…

Show all active user cron jobs on a system

Notes | 2021-08-11 (updated 2025-10-25) | 1 min read
#cron #linux #sysadmin

Debian/Ubuntu

grep -vH "#" /var/spool/cron/crontabs/*

RedHat/Centos/Rocky

grep -vH "#" /var/spool/cron/*

DNS Resolution Everywhere

Notes | 2021-08-10 (updated 2025-10-25) | 1 min read
#container #dns #linux #sysadmin

Usually at least one of those is present on any system

But sometimes the usual suspects don’t work, especially in container-land. After trying them you may try some more involved/unknown things:

getent

Part of glibc, this will probably work on nearly every system.

getent hosts example.org

Or, if you specifically want to query A or AAAA records.

getent ahostsv4 example.org
getent ahostsv6 example.org

Using Python2 Or Python3

Given this depends on glibc it is more of a alternative then another real solution.

Read more…

Customize Freshervice User Portal

Notes | 2021-08-10 (updated 2025-10-25) | 2 min read
#freshservice

It is possible to customize almost all of the user portal but you better know what you are doing. Otherwise you may end up like me, spending way more time than you ever should on customizing this damn portal.

Let’s hope this one helps you, otherwise feel free to reach out to me on Twitter.

Place a variation of the below at Admin > General Settings > Helpdesk Rebranding > Requester Portal Branding > Customize Portal > Layout And Pages > Portal Pages > General Pages > Portal Home

Read more…

Publish Parts Of Obsidian To My Personal Site

Notes | 2021-08-09 (updated 2025-10-25) | 4 min read
#gitlab #hugo #obsidian #pkm #productivity #writeup

The idea at the start was simple. Do something like Obsidian Publish , so read frontmatter and if it contains published: True put it up on a website to view.

I have since rewritten and updated this tool: New version

The Basics

I started with taking a look at different static site generators but after a bit of testing I ended up back at Hugo, which I already use for ps1.guru and a few other projects.

Read more…

Replace Line In YAML While Keeping Indentation Using Ansible

Notes | 2021-08-08 (updated 2025-10-25) | 1 min read
#ansible #yaml

In theory Ansible should be declarative and have full control over the systems we touch with it.

In practice, this is unfortunately not always the case.

This combination of tasks loads a given yaml file from the remote host, combines a “overwrite dict” onto it, and writes the file back to disk.

- name: Load yaml file contents as fact
  ansible.builtin.slurp:
    src: /etc/some-file.yaml
  register: yaml_file

- name: Parse yaml file contents
  ansible.builtin.set_fact:
    yaml_file_content: "{{ yaml_file.content | b64decode | from_yaml }}"

- name: Create the keys/values that should be overwritten
  ansible.builtin.set_fact:
    yaml_file_content_overwrite:
      some:
        key: "Overwrite value"
      another: "Also overwritten"

- name: Write yaml file with changed values
  ansible.builtin.copy:
    content: "{{ yaml_file_content | combine(yaml_file_content_overwrite, recursive=true) | to_yaml }}"
    dest: /etc/some-file.yaml
I like keeping my learning public. The below is my very old and naive solution I did based on regex.

With this nifty task we can replace the value of a key (given as yaml_key) to a new value (given as new_value) while preserving it’s indentation.

Read more…

How SELinux screws with scripts when run over VMware Tools

Notes | 2021-08-08 (updated 2025-10-25) | 1 min read
#ansible #automation #linux #security #selinux #sysadmin #vmware

SELinux by default prohibits certain things from working through VMware tools (Ansible connection or plain API).

This can be solved two ways:

Note: Adding/Changing this policy through a VMware tools connection is thankfully possible

Example policy

This policy is the base for a VMware tools policy and allows entering the rpm context (yum).

module custom-vmtools 1.0;

require {
        type rpm_script_t;
        type vmtools_unconfined_t;
        class process transition;
}

#============= vmtools_unconfined_t ==============

allow vmtools_unconfined_t rpm_script_t:process transition

curl: Modify DNS Resolution

Notes | 2021-08-08 (updated 2025-10-25) | 1 min read
#curl #productivity #sysadmin

You can intercept normal name resolution in curl with the --resolve parameter allowing you to do things like talk to a specific site of a DNS load-balanced setup or talk to a new deployment not yet made productive.

You can specify the resolve option multiple times so you can even catch redirects and move them to where you want as well.

It’s important to note that this intercept does only work on the ports you specify in the entries.

Read more…

Looping Dates macOS

Notes | 2021-08-07 (updated 2025-10-25) | 1 min read
#bash #macos

date on MacOS does not support --date, so a workaround is needed. Converting Date to unix epoch, adding one day in epoch and converting back.

The Scripty Way

Taken from a blog post

#!/bin/zsh

start=$year-01-01
end=$year-12-31
currentDateTs=$(date -j -f "%Y-%m-%d" $start "+%s")
endDateTs=$(date -j -f "%Y-%m-%d" $end "+%s")
offset=86400

while [ "$currentDateTs" -le "$endDateTs" ]
do
  date=$(date -j -f "%s" $currentDateTs "+%Y-%m-%d")
  echo $date
  currentDateTs=$(($currentDateTs+$offset))
done

The Brew Way

As I found out long after writing the above you can simply brew install coreutils and get a date command with the --date option. The only thing to note there is this: Commands also provided by macOS have been installed with the prefix "g".

Read more…

Download Full Website Copy

Notes | 2021-04-01 (updated 2025-10-25) | 1 min read
#wget

Sometimes it’s nice to download a best effort version of a website, for example before completely redesigning it.

domain=WEB.SITE
wget $domain --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains $domain

Renovate Bot

Notes | 2021-02-12 (updated 2025-10-25) | 1 min read
#renovate-bot #slashpage-uses

My tool of choice for doing dependency maintenance/update type of stuff for both [[infrastructure-as-code]] and [[software-projects]]

Vmware Tools Copy Files

Notes | 2020-09-17 (updated 2025-10-25) | 1 min read
#powershell #vmware

Docs

Copy To Guest

$vm = Get-VM -Name TEST
Get-Item "X:\yourfile.txt" | Copy-VMGuestFile -Destination "c:\temp" -VM $vm -LocalToGuest -GuestUser "Administrator" -GuestPassword "Pa$$w0rd"

Copy From Guest

$vm = Get-VM -Name TEST
Copy-VMGuestFile -Source c:\yourfile.txt -Destination c:\temp\ -VM $vm -GuestToLocal -GuestUser "Administrator" -GuestPassword "Pa$$w0rd"

Ansible VMware Connection Plugin & Become

Notes | 2020-07-02 (updated 2025-10-25) | 1 min read
#ansible #vmware

When using VMware as the connection plugin to connect to remote hosts you commonly set two facts for username and password:

ansible_vmware_tools_user: "mkamner"
ansible_vmare_tools_password: "Super Secret PW"

This will work just fine for windows and with many tasks on linux.

However, if you want to use become: true on linux it will fail with the strangest error messages.

For example: apt will fail, because it can’t acquire the lock file

The solution is rather simple, become does not honor the VMware facts set, instead it wants two different facts set:

Read more…

IANA To openSSL Ciphers

Notes | 2020-03-07 (updated 2025-10-25) | 1 min read
#openssl

Handy table to map IANA IDs of ciphers to their openSSL IDs used in web server configurations, for example [[nginx]] ssl_ciphers or proxy_ssl_ciphers

https://testssl.sh/openssl-iana.mapping.html

Python

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#python #slashpage-uses

These days Python is my language of choice for both simple scripts and more complex backend applications, usually in combination with [[django]]

PowerShell

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#powershell #slashpage-uses

PowerShell holds a special place in my heart as it was the first ever tool I dived into deeply and used to automate my daily work.

To this day it runs a bunch of fundamental automations in my life.

MacOS

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#macos #slashpage-uses

My operating system of choice on the client, usually on a MacBook Pro.

Kustomize

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#kustomize #slashpage-uses

My prefered tool for writing and provisioning home-built manifests to [[kubernetes]]

Kubernetes

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#k8s #slashpage-uses

I have run and am still running loads of Kubernetes clusters, mostly on-premise.

JQ

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#jq #slashpage-uses

A incredibly powerful tool for manipulating the heaps of JSON files and responses I interact with daily.

A lot of times I also use ijq1 instead, which is a interactive version of jq.

Hugo

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#hugo #slashpage-uses #ssg

My static site generator of choice, used to build my blog among other things.

Helm

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#helm #slashpage-uses

A good way to pull in external dependencies into Kubernetes For writing my own manifests I prefer to use Kustomize.

GitLab

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#gitlab #slashpage-uses

My preferred git server and CI/CD system, either gitlab.com or self-hosted.

Django

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#django #slashpage-uses

My preferred framework for building web apps

ArgoCD

Notes | 2020-01-01 (updated 2025-10-25) | 0 min read
#argocd #slashpage-uses

Ansible

Notes | 2020-01-01 (updated 2025-10-25) | 1 min read
#ansible #slashpage-uses

Need to automate a VM? you need Ansible!

vCenter Cert Bundle

Notes | 2019-05-13 (updated 2025-10-25) | 1 min read
#powershell #vmware

Errors connecting to vCenter or any ESXi server in the cluster without certificate errors?

VMware KB