Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/perl
# Buchan Milne <[email protected]> 20051213
# Script to monitor OpenLDAP performance and sync-replication status via
# Hobbit (may also still work with BigBrother).
#
# 1)Install Net::LDAP (perl-ldap) and Date::Manip (perl-DateManip)
# 2)Run as task from hobbitserver.cfg (or BBEXT in bbdef.sh for BigBrother)
# 3)Use ncv in hobbit to collect data:
# -add "ol=ncv" to TEST2RRD, and "ncv" to GRAPHS in hobbitserver.cfg
#!/usr/bin/env python
# coding=utf8
# author=evi1m0
# website=linux.im
'''
12306 Captcha Picture:
author: Evi1m0@20150316
1. Download Captcha
2. Pic Conver Text
@ice-age
ice-age / cn-route.sh
Created October 29, 2014 07:20
生成路由添加批处理文件。国内路由直接走本地,不走vpn
#!/bin/bash
wget http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest -O apnic-ip
echo "@echo off" >cn_route_via_local.bat
cat apnic-ip |grep "^apnic"|grep ipv4|grep CN|awk -F'|' '{print $4,$5}'|while read ip count
do
echo $ip,$count
count=`expr $count - 1`
count=`echo "obase=2;$count"|bc|awk '{print length($0)}'`
mask_count=`expr 32 - $count`
echo "route add $ip/$mask_count 172.16.70.1" >>cn_route_via_local.bat
#!/bin/bash
#cd ~
#mkdir ganglia_packages
#cd ganglia_packages
yum install gcc make glibc-devel rrdtool-devel apr-devel expat-devel pcre-devel -y
#yum install libconfuse -y
#wget http://savannah.nongnu.org/download/confuse/confuse-2.7.tar.gz
tar zxf confuse-2.7.tar.gz
cd confuse-2.7
@ice-age
ice-age / hdd_ipos.sh
Created September 4, 2013 06:31
ipos performance
#!/bin/bash
bs="512 4k 8k 16k 32k 64k"
dir=/data/8
disk=/dev/sdi
for i in $bs
do
echo "bs=$i"
iostat -x $disk 1 >iostat.$i &
require 'irb/ext/save-history'
IRB.conf[:SAVE_HISTORY] = 100
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history"
Kernel.at_exit do
IRB.conf[:AT_EXIT].each do |i|
i.call
end
end
@ice-age
ice-age / echo_color.sh
Created August 23, 2013 11:01
shell function library
#!/bin/bash
function echo_color(){
if [[ "x$1" == "x--color" ]]; then
shift
case "$1" in
black)
shift
echo -e "\033[1;30m$@\033[0m"