Install Ganglia 3.1.7 @Centos5.4_x64

confuse-2.7.tar.gz
libconfuse-2.6-2.el5.rf.x86_64.rpm
libconfuse-devel-2.6-2.el5.rf.x86_64.rpm
rrdtool-1.4.4.tar.gz
ganglia-3.1.7.tar.gz
apr-1.2.7-11.el5_5.3.x86_64.rpm
apr-devel-1.2.7-11.el5_5.3.x86_64.rpm

tar -zxf confuse-2.7.tar.gz
cd confuse-2.7
./configure
make
make install
rpm -ivh libconfuse-2.6-2.el5.rf.x86_64.rpm

rpm -ivh apr-1.2.7-11.el5_5.3.x86_64.rpm
rpm -ivh  apr-devel-1.2.7-11.el5_5.3.x86_64.rpm

tar -zxf rrdtool-1.4.4.tar.gz
cd rrdtool-1.4.4
./configure –prefix=/usr/local/rrdtool
./configure
make && make install

 

tar -zxvf ganglia-3.1.7.tar.gz
cd ganglia-3.1.7
./configure –with-gmetad –enable-gexec –sysconfdir=/etc/ganglia –prefix=/usr/local/ganglia –with-librrd=/usr/local/rrdtool/
make
make install

cp gmetad/gmetad.init
/etc/init.d/gmetad
cp gmond/gmond.init /etc/init.d/gmond
vi /etc/init.d/gmond      # change GMOND=/usr/local/ganglia/sbin/gmetad
vi /etc/init.d/gmetad     # change GMETAD=/usr/local/ganglia/sbin/gmetad
mkdir -p /var/lib/ganglia/rrds
chown nobody.nobody /var/lib/ganglia/rrds
mkdir /etc/ganglia
gmond/gmond -t | tee /etc/ganglia/gmond.conf
cp gmetad/gmetad.conf /etc/ganglia/
vim /etc/ganglia/gmond.conf

data_source “blue” localhost

vim /etc/ganglia/gmetad.conf

cluster {

name = “blue

owner = “unspecified”

latlong = “unspecified”

url = “unspecified”}

/etc/init.d/gmond start
/etc/init.d/gmetad start

 

 

########## client install ############

tar -zxf confuse-2.7.tar.gz
cd confuse-2.7
./configure      #if u got error try ./configure CFLAGS=-fPIC –disable-nls
make
make install
rpm -ivh libconfuse-2.6-2.el5.rf.x86_64.rpm

rpm -ivh apr-1.2.7-11.el5_5.3.x86_64.rpm
rpm -ivh  apr-devel-1.2.7-11.el5_5.3.x86_64.rpm

 

tar -zxvf ganglia-3.1.7.tar.gz
cd ganglia-3.1.7
./configure –enable-gexec –sysconfdir=/etc/ganglia/
make
make install
cp gmond/gmond.init /etc/init.d/gmond
gmond -t > /etc/ganglia/gmond.conf

vim /etc/ganglia/gmetad.conf

cluster {

name = “blue

owner = “unspecified”

latlong = “unspecified”

url = “unspecified”}

route add -net 239.2.11.71 netmask 255.255.255.255 dev eth1  ## if u has 2 eth

/etc/init.d/gmond start

 

 

install pptpd vpn server @linodn/@aws

@aws // amazon instance

#wget https://gist.github.com/raw/666241/e8f3030a9e7066b8deb0a3d9ec761360e2d94227/pptpd.sh
#sh pptpd.sh

#vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
username  pptpd  passwd *

set security groups

Connection Method

Protocol

From Port

To Port

Source (IP or group)

-

tcp

1723

1723

0.0.0.0/0

-

tcp

47

47

0.0.0.0/0

-

udp

47

47

0.0.0.0/0

——————————————————————————————————

@linodn // centos5.5 32bit

#yum -y install rpm-build gcc

#yum -y install ppp

get pptpd rpm http://poptop.sourceforge.net/yum/stable/packages/

#rpm -ivh pptpd-1.3.4-2.rhel5.i386.rpm

# vi /etc/pptpd.conf

option /etc/ppp/pptpd-options

logwtmp

# 第一次配置时开启debug, 用于排错, 配置完成后可注释.

debug

# PPTP Wan IP

localip 173.230.132.139

# PPTP Client IP

remoteip 173.230.132.140-200

