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
#include <signal.h> | |
#include <sys/syscall.h> /* For SYS_xxx definitions */ | |
#include <sys/types.h> | |
#include <unistd.h> | |
int main() { | |
pid_t tgid=18456; | |
pid_t tid=24671; | |
return syscall(SYS_tgkill, tgid, tid, SIGABRT); | |
} |
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
def fizbuz(): | |
n = 0 | |
while True: | |
n += 1 | |
yield n | |
n += 1 | |
yield n | |
n += 1 | |
yield 'Fizz' # 3 | |
n += 1 |
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
#include "../src/memcache.hpp" | |
#include <cybozu/dynbuf.hpp> | |
#include <cybozu/tcp.hpp> | |
#define TEST_DISABLE_AUTO_RUN | |
#include <cybozu/test.hpp> | |
#include <cybozu/util.hpp> | |
#include <cstdint> | |
#include <cstring> |
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
(add-hook 'find-file-hook 'auto-insert) | |
(setq auto-insert-alist | |
'(("\\.hpp\\'" | |
nil | |
'(setq v1 (read-string "Namespace: " "cybozu")) | |
'(setq v2 (upcase (concat v1 "_" | |
(file-name-nondirectory | |
(file-name-sans-extension buffer-file-name)) | |
"_" (file-name-extension buffer-file-name)))) | |
"// " (file-name-nondirectory buffer-file-name) n |
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
#include <chrono> | |
#include <typeinfo> | |
#include <cxxabi.h> | |
#include <cstdlib> | |
#include <string> | |
#include <iostream> | |
typedef std::chrono::microseconds us_t; | |
template <typename T> |
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
--- /etc/network/if-pre-up.d/ifenslave 2012-01-24 02:26:28.000000000 +0900 | |
+++ ifenslave 2012-09-12 01:03:22.558799876 +0900 | |
@@ -224,6 +224,7 @@ | |
# Setup the master interface | |
early_setup_master | |
setup_master | |
+ enslave_slaves | |
# Indicate that we're done setting up the master | |
# this is required as ifstate is modified at the beginning |
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
--- OSDistro.py.orig 2012-06-15 06:05:53.966087512 +0000 | |
+++ OSDistro.py 2012-06-15 06:09:42.362805372 +0000 | |
@@ -951,7 +951,11 @@ | |
# regular tree: | |
# http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/ | |
+ def _set_media_paths(self): | |
+ self._hvm_kernel_paths = [ ("vmlinuz", "initrd.gz") ] | |
+ | |
def isValidStore(self, fetcher, progresscb): |
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/env python | |
from __future__ import print_function | |
from argparse import ArgumentParser, RawDescriptionHelpFormatter | |
import re | |
import sys | |
# Constants | |
HELP_DESCRIPTION = '''\ | |
Annotate id-ns output for humans. |
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
$ sudo /sbin/mdadm -A /dev/md/a -R --auto=md --symlink=no --update=devicesize /dev/sda | |
Size was 2097128 | |
Size is 2097128 | |
mdadm: /dev/md/a has been started with 1 drive (out of 2). | |
$ ls -l /dev/md | |
total 0 | |
lrwxrwxrwx 1 root root 8 Aug 9 02:28 a -> ../md127 | |
$ sudo /sbin/mdadm -A /dev/md/b -R --auto=md --symlink=no --update=devicesize /dev/sdb |
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
# -*- coding: utf-8 -*- | |
''' | |
パスフレーズがいいらしい | |
→ 日本人なんだから日本語フレーズがいいに決まっている | |
いい辞書ないかな | |
→ pubdic+ | |
http://www.remus.dti.ne.jp/~endo-h/wnn/ | |
平仮名→ローマ字 |