Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View tianon's full-sized avatar
♥️
TIANON

Tianon Gravi tianon

♥️
TIANON
  • @docker, but thoughts, comments, commits generally his own ("do not represent the views of Docker, Inc" etc etc)
  • Las Vegas, NV
  • 05:08 (UTC -07:00)
  • X @tianon
View GitHub Profile
@tianon
tianon / apt-mark-minimum-manual.sh
Last active May 13, 2016 19:13
discover the minimum set of packages that need to be "apt-mark manual" to keep what's currently installed
#!/bin/bash
set -e
# https://gist.github.com/tianon/b7fce03f0d52f8103242421878fc6b5e
#
# usage:
#
# $ apt-mark-minimum-manual.sh
# inetutils-ping
#!/bin/bash
set -e
# https://gist.github.com/tianon/92ebbd1793864b9586bc
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
hackVendor="$(< hack/vendor.sh)"
if [ "$1" ]; then
hackVendor="$(git show "$1":hack/vendor.sh)"
@tianon
tianon / driver.go
Last active April 21, 2016 22:37
docker-machine-driver-template
package main
import (
"fmt"
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/engine"
"github.com/docker/machine/libmachine/mcnflag"
"github.com/docker/machine/libmachine/state"
)
@tianon
tianon / vim-gpg
Created March 4, 2016 20:32
edit GPG-encrypted files reasonably
#!/bin/bash
set -e
usage() {
local s="$(basename "$0")"
echo "usage: $s [identity] [file]"
echo " ie: $s jsmith@example.com ~/some-secret-file.asc"
}
identity="$1"; shift || { usage >&2; exit 1; }
@tianon
tianon / docker-pull-official.sh
Last active January 5, 2016 08:30
"docker pull" all official images
#!/bin/bash
set -e
dir="$(mktemp -d)"
trap "rm -rf '$dir'" EXIT
git clone --depth 1 https://github.com/docker-library/official-images.git "$dir"
"$dir/bashbrew/bashbrew.sh" list --all | xargs -rtn1 docker pull
$ docker images ubuntu
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu saucy 43461fe97ba1 20 hours ago 144.6 MB
ubuntu raring 5e94ff221e91 20 hours ago 133.6 MB
ubuntu quantal 3e47bae8d07a 20 hours ago 127.6 MB
ubuntu lucid 04180f9bd8a6 20 hours ago 139.6 MB
ubuntu precise 1e548c932d40 20 hours ago 125.9 MB
ubuntu 12.04 8dbd9e392a96 9 months ago 128 MB
ubuntu latest 8dbd9e392a96 9 months ago 128 MB
ubuntu 12.10 b750fe79269d 10 months ago 175.3 MB
@tianon
tianon / output.txt
Created January 20, 2014 23:45
restarting Docker Ghost container http panic trace
2014/01/20 16:41:59 POST /v1.9/containers/mongodb-mms/restart?t=10
[/var/lib/docker|689cb5a3] +job restart(mongodb-mms)
[/var/lib/docker|689cb5a3] -job restart(mongodb-mms)
2014/01/20 16:41:59 http: panic serving @: runtime error: invalid memory address or nil pointer dereference
goroutine 63 [running]:
net/http.func·009()
/usr/lib/go/src/pkg/net/http/server.go:1093 +0xae
runtime.panic(0x875740, 0x10a25a8)
/usr/lib/go/src/pkg/runtime/panic.c:248 +0x106
github.com/dotcloud/docker/execdriver/lxc.(*driver).kill(0xc2100d83c0, 0x0, 0xf, 0xa040a0, 0x7f715fbba8e0)
use Mojo::JSON;
my $json = Mojo::JSON->new;
my $str = '{"some":"json","more":"stuff"}';
my $obj = $json->decode($str);
$obj->{some} = 'changed';
$obj->{new} = 'brand new!';
delete $obj->{more}; # remove that nonsense
@tianon
tianon / mountinfo
Created December 20, 2013 18:25
/proc/self/mountinfo
15 1 8:6 / / rw,noatime,nodiratime - ext4 /dev/sda6 rw,data=ordered
16 15 0:3 / /proc rw,nosuid,nodev,noexec,relatime - proc proc rw
17 15 0:14 / /run rw,nosuid,nodev,relatime - tmpfs tmpfs rw,size=3292172k,mode=755
18 15 0:5 / /dev rw,nosuid,relatime - devtmpfs udev rw,size=10240k,nr_inodes=4106451,mode=755
19 18 0:12 / /dev/mqueue rw,nosuid,nodev,noexec,relatime - mqueue mqueue rw
20 18 0:10 / /dev/pts rw,nosuid,noexec,relatime - devpts devpts rw,gid=5,mode=620,ptmxmode=000
21 18 0:15 / /dev/shm rw,nosuid,nodev,noexec,relatime - tmpfs shm rw
22 15 0:16 / /sys rw,nosuid,nodev,noexec,relatime - sysfs sysfs rw
23 22 0:7 / /sys/kernel/debug rw,nosuid,nodev,noexec,relatime - debugfs debugfs rw
24 22 0:17 / /sys/fs/cgroup rw,nosuid,nodev,noexec,relatime - tmpfs cgroup_root rw,size=10240k,mode=755
@tianon
tianon / Dockerfile
Last active December 29, 2015 11:58
pyenv in tianon/centos-null:5.9
FROM tianon/centos-null:5.9
RUN yum install -y wget
RUN wget http://dl.fedoraproject.org/pub/epel/5/x86_64/epel-release-5-4.noarch.rpm && rpm -Uvh epel-release-5-4.noarch.rpm && rm epel-release-5-4.noarch.rpm
RUN yum install -y git
RUN git clone https://github.com/yyuu/pyenv.git /.pyenv
ENV PYENV_ROOT /.pyenv
ENV PATH /.pyenv/bin:$PATH