Skip to content

Instantly share code, notes, and snippets.

View teddyking's full-sized avatar

Ed King teddyking

View GitHub Profile
@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 / 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 / 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 / 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 / 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

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