https://github.com/sharpstone/rack-timeout 使う
Gemfile
group :development do
gem 'rack-timeout'
end
.env
# { 'Org' => ['id:integer','name:string'], | |
# 'User' => ['id:integer','email:string'] } | |
# | |
# NOTE: If there is no corresponding model in the DB, it will warn. | |
err = [] | |
ActiveRecord::Base.connection.tables.each_with_object({}) do |table_name, hash| | |
begin | |
next if table_name == 'schema_migrations' | |
next if table_name == 'ar_internal_metadata' |
# wiki は repo とは別のリポジトリになっている。 | |
# github uri => https://github.com/[user or org]/[repo].wiki.git | |
# clone the wiki | |
git clone https://github.com/[user or org]/[repo].wiki.git | |
# rm .git folder | |
rm -rf .git | |
# 初期化 |
# 20s 以上かかった 200 OK のリクエストログ行を出力 | |
fields @timestamp, @message | |
| filter @message like /Completed 200 OK in / | |
| parse '*, [* *] * -- : [*] Completed 200 OK in *ms (*)' as key,ts,hash,level,req_hash,ms,detail | |
| display key,ts,hash,level,req_hash,ms,detail | |
| filter (ms>20000) | |
# https://docs.aws.amazon.com/ja_jp/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html |
https://github.com/sharpstone/rack-timeout 使う
Gemfile
group :development do
gem 'rack-timeout'
end
.env
# ホストにインストールされているセキュリティー更新の表示 | |
yum updateinfo list sec | |
# 再起動が必要か, 要 yum-utils パッケージ | |
needs-restarting -s | sort |
# profile 定義ファイル | |
`cat ~/.aws/credentials` | |
# profile 指定 | |
`aws s3 ls --profile PROFILE_NAME` | |
# リージョン 指定 | |
`AWS_DEFAULT_REGION=ap-northeast-1 aws s3 ls` | |
# Service 情報表示 |
brew install source-highlight # https://www.gnu.org/software/src-highlite/ | |
export LESSOPEN='| /usr/local/bin/src-hilite-lesspipe.sh %s' | |
export LESS='-R' |
// make understanding this https://codepen.io/aanjulena/pen/ZLZjzV | |
// toggle button ==================================================================== | |
// Toggle Sizes | |
@toggle-default-size: 1.5rem; | |
@toggle-default-label-width: 4rem; | |
@toggle-default-font-size: .75rem; | |
.btn-toggle { | |
// top: 50%; |
#!/bin/sh | |
# exec by cron | |
# * * * * * /home/app/cron/sidekiq-killer.sh >> /var/log/cronlog/cron.log 2>&1 | |
# if use pid, get sidekiq-0.pid | |
# PID=`cat /var/www/app/shared/tmp/pids/sidekiq-0.pid` | |
count=`ps aux | grep -v grep | grep sidekiq | grep 'busy] stopping' | wc -l` | |
pid=`ps aux | grep -v grep | grep sidekiq | grep 'busy] stopping' | awk '{print $2}'` |