Skip to content

Instantly share code, notes, and snippets.

@mbentley
mbentley / kern.log
Created December 16, 2014 01:56
docker + virtualbox CPU stall - kern.log backtrace
Dec 14 04:10:27 debiantest kernel: [ 337.592875] INFO: rcu_sched self-detected stall on CPU { 0} (t=5250 jiffies g=675 c=674 q=438)
Dec 14 04:10:27 debiantest kernel: [ 337.592917] sending NMI to all CPUs:
Dec 14 04:10:27 debiantest kernel: [ 337.592919] NMI backtrace for cpu 0
Dec 14 04:10:27 debiantest kernel: [ 337.592921] CPU: 0 PID: 3477 Comm: sshd Tainted: G C O 3.16.0-0.bpo.4-amd64 #1 Debian 3.16.7-ckt2-1~bpo70+1
Dec 14 04:10:27 debiantest kernel: [ 337.592922] Hardware name: Gigabyte Technology Co., Ltd. EX58-UD3R/EX58-UD3R, BIOS Fk1 05/10/2011
Dec 14 04:10:27 debiantest kernel: [ 337.592924] task: ffff88031f72e090 ti: ffff88031f764000 task.ti: ffff88031f764000
Dec 14 04:10:27 debiantest kernel: [ 337.592925] RIP: 0010:[<ffffffff812d47f9>] [<ffffffff812d47f9>] __const_udelay+0x9/0x30
Dec 14 04:10:27 debiantest kernel: [ 337.592929] RSP: 0018:ffff88032fc03da0 EFLAGS: 00000002
Dec 14 04:10:27 debiantest kernel: [ 337.592930] RAX: 0000000000001400 RBX: 00000000000003e9 RCX: 000000000
### Keybase proof
I hereby claim:
* I am mbentley on github.
* I am mbentley (https://keybase.io/mbentley) on keybase.
* I have a public key whose fingerprint is A31B F841 EFB1 6C07 DC6F 1C4B F38E 2446 6CFF C4FB
To claim this, I am signing this object:
#!/usr/bin/env python
"""
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
script provided by adamhadani (see https://github.com/docker/docker/issues/6354#issuecomment-60817733)
"""
import logging
import os
#!/bin/bash
set -e
set_variables() {
# define the full path to the docker binary
DOCKER_BINARY="/usr/bin/docker"
# define the full path to the 'zombie_dir_cleanup.py' script (see https://gist.github.com/mbentley/af9845a509b0166562b1)
VOLUME_CLEANUP_SCRIPT="/usr/local/bin/zombie_dir_cleanup.py"
@mbentley
mbentley / gist:e2d360a469591986e884
Last active August 29, 2015 14:14
docker machine + swarm
demo-master
===========
swarm create
docker-machine -D create -d amazonec2 --swarm --swarm-master --swarm-discovery token://<cluster_id> --swarm-host 'tcp://0.0.0.0:3376' demo-master
<initialize other docker hosts; demo-docker01 and demo-docker02>
$(docker-machine shellinit demo-master)
echo $DOCKER_HOST
export DOCKER_HOST=tcp://54.152.22.32:3376
@mbentley
mbentley / cache_docker_images
Created March 12, 2015 13:41
docker registry mirror
#!/bin/bash
# lists of images to cache
base_images="busybox:latest debian:wheezy debian:jessie ubuntu:14.04 golang:1.3-cross"
dhe="dockerhubenterprise/admin-server dockerhubenterprise/log-aggregator dockerhubenterprise/distribution dockerhubenterprise/nginx"
dhedev="dockerhubenterprise/log-aggregator-dev dockerhubenterprise/admin-server-dev dockerhubenterprise/nginx-dev dockerhubenterprise/garant dockerhubenterprise/distribution"
# pull lists together
images="${base_images} ${dhe} ${dhedev}"
@mbentley
mbentley / gist:008361909431d6fb39d7
Last active August 29, 2015 14:23
docker + libnetwork (overlay) quickstart
# install the kernel from utopic (on both nodes)
apt-get install -y linux-image-generic-lts-utopic
reboot
# install experimental docker release (on both nodes)
wget -qO- https://experimental.docker.com/ | sh
# install consul (on both nodes)
curl -OL https://dl.bintray.com/mitchellh/consul/0.5.2_linux_amd64.zip
apt-get install -y unzip
@mbentley
mbentley / setup.ps1
Last active April 4, 2016 19:07
Windows Server 2016 TP3 Docker Containers
### tp4
wget -uri https://aka.ms/tp4/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1
.\Install-ContainerHost.ps1
### tp5
wget -uri https://aka.ms/tp5/Install-ContainerHost -OutFile C:\Install-ContainerHost.ps1
Install-ContainerImage WindowsServerCore -ErrorAction Stop
.\Install-ContainerHost.ps1
@mbentley
mbentley / dtr_install_error.log
Created November 23, 2015 16:43
DTR 1.4.0 Install Error
[root@ip-10-94-116-145 ec2-user]# sudo bash -c "$(sudo docker run docker/trusted-registry install)"
Unable to find image 'docker/trusted-registry:latest' locally
latest: Pulling from docker/trusted-registry
c63fb41c2213: Pulling fs layer
99fcaefe76ef: Pulling fs layer
5a4526e952f0: Pulling fs layer
1d073211c498: Pulling fs layer
202ea39d40d6: Pulling fs layer
6082dfdb8050: Pulling fs layer
ccb2a8e69485: Pulling fs layer
@mbentley
mbentley / dns-r53.sh
Last active February 7, 2016 16:16
le dnsapi plugin for AWS Route 53
#!/bin/bash
# Dependencies:
# - awscli see https://docs.aws.amazon.com/cli/latest/userguide/installing.html for installation instructions
# - jq typically found as the package 'jq' on most distros
# AWS API keys
#AWS_ACCESS_KEY_ID=""
#AWS_SECRET_ACCESS_KEY=""