Skip to content

Instantly share code, notes, and snippets.

Avatar
♥️
TIANON

Tianon Gravi tianon

♥️
TIANON
View GitHub Profile
@tianon
tianon / .config
Last active Aug 29, 2015
linux-3.12.9-gentoo config
View .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 Aug 29, 2015
can't get ruby to install on debian sid
View output.txt
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 Aug 29, 2015
randinit, for paultag
View Makefile
randinit: randinit.go
go build -o $@ -ldflags -d $<
@tianon
tianon / changeifname.go
Last active Aug 29, 2015
SIOCSIFNAME in Go instead of C
View changeifname.go
package netlink
// #include <net/if.h>
import "C"
import (
"syscall"
"unsafe"
)
@tianon
tianon / 256colors
Created Feb 18, 2014
256colors: docker build --rm --no-cache 'git://gist.github.com/9077366.git'
View 256colors
#!/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 Feb 19, 2014
Go Newlines in Tags
View main.go
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 Aug 29, 2015
Testing "docker build" Remote API Endpoint Using Curl
View curl-docker-build.sh
{ 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 Aug 29, 2015
"docker build" output mangling
View Dockerfile
FROM busybox
RUN echo -n '[ ] testing...' && sleep 5 && echo -e 'done.\r[✓]'
@tianon
tianon / output.txt
Created Feb 28, 2014
even failed builds make images, of course
View output.txt
$ 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
View cgroups.patch
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) {
You can’t perform that action at this time.