Skip to content

Instantly share code, notes, and snippets.

View harukasan's full-sized avatar
💤

Michii Shunsuke harukasan

💤
View GitHub Profile
@harukasan
harukasan / Dockerfile
Created April 15, 2017 02:35
cryptcheck for pawoo.net
FROM debian:jessie
RUN apt-get update && apt-get install -y openssl git ruby ruby-dev build-essential ruby-dev libxml2-dev libxslt-dev libz-dev wget
RUN cd / && git clone https://github.com/aeris/cryptcheck.git
WORKDIR /cryptcheck
RUN gem install --no-ri --no-doc bundler
@harukasan
harukasan / README.md
Last active October 28, 2015 05:26
Fixtureを複数使ったときにテストがこける

エラーメッセージ:

$ sbt test
[info] Loading global plugins from /Users/harukasan/.sbt/0.13/plugins
[info] Loading project definition from /Users/harukasan/repo/play-test/project
[info] Set current project to play-test (in build file:/Users/harukasan/repo/play-test/)
[info] Compiling 1 Scala source to /Users/harukasan/repo/play-test/target/scala-2.11/test-classes...
[info] - play.api.libs.concurrent.ActorSystemProvider - Starting application default Akka system: application
[info] - play.api.libs.concurrent.ActorSystemProvider - Shutdown application default Akka system: application
@harukasan
harukasan / README.md
Last active August 29, 2015 14:22
ログを書き込むスレッドをチャネル経由で制御する

ゴルーチンをつかってスレッドを作って非同期にするとき、そのスレッドをチャネル経由で制御するデモ。 気が向いたら説明を付加するけど、だいたいわかると思う。

Files

  • LogWriter.go
  • main.go
@harukasan
harukasan / set_smp_affinity.sh
Last active August 29, 2015 14:18
RSS対応NICの各キューをCPUコアに割り当てる
# /etc/network/interface
# post-upに指定しておく
iface eth0 inet static
address 192.2.0.10
netmask 255.255.255.0
network 192.2.0.0
broadcast 192.2.0.255
gateway 192.2.0.1
post-up /var/scripts/set_irq_affinity.sh > /dev/null
#!/bin/sh
script_dir=$(cd $(dirname $0) && pwd)
norikra_dir=$(cd "$script_dir/../lib/norikra" && pwd)
shared_dir=$(cd "$script_dir/../shared" && pwd)
log_dir=/var/log/norikra
pid_file="$shared_dir/norikra.pid"
full_dir=$(cd "$norikra_dir" && pwd)
@harukasan
harukasan / Gemfile
Created December 13, 2013 10:53
何故か再現しないnorikraとfluent-plugin-norikraの依存rack不一致
source "https://rubygems.org"
platforms :ruby do
gem "fluentd"
gem "fluent-plugin-norikra"
gem "fluent-plugin-dummydata-producer"
end
platforms :jruby do
#
# Auto typecast
# =============
#
# Ref:: http://y-ken.hatenablog.com/entry/fluentd-parser-auto-type-conversion
#
# ちなみにこの方法だとApacheとかNginxのログで、"-"とかが流れたときにIntegerとStringが混ざって死ぬ。
#
module Fluent
@harukasan
harukasan / example
Last active December 18, 2015 04:39
Muninのグラフを修正したかった。 ref: http://qiita.com/items/70cbb6df4b70a704eaaa
$ sudo ./modify_rrd.sh /var/lib/munin/example.com/example2-if_eth0-up-c.rrd
@harukasan
harukasan / out_forward_with_hostname.rb
Last active December 12, 2015 00:08
Forwardプラグインで投げるときにホスト名を追加する
#
# Forward with hostname
#
# harukasan <harukasan@pixiv.com>
#
# == configure
# key (optional):: キー名(default: host)
#
class ForwardWithHostnameOutput < Fluent::ForwardOutput
@harukasan
harukasan / gist:2292975
Created April 3, 2012 15:36
最前面のTerminal.appでコマンドを入力した実行するAlfreadスクリプト
on alfred_script(q)
set command to q
tell application "Terminal"
activate
do script command in front window
end tell
end alfred_script