user root admin;
worker_processes 1;
# pid of nginx master process
pid /var/run/nginx.pid;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'date' | |
author = "Saito" | |
email = "[email protected]" | |
date = Date.new(2012, 7, 30) | |
s = %w{ | |
. . . . . . . | |
. . o o o . . | |
. o . . . . . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100.times do | |
sleep 1 | |
system("git clone http://127.0.0.1:9292/hanwen.git /Users/saito/Develop/grack-test/#{Time.now.to_i}") | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.ssh/config | |
#attempts | |
ConnectionAttempts 10 | |
#allow 30*120 = 1 hour down time | |
ServerAliveInterval 30 | |
ServerAliveCountMax 120 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require'grit' | |
repo = Grit::Repo.new(".") #=> #<Grit::Repo "/Users/saito/hanwen/.git"> | |
# check_applies => 0(can apply) or 1(can not) | |
repo.git.check_applies("master", "new") #=> 0 | |
patch = repo.git.get_patch("new") #=> raw_patch | |
# apply_patch => tree_sha | |
repo.git.apply_patch("master", patch) #=> "c9a4861d9b3229974a0b1b05b87583ab3a887629" | |
# commit => commit_sha | |
# commit_message, array_of_commit, actor, tree_sha, head |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: stampWait: Overflowed checking for stamp 0x39eb098 on MAIN ring: called from | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: timestamp = 0x39eb096 | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: **** Debug info for *possible* hang in MAIN graphics engine **** | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: ring head = 0xa0e045d8, wrap count = 1287 | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: ring tail = 0x00004c48 | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: ring control = 0x0000f401 enabled, auto report disabled, not waiting, semaphore is waiting, length = 0x010 4KB pages | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: timestamps = 0x39eb096 | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: Semaphore register values: | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: VRSYNC: (0x12044) = 0x39eb096 | |
Aug 31 15:09:01 Saitos-MacBook-Pro kernel[0]: BRSYNC: (0x22040) = 0x0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# unicorn | |
# tee_input.rb 36L | |
@tmp = @len && @len <= @@client_body_buffer_size ? | |
StringIO.new("") : Unicorn::TmpIO.new | |
# Puma | |
# client.rb 106L | |
if remain > MAX_BODY |
~ ❯ gem i rails -V ⏎
GET http://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://rubygems.org/specs.4.8.gz
302 Moved Temporarily
GET http://production.s3.rubygems.org/specs.4.8.gz
200 OK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install | |
# git clone https://github.com/SaitoWu/grack.git | |
# cd grack | |
# rake install | |
require 'grack' | |
config = { | |
:project_root => "/Users/saito/Develop/Repositories/", | |
:git_path => '/usr/bin/git', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rack' | |
require 'rack/auth/basic' | |
class HelloWorld | |
def call(env) | |
[200, {"Content-Type" => "text/html"}, "Hello World!"] | |
end | |
end | |
class WorldHello |