Skip to content

Instantly share code, notes, and snippets.

@ubergesundheit
ubergesundheit / create-kubeconfig.sh
Created May 30, 2022 08:14
RBAC namespace permissions
# The script returns a kubeconfig for the service account given
# you need to have kubectl on PATH with the context set to the cluster you want to create the config for
# Cosmetics for the created config
clusterName=....
# your server address goes here get it via `kubectl cluster-info`
server=https://....
# the Namespace and ServiceAccount name that is used for the config
namespace=mynamespace
serviceAccount=mynamespace-user
@ubergesundheit
ubergesundheit / readme.md
Last active February 5, 2024 10:46
systemd traefik.service

systemd Service Unit for Traefik

Adapted from caddy systemd Service Unit

The provided file should work with systemd version 219 or later. It might work with earlier versions. The easiest way to check your systemd version is to run systemctl --version.

Instructions

We will assume the following:

@ubergesundheit
ubergesundheit / ca_setup_with_certstrap.md
Last active December 31, 2023 00:44
CA setup with certstrap

Certificate Authority setup

Certificates used for the mTLS authentication can be generated using certstrap or any other means for generating TLS certificates (openssl, step cli).

Example CA generation with certstrap

We're following the advice of Mozilla of generating one long term root CA certificate with intermediate CA certificates signing the actual client certificates.

If your server and client supports Ed25519 certificates, add --curve=Ed25519 to init and request-cert commands. (Requires compilation CGO_ENABLED=0 go install github.com/square/certstrap@2a55ac3)

@ubergesundheit
ubergesundheit / VIN.java
Created May 22, 2013 10:39
VIN validator/decoder
public class VIN {
//from http://introcs.cs.princeton.edu/java/31datatype/VIN.java.html
public static boolean isVinValid(String vin) {
int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 0, 7, 0, 9,
2, 3, 4, 5, 6, 7, 8, 9 };
int[] weights = { 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 };
@ubergesundheit
ubergesundheit / index.md
Created November 6, 2017 13:19
ngrok on raspberrypi on systemd
  • Download ngrok binary
  • Create /etc/systemd/system/ngrok.service
  • Create /opt/ngrok/ngrok.yml

73# First steps after installing Pop!_OS 19.10

Using ansible. Installs pyenv, nvm, keybase, keeweb, vs codium, riot-web, golang

Packages

Upgrade & install basics

sudo apt-get update && sudo apt-get upgrade -y
@ubergesundheit
ubergesundheit / ssh_config
Last active June 20, 2022 15:14
ED25519 sshkey
KEY_NAME=MY-SECRET_KEY; ssh-keygen -t ed25519 -a 100 -N "" -f ~/.ssh/"${KEY_NAME}" -C "${KEY_NAME}"
# Explanation
KEY_NAME=MY-SECRET_KEY The name of the key, also used as filename
-t ed25519 Use a ed25519 key
-a 100 Use 100 key derivation function rounds (higher = slower)
-N "" No password
-f ~/.ssh/"${KEY_NAME}" Store the key at this location on your computer
-C "${KEY_NAME}" Set the comment to the key name
@ubergesundheit
ubergesundheit / fix-logging.service
Created February 11, 2021 15:15
Crude fix for log2ram & journald
[Unit]
Description=start log2ram & restart systemd-journald
[Service]
ExecStart=/bin/systemctl start log2ram.service
ExecStartPost=/bin/systemctl restart systemd-journald
@ubergesundheit
ubergesundheit / 000-tunneld-server.md
Last active September 21, 2021 00:14
Ngrok alternative with mmatczuk/go-http-tunnel server
@ubergesundheit
ubergesundheit / README.md
Last active August 17, 2021 14:00
Glasfaser Münster

Glasfaser Münster

Name Downstream (Mbit/s) Upstream (Mbit/s) Preis (€)
Münster:Highspeed 50 50 20 42,69
Münster:Highspeed 100 100 40 49,69
Münster:Highspeed 250 250 50 59,69
Münster:Highspeed 500 500 100 67,69
Münster:Highspeed 1000 1000 200 84,69