Here's a preliminary experiment to see how much memory is saved with the new copy-on-write friendly (bitmap marking) GC.
Calculated by memstats.rb https://gist.github.com/kenn/5105061 on Debian x86_64.
# ./memstats.rb 20547
upstream application-unicorn { | |
# Unicornのソケットを指定: | |
server unix:/tmp/unicorn_{application}.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name HOSTNAME; | |
client_max_body_size 4G; |
#! /usr/bin/env ruby | |
# coding: utf-8 | |
def has_magic_comment?(content) | |
if content.lines.first =~ /\A#!/ | |
first_line = content.lines.take(2).last | |
else | |
first_line = content.lines.first | |
end | |
comment = first_line.sub(/(?:\"(?:[^"]|\\\")*\"|\'(?:[^']|\\\')*\'|[^#]*)#/, '').strip |
Here's a preliminary experiment to see how much memory is saved with the new copy-on-write friendly (bitmap marking) GC.
Calculated by memstats.rb https://gist.github.com/kenn/5105061 on Debian x86_64.
# ./memstats.rb 20547
describe "hoge" do | |
bofore do | |
get "index" , value | |
end | |
context "範囲内に収まるパラメータがくる" do | |
let (:value) { 123 } | |
it { response.should eq true } | |
end | |
context "範囲内に収まっていないパラメータがくる" do | |
let (:value) { 123456 } |
def capture(options={}) | |
out = options[:out] | |
err = options[:err] || :out | |
stdout_old = $stdout.dup | |
stderr_old = $stderr.dup | |
$stdout.reopen out | |
err = $stdout if err == :out |
#!/bin/sh | |
# | |
# 256色のカラーパレットを表示する | |
# bash と zsh にて実行可能 | |
# | |
target_shell=$1 | |
if [ -z "$1" ]; then | |
target_shell=$(basename "$SHELL") |
#!/bin/sh | |
# | |
# chkconfig: - 88 12 | |
# | |
# init.d script for single or multiple unicorn installations. Expects at least one .env | |
# file in /etc/unicorn | |
# | |
## A sample /etc/unicorn/production.env | |
## | |
## RAILS_ENV=production |
# 元の動画をトリミング | |
ffmpeg -i DSC_3872.avi -vcodec copy -acodec copy -ss '00:00:04.33' -t '00:00:05.48' trim01.avi | |
# 横幅500px(tumblrの上限)にリサイズしつつ animated gif に変換 | |
convert -resize 500 trim01.avi trim01.gif | |
# 明るさ・コントラストをいじりつつ63色に減色(クロップ処理後に1MBに収まるように色数調整) | |
convert -brightness-contrast 40x40 -colors 63 trim01.gif trim01-v3.gif | |
# 横3x縦2にクロップする(画像同士の間隔は10px) | |
convert -crop 160x135+0+0 +repage trim01-v3.gif trim01-v3-1.gif | |
convert -crop 160x135+170+0 +repage trim01-v3.gif trim01-v3-2.gif | |
convert -crop 160x135+340+0 +repage trim01-v3.gif trim01-v3-3.gif |
# These modules should be loaded by default: proxy_module, proxy_balancer_module, rewrite_module | |
Listen *:80 | |
# You may want to keep the VirtualHost config under extra/*.conf | |
# Start your thin | |
<VirtualHost *:80> | |
ServerName wwww.yourawesomeapp.dev |