This file contains hidden or 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
#!/bin/sh | |
volume="$1" | |
snapshot=`ec2-create-snapshot $volume | cut -f 2` | |
status="pending" | |
while [ "$status" = "pending" ]; do | |
sleep 300 | |
status=`ec2-describe-snapshots $snapshot | cut -f 4` | |
done |
This file contains hidden or 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
# login as root | |
naoty@local% ssh-keygen -R xxx.xxx.xxx.xxx | |
naoty@local% ssh [email protected] | |
# add admin user | |
root@sakura% useradd naoty | |
root@sakura% passwd naoty | |
# limit su, sudo | |
root@sakura% usermod -G wheel naoty |
This file contains hidden or 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
#!/bin/ruby | |
require "rubygems" | |
require "twitter" | |
Twitter.configure do |config| | |
config.consumer_key = "CONSUMER KEY" | |
config.consumer_secret = "CONSUMER SECRET" | |
config.oauth_token = "ACCESS TOKEN" | |
config.oauth_token_secret = "ACCESS TOKEN SECRET" |
This file contains hidden or 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
worker_processes 2 | |
listen File.expand_path("tmp/sockets/unicorn.sock", ENV["RAILS_ROOT"]) | |
pid File.expand_path("tmp/pids/unicorn.pid", ENV["RAILS_ROOT"]) | |
stdout_path File.expand_path("log/unicorn.log", ENV["RAILS_ROOT"]) | |
stderr_path File.expand_path("log/unicorn.log", ENV["RAILS_ROOT"]) |
This file contains hidden or 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
upstream gitlabhq { | |
server unix:/home/naoty/gitlabhq/tmp/sockets/unicorn.sock; | |
} | |
server { | |
listen 80; | |
server_name repo.naoty.jp; | |
location / { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; |
This file contains hidden or 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
user naoty naoty; | |
worker_processes 2; | |
worker_cpu_affinity 01 10; | |
events { | |
multi_accept on; | |
worker_connections 128; | |
} | |
http { |
This file contains hidden or 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
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: 345 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
This file contains hidden or 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
source "http://rubygems.org" | |
gem "rails" | |
gem "unicorn" | |
gem "mysql2" | |
gem "devise" | |
gem "haml-rails" | |
gem "jquery-rails" | |
group :assets do |
This file contains hidden or 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_self | |
//= require_tree . | |
html { | |
background-color: #4B7399; | |
font-family: Verdana, Helvetica, Arial; | |
font-size: 14px; | |
} | |
body { |
This file contains hidden or 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
# 集合地プログラミングお勉強用コード | |
# テスト用データセット生成 | |
# k0h3yさんが分身して映画をレビューするお | |
# データセットの値が毎回変わるし、検算するの面倒 | |
#dataset = Hash.new | |
#["Kohey", "K0h3y", "Mr. Kohey", "St. Kohey", "Dr. Kohey"].each do |name| | |
# dataset.store(name, Hash.new) | |
# ["STAR WARS", "The Matrix", "The Shawshank Redemptation", "Before Sunrise", "The Notebook"].each do |tittle| | |
# dataset[name].store(tittle, rand(6).to_f) |