Skip to content

Instantly share code, notes, and snippets.

@matetsu
matetsu / redis-slaveof.py
Created December 28, 2012 03:48
Redisにslaveofコマンドを送るためだけのスクリプト。
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import redis
import logging
import socket
import traceback
LOGFILE = "/var/log/redis-ha.log"
@matetsu
matetsu / redis-failover.sh
Created December 28, 2012 03:47
Redisフェイルオーバ時に実行するスクリプト。 要redis-vpc-route-change.py
#!/bin/sh
IPADDR=`LANG=C ifconfig eth0 | sed -n '/.*inet addr:\([0-9.]*\).*/{s//\1/;p}'`
LOCK_FILE="/tmp/redis-failover.lock"
if [ "$#" = "7" ]; then
if [ ! -f ${LOCK_FILE} ]; then
touch ${LOCK_FILE}
if [ "$3" = "end" -a $6 = ${IPADDR} ]; then
/usr/bin/python /usr/local/sbin/redis-vpc-route-change.py
@matetsu
matetsu / etc_initd_sentinel.sh
Created December 28, 2012 03:45
CentOS用Sentinel起動スクリプト
#!/bin/sh
#
# sentinel - this script starts and stops the sentinel daemon
#
# chkconfig: - 86 14
# description: Redis Sentinel is monitor and aut-failover for redis.
# processname: redis-sentinel
# config: /etc/redis/sentinel.conf
# config: /etc/sysconfig/redis-sentinel
# pidfile: /var/run/redis-sentinel.pid
@matetsu
matetsu / etc_initd_redis.sh
Created December 28, 2012 03:45
CentOS用Redis起動スクリプト
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid
@matetsu
matetsu / test.sh
Created December 28, 2012 03:43
テスト
#!/bin/sh
echo "test"
@matetsu
matetsu / gist:3753806
Created September 20, 2012 03:24
cpanm/build.log
cpanm (App::cpanminus) 1.5018 on perl 5.010001 built for x86_64-linux-thread-multi
Work directory is /root/.cpanm/work/1348110064.19597
You have make /usr/bin/make
You have LWP 6.04
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
使用許諾 GPLv3+: GNU GPL version 3 またはそれ以降 <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.