Skip to content

Instantly share code, notes, and snippets.

View chroju's full-sized avatar
👑
Keep Calm and Stay Home

Jutaro chroju

👑
Keep Calm and Stay Home
View GitHub Profile
@chroju
chroju / Capfile
Created April 12, 2014 11:19
汎用的Capfile
# vim: set ft=ruby :
# Load DSL and Setup Up stages
require 'capistrano/setup'
# Inculeds default deployment tasks
require 'capistrano/deploy'
# Bundler and Rails
require 'capistrano/bundler'
@chroju
chroju / staging.rb
Last active July 5, 2016 13:27
capistrano - config/deploy/staging.rb
set :stage, :staging
set :rails_env, 'staging'
server '127.0.0.1', port: 2222, user: 'vagrant', roles: %w{web app db}, ssh_options: {
keys: %w(~/.vagrant.d/insecure_private_key),
forward_agent: true,
auth_methods: %w(publickey)
}
@chroju
chroju / deploy.rb
Last active August 29, 2015 13:59
Capistrano - config/deploy.rb
# アプリケーション名
set :application, 'Rails-app'
# レポジトリURL
set :repo_url, 'git@github.com:chroju/Rails-app'
# デプロイ先ディレクトリ
set :deploy_to, '/var/www/Rails-app'
# SCMを指定
set :scm, :git
# logを詳細表示
@chroju
chroju / unicorn.cap
Last active August 29, 2015 13:59
Capistrano - lib/capistrano/tasks/unicorn.cap
# vim: set ft=ruby :
namespace :unicorn do
task :environment do
set :unicorn_pid, "#{shared_path}/tmp/pids/unicorn.pid"
set :unicorn_config, "#{current_path}/config/unicorn.rb"
set :rails_path, "/Rails-app"
end
def start_unicorn
@chroju
chroju / nginx.conf
Created April 12, 2014 13:02
sites-enabledを食わせる前提。
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
@chroju
chroju / nginx - Rails-app
Last active August 29, 2015 13:59
Nginx、sites-availableに配置、Railsをサブディレクトリ下で展開するための設定
upstream unicorn-of-my-app {
server unix:/var/www/Rails-app/shared/tmp/sockets/unicorn.sock;
}
server {
listen 80;
server_name www.chroju.com 192.168.1.1;
root /var/www/home;
access_log /var/log/nginx/home.log;
# -*- coding: utf-8 -*-
APP_PATH = "/var/www/Rails-app"
APP_SHARED_PATH = "#{APP_PATH}/shared"
# worker数
worker_processes 2
working_directory "#{APP_PATH}/current"
# Unix domain socket
listen "#{APP_SHARED_PATH}/tmp/sockets/unicorn.sock"
# ESCキーの効きを改善
set -s escape-time 0
# マウススクロールを許可
set-window-option -g mode-mouse on
# クリップボード設定
set-option -g default-command "reattach-to-user-namespace -l bash"
# 文字コード設定
# Default Theme
if patched_font_in_use; then
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="⮂"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="⮃"
TMUX_POWERLINE_SEPARATOR_RIGHT_BOLD="⮀"
TMUX_POWERLINE_SEPARATOR_RIGHT_THIN="⮁"
else
TMUX_POWERLINE_SEPARATOR_LEFT_BOLD="◀"
TMUX_POWERLINE_SEPARATOR_LEFT_THIN="❮"
# coding: utf-8
require 'rubygems'
require 'mechanize'
class SBIBank
attr_accessor :id, :password
def initialize(id, password)
@id = id
@password = password
end