Skip to content

Instantly share code, notes, and snippets.

View teddyking's full-sized avatar

Ed King teddyking

View GitHub Profile
2019-06-03T07:25:07.643Z INFO crossplane Adding schemes
2019-06-03T07:25:07.645Z INFO crossplane Adding controllers
2019-06-03T07:25:07.646Z INFO kubebuilder.controller Starting EventSource {"controller": "replicationgroup.cache.aws.crossplane.io", "source": "kind source: /, Kind="}
2019-06-03T07:25:07.838Z INFO kubebuilder.controller Starting EventSource {"controller": "eks.compute.aws.crossplane.io", "source": "kind source: /, Kind="}
2019-06-03T07:25:07.842Z INFO kubebuilder.controller Starting EventSource {"controller": "instance-controller", "source": "kind source: /, Kind="}
2019-06-03T07:25:07.842Z INFO kubebuilder.controller Starting EventSource {"controller": "instance-controller", "source": "kind source: /, Kind="}
2019-06-03T07:25:07.940Z INFO kubebuilder.controller Starting EventSource {"controller": "aws.provider", "source": "kind source: /, Kind="}
2019-06-03T07:25:07.941Z INFO kubebuilder.controller Starting EventSource {"controller": "s3bucket.aws.crossplane.io", "source": "kind source: /, Kin
@teddyking
teddyking / rust_notes.md
Last active July 11, 2018 07:14
Rust notes

Rust

Stack and Heap

  • Stack = LIFO and is hella fast
  • All data on the stack must take up a known, fixed size
  • Basic data types (ints, bools, etc.) are all stored on the stack because they have a fixed size
  • More complex data types of unknown size get stored on the heap

Ownership

@teddyking
teddyking / gdn_disk.go
Created March 27, 2018 10:24
Garden container disk usage experiment
package main
import (
"fmt"
"log"
"code.cloudfoundry.org/garden"
"code.cloudfoundry.org/garden/client"
"code.cloudfoundry.org/garden/client/connection"
)
func main() {
var diskLimit uint64
@teddyking
teddyking / containerd_notes.md
Last active January 15, 2018 08:47
Notes on containerd

Start the containerd daemon

$ containerd -l debug
INFO[0000] starting containerd                           module=containerd revision=bb7b41ad7b3d3eb8b978abee2f5b7a1395b41f4f version=v1.0.0-alpha2-32-gbb7b41ad

Fetch an image

$ ctr content fetch docker.io/library/redis:latest
docker.io/library/redis:latest:                                                   resolved       |++++++++++++++++++++++++++++++++++++++|
@teddyking
teddyking / linux_debug_commands.txt
Last active August 24, 2017 10:40
A collection of commands that are useful when debugging linux systems
# list processes in D or Z state, along with kernel function where the processes are sleeping
ps axo pid,ppid,comm,state,eip,esp,wchan | grep 'D\|Z'
# dump all D state processes incl. kernel stack traces to /var/log/messages
echo w > /proc/sysrq-trigger
# check process start time
ps -eo pid,comm,lstart,etime,time,args
# view syslog without noise
@teddyking
teddyking / cgroup.sh
Created March 10, 2017 11:05
cgroup u/mounting
#!/bin/bash
set -eu
function ensureMounted() {
source=$1
shift
target=$1
shift
type=$1
@teddyking
teddyking / config.json
Created February 24, 2017 07:56
config.json generated via `runc spec --rootless`
{
"ociVersion": "1.0.0-rc3",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": false,
"consoleSize": {
"height": 0,
@teddyking
teddyking / iptables-regression-verification.md
Last active April 9, 2017 16:21
iptables regression patch verification

Objective

In this gist, we verified that the iptables regression patches improved performance for both direct iptables executions and for garden NetOut API calls.

In this gist, we attempt to verify that the performance improvements are still seen for the Release Candidate 4.4.0-63.84~14.04.1.

iptables rule addition

func startContainer(context *cli.Context, spec *specs.Spec, create bool) (int, error) {
id := context.Args().First()
if id == "" {
return -1, errEmptyID
}
container, err := createContainer(context, id, spec)
if err != nil {
return -1, err
}
// Support on-demand socket activation by passing file descriptors into the container init process.
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
return err
}
if err := revisePidFile(context); err != nil {
return err
}
spec, err := setupSpec(context)
if err != nil {
return err