Let's look at some basic kubectl output options.
Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).
We can start with:
kubectl get no
Taken from: https://github.com/opencontainers/runc/blob/master/libcontainer/devices/devices.go | |
``` | |
$ go get -u github.com/opencontainers/runc | |
$ go get -u golang.org/x/sys/unix | |
``` |
#!/bin/sh | |
echo () { printf "%s\n" "$*" ; } | |
fail () { echo "$*" ; exit 1 ; } | |
fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } | |
cmdexists () { type "$1" >/dev/null 2>&1 ; } | |
trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } | |
printf "checking for C compiler... " | |
trycc ${CROSS_COMPILE}gcc |
Setting up linux headers for musl and golang
Example
$ ./setup_linux_headers
$ CGO_CFLAGS="-I/kernel-headers/include" CC='/usr/local/musl/bin/musl-gcc' go build -a --ldflags '-linkmode external -extldflags "-static"' main.go
{ | |
"args": [ | |
"/usr/bin/lxcfs", | |
"/var/lib/lxcfs/" | |
], | |
"ppid": 1 | |
} | |
{ | |
"args": [ | |
"/sbin/iscsid" |
#include <uapi/linux/ptrace.h> | |
#include <uapi/linux/if_packet.h> | |
#include <net/sock.h> | |
#include <bcc/proto.h> | |
#define IP_TCP 6 | |
#define ETH_HLEN 14 | |
struct Key { | |
u32 src_ip; // source ip |
MacBook Pro (13-inch, 2017)
Intel(R) Core(TM) i7-7567U CPU @ 3.50GHz
16 GB 2133 MHz LPDDR3
$ go test -bench=.
goos: darwin
goarch: amd64
package bitsbench | |
import ( | |
dbits "github.com/dgryski/go-bits" | |
"math/bits" | |
"testing" | |
) | |
// Modelled after https://github.com/golang/go/blob/master/src/math/bits/bits_test.go |