vi /etc/ppp/pptpd-options

# 默认

name pptpd

# 默认

refuse-pap

refuse-chap

refuse-mschap

require-mschap-v2

require-mppe-128

# PPTP 客户端拨号后, 分配的DNS, 我写的是 [OpenDNS]

ms-dns 208.67.222.222

ms-dns 208.67.220.220

# 默认

proxyarp

# 默认

nodefaultroute

# [注意] 指定pptp.log文件路径

logfile /var/log/pptpd.log

# 如果没有指定 pptpd.log 会报错:

#GRE: read(fd=,buffer=,len=) from PTY failed: status = -1 error = Input/output error, usually caused by unexpected termination of pppd, check option syntax a

nd pppd logs

# 默认

lock

# 默认

nobsdcomp

# PPTP 客户端如果没有任何流量, 1小时自动断开拨号连接 (单位: 秒)

idle 3600

Set Forward/iptables

#vi /etc/sysctl.conf

net.ipv4.ip_forward = 1

#sysctl -p

#/sbin/iptables -t nat -A POSTROUTING -s 173.230.132.0/255.255.255.0 -o eth0 -j MASQUERADE

#iptables-save

set username

#vi /etc/ppp/chap-secrets

# Secrets for authentication using CHAP

# client        server  secret                  IP addresses

otto pptpd Otto123! *

viva pptpd vivaz5 *

start pptpd

# /etc/init.d/pptpd start

HAProxy with Keepalived

Internet

firewall(ssg520)

vip 10.20.0.100 (keepalived)

haproxy A 10.20.0.12  + haproxy B 10.20.0.11

web* 3 (10.20.0.100-103)

——————————————————————————————-

haproxy A setting files

# vi /opt/haproxy.cfg

global

maxconn 5120

chroot /usr/local/haproxy

group nobody

user nobody

daemon

quiet

#nbproc 8

defaults

log global

log 127.0.0.1 local3

mode http

option httplog

option dontlognull

retries 3

option redispatch

maxconn 2000

contimeout 5000

clitimeout 50000

srvtimeout 50000

listen webgrp 0.0.0.0:80

mode http

option httplog

option dontlognull

option forwardfor

option httpclose

cookie SERVERID rewrite

balance roundrobin

option httpchk HEAD /time.jsp HTTP/1.0

stats uri /status

stats auth admin:vivaz

server web01 10.30.0.100:80 cookie web01inst1 check inter 2000 rise 2 fall 5

server web02 10.30.0.101:80 cookie web01inst1 check inter 2000 rise 2 fall 5

server web03 10.30.0.102:80 cookie web01inst1 check inter 2000 rise 2 fall 5

# vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
abc@abc.com
}
notification_email_from abc@abc.com
smtp_server localhost
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script chk_haproxy {       # Requires keepalived-1.1.13
script “killall -0 haproxy”  # cheaper than pidof
interval 2                   # check every 2 seconds
weight 2                     # add 2 points of prio if OK
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 101
virtual_ipaddress {
10.20.0.100
}
track_script {
chk_haproxy
}
}

——————————————————————————————-

haproxy B setting files

# vi /opt/haproxy.cfg

global

maxconn 5120

chroot /usr/local/haproxy

group nobody

user nobody

daemon

quiet

#nbproc 8


defaults

log global

log 127.0.0.1 local3

mode http

option httplog

option dontlognull

retries 3

option redispatch

maxconn 2000

contimeout 5000

clitimeout 50000

srvtimeout 50000


listen webgrp 0.0.0.0:80

mode http

option httplog

option dontlognull

option forwardfor

option httpclose

cookie SERVERID rewrite

balance roundrobin

option httpchk HEAD /time.jsp HTTP/1.0

stats uri /status

stats auth admin:vivaz

server web01 10.30.0.100:80 cookie web01inst1 check inter 2000 rise 2 fall 5

server web02 10.30.0.101:80 cookie web01inst1 check inter 2000 rise 2 fall 5

server web03 10.30.0.102:80 cookie web01inst1 check inter 2000 rise 2 fall 5

