Skip to content

Instantly share code, notes, and snippets.

Yamamoto, Hirotaka ymmt2005

Block or report user

Report or block ymmt2005

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ymmt2005
ymmt2005 / mod_proxy.patch
Created Oct 24, 2014
proxy handler support backport from 2.4.10 to 2.4.7 for Ubuntu 14.04
View mod_proxy.patch
--- apache2-2.4.7/modules/proxy/mod_proxy.c 2013-11-16 02:07:52.000000000 +0900
+++ httpd-2.4.10/modules/proxy/mod_proxy.c 2014-06-21 22:47:30.000000000 +0900
@@ -744,22 +744,52 @@
*/
const char *proxyname = r->filename + 6;
int j;
+ apr_pool_t *rxpool = NULL;
for (j = 0; j < num_sec; ++j)
{
View virtinst_macvtap.patch
diff -ru virtinst-0.600.4.orig/virtinst/cli.py virtinst-0.600.4/virtinst/cli.py
--- virtinst-0.600.4.orig/virtinst/cli.py 2013-03-23 01:12:13.000000000 +0900
+++ virtinst-0.600.4/virtinst/cli.py 2014-10-15 17:25:26.946638800 +0900
@@ -1684,6 +1684,8 @@
set_param("bridge", "bridge")
set_param("model", "model")
set_param("macaddr", "mac")
+ set_param("source_dev", "source")
+ set_param("source_mode", "source_mode")
@ymmt2005
ymmt2005 / ipv6_linklocal.cpp
Created Aug 12, 2014
IPv6 link local address resolution
View ipv6_linklocal.cpp
#include <arpa/inet.h>
#include <ifaddrs.h>
#include <iostream>
#include <netdb.h>
#include <sys/socket.h>
#include <sys/types.h>
int main() {
struct ifaddrs* addr;
getifaddrs(&addr);
@ymmt2005
ymmt2005 / kill_thread.c
Created Dec 25, 2013
Kill a specific thread externally by using tgkill(2).
View kill_thread.c
#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);
}
@ymmt2005
ymmt2005 / fizzbuzz.py
Created Oct 17, 2013
FizzBuzz using generators.
View fizzbuzz.py
def fizbuz():
n = 0
while True:
n += 1
yield n
n += 1
yield n
n += 1
yield 'Fizz' # 3
n += 1
@ymmt2005
ymmt2005 / protocol_binary.cpp
Created Jul 26, 2013
yrmcds のバイナリプロトコルの自動テストツール(書きかけ)
View protocol_binary.cpp
#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>
@ymmt2005
ymmt2005 / auto-insert-cxx.el
Created Jun 11, 2013
Emacs skeleton for C++ header files.
View auto-insert-cxx.el
(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
View chrono.cpp
#include <chrono>
#include <typeinfo>
#include <cxxabi.h>
#include <cstdlib>
#include <string>
#include <iostream>
typedef std::chrono::microseconds us_t;
template <typename T>
@ymmt2005
ymmt2005 / OSDistro.patch
Created Jan 14, 2013
Patch for libvirt virt-install script to install Ubuntu with image ISO file and w/o networking.
View OSDistro.patch
--- 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):
@ymmt2005
ymmt2005 / ifenslave.patch
Created Jan 14, 2013
Patch for ifenslave-2.6 in Ubuntu 12.04 to modify the timing for enslaving slaves.
View ifenslave.patch
--- /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
You can’t perform that action at this time.