Spring Custom User Context

If you’re doing OAuth2/OIDC + JWT with Spring, you might be using the ThreadLocal SecurityContextHandler to get Data about the authorized user. This code extracts the “JWT Subject” which can be used as a unique identifier for users: SecurityContextHolder.getContext().getAuthentication().getName() Your User data model might look Something like this: @Entity public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(unique = true) private String sub; ... } If we now want to get The User Object of the authenticated User, we would have to do something like this:...

August 5, 2023

Why you should use Linux 🐧

Use Arch or Debian The two base distros in the Linux desktop realm Download: latest debian iso latest arch iso 1: Free and open source You want to be able to fully trust you operating system? You can view every line of code of the operating system you’re running. Why would you pay for proprietary closed source bloat if you can easily install the Linux distro of your choice? 2: Community driven There is no company behind Linux The Linux foundation is not trying to make money but instead deliver a good, lightweight kernel...

July 24, 2023

Hosting a mirror

Mirrors are used by most Linux Distros to distribute packages and installer images. This post documents the setup of an Arch Linux mirror. The most common way to keep you mirror in sync is rsync Checking disk usage rsync -avzhn rsync://mirror.lcarilla.de/archlinux/ Use this command to check this total size of an rsync module to check how much space you need on your server Web server setup You need to set up an HTTP(S) server to distribute the files....

July 24, 2023