Skip to content

Instantly share code, notes, and snippets.

View kzk's full-sized avatar
🍶

Kazuki Ohta kzk

🍶
View GitHub Profile
# What the timeout for killing busy workers is, in seconds
timeout 60
# Whether the app should be pre-loaded
preload_app true
# How many worker processes
worker_processes 4
# before/after forks
web: bundle exec unicorn -c lib/unicorn/config.rb -p $PORT
gem "unicorn", "~> 4.3.1"
@kzk
kzk / td-synchronous-job-issue.rb
Created May 3, 2012 01:05
td-synchronous-job-issue.rb
require 'td'
require 'td-client'
cln = TreasureData::Client.new(ENV['TREASURE_DATA_API_KEY'])
job = cln.query('testdb', 'SELECT COUNT(1) FROM www_access')
until job.finished?
sleep 2
job.update_status!
end
if job.success?
#
# Example Input
#
# 1335851771|a|b
#
# Example Conf:
#
# <source>
# type tail_char_delim
# path /path/to/the/file1
#
# Example Input
#
# time=1335851771&a=b&c=d&d=e
#
# Example Conf:
#
# <source>
# type tail_kv
# path /path/to/the/file1
array(7) {
["stream_type"]=>
string(14) "tcp_socket/ssl"
["mode"]=>
string(2) "r+"
["unread_bytes"]=>
int(0)
["seekable"]=>
bool(false)
["timed_out"]=>
# Scribe input
<source>
type scribe
port 1463
</source>
# match tag=debug.** and dump to console
<match debug.**>
type null
</match>
@kzk
kzk / build.sbt
Created January 4, 2012 18:50
SBT's build.sbt for fluent-logger-java
// Repositories
resolvers ++= Seq(
"td-logger Maven2 Repository" at "http://treasure-data.com/maven2/",
"fluent-logger Maven2 Repository" at "http://fluentd.org/maven2/"
)
// Dependencies
libraryDependencies ++= Seq(
"com.treasure_data" % "td-logger" % "0.1.0"
)
@kzk
kzk / td-agent.conf.erb
Created December 19, 2011 07:13
default.rb
#
# Cookbook Name:: td-agent
# Recipe:: default
#
# Copyright 2011, YOUR_COMPANY_NAME
#
# All rights reserved - Do Not Redistribute
#
group 'td-agent' do