Skip to content

Instantly share code, notes, and snippets.

View kei2100's full-sized avatar

Kei Arima kei2100

  • Japan
  • 08:28 (UTC +09:00)
View GitHub Profile
@kei2100
kei2100 / rbenv install chef recipe
Created November 20, 2013 08:23
rbenv install chef recipe
RBENV_DIR = "/usr/local/rbenv"
RUBY_VER = "1.9.3-p448"
# install packages
%w{
gcc
gcc-c++
openssl-devel
readline
readline-devel
@kei2100
kei2100 / vagrant setup
Last active December 22, 2015 15:38
vagrant setup
# mac
http://files.vagrantup.com/packages/b12c7e8814171c1295ef82416ffe51e8a168a244/Vagrant-1.3.1.dmg
# linux
sudo yum localinstall http://files.vagrantup.com/packages/b12c7e8814171c1295ef82416ffe51e8a168a244/vagrant_1.3.1_x86_64.rpm
vagrant box add centos6.3 http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.3-x86_64-v20130101.box
mkdir -p ~/vagrant/repos/centos6.3
cd ~/vagrant/repos/centos6.3
@kei2100
kei2100 / file0.java
Created September 5, 2013 05:04
charのUnicodeコードポイントがどのUnicodeブロックなのか判定(何語か判定) ref: http://qiita.com/kei2100/items/290f5c8b4216599c9e26
if (UnicodeBlock.of(character) == UnicodeBlock.ARABIC) {
//
}
@kei2100
kei2100 / curl response time test
Created August 23, 2013 06:11
curl response time test
#!/bin/bash
set -e
URL=${1}
while : ;do
DATE_OUT=`date +"%Y/%m/%d-%k:%M:%S"`
CURL_OUT=`curl -w 'http_code\t%{http_code}\ttotal\t%{time_total}\tconnect\t%{time_connect}\tstarttransfer\t%{time_starttransfer}\n' "${URL}" -s -o /dev/null`
echo -e "${DATE_OUT}\t${CURL_OUT}"
@kei2100
kei2100 / my vim setting
Last active December 21, 2015 08:39
my vim setting
# root
yum -y install git
yum -y install mercurial
yum -y install ncurses-devel
yum -y install gcc
yum -y install ruby ruby-devel
cd /usr/local/src
hg clone https://vim.googlecode.com/hg/ vim
cd vim
@kei2100
kei2100 / apache_response_time.py
Last active December 20, 2015 16:39
munin script for apache response time
#!/usr/bin/env python
import sys
import os.path
import re
from subprocess import *
LAST_N_REQUESTS = 50000
LOG_PATH = '/usr/local/apache/logs/access.log'
LOG_OPEN_COMMANDS = [
('tail', '-n %d' % LAST_N_REQUESTS, LOG_PATH),
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import org.apache.commons.beanutils.PropertyUtils;
/**
* JavaBeanをMapにディープdescribeします。PropertyUtils使って。
@kei2100
kei2100 / JMagick Eclipse Webapp Setting
Created February 3, 2013 15:14
JMagick Eclipse Webapp Setting
* add jmagick.jar > Java Build Path Entries
* add jmagick.jar > Deployment Assembly
* jmagick.systemclassloader setting
static {
System.setProperty("jmagick.systemclassloader","false");
}
or
@kei2100
kei2100 / ImageMagick and JMagick install on Mac OSX
Last active November 6, 2019 15:40
ImageMagick and JMagick install on Mac OSX
# imagemagick
brew install imagemagick --disable-openmp
すると色々怒られるので、
sudo brew link libtiff
sudo brew link little-cms
sudo brew link jasper
sudo brew link imagemagick
sudo brew link jpeg
する
@kei2100
kei2100 / out_redis_sample.rb
Created February 15, 2012 12:12
Fluentd Redis out plugin sample
class RedisOutput < Fluent::BufferedOutput
# Register plugin first. NAME is the name of this plugin
# which is used in the configuration file.
Fluent::Plugin.register_output('redis_sample', self)
def initialize
require 'msgpack'
require 'redis'
super
end