This file contains hidden or 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
cat > Dockerfile <<EOF | |
# 上位イメージとして正式な Node ランタイムを使用します | |
FROM node:6 | |
# コンテナの作業ディレクトリを /app に設定します | |
WORKDIR /app | |
# 現行ディレクトリの内容を /app のコンテナにコピーします | |
ADD . /app | |
# コンテナのポート 80 で外部からアクセスできるようにします | |
EXPOSE 80 | |
# コンテナの起動時に node を使用して app.js を実行します |
This file contains hidden or 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
-- SHOWQ command to check all parameters or just one | |
SHOW ALL; | |
SHOW max_connection; | |
SHOW config_file; | |
-- Pattern searchable | |
\x | |
SELECT |
This file contains hidden or 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
#build | |
docker build -t {image_name} . | |
docker-compose build | |
docker-compose build --no-cache | |
#run | |
docker-compose up -d #background | |
# or | |
docker ps |
This file contains hidden or 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
#only check auto vacuum | |
select n_live_tup,n_dead_tup,relname,last_autovacuum,last_autoanalyze,autovacuum_count,autoanalyze_count from pg_stat_all_tables where schemaname = 'hogehoge'; |
This file contains hidden or 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
while true; date "+%Y%m%d-%H:%M:%S" | tr '\n' ' '; do netstat -ant | grep -c "5432.*ESTABLISHED"; sleep 5s; done; |
This file contains hidden or 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
while true; date "+%Y%m%d-%H:%M:%S"; do ~/redis-stable/src/redis-cli -h redis-endpoint -p 6379 info; sleep 5s; done; |
This file contains hidden or 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
cat tablelist.txt | while read line; do line=`echo ${line} | sed -e "s/[\r\n]\+//g"`; echo 'SELECT '"'${line}'"' AS TableName, COUNT(*) FROM '${line}' UNION ALL' >> select.sql; done |
This file contains hidden or 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
gawk -F, 'BEGIN{OFS=","}{print $2,$4,$8,$9}' {filename} | gawk 'seen[$0]++' |