Skip to content

Instantly share code, notes, and snippets.

View samuelkarp's full-sized avatar
:shipit:
I may be slow to respond.

Samuel Karp samuelkarp

:shipit:
I may be slow to respond.
View GitHub Profile
@samuelkarp
samuelkarp / bisect.sh
Created October 19, 2015 17:21
Docker 1.9.0-rc1 sha256 digest repro
#!/bin/bash
sudo service docker stop
sudo rm -rf /var/lib/docker
sudo rm -rf ./bundles/ .gopath
AUTO_GOPATH=1 ./hack/make.sh dynbinary || exit 125
sudo cp bundles/latest/dynbinary/docker /usr/bin/docker
sudo cp bundles/latest/dynbinary/dockerinit /usr/bin/dockerinit
@samuelkarp
samuelkarp / userdata.sh
Created November 30, 2015 18:56
Docker 1.9.1 on Ubuntu 14.04 with devicemapper
#!/bin/bash
TESTDIR=/opt/test
mkdir -p ${TESTDIR}
cat >${TESTDIR}/runner.sh << 'EORUNNER'
#!/bin/bash
curl https://get.docker.com | sh
@samuelkarp
samuelkarp / docker-disk-exhaustion.sh
Created February 26, 2016 00:26
Docker disk exhaustion
#!/bin/bash
get_space_available() {
grep 'Data Space Available' <<< "${1}" | \
sed -e 's/.*: //' | \
xargs -I'{}' units '{}' "MB" -t
}
sudo docker pull ubuntu
i=0
#!/bin/bash
sudo docker pull registry:2
cd /proc/$(pidof docker)/task
if [ "$?" -ne 0 ]; then
echo >&2 "/proc/$(pidof docker)/task doesn't exist or isn't a directory."
exit 1
fi
@samuelkarp
samuelkarp / repro.sh
Created April 25, 2016 21:50
docker/libnetwork default network affixed namespace
#!/bin/bash
# Retry a command until it succeeds or we've hit 10 attempts without it
# returning 0.
function retry_command
{
local tries=0
local rc=1
local max_tries=10
local cmd="${@}"
@samuelkarp
samuelkarp / race.txt
Created May 25, 2016 18:20
awslogs: Race detector output
$ go test -v -race -timeout=5s ./daemon/logger/awslogs/... -run TestCollectBatchMaxTotalBytes
=== RUN TestCollectBatchMaxTotalBytes
==================
WARNING: DATA RACE
Read by goroutine 14:
github.com/docker/docker/daemon/logger/awslogs.TestCollectBatchMaxTotalBytes.func3()
/home/local/ANT/skarp/go/src/github.com/docker/docker/daemon/logger/awslogs/cloudwatchlogs_test.go:613 +0x260
Previous write by goroutine 9:
github.com/docker/docker/daemon/logger/awslogs.(*logStream).collectBatch()
@samuelkarp
samuelkarp / keybase.md
Created September 20, 2016 04:35
keybase.md

Keybase proof

I hereby claim:

  • I am samuelkarp on github.
  • I am samuelkarp (https://keybase.io/samuelkarp) on keybase.
  • I have a public key whose fingerprint is 0A4B DF41 8E8D ECB8 7F3E 9E14 AAA3 FE8A 831F C087

To claim this, I am signing this object:

@samuelkarp
samuelkarp / simple.go
Created June 8, 2017 21:47
containerd experiment
package main
import (
"context"
"fmt"
"os"
"syscall"
"time"
"github.com/containerd/containerd"