# vi /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
abc@abc.com
}
notification_email_from abc@abc.com
smtp_server localhost
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_script chk_haproxy {       # Requires keepalived-1.1.13
script “killall -0 haproxy”  # cheaper than pidof
interval 2                   # check every 2 seconds
weight 2                     # add 2 points of prio if OK
}
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 100
virtual_ipaddress {
10.20.0.100
}
track_script {
chk_haproxy
}
}
——————————————————————————————-
start master/slave daemon
# /etc/init.d/haproxy start
# /etc/init.d/keepalived start
check its working?
# tcpdump | grep VRRP
3:45:49.073458 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:50.074463 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:51.075474 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:52.075483 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:53.076495 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:54.076505 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:55.077511 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:56.077520 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:57.078531 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:58.079536 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:45:59.080550 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:46:00.080558 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:46:01.081568 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:46:02.082574 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
13:46:03.083585 IP 10.20.0.12 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 103, authtype none, intvl 1s, length 20
change to slave
13:46:23.700757 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:24.701871 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:25.702786 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:26.706196 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:27.706819 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:28.707841 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:29.708852 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:30.709876 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20
13:46:31.709891 IP 10.20.0.11 > VRRP.MCAST.NET: VRRPv2, Advertisement, vrid 51, prio 102, authtype none, intvl 1s, length 20

My new Cellphone

Moto Milestone

null

null

a logrotate scripts

logrotate.sh

#!/bin/bash

cd `dirname $0`
d=`date +%Y%m%d`
d7=`date -d’7 day ago’ +%Y%m%d`

cp tu.log tu.log.${d}
echo “” > tu.log
rm -rf tu.log.${d7}

dirname $0 是代表脚本所在目录

Use cacti monitor http online users

1.vi /etc/snmp/snmpd.conf, add scripts

extend .1.3.6.1.4.1.2021.50 tuhttp /bin/bash /opt/httpd2/conf/tuhttp.sh

2.vi tuhttp.sh

#!/bin/bash
num=$(ps -e |grep http|grep -v grep|grep -v jkhttp|wc -l)
#num=$(grep “ONLINE USERS=” /opt/photo/log/tu.log | sed ‘$!d’ | sed ’s/\(.*\)USERS=\([0-9]*\)$/\2/’)
echo $num
echo OK

ps: tu.log is my system log, ignore

3.reload snmpd

/etc/init.d/snmpd reload

4.check snmp info

snmpwalk -v 2c 10.30.0.22 -c public .1.3.6.1.4.1.2021.50

display:

UCD-SNMP-MIB::ucdavis.50.1.0 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1.2.6.116.117.104.116.116.112 = STRING: “/bin/bash”
UCD-SNMP-MIB::ucdavis.50.2.1.3.6.116.117.104.116.116.112 = STRING: “/opt/httpd2/conf/tuhttp.sh”
UCD-SNMP-MIB::ucdavis.50.2.1.4.6.116.117.104.116.116.112 = “”
UCD-SNMP-MIB::ucdavis.50.2.1.5.6.116.117.104.116.116.112 = INTEGER: 5
UCD-SNMP-MIB::ucdavis.50.2.1.6.6.116.117.104.116.116.112 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1.7.6.116.117.104.116.116.112 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.2.1.20.6.116.117.104.116.116.112 = INTEGER: 4
UCD-SNMP-MIB::ucdavis.50.2.1.21.6.116.117.104.116.116.112 = INTEGER: 1
UCD-SNMP-MIB::ucdavis.50.3.1.1.6.116.117.104.116.116.112 = STRING: “3″
UCD-SNMP-MIB::ucdavis.50.3.1.2.6.116.117.104.116.116.112 = STRING: “3
OK”
UCD-SNMP-MIB::ucdavis.50.3.1.3.6.116.117.104.116.116.112 = INTEGER: 2
UCD-SNMP-MIB::ucdavis.50.3.1.4.6.116.117.104.116.116.112 = INTEGER: 0
UCD-SNMP-MIB::ucdavis.50.4.1.2.6.116.117.104.116.116.112.1 = STRING: “3″
UCD-SNMP-MIB::ucdavis.50.4.1.2.6.116.117.104.116.116.112.2 = STRING: “OK”

ps:we need .1.3.6.1.4.1.2021.50.3.1.1.6.116.117.104.116.116.112

5.add cacti data templates
Console -> Data Templates
data_templates

6.add cacti graph templates
Console -> Graph Templates
graph_templates

7.add these templates to host
Console -> Devices -> Create Graphs for this Host

8.All Done
cacti_httpnum

refer: http://bbs.linuxtone.org/thread-1372-1-1.html

Compile Memcached + Php extension at Centos5.2 x64

