AWS で動いている nginx のログを fluentd で S3 に転送している状態で、 ログを Elastic Search に飛ばして Kibana 3 で眺めるまでの流れ。
- 拠点からの80番と9200番を許可(443にできるなら443で)
- ログを発生させるサーバからの9200番を許可
AWS で動いている nginx のログを fluentd で S3 に転送している状態で、 ログを Elastic Search に飛ばして Kibana 3 で眺めるまでの流れ。
| rem for ckw | |
| start %~dp0ckw\ckw.exe -x "CMD /K cd %USERPROFILE%\git\myproj && set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_25 && PATH=C:\Program Files\Java\jdk1.7.0_25\bin;%PATH%;C:\Ruby200\bin;%APPDATA%\npm;C:\Program Files\nodejs-v0.10.22" | |
| rem for PowerShell | |
| powershell -NoExit -Command "cd $env:USERPROFILE\git\myproj; $env:JAVA_HOME = \"C:\Program Files\Java\jdk1.7.0_25\"; $env:PATH = \"C:\Program Files\Java\jdk1.7.0_25\bin;$env:PATH;C:\Ruby200\bin;$env:APPDATA\npm;C:\Program Files\nodejs-v0.10.22\"" |
| @echo off | |
| goto checkaws | |
| :: | |
| :: apidoc のインストールチェック | |
| :: | |
| cmd /C apidoc -h >NUL 2>&1 | |
| if not errorlevel 1 goto runapidoc |
| import javax.crypto.Cipher; | |
| import java.security.NoSuchAlgorithmException; | |
| public class KeyLengthDetector { | |
| public static void main(String[] args) { | |
| String transformation = "AES"; | |
| if (args.length >= 1) transformation = args[0]; | |
| int allowedKeyLength = 0; | |
| try { |
| #!/bin/sh -eu | |
| git update-server-info | |
| APP_HOME=/home/rch850/hogeapp | |
| APP_BRANCH=develop | |
| PIDFILE=$APP_HOME/node.pid | |
| export GIT_DIR=$APP_HOME/.git | |
| (cd $APP_HOME && git --git-dir=.git pull && git checkout $APP_BRANCH) |
| public class RawJsonBodyParser extends Action.Simple { | |
| @Override | |
| public Result call(Context ctx) throws Throwable { | |
| String rawBody = new String(ctx.request().body().asRaw().asBytes()); | |
| JsonNode json = Json.parse(rawBody); | |
| ctx.args.put("json", json); | |
| return delegate.call(ctx); | |
| } | |
| REGEX="id=123[^0-9]" | |
| echo "id=123" | grep $REGEX &>/dev/null && echo PASS | |
| echo "id=123&a=b" | grep $REGEX &>/dev/null && echo PASS | |
| echo "id=1234&a=b" | grep $REGEX || echo PASS | |
| echo "id=1234" | grep $REGEX || echo PASS |
| #!/bin/sh | |
| nc -w 10 $IRC_SERVER 6667 << EOF &>/dev/null | |
| PASS $IRC_PASS | |
| NICK $IRC_NICK | |
| USER $IRC_NICK 8 * : $IRC_NICK | |
| JOIN $IRC_CH | |
| PRIVMSG $IRC_CH : $1 | |
| QUIT | |
| EOF |