Skip to content

Instantly share code, notes, and snippets.

@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
#!/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 / 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

@hegerdes
hegerdes / cloud-init-default.yml
Last active November 1, 2024 11:56
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 / 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 / README.md
Last active June 17, 2024 14:52
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 / hcloud-talos.pkr.hcl
Created May 21, 2024 10:02
Create any talos image on the hetzner cloud (hcloud). Packer handles version, architecture and extensions
# hcloud-talos.pkr.hcl
# NOTE: Based on https://www.talos.dev/v1.5/talos-guides/install/cloud-platforms/hetzner/
packer {
required_plugins {
hcloud = {
source = "github.com/hetznercloud/hcloud"
version = ">= 1.4.0"
}
}
@hegerdes
hegerdes / create-kubernetes-client-conf-users.sh
Last active June 12, 2024 13:21
Create Kubernetes client configs with X509 certificates via openssl and the certificate-api
#!/bin/bash
set -e
# Make it priiittttty
RED='\033[0;31m'
NC='\033[0m'
GRN='\033[0;32m'
# Easy config
KEY_SIZE=4096
System info:
Linux 168.119.165.86 6.1.0-21-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm
Will run crun runc runsc youki for 1000 times
-----------------------------------
Running: nerdctl run --network=none --rm --runtime crun busybox true
crun version 1.15