Skip to content

Instantly share code, notes, and snippets.

@caglar10ur
caglar10ur / gist:8034412
Created December 19, 2013 04:25
stuck concurrent start
Iteration 66/100 maxfd:3
Executing (create) for 10 containers...
Executing (start) for 10 containers...
Executing (stop) for 10 containers...
Executing (destroy) for 10 containers...
Iteration 67/100 maxfd:3
Executing (create) for 10 containers...
Executing (start) for 10 containers...
@caglar10ur
caglar10ur / gist:8077658
Created December 22, 2013 02:12
process_lock
root 534 0.0 0.5 1426600 10264 ? Ss 21:03 0:00 lxc-test-concurrent -j 20 -i 100
root 570 0.0 0.0 2260 496 ? Ss 21:03 0:00 \_ init
root 650 0.0 0.0 2260 260 ? Ss 21:03 0:00 \_ /bin/sh /etc/init.d/rcS
root 659 0.0 0.0 2260 264 ? S 21:03 0:00 | \_ /bin/udhcpc
root 652 0.0 0.0 2260 276 ? Ss 21:03 0:00 \_ /bin/syslogd
root 547 0.0 0.5 1434800 10276 ? Ss 21:03 0:00 lxc-test-concurrent -j 20 -i 100
root 657 0.0 0.0 2260 496 ? Ss 21:03 0:00 \_ init
root 863 0.0 0.0 2260 260 ? Ss 21:03 0:00 \_ /bin/sh /etc/init.d/rcS
root 873 0.0 0.0 2260 264 ? S 21:03 0:00 | \_ /bin/udhcpc
root 870 0.0 0.0 2260 272 ? Ss 21:03 0:00 \_ /bin/syslogd
@caglar10ur
caglar10ur / unprivileged.sh
Last active October 7, 2016 16:12
unprivileged.sh
#!/bin/bash
uid=$(grep $USER /etc/subuid | cut -d : -f 2)
gid=$(grep $USER /etc/subgid | cut -d : -f 2)
range=$(grep $USER /etc/subuid | cut -d : -f 3)
NOCOLOR="\033[0m"
OKCOLOR="\033[0;32m"
UNPRIVILEGED="unpriv"
#!/bin/bash
if [ ! -f /usr/bin/uidmapshift ]; then
wget https://bazaar.launchpad.net/~serge-hallyn/+junk/nsexec/download/head:/uidmapshift.c-20121030152620-2zy9rkac9y6htoia-8/uidmapshift.c
gcc -o uidmapshift uidmapshift.c
sudo mv uidmapshift /usr/bin/uidmapshift
rm -f uidmapshift.c
fi
uid=$(grep $USER /etc/subuid | cut -d : -f 2)
[caglar@qp:~/go/src/github.com/caglar10ur/lxc(devel)] make test
==> Running go test
=== RUN TestVersion-2
--- PASS: TestVersion-2 (0.00 seconds)
lxc_test.go:40: LXC version: 1.0.0.beta2
=== RUN TestDefaultConfigPath-2
--- PASS: TestDefaultConfigPath-2 (0.00 seconds)
=== RUN TestSetConfigPath-2
--- PASS: TestSetConfigPath-2 (0.00 seconds)
=== RUN TestGetContainer-2
@caglar10ur
caglar10ur / gist:8461601
Last active January 3, 2016 12:19
configure flags for cgmanager
CFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" CPPFLAGS="-D_FORTIFY_SOURCE=2" CXXFLAGS="-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security" FFLAGS="-g -O2" LDFLAGS="-Wl,-Bsymbolic-functions -Wl,-z,relro" ./configure --prefix=/usr --sysconfdir=/etc --bindir=/bin --sbindir=/sbin --libdir=/lib/x86_64-linux-gnu/ --localstatedir=/var
@caglar10ur
caglar10ur / cgmanager.conf
Created January 16, 2014 19:24
/etc/init/cgmanager.conf
description "cgroup management daemon"
author "Serge Hallyn <serge.hallyn@ubuntu.com>"
respawn
# in trusty /sys/fs/cgroup will be mounted for us.
# prior to saucy, we would need to start on mounted
# MOUNTPOINT=/sys, and mount /sys/fs/cgroup ourselves
start on mounted MOUNTPOINT=/sys/fs/cgroup
@caglar10ur
caglar10ur / keybase.md
Last active April 25, 2018 17:41
keybase.io

Keybase proof

I hereby claim:

  • I am caglar10ur on github.
  • I am caglar10ur (https://keybase.io/caglar10ur) on keybase.
  • I have a public key ASBF_OJkBbxuSacZ2uT7g4Qmg_o89ncaw79e0lLyUchF0go

To claim this, I am signing this object:

@caglar10ur
caglar10ur / iperf-servers
Created January 7, 2015 19:11
iperf-servers
#!/bin/bash
base_port=5000
# Command line input: number of servers
# E.g. 5
num_servers=$1
shift
# Command line input: base report file name
# E.g. report
@caglar10ur
caglar10ur / iperf-clients
Created January 7, 2015 19:12
iperf-clients
#!/bin/bash
base_port=5000
# Command line input: server IP address
# E.g. 1.1.1.1
server_ip=$1
shift
# Command line input: number of clients to start