Skip to content

Instantly share code, notes, and snippets.

View kzk's full-sized avatar
🍶

Kazuki Ohta kzk

🍶
View GitHub Profile
@kzk
kzk / gist:1108620
Created July 27, 2011 03:34
mapred.patch
/usr/src/hadoop-0.20$ diff -u ./mapred/org/apache/hadoop/mapred/ReduceTask.java.orig ./mapred/org/apache/hadoop/mapred/ReduceTask.java.new
--- ./mapred/org/apache/hadoop/mapred/ReduceTask.java.orig 2011-07-27 03:32:11.000000000 +0000
+++ ./mapred/org/apache/hadoop/mapred/ReduceTask.java.new 2011-07-27 03:32:35.000000000 +0000
@@ -1014,8 +1014,8 @@
maxInMemCopyUse);
}
// Allow unit tests to fix Runtime memory
- maxSize = (int)(conf.getInt("mapred.job.reduce.total.mem.bytes",
- (int)Math.min(Runtime.getRuntime().maxMemory(), Integer.MAX_VALUE))
+ maxSize = (long)(conf.getLong("mapred.job.reduce.total.mem.bytes",
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
$ rvm install jruby-1.6.4
$ rvm jruby-1.6.4
$ ruby --version
jruby 1.6.4 (ruby-1.8.7-p330) ...
$ gem install rails
$ rails new myapp
$ rails new myapp
$ cd myapp
$./script/rails s
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-09-04 15:06:54] INFO WEBrick 1.3.1
platforms :jruby do
# Trinidad
gem 'trinidad'
end
---
port: 3000
jruby_min_runtimes: 1 # min number of runtimes
jruby_max_runtimes: 1 # max number of runtimes
web_apps:
default:
extensions:
# Enable threaded mode
config.threadsafe!
$ export JRUBY_OPTS='--1.8 --server -J-Xmx1024m'
$ trinidad -e development -f config/trinidad.yml
2011/09/04 15:16:30 org.apache.coyote.AbstractProtocolHandler init
情報: Initializing ProtocolHandler ["http-bio-3000"]
2011/09/04 15:16:30 org.apache.catalina.core.StandardService startInternal
情報: Starting service Tomcat
2011/09/04 15:16:30 org.apache.catalina.core.StandardEngine startInternal
情報: Starting Servlet Engine: Apache Tomcat/7.0.11
2011-09-04 15:16:30 INFO: No global web.xml found
2011-09-04 15:16:32 INFO: Info: received max runtimes = 1
knife bootstrap 192.168.1.14 -N staging_td-worker --ssh-user ubuntu --ssh-password ubuntu --sudo -E staging -r 'role[base]'
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet manual
mkdir heroku-tornado
cd heroku-tornado
virtualenv --no-site-packages .
source bin/activate
./bin/pip install pycurl==7.16.4
./bin/pip install simplejson
./bin/pip install tornado
./bin/pip install gunicorn