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
$ cat ACCESS_LOG | awk '$4 >= "[29/Jan/2012:12:00:00" && $4 < "[29/Jan/2012:13:00:00"' |
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
select sql_exec_start,username,machine,module,program, | |
(select px.QCSID||','||px.QCSERIAL# ||',@'||px.QCINST_ID from gv$px_session px where px.sid=vs.sid and px.serial#=vs.serial#) as QC_info, | |
(select substr(sql_text,1,80) from gv$sql vsql where vsql.sql_id = vs.sql_id and rownum = 1) as SQLTEXT | |
from v$session vs | |
where | |
vs.sql_exec_start < SYSDATE - 1 / 48 | |
and | |
EXISTS ( | |
SELECT | |
1 |
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
#!/bin/env perl | |
# pachi | |
# | |
# This script find out process currently swapped by /proc/$PID/status | |
use strict; | |
use warnings; | |
# When you want to debug, you should exec "export SCRIPT_DEBUG=1". | |
my $debug = $ENV{SCRIPT_DEBUG} ? 1 : 0; | |
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
<Location /> | |
### COMPRESS EVERYTHING EXCEPT IMAGES >> ### | |
# Insert filter | |
SetOutputFilter DEFLATE | |
# Netscape 4.x has some problems... | |
BrowserMatch ^Mozilla/4 gzip-only-text/html | |
# Netscape 4.06-4.08 have some more problems | |
BrowserMatch ^Mozilla/4\.0[678] no-gzip |
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
#!/bin/sh -e | |
TODAY=`date +%Y%m%d` | |
if [ $# -eq 1 ] | |
then | |
TARGET_DATE=$1 | |
else | |
TARGET_DATE=`date -d "1 day ago" +%Y%m%d` |
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
#!/usr/bin/perl | |
### | |
### ApacheのCombined + %D 形式のアクセスログから1秒毎の同時接続数を集計するスクリプト。 | |
### タイムスタンプを接続が開始された時刻とみなして、%D の間は接続が維持されているものとする。 | |
### 結果はあくまで参考値。 | |
### スクリプトと同じディレクトリに access_log をおいてから実行する。 | |
### | |
use strict; |
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
ExpiresActive On | |
ExpiresDefault A0 | |
Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform" | |
Header set Pragma "no-cache" | |
ErrorDocument 503 /maintenance/index.html | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} !^/maintenance/.*$ | |
RewriteRule ^.*$ - [R=503,L] |
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
#!/bin/sh | |
LANG=C | |
/bin/gawk -F"\t" '$0 !~ /^#/ { | |
## make epochtime from timestamp | |
split($1, d, "-"); | |
split($2, t, ":"); | |
timestamp=d[1]" "d[2]" "d[3]" "t[1]" "t[2]" "t[3]; | |
epochtime=mktime(timestamp); |
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
## Rx | |
$ LANG=C sudo sar -n DEV | grep eth0 | grep -v Average | awk '{print $1, $5*8/1048576}' | |
## Tx | |
$ LANG=C sudo sar -n DEV | grep eth0 | grep -v Average | awk '{print $1, $6*8/1048576}' | |
# Ex. | |
$ LANG=C sudo sar -n DEV -f /var/log/sa/sa24 | grep eth0 | grep -v Average | awk '{print $1, $6*8/1048576}' | |
... | |
23:20:01 4.32473 |
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
$ cat ACCESS_lOG | awk '{bytes = bytes + $10} END {print bytes/1048576}' |
NewerOlder