Skip to content

Instantly share code, notes, and snippets.

@kjmkznr
kjmkznr / livecd.spec
Created June 6, 2014 04:43
metro: target/gentoo/livecd.spec
[collect ./source/stage3.spec]
[collect ./target/stage4.spec]
[collect ./steps/kernel.spec]
[collect ./steps/capture/livecd.spec]
[section stage4]
target/name: livecd
[section steps]
INSTALL = /usr/bin/install -c
prefix = /usr/local
libdir = $(prefix)/lib
default:
$(CC) -Wall -fPIC -c libexample.c
$(CC) -Wall -shared -Wl,-soname=libexample.so -o libexample.so libexample.o
clean:
@rm -f libexample.o libexample.so
#include <stdio.h>
#include <dlfcn.h>
int main()
{
void *handle = dlopen("./libexample.so", RTLD_LAZY);
if (handle == 0) {
fprintf(stderr, "%s\n", dlerror());
return 1;

Nginx vs h2o (http/1.1)

Environment

WebServer

  • AWS EC2 c3.xlarge(ap-northeast-1a)
  • cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
$ strace -c -f -p 460
Process 460 attached
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
57.08 0.001468 0 95742 writev
16.91 0.000435 0 287239 95739 read
11.51 0.000296 0 95743 open
7.66 0.000197 0 95754 close
5.56 0.000143 0 95744 fstat
1.28 0.000033 0 9599 1 epoll_wait
@kjmkznr
kjmkznr / 70-u2f.rules
Created December 6, 2014 06:42
Yubico FIDO U2F Security Key udev rule
ACTION!="add|change", GOTO="u2f_end"
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0113|0114|0115|0116|0120|0402|0403|0406|0407|0410", MODE="0660", GROUP="plugdev"
LABEL="u2f_end"
/*
* mod_hello - Hello World for Apache 2.2
*
* Copyright(c) 2014, KOJIMA Kazunori
*
* License: Apache License, Version 2.0
*
* Install:
* $ apxs -c mod_hello.c
* $ sudo apxs -i -a -n hello mod_hello.la
diff --git a/gcimagebundle/gcimagebundlelib/platform_factory.py b/gcimagebundle/gcimagebundlelib/platform_factory.py
index da63f0e..c967813 100644
--- a/gcimagebundle/gcimagebundlelib/platform_factory.py
+++ b/gcimagebundle/gcimagebundlelib/platform_factory.py
@@ -25,6 +25,7 @@ from gcimagebundlelib import opensuse
from gcimagebundlelib import rhel
from gcimagebundlelib import sle
from gcimagebundlelib import ubuntu
+from gcimagebundlelib import gentoo
@kjmkznr
kjmkznr / .config
Created December 20, 2014 06:14
Google Compute Engine kernel config
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 3.14.14-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y

Keybase proof

I hereby claim:

  • I am kjmkznr on github.
  • I am kjmkznr (https://keybase.io/kjmkznr) on keybase.
  • I have a public key whose fingerprint is ABEC 3A90 3CCD D6E0 2D0B 8602 1794 BC64 DA2D 1A5F

To claim this, I am signing this object: