Skip to content

Instantly share code, notes, and snippets.

View maxsei's full-sized avatar

Maximillian Schulte maxsei

View GitHub Profile
$ kubectl get svc --all-namespaces | rg 105
kubectl get svc --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
authelia authelia ClusterIP 10.43.211.45 <none> 80/TCP 3h25m
default docker-registry ClusterIP 10.43.48.244 <none> 5000/TCP 7d1h
default kubernetes ClusterIP 10.43.0.1 <none> 443/TCP 27d
demo postgres ClusterIP 10.43.120.212 <none> 5432/TCP 3h25m
demo trade ClusterIP 10.43.136.135 <none> 80/TCP 3h25m
demo2 drawback-backend ClusterIP 10.43.86.192 <none> 8000/TCP 3h18m
demo2 drawback-frontend ClusterIP 10.43.113.133 <none> 80/TCP
console.log`got otp from stdin: ${otp}`); // ❌ Wrong
console.log(`got otp from stdin: ${otp}`); // ✅ Correct
throw new Error`failed...`); // ❌ Wrong
throw new Error(`failed...`); // ✅ Correct
await Bun.write`${runDirPath}/api-response.json`, ...); // ❌ Wrong
await Bun.write(`${runDirPath}/api-response.json`, ...); // ✅ Correct
@maxsei
maxsei / kind.nix
Created December 11, 2025 00:55
kind is not kind on nixos
{
config,
lib,
pkgs,
modulesPath,
...
}:
{
environment.systemPackages = with pkgs; [
kind
@maxsei
maxsei / flake.nix
Created December 10, 2025 05:46
flake nix for deploying with terranix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
terranix.url = "github:terranix/terranix";
terranix.inputs.nixpkgs.follows = "nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
sops-nix = {
url = "github:Mic92/sops-nix";
@maxsei
maxsei / strings.c
Last active October 25, 2024 18:51
// Generated by `wit-bindgen` 0.33.0. DO NOT EDIT!
#include "strings.h"
#include <stdlib.h>
#include <string.h>
// Exported Functions from `x:strings/upper`
__attribute__((__weak__, __export_name__("cabi_post_x:strings/upper#upper")))
void __wasm_export_exports_x_strings_upper_upper_post_return(uint8_t * arg0) {
switch ((int32_t) (int32_t) *((uint8_t*) (arg0 + 0))) {
@maxsei
maxsei / strings.c
Last active October 25, 2024 18:43
// Generated by `wit-bindgen` 0.33.0. DO NOT EDIT!
#include "strings.h"
#include <stdlib.h>
#include <string.h>
// Exported Functions from `x:strings/upper`
__attribute__((__weak__, __export_name__("cabi_post_x:strings/upper#upper")))
void __wasm_export_exports_x_strings_upper_upper_post_return(uint8_t * arg0) {
switch ((int32_t) (int32_t) *((uint8_t*) (arg0 + 0))) {
@maxsei
maxsei / out.txt
Created October 12, 2024 05:10
MultiArrayList for unions does not save bytes in zig 0.13.0
$ !zig build test
test
+- run test stderr
total allocated bytes: 4608
total allocated bytes: 4672
total allocated bytes: 4672
tag type: @typeInfo(root.test_0.Foo).Union.tag_type.?
tag 0 addr: @typeInfo(root.test_0.Foo).Union.tag_type.?@7ffff7ef7200
tag 1 addr: @typeInfo(root.test_0.Foo).Union.tag_type.?@7ffff7ef7201
@maxsei
maxsei / welford.zig
Created September 19, 2024 16:58
welfords online variance algorithm
const std = @import("std");
pub fn main() void {
const input1 = [_]f32{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
var mean: f32 = 0;
var variance: f32 = 0;
for (input1, 0..) |v, count| {
const delta = v - mean;
mean += delta / @as(f32, @floatFromInt(count + 1));
const delta2 = v - mean;
@maxsei
maxsei / id_obfuscate.go
Last active August 22, 2024 23:11
Nice way of obfuscating database ids https://go.dev/play/p/4t9Ej8xOG5C
package main
import (
"bytes"
"encoding/base32"
"encoding/binary"
"fmt"
"io"
)
@maxsei
maxsei / debug_mutex.go
Created August 21, 2024 18:56
debug mutex lol
package main
import (
"fmt"
"runtime"
"sync"
)
func NewDebugMutex() sync.Locker {
return &debugMutex{}