Skip to content

Instantly share code, notes, and snippets.

View khamanaka's full-sized avatar

HAMANAKA, Kei khamanaka

View GitHub Profile
@khamanaka
khamanaka / install-apache.txt
Created August 29, 2010 10:17
install apache
cd /usr/local/src/
wget http://ftp.kddilabs.jp/infosystems/apache/httpd/httpd-2.2.17.tar.gz
tar xzvf httpd-2.2.17.tar.gz
cd httpd-2.2.17
./configure --prefix=/usr/local/apache2.2.16 --enable-mods-shared=all --enable-module=all --with-mpm=worker --enable-module=all --enable-ssl --enable-deflate
make
make install
mkdir /service
@khamanaka
khamanaka / install-ruby.txt
Created August 29, 2010 10:34
install ruby
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )
rvm install 1.8.7
rvm use 1.8.7 --default
yum install gcc-c++
gem install passenger
cd /usr/local/rvm/gems/ruby-1.8.7-p302/gems/passenger-2.2.15/bin
./passenger-install-apache2-module --apxs2-path=/usr/local/apache2.2.16/bin/apxs --apr-config-path=/usr/local/apache2.2.16/bin/apr-1-config
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.8.7-p302/gems/passenger-2.2.15/ext/apache2/mod_passenger.so
#! /usr/bin/env ruby
# NIFTY Cloud API - DescribeInstances
# Author:: Kei HAMANAKA <kei.hamanaka (at) gmail.com>
# License:: Distributes under the same terms as Ruby
require 'uri'
require 'time'
require 'net/https'
require 'cgi'
require 'openssl'
#! /usr/bin/env ruby
require 'benchmark'
require 'net/http'
REQUEST_URI_BASE = URI.parse('http://www.yahoo.co.jp/')
def http_request(uri)
http = Net::HTTP.new(uri.host, uri.port)
http.start do |request|