Skip to content

Instantly share code, notes, and snippets.

View shoji-mochizuki's full-sized avatar

shoji mochizuki shoji-mochizuki

View GitHub Profile
@shoji-mochizuki
shoji-mochizuki / file0.txt
Last active August 29, 2015 14:26
mycliでMySQLコマンドの補完機能を簡単に使う ref: http://qiita.com/shojimotio/items/efc8fce9ce3ebe179897
mysql root@localhost:wordpressdb> SELECT * FROM
wp_commentmeta
wp_comments
wp_links
wp_options
wp_postmeta
wp_posts
wp_term_relationships
@shoji-mochizuki
shoji-mochizuki / .bashrc
Last active August 29, 2015 14:25
CrontabでEC2を指定の時間にシャットダウンさせる ref: http://qiita.com/shojimotio/items/65f769ef92cc0b7c752b
# crontab -e(編集)と-r(削除)の押し間違い防止
alias crontab='crontab -i '
@shoji-mochizuki
shoji-mochizuki / file0.txt
Last active August 29, 2015 14:22
VPC Flow Logsを早速設定してみた ref: http://qiita.com/shojimotio/items/4130ac53aa5ad5e9f62c
アカウント、IP値はマスクしています
2 999999999999 eni-99999999 218.77.zzz.zzz xxx.xxx.xxx.xxx 58065 22 6 1 40 1434068602 1434068662 REJECT OK
2 999999999999 eni-99999999 95.181.zzz.zzz xxx.xxx.xxx.xxx 39990 22 6 4 24 1434069322 1434069382 REJECT OK
@shoji-mochizuki
shoji-mochizuki / composer.json
Created May 29, 2015 06:34
AWS SDK for PHPのVersion 3に更新して、EC2自動起動処理を書き換えてみた ref: http://qiita.com/shojimotio/items/38497ed4e826d772e583
{
"require": {
"aws/aws-sdk-php": "3.*"
}
}
@shoji-mochizuki
shoji-mochizuki / aws_elb.conf
Created May 15, 2015 16:09
AWSのApache2.4の初期設定とセキュリティ設定 ref: http://qiita.com/shojimotio/items/41a74f314f3e47c018a5
# Set over AWS ELB connection time out default 60s
RequestReadTimeout header=70
# ELB access_log format
LogFormat "%h %{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" elbcombined
@shoji-mochizuki
shoji-mochizuki / crontab
Created May 15, 2015 16:09
AWS ロードバランサーに接続しているインスタンスを切断、再接続する処理をAWS SDK for PHP 2で作成する ref: http://qiita.com/shojimotio/items/c30041d6eea7e9871869
SHELL=/bin/bash
# root PATHを設定
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin:/opt/aws/bin
# mailを送信したくない時
MAILTO=""
AWS=/home/ec2-user/aws-php
# 時間はJSTかUSTかシステムに合わせる。今回はJST。 ログはmessageに吐き出す。
# EC2インスタンスを業務時間だけ自動起動する処理
27 8 * * 1-5 php $AWS/ec2_start.php 2>&1 | logger -t AWS_SDK_AUTO -p local0.info
@shoji-mochizuki
shoji-mochizuki / oil.php
Last active August 29, 2015 14:21
FuelphpでWebアプリを作成した時のNetBeansに入れたプラグイン設定 ref: http://qiita.com/shojimotio/items/62580f8579c4de3e7102
'binary_path' => VENDORPATH. 'bin/phpunit',