Skip to content

Instantly share code, notes, and snippets.

View vbatts's full-sized avatar
🧁

Vincent Batts vbatts

🧁
View GitHub Profile
vbatts@valse ~ (master *) $ docker pull --all-tags=true fedora
Pulling repository fedora
717a8c89fa48: Download complete
93be8052dfb8: Download complete
d7f0e75cf11f: Download complete
48ecf305d2cf: Download complete
eb8e83ebb17d: Download complete
Status: Image is up to date for fedora
vbatts@valse ~ (master *) $ for i in $(docker images -q fedora | sort -u ); do echo $i; docker run -it $i grep ^root /etc/shadow ; echo ; done
717a8c89fa48
@vbatts
vbatts / example.sh
Created May 14, 2015 19:43
docker-save-dockerfile
vbatts@valse ~ (master *) $ go get github.com/vbatts/docker-utils/cmd/docker-save-dockerfile
vbatts@valse ~ (master *) $ docker save busybox | docker-save-dockerfile
INFO[0000] using stdin ...
INFO[0000] Wrote {"busybox" "latest" "4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125"} to "/tmp/docker-save-dockerfile.755321479/Dockerfile.4986bf8c15363d1c5d15512d5266f8777bfba4974ac56e3270e7760f6f0a8125.441581114"
vbatts@valse ~ (master *) $ docker save -o mutt.tar vbatts/mutt
vbatts@valse ~ (master *) $ docker-save-dockerfile ./mutt.tar
INFO[0000] using "./mutt.tar" ...
INFO[0000] Wrote {"vbatts/mutt" "latest" "7eefac143e1c0f8710462b4689ac6330fe2255fd875bffc745c4e5312731f194"} to "/tmp/docker-save-dockerfile.182211867/Dockerfile.7eefac143e1c0f8710462b4689ac6330fe2255fd875bffc745c4e5312731f194.724815294"
@vbatts
vbatts / build.sh
Created April 9, 2015 14:02
FORTIFY_SOURCE
#!/bin/sh
# build and see output
go build -x c.go
# if you link to outside libraries
#go build -ldflags '-extldflags "-DFORTIFY_SOURCE"' -x c.go

Keybase proof

I hereby claim:

  • I am vbatts on github.
  • I am vbatts (https://keybase.io/vbatts) on keybase.
  • I have a public key whose fingerprint is 5B16 75CE 143A 088B AE92 EDFE 1093 7E57 733F 1362

To claim this, I am signing this object:

@vbatts
vbatts / README.md
Last active August 29, 2015 14:16
checksum consistency of gzip (golang and gnu utils)

Overview

Choose or make a simple tar archive to work with.

Layout

$ ls -sh t.tar
24K t.tar
@vbatts
vbatts / README.md
Last active August 29, 2015 14:14
investigating archive permutations due to hardlinks

Issue

The difference in the sum, has to do with an arbitrary order that can occur
when tar'ing hardlinks. The first file encountered pointing to the inode wins
and has it's Size recorded. Then following files that may have the same inode, then have their LinkName point to the first file's Name, and their Size is 0.

WIP to fix ti https://github.com/vbatts/docker/compare/vbatts-archive_sort

@vbatts
vbatts / setns.c
Created January 22, 2015 03:26
setns
#define _GNU_SOURCE
#include <fcntl.h>
#include <sched.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
} while (0)
@vbatts
vbatts / Dockerfile
Created January 16, 2015 19:45
Devel container
FROM fedora:20
RUN yum erase -y vim-minimal &&\
yum groupinstall -y "development tools" && \
yum install -y --setopt=override_install_langs=en --setopt=tsflags=nodocs \
yum-utils \
git \
golang \
mercurial \
bzr \
FROM busybox
RUN dd if=/dev/urandom of=/dev/null bs=1024k count=5
@vbatts
vbatts / .gitignore
Last active May 13, 2020 00:17
renegotiation example
.client
.server
Dockerfile