Skip to content

Instantly share code, notes, and snippets.

View euank's full-sized avatar

Euan Kemp euank

View GitHub Profile
$ git checkout v1.7.1
$ echo "/vendor" > .ignore
$ rg '^//.*\+.*build' --no-filename -N | sort | uniq -c | sort -nr
211 // +build !ignore_autogenerated
44 // +build linux
23 // +build !linux
12 // +build windows
5 // +build !windows
5 // +build !linux,!windows
5 // +build cgo,linux
@euank
euank / test-sha.sh
Created June 12, 2017 19:52
Reproduce inconsistent sha output for docker2aci
#!/bin/bash
set -euo pipefail
for i in $(seq 1 20); do
mkdir "fetch-$i"
pushd "fetch-$i"
../bin/docker2aci docker://euank/manylabels:busybox
sudo rkt fetch --insecure-options=image *.aci > sha
sudo rkt image cat-manifest $(cat sha) > rktmanifest
cat *.aci | gunzip | tar x
@euank
euank / cloud-init.yaml
Created June 9, 2017 20:26
what linode puts at /var/lib/coreos-install/user_data
#cloud-config
users:
- name: "core"
- passwd: "***"
# The formatting of the following section is important. Don't change it!
# sytemd-networkd and dhcpcd are both packaged in Container Linux. We'll use systemd
# because that's what's used in the most minimal, out-of-the-box config at this time,
# and dhcpcd is disabled. We're giving systemd a dhcp config file so we can tell it
# to not use IPv6 privacy extensions. We also need DHCP=ipv4 b/c DHCP=all causes
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git-receive-pack
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git-upload-archive
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-add
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-am
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-annotate
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-apply
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-archive
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-bisect--helper
[vm_0] *** Error in `/usr/bin/python2.7': double free or corruption (out): 0x00007f43ec00eb10 ***
[vm_0] ======= Backtrace: =========
[vm_0] /lib64/libc.so.6(+0x6f1b3)[0x7f43fb6a31b3]
[vm_0] /lib64/libc.so.6(+0x74816)[0x7f43fb6a8816]
[vm_0] /lib64/libc.so.6(+0x7501e)[0x7f43fb6a901e]
[vm_0] /usr/lib64/libpython2.7.so.1.0(PyThread_ReInitTLS+0x49)[0x7f43fbcfe829]
[vm_0] /usr/lib64/libpython2.7.so.1.0(PyOS_AfterFork+0x44)[0x7f43fbd04554]
[vm_0] /usr/lib64/libpython2.7.so.1.0(+0x118a46)[0x7f43fbd08a46]
[vm_0] /usr/lib64/libpython2.7.so.1.0(PyEval_EvalFrameEx+0x7023)[0x7f43fbcd21f3]
[vm_0] /usr/lib64/libpython2.7.so.1.0(PyEval_EvalCodeEx+0x820)[0x7f43fbcd48a0]
storage:
files:
- filesystem: root
mode: 420
path: /etc/ssh/sshd_config
contents:
inline: |-
# From: https://wiki.mozilla.org/Security/Guidelines/OpenSSH#Modern_.28OpenSSH_6.7.2B.29
# Supported HostKey algorithms by order of preference.
HostKey /etc/ssh/ssh_host_ed25519_key
@euank
euank / kubelet-master-stage-1.sh
Last active May 2, 2017 16:19
Hacky script to attempt to repro some stuff
#!/bin/bash
set -x
set -e
source /etc/environment
MY_IP=${COREOS_PRIVATE_IPV4}
openssl genrsa -out ca-key.pem 2048
openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj "/CN=kube-ca"
require 'aws-sdk'
require 'base64'
COREOS_AMI="ami-4b1c763c"
ec2 = Aws::EC2::Client.new(region: 'eu-west-1')
ecs = Aws::ECS::Client.new(region: 'eu-west-1')
NUM_INSTANCES=10
#!/bin/bash
while true; do
instance_id=$(aws ec2 run-instances --key-name euank --instance-type m1.small --region=us-east-1 --image-id ami-8b7b759c | jq '.Instances[].InstanceId' -r)
sleep 20
while true; do
console=$(aws ec2 --region=us-east-1 get-console-output --instance-id $instance_id | jq '.Output' -r)
if [[ "$console" == "null" ]]; then
sleep 30
@euank
euank / docker-stack.sh
Created February 2, 2017 19:57
Gets a docker stacktrace. I think it works.
printf "$(sudo journalctl -u docker -o cat | awk 'BEGIN { instack=0; stack=""; } /BEGIN goroutine stack dump/ { instack=1; stack=$0 } /.*/ { if(instack==1) { stack=stack $0; } } /END goroutine stack dump/ { instack=0; } END { print stack }')"