Skip to content

Instantly share code, notes, and snippets.

View tklauser's full-sized avatar

Tobias Klauser tklauser

View GitHub Profile
@tklauser
tklauser / netconv.go
Created June 24, 2022 21:12
net/netip <-> net conversion helpers
// Package netconv provides utilities to convert between types in packages net
// and netip.
package netconv
import (
"net"
"net/netip"
)
// PrefixToIPNet returns p as a *net.IPNet.
@tklauser
tklauser / ztypes_linux.diff
Created September 16, 2021 10:18
ztypes_linux*.go.diff
diff --git a/unix/ztypes_linux_arm.go b/unix/ztypes_linux_arm.go
index c4982a22982e..35385673ddb7 100644
--- a/unix/ztypes_linux_arm.go
+++ b/unix/ztypes_linux_arm.go
@@ -83,24 +83,24 @@ type Rusage struct {
}
type Stat_t struct {
- Dev uint64
- _ uint16
@tklauser
tklauser / eks-kube-proxy-free.md
Last active December 27, 2022 16:38
Cilium kube-proxy free with XDP NodePort acceleration on EKS
@tklauser
tklauser / micro-k8s-setup.md
Last active January 8, 2024 13:37 — forked from joestringer/micro-k8s-setup.md
MicroK8s development environment setup for Cilium

Set up microk8s with Cilium for development

Microk8s is a Canonical project to provide a kubernetes environment for local development, similar to minikube but without requiring a separate VM to manage. These instructions describe setting it up for common development use cases with Cilium and may be helpful in particular for testing BPF kernel extensions with Cilium.

Microk8s will run its own containerd runtime, which may be initially confusing when building containers locally with docker. This guide assumes that you will use docker locally for building containers, and push these into a microk8s registry for use by containerd in the microk8s environment.

This guide works with MicroK8s 1.14 or above, with containerd. If you are running an earlier version, see the previous instructions.

Requirements

rr, ww, err := os.Pipe()
if err != nil {
t.Fatal(err)
}
defer rr.Close()
defer ww.Close()
if _, err := ww.Write([]byte("HELLO GOPHER")); err != nil {
t.Fatal(err)
}
@tklauser
tklauser / gist:576094d1635c1d3d18793ab3fbef9abf
Last active November 30, 2018 12:19
go test -v bytes on linux/arm
# cat /proc/cpuinfo
Processor : ARMv7 Processor rev 9 (v7l)
processor : 0
BogoMIPS : 1196.85
processor : 1
BogoMIPS : 1196.85
processor : 2
BogoMIPS : 1196.85