Skip to content

Instantly share code, notes, and snippets.

View bageljp's full-sized avatar

Keisuke Kadoyama bageljp

  • Tokyo, Japan
  • 11:20 (UTC +09:00)
  • X @bageljp
View GitHub Profile
@bageljp
bageljp / apache_balancer.bash
Last active December 16, 2015 22:39
apache balancer manager control
#!/bin/bash
#------------------------------------------------------------------------------
#
# Author(s): K.Kadoyama
#
# Usage:
# apache_balancer.bash {worker-url} {ENABLE|DISABLE} [https]
# apache_balancer.bash status [https]
#
# Current Version: 1.1.0
@bageljp
bageljp / cycledel. bat
Created June 3, 2013 10:36
cycle delete file and folder.
@echo off
:: ============================================================================
::
:: 一定期間が経過したファイル/フォルダを削除する
::
:: 第1引数に対象ディレクトリのパスを指定(require)
:: 第2引数に何日前のファイル/フォルダを対象とするか、日数を指定(require)
::
:: example. E:\tempを対象に、3日前のファイル/フォルダを削除する場合
:: call cycledel.bat "E:\temp" 3 > E:\log\cycledel.log 2>&1
@bageljp
bageljp / cf-sg1
Created June 8, 2013 15:20
cloudformation templates.
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Template SecurityGroupIngress Sample and AllTrafic Sample",
"Resources" : {
"SGroup1" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "EC2 Instance access"
#!/bin/bash
DATETIME="`date +'%Y%m%d_%H%M%S'`"
LOG="/root/logs/${DATETIME}_report.log"
OVER_LOG="/root/logs/${DATETIME}_over.log"
JMETER_LOG="/root/logs/${DATETIME}_jmeter.log"
export i1=0
export i2=0
export i3=0
export i4=0
@bageljp
bageljp / server_create.bash
Last active December 18, 2015 15:59
さくらのクラウドAPI
#!/bin/bash
ACCESS_KEY="<access-key>"
ACCESS_KEY_SECRET="<access-key-secret>"
SERVER_NUM=${1:-1}
HOST_NAME="<hostname>"
DISK_ID="<disk-id>"
SSH_KEY_ID="<ssh-key-id>"
PASSWORD="<password>"
@bageljp
bageljp / td-agent.conf
Last active December 18, 2015 20:29
apacheのアクセスログ(LTSV)のステータスコードをカウントしてzabbixに送るtd-agent.conf
<source>
type forward
port 24224
</source>
<match {web*,stg*}.**.apache.access>
type copy
<store>
type forest
subtype file_alternative
# 'host-notify-by-jabber' command
define command{
command_name host-notify-by-jabber
command_line /usr/bin/perl $USER1$/notify_via_jabber.pl $CONTACTPAGER$ "`/usr/bin/printf \"***** Nagios *****\nHost '$HOSTALIAS$' is $HOSTSTATE$ - Info: $HOSTOUTPUT$\"`"
}
# 'host-notify-by-jabber' command to groupchat
define command{
command_name host-notify-by-jabber-groupchat
command_line /usr/bin/perl $USER1$/notify_via_jabber.pl $CONTACTPAGER$ "`/usr/bin/printf \"***** Nagios *****\nHost '$HOSTALIAS$' is $HOSTSTATE$ - Info: $HOSTOUTPUT$\"`" groupchat
@bageljp
bageljp / mysql_conn_metadata_lock.bash
Last active December 18, 2015 21:39
mysql wait metadata lock check.
#!/bin/bash -x
#-------------------
# Define
#-------------------
LANG=C
DATETIME="`date +'%Y%m%d-%H%M%S'`"
@bageljp
bageljp / aws_autoscaling_terminate_elb_outofservice.bash
Created June 26, 2013 18:21
ELBでOutOfServiceになったインスタンスをAutoScalingグループから強制排除
#!/bin/bash
if [ $# -lt 1 ]; then
echo "Usage: `basename $0` {elb-name} [region]"
exit 1
fi
ELB_NAME="$1"
REGION="${2:-ap-northeast-1}"
@bageljp
bageljp / HTMLタグチェック
Last active December 19, 2015 16:39
jsメモ
javascript:var w=window.open('','_blank','width=800,height=500,scrollbars=yes');var s=document.createElement('script');s.charset='Shift_JIS';s.src='http://tkr.nsf.jp/tagcheck/tagcheck2.js?'+Math.random();document.body.appendChild(s);void(0);