Skip to content

Instantly share code, notes, and snippets.

View srockstyle's full-sized avatar

Shohei Kobayashi srockstyle

View GitHub Profile
@srockstyle
srockstyle / file0.txt
Created February 3, 2014 00:50
OSXからAmazon s3をマウントするには ref: http://qiita.com/srockstyle/items/05f125ef92e12dff38f4
brew install s3fs
gem install knife-github-cookbooks
@srockstyle
srockstyle / file0.txt
Created February 12, 2014 02:59
paperclipでS3にアップするとき「AWS::S3::Errors::PermanentRedirect」なんて怒られたら ref: http://qiita.com/srockstyle/items/50060606141b042355eb
AWS::S3::Errors::PermanentRedirect (The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.):」
@srockstyle
srockstyle / file0.txt
Created February 20, 2014 06:22
CentOSでMySQL5.5いれてマルチマスターレプリケーション組むまで ref: http://qiita.com/srockstyle/items/8bed9550be75bf2e5e14
## EpelとRemiを入れる
rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
@srockstyle
srockstyle / file1.txt
Created February 20, 2014 07:58
CentOSでMySQL5.5いれて準同期レプリケーション組むまで ref: http://qiita.com/srockstyle/items/aa6220a58ba9d8318155
GRANT REPLICATION SLAVE ON *.* TO 'slave-user'@'%' IDENTIFIED BY 'slave-password';
@srockstyle
srockstyle / file0.txt
Created March 13, 2014 02:23
passenger-install-nginx-moduleを自動で済ますには ref: http://qiita.com/srockstyle/items/107b51080ed745cdca14
passenger-install-nginx-module
@srockstyle
srockstyle / file0.txt
Last active December 15, 2017 07:08
Railsのマイグレーションでbigintを使うには ref: https://qiita.com/srockstyle/items/23a6add490933ae45252
t.integer ## 10桁までの数値
t.string ## 255文字までの文字列
@srockstyle
srockstyle / job_flow.rb
Last active August 29, 2015 14:00
Job_flowのaws-sdkを使った設定例 for Ruby
emr = AWS::EMR.new({
:access_key_id => AWS_ACCESS_KEY,
:secret_access_key => AWS_SECRET_KEY,
:region => "#{AWS_REGION}",
:emr_endpoint => "#{ENDPOINT_EMR}"
})
emr_result = emr.job_flows.create(
"#{BATCHNAME}", {
:log_uri => "s3://#{S3BUCKET}/batch_logs",
:ami_version => 'latest',
@srockstyle
srockstyle / file0.txt
Created June 23, 2014 06:00
RailsでJSやCSSのファイル名の最後に?body=1みたいなパラメータをつけない方法 ref: http://qiita.com/srockstyle/items/b726f17d89ca8f17d56e
# ここをかえると開発のときbodyパラメーをつけるかつけないか変えられる。知らなかったぜ! 属性かくにん!
config.assets.debug = false
@srockstyle
srockstyle / file0.rb
Created September 25, 2014 02:05
AWS-SDK for RubyからELB直下のインスタンスのpublic DNSを一括取得するには ref: http://qiita.com/srockstyle/items/7b72a56bc0ac02953164
#!/usr/bin/ruby
require "aws-sdk"
require "pp"
AWS.config(
access_key_id: '******',
secret_access_key: '******',
ec2_endpoint: '[環境に合わせてください]',
elb_endpoint: '[環境にあわせてください]'
)