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
  • 13:34 (UTC -07:00)
  • X @tianon
View GitHub Profile
@tianon
tianon / .config
Last active August 29, 2015 13:55
linux-3.12.9-gentoo config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.12.9-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
@tianon
tianon / output.txt
Last active August 29, 2015 13:56
can't get ruby to install on debian sid
root@58a79975c52d:/# apt-get update
Get:1 http://http.debian.net sid InRelease [205 kB]
Get:2 http://http.debian.net sid/main amd64 Packages/DiffIndex [7876 B]
Get:3 http://http.debian.net sid/main amd64 2014-01-29-2048.00.pdiff [12.8 kB]
Get:4 http://http.debian.net sid/main amd64 2014-01-30-0248.25.pdiff [7442 B]
Get:5 http://http.debian.net sid/main amd64 2014-01-30-0848.01.pdiff [2746 B]
Get:6 http://http.debian.net sid/main amd64 2014-01-30-1443.21.pdiff [21.4 kB]
Get:7 http://http.debian.net sid/main amd64 2014-01-30-2048.10.pdiff [7342 B]
Get:8 http://http.debian.net sid/main amd64 2014-01-31-0246.50.pdiff [5433 B]
Get:9 http://http.debian.net sid/main amd64 2014-01-31-0844.47.pdiff [2125 B]
@tianon
tianon / Makefile
Last active August 29, 2015 13:56
randinit, for paultag
randinit: randinit.go
go build -o $@ -ldflags -d $<
@tianon
tianon / changeifname.go
Last active August 29, 2015 13:56
SIOCSIFNAME in Go instead of C
package netlink
// #include <net/if.h>
import "C"
import (
"syscall"
"unsafe"
)
@tianon
tianon / 256colors
Created February 18, 2014 18:54
256colors: docker build --rm --no-cache 'git://gist.github.com/9077366.git'
#!/usr/bin/perl
# Author: Todd Larason <jtl@molehill.org>
# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
# colors 16-231 are a 6x6x6 color cube
for ($red = 0; $red < 6; $red++) {
@tianon
tianon / main.go
Created February 19, 2014 22:55
Go Newlines in Tags
package main
type SomeSqlRelatedStruct struct {
SomeValue int `magicsql:"MyDatabaseIntField"`
SomeValueThatComesFromSql *string `magicsql:"(
SELECT 'some magic subselect'
FROM someothertable
WHERE MainId = MyDatabaseIntField
)"`
}
@tianon
tianon / curl-docker-build.sh
Last active August 29, 2015 13:56
Testing "docker build" Remote API Endpoint Using Curl
{ echo 'FROM debian'; echo 'RUN apt-get update'; } | perl -w -MArchive::Tar -e 'my $tar = Archive::Tar->new; { local $/; $tar->add_data("Dockerfile", <>); } print $tar->write' | curl --data-binary @- --header 'Content-Type: application/x-tar' --dump-header - --no-buffer 'http://localhost:4243/build?rm=1&nocache=1'
@tianon
tianon / Dockerfile
Last active August 29, 2015 13:56
"docker build" output mangling
FROM busybox
RUN echo -n '[ ] testing...' && sleep 5 && echo -e 'done.\r[✓]'
@tianon
tianon / output.txt
Created February 28, 2014 16:26
even failed builds make images, of course
$ docker build --rm -
FROM busybox
RUN true
RUN true
RUN true
RUN false
<Ctrl+D>
Uploading context 2.048 kB
Uploading context
Step 0 : FROM busybox
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go
index b40e1a3..3df82c2 100644
--- a/pkg/cgroups/cgroups.go
+++ b/pkg/cgroups/cgroups.go
@@ -62,7 +62,15 @@ func GetInitCgroupDir(subsystem string) (string, error) {
return parseCgroupFile(subsystem, f)
}
-func (c *Cgroup) Path(root, subsystem string) (string, error) {
+func (c *Cgroup) Path(subsystem string) (string, error) {