Skip to content

Instantly share code, notes, and snippets.

View tianon's full-sized avatar
♥️
TIANON

Tianon Gravi tianon

♥️
TIANON
View GitHub Profile
@tianon
tianon / sed-xdg-user-dirs.sh
Last active August 29, 2015 14:02
fix stupid user-dirs.defaults
sudo sed -ri 's/=.*/\L&/g; s/public$/public-share/; s/documents/docs/g; s/pictures/pics/g' /etc/xdg/user-dirs.defaults
xdg-user-dirs-update --force
@tianon
tianon / Dockerfile
Last active August 29, 2015 14:00
Debian Potato Docker Base Image
FROM scratch
ADD rootfs.tar.xz /
CMD ["/bin/bash"]
diff --git a/DCO.md b/DCO.md
index c9cedee..5bfe198 100644
--- a/DCO.md
+++ b/DCO.md
@@ -1,11 +1,11 @@
-Docker Developer Certificate of Origin 1.1
+Developer's Certificate of Origin 1.1
-By making a contribution to the Docker Project ("Project"), I represent and warrant that:
+By making a contribution to this project, I certify that:
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) {
@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
@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 / 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 / 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 / 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 <[email protected]>
# $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 / 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"
)