Skip to content

Instantly share code, notes, and snippets.

View nekoruri's full-sized avatar
🤔
にゃーん

@nekoruri nekoruri

🤔
にゃーん
View GitHub Profile
@nekoruri
nekoruri / redis_bgsave.sh
Last active December 21, 2015 02:59
RedisのBGSAVEコマンドを実行し、LASTSAVEが更新されるのを待つ。 タイムアウト時間を超えたら exit status 1 で終了する。
#!/bin/bash
# RedisのBGSAVEコマンドを実行し、LASTSAVEが変わる(=dump.rdbが更新される)のを待つ。
# タイムアウト時間を超えたら exit status 1 で終了する。
TIMEOUT=30
# Timeout handler
# http://stackoverflow.com/questions/1226094/how-to-include-a-timer-in-bash-scripting
set_timer() {
@nekoruri
nekoruri / class.cchart.php.diff
Last active December 20, 2015 13:19
Zabbixのグラフで日付表示時に時刻を省略して縦幅を縮めるパッチ。Zabbix 2.0.6 にて動作確認済み。 /usr/share/zabbix とかに行って patch -p0 で食わせてください。
--- include/classes/class.cchart.php.orig 2013-08-02 07:55:09.131739793 +0000
+++ include/classes/class.cchart.php 2013-08-02 07:58:21.199739718 +0000
@@ -34,7 +34,7 @@
$this->skipRightScale = 0; // in case if right axis should be drawn but doesn't contain any data
$this->ymin_itemid = 0;
$this->ymax_itemid = 0;
- $this->legendOffsetY = 90;
+ $this->legendOffsetY = 50;
$this->percentile = array(
'left' => array(
@nekoruri
nekoruri / AWS大好き男に「どの機能が好き?」と訊ねられたとき、女はどう答えたらいいの?
Last active January 25, 2021 15:13
AWS大好き男に「どの機能が好き?」と訊ねられたとき、女はどう答えたらいいの?
あ、まず前提として、
貴女がAWS大好き男を夢中にさせることが、
はたして貴女を幸福にするかどうか、それはまた別問題だけれど。
とはいえ、AWS大好き男たちは玉石混交ながら、
SIer系の超上流な男なども多く、
したがって、釣り師たる女たちにとっては、
なかなかあなどれない釣り場です。
では、AWS大好き男に「どの機能が好き?」と訊ねられたとき、
#!/bin/sh
SERVER=$1
PORT=$2
TIMEOUT=25
PATH=/bin:/usr/bin; export PATH
basedir=`dirname $0`
$basedir/timeout $TIMEOUT $basedir/ssl-cert-check -s $SERVER -p $PORT -n | sed 's/ */ /g' | cut -f6 -d" " | sed 's/^.*=//g'
# Example configuration file for Munin, generated by 'make build'
# The next three variables specifies where the location of the RRD
# databases, the HTML output, logs and the lock/pid files. They all
# must be writable by the user running munin-cron. They are all
# defaulted to the values you see here.
#
#dbdir /var/lib/munin
#htmldir /var/www/html/munin
#logdir /var/log/munin
apt-get update
apt-get -y install apache2 rrdtool librrds-perl libcgi-fast-perl libdate-manip-perl \
libfile-copy-recursive-perl libhtml-template-perl libio-socket-inet6-perl \
liblog-log4perl-perl liburi-perl ttf-dejavu
wget \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin_2.0.6-3~bpo60+1_all.deb \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin-common_2.0.6-3~bpo60+1_all.deb
dpkg -i munin*.deb
ufw allow Apache
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install munin httpd
chkconfig httpd on
service httpd restart
apt-get update
apt-get -y install gawk libnet-server-perl liblist-moreutils-perl libcache-cache-perl
wget \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin-common_2.0.6-3~bpo60+1_all.deb \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin-node_2.0.6-3~bpo60+1_all.deb \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin-plugins-core_2.0.6-3~bpo60+1_all.deb \
http://ftp.jp.debian.org/debian-backports/pool/main/m/munin/munin-plugins-extra_2.0.6-3~bpo60+1_all.deb
dpkg -i munin*.deb
rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
yum -y install munin-node perl-Cache-Cache
chkconfig munin-node on
service munin-node start
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>2.0</version>
<date>2013-03-22T04:14:28Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>