Skip to content

Instantly share code, notes, and snippets.

@hegerdes
hegerdes / README.md
Last active February 20, 2024 18:10
Kubernetes API Server Test-Endpoint - minimal dev k8s controlplane

Minimal Kubernetes Controlplane

When you create a operator, interact with the k8s api via your service or want to tinker with the controlplane server args you might want a sandboxed endpont that dosen't cost a fortune and doesen't bring down production.
But starting the controlplane isn't as easy as starting a http web server. It has dependencies to etcd end requires communication via TLS certs. Setting this up can be a pain in the a**.

Thats why I created this docker compose file and some supporting scripts to create the required certs.

How

Download the files into a dircetory that looks like ths:

@hegerdes
hegerdes / suse-download.py
Created January 5, 2024 00:07
Headless auto download of suse os images
import time
import os
from bs4 import BeautifulSoup
from selenium import webdriver
from lxml import etree
suse_username = os.environ.get('SUSE_USERNAME')
suse_password = os.environ.get('SUSE_PASSWORD')
if (suse_username == None or suse_password == None):
@hegerdes
hegerdes / cloud-init-default.yml
Last active January 1, 2024 12:38
Hetzner Packer
#cloud-config
ssh_pwauth: false
disable_root_opts: no-port-forwarding,no-agent-forwarding,no-X11-forwarding
# Install base packages
package_update: true
package_upgrade: true
packages:
- gnupg
@hegerdes
hegerdes / node-typescript-esm.md
Created November 21, 2023 17:30 — forked from khalidx/node-typescript-esm.md
A Node + TypeScript + ts-node + ESM experience that works.

The experience of using Node.JS with TypeScript, ts-node, and ESM is horrible.

There are countless guides of how to integrate them, but none of them seem to work.

Here's what worked for me.

Just add the following files and run npm run dev. You'll be good to go!

package.json

#!/bin/bash
sleeptime=10
breakAfter=180
# Windows RAW
counter=0
while true; do
if [ $counter -eq $breakAfter ]; then break; fi
echo "At run ${counter}"
pwsh -Command Get-Process | sed -e '1,3d' | sed -e '$ d' >> stats_win_raw.csv
@hegerdes
hegerdes / init_setup.sh
Last active June 5, 2022 13:04
Debian-Bullseye-personal_setup
# Set sources
echo '# deb cdrom:[Debian GNU/Linux bullseye-DI-rc2 _Bullseye_ - Official Snapshot amd64 NETINST 20210607-15:56]/ bullseye main
# deb cdrom:[Debian GNU/Linux bullseye-DI-rc2 _Bullseye_ - Official Snapshot amd64 NETINST 20210607-15:56]/ focal main restricted
deb https://deb.debian.org/debian/ bullseye main contrib non-free
deb-src https://deb.debian.org/debian/ bullseye main contrib non-free
deb https://security.debian.org/debian-security bullseye-security main contrib non-free