Skip to content

Instantly share code, notes, and snippets.

View mrunalp's full-sized avatar

Mrunal Patel mrunalp

View GitHub Profile
@mrunalp
mrunalp / mountrun.c
Created August 25, 2015 23:16
Mount tmpfs at /run in a process's mount namespace
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sched.h>
#include <unistd.h>
#include <errno.h>
package main
import (
"flag"
"log"
"os"
"path/filepath"
"syscall"
)
@mrunalp
mrunalp / config.json
Created September 11, 2015 23:54
Config for runc nginx
{
"version": "pre-draft",
"platform": {
"os": "linux",
"arch": "amd64"
},
"process": {
"terminal": false,
"user": {
"uid": 0,
@mrunalp
mrunalp / test_stdin.go
Created September 30, 2015 00:15
Test stdin through API
package main
import (
"log"
"github.com/fsouza/go-dockerclient"
)
func main() {
endpoint := "unix:///var/run/docker.sock"
#!/bin/bash
set -e
set -x
RUNC_GOPATH="$(mktemp -d)"
CONTAINERD_GOPATH="$(mktemp -d)"
PWD="$(pwd)"
function cleanup() {
rm -rf "${RUNC_GOPATH}"
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<match target="font">
<edit name="rgba" mode="assign"> <const>rgb</const> </edit>
<edit name="hinting" mode="assign"> <bool>true</bool> </edit>
<edit name="autohint" mode="assign"> <bool>true</bool> </edit>
<edit name="antialias" mode="assign"> <bool>true</bool> </edit>
<edit name="hintstyle" mode="assign"> <const>hintslight</const> </edit>
<edit name="lcdfilter" mode="assign"> <const>lcdlight</const> </edit>

For keybase.io

diff --git a/Makefile b/Makefile
index a84c539..16b0ec1 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ MAN_INSTALL_PATH := ${PREFIX}/share/man/man8/
VERSION := ${shell cat ./VERSION}
all: $(RUNC_LINK)
- go build -i -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -tags "$(BUILDTAGS)" -o runc .
+ go build -i -tags "$(BUILDTAGS)" -o runc .
diff --git a/Makefile b/Makefile
index a84c539..de40636 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ MAN_INSTALL_PATH := ${PREFIX}/share/man/man8/
VERSION := ${shell cat ./VERSION}
all: $(RUNC_LINK)
- go build -i -ldflags "-X main.gitCommit=${COMMIT} -X main.version=${VERSION}" -tags "$(BUILDTAGS)" -o runc .
+ go build -i -ldflags "-X main.gitCommit ${COMMIT} -X main.version ${VERSION}" -tags "$(BUILDTAGS)" -o runc .
@mrunalp
mrunalp / cleanup.sh
Created January 17, 2017 21:28
Cleanup cri-o test env
#!/bin/bash -x
runc list | awk '{print $1}' | grep -v ID | xargs runc delete -f
mount | grep shm | grep /tmp/tmp | awk '{print $3}' | xargs umount
mount | grep devicemapper | grep /tmp/tmp | awk '{print $3}' | xargs umount
rm -rf /tmp/tmp.*
mount | grep shm | grep /var/lib/ocid | awk '{print $3}' | xargs umount
mount | grep devicemapper | grep /var/lib/ocid | awk '{print $3}' | xargs umount
rm -rf /var/lib/ocid