Skip to content

Instantly share code, notes, and snippets.

View bageljp's full-sized avatar

Keisuke Kadoyama bageljp

  • Tokyo, Japan
  • 17:03 (UTC +09:00)
  • X @bageljp
View GitHub Profile
#!/bin/bash
DIR_IMAGE="/var/www/html/contents/"
CMD_FIND="/usr/bin/find"
CMD_XARGS="/usr/bin/xargs"
echo "### Self Heal Start. [${DIR_IMAGE}][time=`date +'%Y/%m/%d %H:%M:%S'`] ###"
${CMD_FIND} ${DIR_IMAGE} -noleaf -print0 | ${CMD_XARGS} --null stat > /dev/null
ret=$?
@bageljp
bageljp / tomcat_log_del.bash
Created February 10, 2014 08:31
tomcat log delete script.
#!/bin/bash
#
# crontab -l
# 00 3 * * * /usr/local/tlab/script/tomcat_log_del.bash tomcat_front > /dev/null 2>&1
#
#----------
# define.
#----------
TOMCAT_UNIQ="${1:-tomcat}"
DIR_TOMCAT="/usr/local/${TOMCAT_UNIQ}"
@bageljp
bageljp / install
Created November 3, 2013 11:03
nagios on Mac OS X 10.8.3
[user1@canal-mac01 19:58:46 log][315][20]$ brew install nagios
Warning: Your Xcode (4.6.3) is outdated
Please update to Xcode 5.0.1.
Xcode can be updated from the App Store.
==> Installing dependencies for nagios: libpng, jpeg, gd, nagios-plugins
==> Installing nagios dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.5.14.mountain_lion.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libpng-1.5.14.mountain_lion.bottle.tar.gz
🍺 /usr/local/Cellar/libpng/1.5.14: 15 files, 1.0M
@bageljp
bageljp / knife_base.bash
Last active April 22, 2022 10:58
knife command parallel exec in hosts
#!/bin/bash
SH_KNIFE="/usr/local/chef/chef-repo/knife_parallel.bash"
LOG_FILE="/usr/local/chef/chef-repo/knife_base.log"
func_usage() {
echo "Usage: `basename $0` {bootstrap|prepare|cook}"
return 0
}
@bageljp
bageljp / pssh_command.bash
Created October 13, 2013 11:37
pssh command in hosts
#!/bin/bash
func_usage() {
echo "Usage: `basename $0` {role} {command}"
return 0
}
if [ $# -lt 2 ]; then
func_usage
exit 1
@bageljp
bageljp / init network setting
Last active December 23, 2015 14:09
ubuntu-network
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto wlan0
iface wlan0 inet dhcp
@bageljp
bageljp / capture_noiscsi.bash
Last active December 20, 2015 18:09
サーバのリソースチェックスクリプト群。
#!/bin/bash
DATE="`date +%Y%m%d`"
HOUR="`date +%H`"
DATETIME="${DATE}_${HOUR}`date +%M%S`"
OUT_DIR="/tmp/${DATE}/${HOUR}"
OUTPUT="${OUT_DIR}/`basename $0 .bash`_`hostname`_${DATETIME}"
CMD_TCPDUMP="/usr/sbin/tcpdump"
SLEEP=30
CAP_IF="eth1"
@bageljp
bageljp / unicorn
Created July 21, 2013 09:35
unicorn init script with rbenv and bundler.
#!/bin/sh
#
# unicorn
#
# chkconfig: - 80 20
# description: unicorn
# processname: unicorn
# config: /usr/local/redmine/config/unicorn.rb
# pidfile: /usr/local/redmine/tmp/pids/.pid
@bageljp
bageljp / default.conf
Last active December 19, 2015 22:18
nginxのリバースプロキシ検証
upstream solr-backend {
server 127.0.0.1:3306 max_fails=2 fail_timeout=10s;
server 127.0.0.1:18080 max_fails=2 fail_timeout=10s;
keepalive 60;
}
server {
listen 80;
server_name localhost;
@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);