This file contains 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
FROM mysql:5.7 | |
ARG custom_cnf | |
COPY $custom_cnf /etc/mysql/conf.d/custom.cnf |
This file contains 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
FROM mysql:5.7 | |
COPY ./charset.cnf /etc/mysql/conf.d/charset.cnf |
This file contains 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 'optparse' | |
require 'net/http' | |
require 'aws-sdk-resources' | |
# bundle exec ruby cloudwatch_put_process.rb --process nginx | |
opts = ARGV.getopts('', 'process:') | |
process = opts['process'] | |
METADATA_ENDPOINT = 'http://169.254.169.254/latest/meta-data' | |
instance_id = Net::HTTP.get(URI.parse("#{METADATA_ENDPOINT}/instance-id")) |
This file contains 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
namespace :db do | |
desc 'S3へのDBバックアップ' | |
task backup: :environment do | |
# loggerの設定 | |
logger = Logger.new('log/cron.log', 5, 10.megabytes) | |
logger.info('start db:backup') | |
t = Time.current | |
backup_file = "tmp/backups/#{t.strftime('%Y-%m-%d')}_dbname.dump" | |
This file contains 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
*filter | |
# 受信/転送を破棄・送信を許可 | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT ACCEPT [0:0] | |
# ループバックアドレスからの送受信を許可 | |
-A INPUT -i lo -j ACCEPT | |
-A OUTPUT -o lo -j ACCEPT |
This file contains 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
<% @hoges.each do |hoge| %> | |
<%= hoge %> | |
<% end %> |
This file contains 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
<%= f.submit %> |
This file contains 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
<ul class="nav"> | |
<li class="<%= active_class_for('controller1') %>"><a href="#">Controller1</a></li> | |
<li class="<%= active_class_for('controller2') %>"><a href="#">Controller2</a></li> | |
<li class="<%= active_class_for('controller3') %>"><a href="#">Controller3</a></li> | |
</ul> |
This file contains 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
config.action_view.field_error_proc = proc { |html_tag, instance| "<div class='has-error'>#{html_tag}</div>".html_safe } |
This file contains 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
<% if errors.any? %> | |
<div class="alert alert-danger" role="alert"> | |
<ul> | |
<% errors.full_messages.each do |message| %> | |
<li><%= message %></li> | |
<% end %> | |
</ul> | |
</div> | |
<% end %> |
NewerOlder