Skip to content

Instantly share code, notes, and snippets.

View cgwalters's full-sized avatar
👍
LGTM

Colin Walters cgwalters

👍
LGTM
View GitHub Profile
@cgwalters
cgwalters / f21-annotated-sizes.md
Last active February 1, 2016 20:13
Are we slim yet?

Are we slim yet?

Translations, coreutils also has a lot of static linking of gnulib.

120417342 glibc-common
14623272 coreutils
14000291 glibc
@cgwalters
cgwalters / gist:a366c14b2fc58e0f7367
Created November 22, 2014 22:06
create-cloud-vm.sh
!/bin/sh
# Clone a copy-on-write "gold" cloud image, resize it to the target, and
# use virt-install to create a VM, attaching a cloud-init metadata ISO.
# Run in /var/lib/libvirt/images
img=$1
shift
name=$1
shift
size=$1
Run like this: $ python ~/tmp/foo.py '(a(s(taya{sv}))a{sv})' /srv/rhel-atomic-host/repo/summary
#!/usr/bin/env python
import os,sys
from gi.repository import GLib
typestr = GLib.VariantType.new(sys.argv[1])
data = open(sys.argv[2]).read()
bytedata = GLib.Bytes.new(data)
@cgwalters
cgwalters / gist:73072640f9f19fdc205f
Last active August 29, 2015 14:13
Anonymous docker/rpm assembly tool
#!/usr/bin/env python
import sys,math
buckets = {}
for f in open(sys.argv[1]).readlines():
f.strip()
s,p = f.split(' ', 1)
sz = int(s)
@cgwalters
cgwalters / ostree-mounttest.sh
Last active August 29, 2015 14:14
OSTree mount testing
#!/bin/sh -xe
function umountcleanup() {
umount -R $1 2>/dev/null || true
}
umountcleanup initramfs
rm -f initramfs.img
dd if=/dev/zero of=initramfs.img seek=20M bs=1 count=1
@cgwalters
cgwalters / gist:4188ad4aaa1d971d2eff
Created February 17, 2015 15:59
yum repomirror
$ cat reposync.sh
#!/bin/sh
# Mirror a subset of packages from yum repositories, creating local
# repos for them.
set -e
run() {
echo "$@"
$@
@cgwalters
cgwalters / setns-demo.py
Created April 7, 2015 14:47
python setns
#!/usr/bin/env python
import ctypes
import sys
import os
import subprocess
f = None
libc = ctypes.CDLL('libc.so.6')
myfd = os.open('/proc/1/ns/mnt', os.O_RDONLY)
From fc1eede8883bdad29eaaf0fd6d4bdfc5797e5d93 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Fri, 12 Jun 2015 15:42:29 -0400
Subject: [PATCH] Add two backported patches
First is a critical issue upstream in 7.1.2.
Second is also a breakage specific to Anaconda.
---
...0001-sysroot-Close-sysroot-fd-in-finalize.patch | 27 +++++++
.../sysroot-sort-returned-bootloader-configs.patch | 89 ++++++++++++++++++++++
package main
import (
"io"
"os"
"fmt"
"strings"
)
type rot13Reader struct {