Skip to content

Instantly share code, notes, and snippets.

View hatak's full-sized avatar
:octocat:

HATAKEYAMA, Hisashi hatak

:octocat:
View GitHub Profile
@hatak
hatak / no-probes_mysql_dtrace.patch
Created October 10, 2012 05:06
Patch for avoid to fail when building mroonga (for MySQL CommunityServer 5.5.28)
--- include/probes_mysql.h.orig 2012-08-29 17:50:46.000000000 +0900
+++ include/probes_mysql.h 2012-10-10 13:30:01.000000000 +0900
@@ -20,10 +20,6 @@
#include <my_global.h>
-#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
-#include "probes_mysql_dtrace.h"
-#else
#include "probes_mysql_nodtrace.h"
@hatak
hatak / json_server.psgi
Created August 7, 2012 09:08
Simple server returns the json response
use JSON;
use Plack::Request;
my $app = sub {
my $req = Plack::Request->new(shift);
my $res = $req->new_response(200);
$res->content_type('application/json');
$res->body(encode_json(+{
method => $req->method,
@hatak
hatak / my.cnf
Created July 26, 2012 02:40
my.cnf for MySQL-5.5.x (official binary) @ MacOSX
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
user = mysql
pid-file = /usr/local/var/mysql/mysqld.pid
socket = /tmp/mysql.sock
port = 3306
datadir = /usr/local/var/mysql
@hatak
hatak / .zshrc
Created June 15, 2012 12:17
.zshrc sample 2012/06/15
### .zshrc
### for mac + macports
### ver. 2012/06/15
### common settings
# export
export LANG=ja_JP.UTF-8
export PATH=$HOME/bin:/opt/local/bin:$PATH
# autoload
@hatak
hatak / digest-slowlog.sh
Created June 1, 2012 09:01
send mail of digest-slowlog
#!/bin/bash
GROUP="hoge-service"
HOST_MASTER="master"
HOST_SLAVE="slave01 slave02 slave03"
MAILTO="performance-report@example.com"
TMPFILE=/tmp/slow-log.`date "+%s"`.log
echo "${GROUP} servers summary" > ${TMPFILE}
echo >> ${TMPFILE}
@hatak
hatak / my.cnf
Created June 1, 2012 08:58
logrotate slowlog of MySQL
## /usr/local/etc/my.cnf
[mysqladmin]
user=root
password=hogefuga
@hatak
hatak / carton-setup.sh
Created May 23, 2012 15:22
install perlbrew + cpanm + carton
#!/bin/bash
PERL_STABLE="5.16.1"
echo '%< --- installing perlbrew ---'
echo
curl -kL http://install.perlbrew.pl | bash
source ~/perl5/perlbrew/etc/bashrc
perlbrew install --notest perl-${PERL_STABLE}
@hatak
hatak / mysql55_numactl.patch
Created April 17, 2012 02:59
patch for "swap insanity" probrem
--- /usr/bin/mysqld_safe.orig 2011-05-12 03:14:52.000000000 +0900
+++ /usr/bin/mysqld_safe 2011-06-07 11:02:49.000000000 +0900
@@ -727,6 +727,10 @@
cmd="`mysqld_ld_preload_text`$NOHUP_NICENESS"
+# Start mysqld with memory allocations interleaved to avoid swapping
+# on NUMA-based architectures. Should be harmless on non-NUMA.
+cmd="/usr/bin/numactl --interleave all $cmd"
+
@hatak
hatak / setup_android_development.sh
Created April 12, 2012 02:32
setup script for Android SDK & NDK
#!/bin/bash
# setup script for Android SDK & NDK
# for macosx lion
PATH_DEVELOPER=$HOME/Library/Developer
PATH_ANDROID=$PATH_DEVELOPER/Android
DIR_ANDROID_SDK="android-sdk"
DIR_ANDROID_NDK="android-ndk"
@hatak
hatak / checker.pl
Created December 9, 2010 05:41
check http-status from url list
#!/usr/bin/perl
#===============================================================================
#
# FILE: checker.pl
#
# USAGE: ./checker.pl [filename]
#
# DESCRIPTION: check http-status from url list
#
# OPTIONS: ---