Skip to content

Instantly share code, notes, and snippets.

View TBeijen's full-sized avatar
🎧

Tibo Beijen TBeijen

🎧
View GitHub Profile
@TBeijen
TBeijen / docker_desktop_kubernetes.md
Last active September 27, 2023 10:18
Docker Desktop Kubernetes (M1)

HOWTO

Find and delete persistent volume contents

Problem:

  • PV contents keep re-appearing, even when PV/PVC is removed even when persistentVolumeReclaimPolicy is set to Delete
  • Underlying docker-desktop VM apparently still has contents
@TBeijen
TBeijen / podman_tricks.md
Last active December 17, 2022 07:06
Podman tips & tricks

Various problems

VM time wrong after host sleep

Various ways this can manifest, examples:

  • AWS sts problems
  • Debian package list 'not valid yet': Release file for http://deb.debian.org/debian/dists/bullseye-updates/InRelease is not valid yet
@TBeijen
TBeijen / gh_prometheus_10257_routine_dump_01
Created August 1, 2022 06:39
Prometheus routine dump, GH issue 10257
goroutine 2858169 [running]:
runtime/pprof.writeGoroutineStacks({0x7fc23ed13bb0, 0xc0314b8820})
/usr/local/go/src/runtime/pprof/pprof.go:693 +0x70
runtime/pprof.writeGoroutine({0x7fc23ed13bb0, 0xc0314b8820}, 0xc00085e800)
/usr/local/go/src/runtime/pprof/pprof.go:682 +0x2b
runtime/pprof.(*Profile).WriteTo(0x2974720, {0x7fc23ed13bb0, 0xc0314b8820}, 0xc)
/usr/local/go/src/runtime/pprof/pprof.go:331 +0x14b
net/http/pprof.handler.ServeHTTP({0xc0279c60fd, 0x8281e7}, {0x7fc3884310e0, 0xc0314b8820}, 0x8)
/usr/local/go/src/net/http/pprof/pprof.go:253 +0x49a
net/http/pprof.Index({0x7fc3884310e0, 0xc0314b8820}, 0xc0374e9b00)
@TBeijen
TBeijen / jq_fu.sh
Created July 29, 2022 08:25
JQ Fu (cheat sheet)
# List EKS addons AWS considers default for given cluster cersion
aws eks describe-addon-versions |jq '.addons[] | del(.addonVersions[].compatibilities[] | select(.clusterVersion != "1.22" or .defaultVersion != true) ) | del(.addonVersions[] | select(.compatibilities | length == 0) )'
@TBeijen
TBeijen / 2serv.py
Created November 16, 2021 05:55
Nginx: Dump incoming request header (CDN debugging)
# Taken and adapted from https://gist.github.com/phrawzty/62540f146ee5e74ea1ab
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
@TBeijen
TBeijen / medium_k8s_failure_describe_node.sh
Created February 1, 2019 19:41
medium_k8s_failure_describe_node
$: kubectl describe node ip-10-150-36-156.eu-west-1.compute.internal
<truncated>
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Starting 36m kubelet, ip-10-150-36-156.eu-west-1.compute.internal Starting kubelet.
Normal NodeHasSufficientDisk 36m (x2 over 36m) kubelet, ip-10-150-36-156.eu-west-1.compute.internal Node ip-10-150-36-156.eu-west-1.compute.internal status is now: NodeHasSufficientDisk
Normal NodeHasSufficientMemory 36m (x2 over 36m) kubelet, ip-10-150-36-156.eu-west-1.compute.internal Node ip-10-150-36-156.eu-west-1.compute.internal status is now: NodeHasSufficientMemory
@TBeijen
TBeijen / medium_k8s_failure_get_nodes.sh
Last active February 1, 2019 19:38
medium_k8s_failure_get_nodes
$: kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-10-150-34-78.eu-west-1.compute.internal Ready master 43d v1.10.6
ip-10-150-35-189.eu-west-1.compute.internal Ready node 2h v1.10.6
ip-10-150-36-156.eu-west-1.compute.internal Ready node 2h v1.10.6
ip-10-150-37-179.eu-west-1.compute.internal NotReady node 2h v1.10.6
ip-10-150-37-37.eu-west-1.compute.internal Ready master 43d v1.10.6
ip-10-150-38-190.eu-west-1.compute.internal Ready node 4h v1.10.6
ip-10-150-39-21.eu-west-1.compute.internal NotReady node 2h v1.10.6
ip-10-150-39-64.eu-west-1.compute.internal Ready master 43d v1.10.6
@TBeijen
TBeijen / views.py
Created July 20, 2018 08:01
Django Redirect307View
import logging
from django import http
from django.views.generic import RedirectView
logger = logging.getLogger('django.request')
class Redirect307View(RedirectView):
"""
@TBeijen
TBeijen / shared_pipeline.groovy
Created May 30, 2018 05:49
Jenkinsfile & shared pipeline constructs
// /src/org/foo/utils.groovy
package org.foo
class Utils {
static def doStuff() {
return "done"
}
}
// /vars/example.groovy
@TBeijen
TBeijen / algorithms.md
Last active April 17, 2017 11:50
Algorithms