Skip to content

Instantly share code, notes, and snippets.

@peo3
peo3 / intellij-scalatest-memo.txt
Created Jan 6, 2012
Scala SBT IntelliJ IDEA ScalaTest設定でやったこと
View intellij-scalatest-memo.txt
- 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"
@peo3
peo3 / configure
Created Oct 23, 2011
Warning about -std=gnu99 in configure
View configure
{ $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
@peo3
peo3 / setup_lxc_rootfs_fedora15.sh
Created Aug 12, 2011
How to boot up Fedora 15 with systemd inside Libvirt LXC
View setup_lxc_rootfs_fedora15.sh
#!/bin/sh
# Setup a rootfs of Fedora 15 for libvirt lxc
#
# The rootfs is based on http://download.openvz.org/template/precreated/fedora-15-x86_64.tar.gz
#
# See also
# - http://www.mail-archive.com/lxc-users@lists.sourceforge.net/msg01707/lxc-fedora.in
if [ $# != 1 ]; then
@peo3
peo3 / cgroup_event_listener.py
Created Apr 21, 2011
A python script doing the same operations as cgroup_event_listener.c
View cgroup_event_listener.py
#!/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
@peo3
peo3 / linux.c
Created Apr 21, 2011
An extension module to call eventfd(2) in python
View linux.c
/*
* Usage in python:
*
* import linux
* efd = linux.eventfd(0, 0)
* ...
* ret = struct.unpack('Q', os.read(efd, 8))
* ...
* linux.close(efd)
*/
@peo3
peo3 / cgconfig.conf
Created Jan 30, 2011
peo3's libcgroup settings
View cgconfig.conf
group browser {
cpu {
cpu.shares = 500;
}
cpuacct {
}
memory {
memory.soft_limit_in_bytes = 400M;
memory.limit_in_bytes = 500M;
}