Skip to content

Instantly share code, notes, and snippets.

@glidenote
Created April 15, 2012 17:49
Show Gist options
  • Save glidenote/2394106 to your computer and use it in GitHub Desktop.
Save glidenote/2394106 to your computer and use it in GitHub Desktop.
sheet command
# 直近5000アクセス中、アクセスが集中しているURLを調べ、上位4件を表示。
tail -5000 /usr/local/apache2/logs/access_log|awk '{print $1}'|sort | uniq -c |sort -gr|head -n 4
# 直近5000アクセス中、アクセス元のIPアドレスを調べ、上位4件を表示。
tail -5000 /usr/local/apache2/logs/access_log|awk '{print $2}'|sort | uniq -c |sort -gr|head -n 4
# 直近5000アクセス中アクセスの多いリダイレクト元(アクセス元)を調べ、上位4件を表示。
tail -n 5000 /usr/local/apache2/logs/access_log | awk '{print $12}' | sort | uniq -c | sort -gr | head -n 4
# 直近5000アクセス中アクセスの多いU/Aを調べ、上位4件を表示。
tail -n 5000 /usr/local/apache2/logs/access_log | awk '{print $13}' | sort | uniq -c | sort -gr | head -n 4
# ユーザの確認
select user,host,password from mysql.user;
# レプリケーションエラー対応用
stop slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1;
start slave;
show slave status\G
# mk-slave-restart
mk-slave-restart -uroot -p --error-numbers 1062 --verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment