Skip to content

Instantly share code, notes, and snippets.

@alban
alban / syscalls-list-sorted.txt
Created November 7, 2022 17:37
Linux syscall names sorted by the length of the name
3 bpf
3 brk
3 dup
3 ipc
3 mpx
3 tee
4 acct
4 bind
4 dup2
4 dup3
[alban@neptune minikube]$ make out/minikube.iso
docker run --rm --workdir /mnt --volume /home/alban/go/src/github.com/kubernetes/minikube:/mnt \
--user 1000:1000 --env HOME=/tmp --env IN_DOCKER=1 \
gcr.io/k8s-minikube/buildroot-image /usr/bin/make out/minikube.iso
/usr/bin/make minikube_iso
make[1]: Entering directory '/mnt'
echo v1.12.0 > deploy/iso/minikube-iso/board/coreos/minikube/rootfs-overlay/etc/VERSION
if [ ! -d ./out/buildroot ]; then \
mkdir -p ./out; \
git clone --depth=1 --branch=2019.02.11 https://github.com/buildroot/buildroot ./out/buildroot; \
@alban
alban / flatcar-hetzner.tf
Last active October 31, 2021 12:25
Terraform snippets for Flatcar on Hetzner Cloud
variable "worker_names" {
type = "list"
}
# worker_names = [
# "w1",
# "w2",
# "w3",
# ]
@alban
alban / edge-hostname.log
Created February 18, 2020 16:50
edge-hostname.log
Apply complete! Resources: 118 added, 0 changed, 0 destroyed.
Your configurations are stored in /home/alban/lokoctl-assets/albandemoedge
Now checking health and readiness of the cluster nodes ...
FATA[0558] Verify cluster installation: not all nodes became ready within the allowed time args="[]" command="lokoctl cluster install"
[alban@neptune albandemoedge]$ echo $?
1
[alban@neptune albandemoedge]$ kubectl get node --kubeconfig=/home/alban/lokoctl-assets/albandemoedge/cluster-assets/auth/kubeconfig
NAME STATUS ROLES AGE VERSION
@alban
alban / calico.log
Created February 18, 2020 15:58
calico.log
$ docker ps -a|grep calico/cni
82a7c635d14a calico/cni "/install-cni.sh" 39 minutes ago Exited (0) 39 minutes ago k8s_install-cni_calico-node-tsnzj_kube-system_1f519186-b756-4eb8-868f-bce98d27dbfc_0
$ docker logs 82a7c635d14a
ls: cannot access '/calico-secrets': No such file or directory
Wrote Calico CNI binaries to /host/opt/cni/bin
CNI plugin version: v3.12.0
/host/secondary-bin-dir is non-writeable, skipping
Using CNI config template from CNI_NETWORK_CONFIG environment variable.
CNI config: {
@alban
alban / Vagrant
Created April 18, 2019 13:54
Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby sw=2 ts=2 :
ENV["TERM"] = "xterm-256color"
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |config|
config.vm.box = "fedora/29-cloud-base" # defaults to fedora
config.vm.synced_folder ".", "/vagrant", type: "sshfs"
config.vm.synced_folder "/home/alban/go", "/go", type: "sshfs"
@alban
alban / kubectl-trace-demo-fosdem.md
Last active January 31, 2019 10:21
kubectl-trace demo FOSDEM

To enable cgroup-v2 in a Kubernetes cluster.

To enable the hybrid mode on Flatcar Linux:

  • sudo vi /usr/share/oem/grub.cfg
  • set linux_append="...... systemd.unified_cgroup_hierarchy=false systemd.legacy_systemd_cgroup_controller=false"
  • sudo reboot

To enable this in Docker:

@alban
alban / asciinema2gif.sh
Created December 7, 2018 17:51
asciinema2gif.sh
asciinema2gif ()
{
SRC=$1;
DST=$2;
SRC_DIR=$(realpath $(dirname $SRC));
SRC_FILE=$(basename $SRC);
DST_DIR=$(realpath $(dirname $DST));
DST_FILE=$(basename $DST);
sudo docker run --rm -v ${SRC_DIR}:/data -v ${DST_DIR}:/out asciinema/asciicast2gif /data/${SRC_FILE} /out/$DST_FILE;
sudo chown $UID:$UID ${DST}
@alban
alban / asciinema-normalize.sh
Created December 7, 2018 17:50
asciinema-normalize.sh
#!/bin/bash
COUNTER=0.00
OLDCMDLINE=0
NEWCMDLINE=0
while read -r LINE ; do
if [[ ! $LINE =~ ^\[ ]]; then
#echo "$LINE"
echo '{"version": 2, "width": 80, "height": 25, "timestamp": 1600000000, "env": {"SHELL": "/bin/bash", "TERM": "xterm-256color"}}'
continue
diff --git a/docs/reference_guide.md b/docs/reference_guide.md
index 512064f..f0e2229 100644
--- a/docs/reference_guide.md
+++ b/docs/reference_guide.md
@@ -1121,6 +1121,7 @@ Note that for this example to work, bash had to be recompiled with frame pointer
- `usym(void *p)` - Resolve user space address
- `kaddr(char *name)` - Resolve kernel symbol name
- `uaddr(char *name)` - Resolve user-level symbol name
+- `cgroupid(char *path)` - Resolve cgroup id
- `reg(char *name)` - Returns the value stored in the named register