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
# logサーバ用の設定 | |
<source> | |
type forward | |
port 24224 | |
</source> | |
<match maillog> | |
type mongo | |
database mail | |
collection log |
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
# appサーバ用の設定 | |
<source> | |
type tail | |
path /var/log/nginx/access.log | |
format apache | |
tag nginx.access | |
pos_file /var/log/td-agent/nginx.pos | |
</source> | |
<match nginx.access> |
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
/bin/cat <<'EOF'> /etc/yum.repos.d/td.repo | |
[treasuredata] | |
name=TreasureData | |
baseurl=http://packages.treasure-data.com/redhat/$basearch | |
gpgcheck=0 | |
EOF | |
yum -y update | |
yum -y install td-agent | |
/etc/init.d/td-agent start |
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
diff --git a/.gitignore b/.gitignore | |
index 68a6830..7537414 100644 | |
--- a/.gitignore | |
+++ b/.gitignore | |
@@ -4,7 +4,6 @@ | |
.gist-cache | |
.pygments-cache | |
_deploy | |
-public | |
sass.old |
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
#============================= | |
# rbenv | |
#============================= | |
if [ -d ${HOME}/.rbenv ] ; then | |
PATH=${HOME}/.rbenv/bin:${PATH} | |
export PATH | |
eval "$(rbenv init -)" | |
fi |
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
brew install \ | |
https://raw.github.com/gist/721952/e99293dc36c9b5c27aec0a4024b848ce50b9b126/vim.rb \ | |
--enable-interp=ruby --force |
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
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'webrick' | |
include WEBrick | |
server = HTTPServer.new( | |
:DocumentRoot => File.join(Dir.pwd, "."), | |
:Port => 10080 | |
) |
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
#compdef ss | |
# ------------------------------------------------------------------------------ | |
# Description | |
# ----------- | |
# | |
# Completion script for ss | |
# | |
# Source: https://github.com/glidenote/ss-zsh-completion | |
# | |
# ------------------------------------------------------------------------------ |
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
compdef _hogecmd hoge | |
function _hogecmd { | |
local -a cmds | |
if (( CURRENT == 2 ));then | |
cmds=('init' 'update' 'upgrade' 'commit') | |
_describe -t commands "subcommand" cmds | |
else | |
_files | |
fi |
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
# 直近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件を表示。 |