1.get source

wget http://memcached.googlecode.com/files/memcached-1.4.4.tar.gz
wget http://www.monkey.org/~provos/libevent-1.4.13-stable.tar.gz

2.compile libevent

tar -zxvf libevent-1.4.13-stable.tar.gz
cd libevent-1.4.13-stable
./configure
make
make install

3.compile memcached

tar -zxvf memcached-1.4.4.tar.gz
cd memcached-1.4.4
./configure –prefix=/opt/memcached –with-libevent
make
make install

4.start memcached

cd /opt/memcached/bin
./memcached -d -m 256 -p 11211 -u root // -d daemon, -m ram, -p port default is 11211, -u user
if your os is 64bit maybe get a error “cant find libevent” try this
在 64bit 系统启动,会报找不到 libenent,可以如下操作
cp -R /usr/local/lib/libevent* /usr/lib64/

5.php memcache ext

wget http://pecl.php.net/get/memcache-2.2.4.tgz
cd memcache-2.2.4
whereis php-config
whereis phpize
phpize && ./configure –enable-memcache –with-php-config=/usr/local/bin/php-config
make
make test
make install

vi /usr/local/lib/php.ini

extension_dir = “/usr/local/lib/php/extensions/no-debug-zts-20060613/”
extension = “memcache.so”

6.monitor memcached

wget http://livebookmark.net/memcachephp/memcachephp.zip
put memcache.php file to wwwroot

vi memcache.php

define(‘ADMIN_USERNAME’,'user’); // Admin Username
define(‘ADMIN_PASSWORD’,'pass’); // Admin Password
$MEMCACHE_SERVERS[] = ‘yourMemCachedHost:11211′; // add more as an array

http://host.com/memcache.php

memcache.php

FF13全英文奖杯对照及获得方法

:2: :2: :2: http://bbs.a9vg.com/read.php?tid=1380341&fpage=1

奖杯类别 奖杯描述 获得方法
白金 Ultimate 所有奖杯全部获得
铜 Instruments of Fate 序章剧情后获得
铜 Instruments of Dissent 第2章剧情后获得
铜 Instruments of Tragedy 第3章剧情后获得
铜 Instruments of Flight 第4章剧情后获得
铜 Instruments of Vengeance 第5章剧情后获得
铜 Instruments of Survival 第6章剧情后获得
铜 Instruments of Rebellion 第7章剧情后获得
铜 Instruments of Shame 第8章剧情后获得
铜 Instruments of Wrath 第9章剧情后获得
铜 Instruments of Truth 第10章剧情后获得
铜 Instruments of Hope 第11章剧情后获得
银 Instruments of Faith 第12章剧情后获得
金 Instruments of Change 游戏通关
铜 Pulsian Pioneer 行走10000步以上,机器人パクティ修理完了之后与机器人对话
铜 Gysahl Wreath 用陆行鸟挖到リボン
铜 Kelger’s Cup 完成全部难易度为D(1~5)的冥碑任务
铜 Xezat’s Chalice 完成全部难易度为C(6~15、18~22、28、35~37、39、56~57)的冥碑任务
银 Exorcist 完成第64个冥碑任务
银 Floraphobe 完成第54个冥碑任务
银 Natural Selector 完成全部泰坦试炼
银 Dorgann’s 难易度为B的任务全部完成
银 Galuf’s Grail 完成全部64个冥碑任务
金 L’Cie Paragon 64个冥碑任务全部取得5星评价
铜 Commando’s Seal Attacker等级达到5级
铜 Ravager’s Seal Blaster等级达到5级
铜 Sentinel’s Seal defencer等级达到5级
铜 Saboteur’s Seal Jammer等级达到5级
铜 Synergist’s Seal Enhancer等级达到5级
铜 Medic’s Seal Healler等级达到5级
银 Limit Breaker 给予敌人单击伤害达到100000以上
银 Adamant Will 完成编号为56~62的冥碑任务后,将出现在大平原的ロングイ(龙龟)击倒
银 Master’s Seal 将Lv10的水晶盘全部填满
金 Treasure Hunter 全部武器(102种)与饰品(119种)取得过一次后与机器人パクティ对话
金 Loremaster 完全获得100种敌人的情报
金 Superstar 最终决战得到5星评价

My Xmas Gift

xmas_gift, originally uploaded by nikogoo.

kinder

kinder, originally uploaded by nikogoo.