View cgconfig.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
group browser { | |
cpu { | |
cpu.shares = 500; | |
} | |
cpuacct { | |
} | |
memory { | |
memory.soft_limit_in_bytes = 400M; | |
memory.limit_in_bytes = 500M; | |
} |
View linux.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage in python: | |
* | |
* import linux | |
* efd = linux.eventfd(0, 0) | |
* ... | |
* ret = struct.unpack('Q', os.read(efd, 8)) | |
* ... | |
* linux.close(efd) | |
*/ |
View cgroup_event_listener.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Usage: sudo python cgroup_event_listener.py /sys/fs/cgroup/memory/hoge/memory.usage_in_bytes 263M | |
import sys | |
import os, os.path | |
import struct | |
import linux |
View configure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5 | |
$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; } | |
if test $gl_cv_header_wchar_h_correct_inline = no; then | |
as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS). | |
This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in | |
C99 mode. You have four options: | |
- Add the flag -fgnu89-inline to CC and reconfigure, or | |
- Fix your include files, using parts of | |
<http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or | |
- Use a gcc version older than 4.3, or |
View intellij-scalatest-memo.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- brew install scala sbt | |
- mkdir -p scala/Hoge | |
- cd scala/Hoge | |
- sbt | |
- vim build.sbt | |
- cat build.sbt | |
name := "Hoge" | |
version := "0.1" | |
scalaVersion := "2.9.0-1" | |
libraryDependencies += "org.scalatest" % "scalatest_2.9.0" % "1.6.1" |
View gist:1669870
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ \ls -1 ~/git | |
bitcoin | |
btrfs-progs-unstable | |
cgroup-utils | |
iproute2 | |
libvirt | |
linux | |
linux-stable | |
lxc | |
openflow |
View store_bundle_in_sqlite3.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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 |
View Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
View gist:3090225
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
View gist:3157001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cgutil tree -t -k --show-autogroup | |
<root> | |
+test | |
+system | |
| +sm-client.service | |
| | `sendmail | |
| +sendmail.service | |
| | `sendmail | |
| +vboxadd-service.service | |
| | `VBoxService |
OlderNewer