Skip to content

Instantly share code, notes, and snippets.

@peo3
peo3 / config-3.8.2-206.vbox.fc18.x86_64
Created March 12, 2013 16:12
A sample configuration of a minimal x86_64 kernel with user namespace for VirtualBox.
# x86_64
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.8.2 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
@peo3
peo3 / try_virt-sandbox.sh
Last active December 12, 2015 08:39
How to try virt-sandbox on Ubuntu 12.10.
sudo aptitude install autoconf
sudo aptitude install libtool
sudo aptitude install libcap-ng-dev
sudo aptitude install libvirt-glib-1.0-dev
sudo aptitude install libglib2.0-dev
sudo aptitude install libglib2.0
sudo aptitude install libxml2-dev
sudo aptitude install libselinux-dev
sudo aptitude install gtk-doc-tools
sudo aptitude install libvirt-bin
@peo3
peo3 / config-3.7.4-204.vbox.fc18.x86_64
Created February 6, 2013 17:19
A configuration for a small custom kernel of Fedora 18 on VirtualBox.
# x86_64
# Automatically generated file; DO NOT EDIT.
# Linux/x86_64 3.7.4-204.vbox.fc18.x86_64 Kernel Configuration
#
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
@peo3
peo3 / gist:4258274
Created December 11, 2012 12:38
Unknown git behavior...
$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
$ cd linux/
$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: include/uapi/linux/netfilter/xt_CONNMARK.h
# modified: include/uapi/linux/netfilter/xt_DSCP.h
@peo3
peo3 / gist:3464550
Created August 25, 2012 12:02
cgroup-utils: git diff v0.3..v0.4 --stat
$ git diff v0.3..v0.4
.gitignore | 4 +
Changelog | 14 ++++
Changelog.md | 10 +++
README | 195 ++++++++++++++++++++++++++++++++++++++++++++++++-
README.md | 30 +++++---
README.rst | 180 ---------------------------------------------
cgutils/cgroup.py | 449 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------
cgutils/command.py | 11 +--
cgutils/commands/__init__.py | 2 +
@peo3
peo3 / gist:3157001
Created July 21, 2012 20:13
cgroup-utils supports autogroup
$ cgutil tree -t -k --show-autogroup
<root>
+test
+system
| +sm-client.service
| | `sendmail
| +sendmail.service
| | `sendmail
| +vboxadd-service.service
| | `VBoxService
@peo3
peo3 / gist:3090225
Created July 11, 2012 12:55
cgutil pgrep
[fedora17 cgroup-utils]$ cgutil pgrep systemd
/: 1
/system/systemd-logind.service: 576
/system/systemd-journald.service: 359
[fedora17 cgroup-utils]$ cgutil pgrep systemd -l -f
/: 1 /usr/lib/systemd/systemd
/: 1321 /bin/python /bin/cgutil pgrep systemd -l -f
/system/systemd-logind.service: 576 /usr/lib/systemd/systemd-logind
/system/dbus.service: 607 /bin/dbus-daemon --system --address=systemd: --nofork --systemd-activation
/system/systemd-journald.service: 359 /usr/lib/systemd/systemd-journald
@peo3
peo3 / Makefile
Created June 23, 2012 15:08
cgroup LKM example
obj-m = cgroup-notifier-counter.o
KVERSION = $(shell uname -r)
all:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(KVERSION)/build M=$(PWD) clean
@peo3
peo3 / store_bundle_in_sqlite3.java
Created February 11, 2012 11:51
Store an arbitrary Bundle object into a SQLite database ref: http://qiita.com/items/2386
/* store a bundle */
Bundle bundle = // get a bundle from somewhere
final Parcel parcel = Parcel.obtain();
bundle.writeToParcel(parcel, 0);
byte[] bundleBytes = parcel.marshall();
parcel.recycle();
ContentValues values = new ContentValues();
values.put("bundle", bundleBytes);
SQLiteDatabase db = // create a db object
@peo3
peo3 / gist:1669870
Created January 24, 2012 12:07
ls ~/git
$ \ls -1 ~/git
bitcoin
btrfs-progs-unstable
cgroup-utils
iproute2
libvirt
linux
linux-stable
lxc
openflow