Skip to content

Instantly share code, notes, and snippets.

@r0mdau
r0mdau / find-k8snode-interface.sh
Last active May 3, 2024 13:21
How to get tcpdump for containers inside Kubernetes pods
# find the kube node of the running pod, appear next to hostIP, and note containerID hash
kubectl get pod mypod -o json
# -> save hostIP
# -> save containerID
# connect to the node and find the pods unique network interface index inside it's container
docker exec containerID /bin/bash -c 'cat /sys/class/net/eth0/iflink'
# -> returns index
# locate the interface of the node
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()
@aphexmunky
aphexmunky / MigrationCode.md
Last active January 21, 2020 11:28
Jersey Migration 1 -> 2

Jersey Migration Guide From 1 -> 2

Taken from this link

25.8.2.1. Making a simple client request

Jersey 1.x way:

Client client = Client.create();
WebResource webResource = client.resource(restURL).path("myresource/{param}");