Skip to content

Instantly share code, notes, and snippets.

innodb_buffer_pool_size=32M
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
character-set-server=utf8
default-time-zone='+9:00'
skip-character-set-client-handshake
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: db_name
pool: 5
username: user_name
password: pass
host: localhost
socket: /var/lib/mysql/mysql/mysql.sock
@hoshinaoshi
hoshinaoshi / CarrierWave_auto_orient!
Created November 24, 2013 16:56
How to fix it to appear (image) is rotated uploaded photos in CarrierWave
class ImageUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick
process :fix_exif_rotation
def fix_exif_rotation
manipulate! do |img|
img.auto_orient!
img = yield(img) if block_given?
img
end
@hoshinaoshi
hoshinaoshi / gist:8542943
Created January 21, 2014 16:08
Apache バーチャルホストの設定
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/www/example/app_nameA/public"
ServerName "site_A"
RailsMaxPoolSize 7
RailsEnv production
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
cp -r three.js-master/utils/exporters/blender/2.65/scripts/addons/ /Applications/blender.app/Contents/MacOS/2.69/scripts/addons/
require 'rubygems'
require 'active_merchant'
ActiveMerchant::Billing::Base.mode = :test
# ActiveMerchant の金額はセント単位の整数でInputするため、日本円の場合は*100しなければならない。
# ¥1,000
amount = 100000
# カードセキュリティコードで使用できるのはCVV2, CVC2, CID
gateway.cancel_recurring(account_id: account_id)
def gon
if wrong_gon_request?
gon_request = Request.new(env)
gon_request.id = request.uuid
Thread.current['gon'] = gon_request
end
Gon
end
# sudo パスワード設定
sudo passwd
# vim 設定
sudo yum -y install vim-enhanced
#vim ~/.vimrc
# git
sudo yum -y install git-core
git config --global user.name “u name"
sudo yum install -y openssl-devel openssl mod_ssl
mkdir /usr/local/ssl
cd /usr/local/ssl
# 乱数ファイル生成
openssl md5 * > rand.dat
# 秘密鍵生成
# 作成するときにパスフレーズを聞かれるので、必ずメモっておくこと。
# apache起動するときにこれがないと起動できなくなる。
openssl genrsa -rand rand.dat -des3 2048 > mykey.pem
openssl req -new -key mykey.pem -out mycsr.pem