posts - 88, comments - 3, trackbacks - 0, articles - 0
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理

http://jsonview.com/

posted @ 2012-02-17 15:35 Milo的海域 阅读(396) | 评论 (0)编辑 收藏

install xdebug
yum install php-pear
pecl install xdebug
find / -name 'xdebug.so'

config php.ini for xdebug extension
; load as zend ext
zend_extension=/usr/lib64/php/modules/xdebug.so
; make sure profiler_enable disable
xdebug.profiler_enable=off
; enable trigger
xdebug.profiler_enable_trigger=on
; make sure web server has write privilege on output dir
xdebug.profiler_output_dir=/tmp

restart httpd
send http request
curl 'http://10.1.74.51/admin/php/adapter.php?action=getSystemChartsData&XDEBUG_PROFILE'

get and analyze output log by kcachegrind





posted @ 2012-02-17 12:58 Milo的海域 阅读(238) | 评论 (0)编辑 收藏

SVN account info will be stored in below dir on linux server:
${HOME}/.subversion/auth/svn.simple/

posted @ 2012-02-17 11:38 Milo的海域 阅读(225) | 评论 (0)编辑 收藏

脚本里出现了相同逻辑被执行多次,需要重构代码以减小代码体积。

Bash array的例子

自己写的例子

#!/bin/sh
a=('1' '2 2' '3 3 3')

# echo whole array elements
echo ${a[@]}
# array length 
len=${#a[@]}

# loop array
for ((i=0; i<=$len-1; i++))
do
      
echo ${a[$i]} 
done

# array insert
a=()
a
=("${a[@]}" "a")
a
=("${a[@]}" "b b")
echo ${a[@]}
              

blogjava的代码高亮不支持unix shell,用PHP的凑合下。。。

posted @ 2012-02-03 16:52 Milo的海域 阅读(210) | 评论 (0)编辑 收藏

iperf是个网络带宽的性能测试工具,但是直接yum install iperf是找不到源的。具体安装方法如下:

yum install iperf on centos5
=======================
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-
0.5.2-2.el5.rf.*.rpm
rpm -i rpmforge-release-
0.5.2-2.el5.rf.*.rpm
yum install iperf


yum install iperf on centos6
=======================
wget  http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
rpm -K rpmforge-release-
0.5.2-2.el6.rf.*.rpm
rpm -i rpmforge-release-
0.5.2-2.el6.rf.*.rpm
yum install iperf

iperf使用示例
on 10.1.74.51
iperf -s

on 10.1.74.76
[root@xen74v02 db1]# iperf -c 10.1.74.51 -B 10.1.74.76
------------------------------------------------------------
Client connecting to 
10.1.74.51, TCP port 5001
Binding to local address 
10.1.74.76
TCP window size: 
16.0 KByte (default)
------------------------------------------------------------
[  3] local 10.1.74.76 port 5001 connected with 10.1.74.51 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.0 sec  1.03 GBytes    884 Mbits/sec

posted @ 2012-02-03 13:49 Milo的海域 阅读(8658) | 评论 (0)编辑 收藏

从源码安装mysql时指定默认字符集:
  1. ./configure ... '--with-charset=utf8' '--with-collation=utf8_general_ci' ...
  2. make & make install
  3. start mysql instance

验证:



也可以在my.cnf里面修改默认字符集:

default-character-set=latin1



posted @ 2012-01-31 13:18 Milo的海域 阅读(274) | 评论 (0)编辑 收藏

仅列出标题
共9页: 上一页 1 2 3 4 5 6 7 8 9