Hunter的大杂烩

十二月 15, 2014

SuseLinux ganglia 图片出错处理

类归于: 技术话题 — hunter @ 4:52 下午

apache error_log文件中

1.  出现:sh: /usr/bin/rrdtool: No such file or directory
修改  conf_default.php,

$conf['rrdtool'] = “/usr/local/rrdtool/bin/rrdtool”;

2. 出现:

(process:4017): Pango-CRITICAL **: No fonts found:
This probably means that the fontconfig
library is not correctly configured. You may need to
(全文…)

十二月 9, 2014

获取百度查询结果的真实链接脚本

类归于: 技术话题 — hunter @ 2:56 下午

#!/bin/sh

page=0

echo > 3.txt

for (( page = 0; page < 70; page=page+10))
do
urlStr="http://www.baidu.com/s?wd=keyword%20site%3Aicaifu.com&pn=”$page”&rsv_spt=1&issp=1&f=8&rsv_bp=0&rsv_idx=2&ie=utf-8″

(全文…)

bash shell script sample

类归于: 技术话题 — hunter @ 2:54 下午

用来提取sql中的两个变量值

sql:UPDATE XXXX SET `SEQ` = ‘123456′, yyy=’xxx’ where SEQ = 123457
#!/bin/sh

int_regex=([0-9]+)

grep UPDATE pg.sql |grep HK_SAKCHMJSHH|while read line
do
first_seq_pos=`echo $line|awk ‘{print index($0,”\x60SEQ\x60 = \x27″)}’`
second_seq_pos=`echo $line|awk ‘{print index($0, “SEQ = “)}’`

if [ $first_seq_pos -ne $second_seq_pos ];then
((first_seq_pos=$first_seq_pos+9))
((second_seq_pos=$second_seq_pos+6))
first_seq=`echo $line |awk -v pos=”$first_seq_pos” ‘{print substr($0, pos, 8) }’`
second_seq=`echo $line |awk -v pos=”$second_seq_pos” ‘{print substr($0, pos, 8) }’`
echo $first_seq
if [[ $first_seq =~ ([0-9]+) ]];then
echo “match:”${BASH_REMATCH[1]}
fi
echo $second_seq
exit
fi

done

WordPress 所驱动