<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">
  <channel>
    <title>Star Life</title>
    <link>http://liuchangjun.com</link>
    <description>I am star.</description>
    <generator>posterous.com</generator>
    <link type="application/json" rel="http://api.friendfeed.com/2008/03#sup" href="http://posterous.com/api/sup_update#1209859bc" xmlns="http://www.w3.org/2005/Atom"/>
    <atom:link rel="self" href="http://liuchangjun.com/rss.xml"/>
    <atom:link rel="hub" href="http://posterous.superfeedr.com"/>
    <item>
      <pubDate>Sat, 11 Jun 2011 18:41:49 -0700</pubDate>
      <title>Howto: ZeroMQ (&#216;MQ) &amp; PyZMQ Install Guide</title>
      <link>http://liuchangjun.com/howto-zeromq-omq-pyzmq-install-guide</link>
      <guid>http://liuchangjun.com/howto-zeromq-omq-pyzmq-install-guide</guid>
      <description>
        <![CDATA[<p>
	<p>Homepage: <a href="http://www.zeromq.org/">http://www.zeromq.org</a></p>
<div class="entry-content">
<blockquote class="posterous_medium_quote">
<p>&Oslash;MQ zeromq:<br /> &Oslash;&ensp;&ensp;The socket library that acts as a concurrency framework.<br /> &Oslash;&ensp;&ensp;Carries messages across inproc, IPC, TCP, and multicast.<br /> &Oslash;&ensp;&ensp;Connect N-to-N via fanout, pubsub, pipeline, request-reply.<br /> &Oslash;&ensp;&ensp;Fast enough for clustered products and supercomputing.<br /> &Oslash;&ensp;&ensp;Asynch I/O for scalable multicore message-passing apps.<br /> &Oslash;&ensp;&ensp;Large and active open source community.<br /> &Oslash;&ensp;&ensp;20+ languages including C, C++, Java, .NET, Python.<br /> &Oslash;&ensp;&ensp;Most OSes including Linux, Windows, OS X.<br /> &Oslash;&ensp;&ensp;LGPL free software with full commercial support from iMatix.</p>
</blockquote>
<p>1. ZeroMQ (&Oslash;MQ) Installation<br /> <code><br /> # wget http://download.zeromq.org/zeromq-2.1.6.tar.gz<br /> # tar zxvf zeromq-2.1.6.tar.gz<br /> # cd zeromq-2.1.6<br /> # ./configure<br /> # make<br /> # make install<br /> # vi /etc/ld.so.conf.d/zmq.conf<br /> /usr/local/lib<br /> # ldconfig /etc/ld.so.conf<br /> </code></p>
<p>2. PyZMQ Installation<br /> <code><br /> # easy_install-2.6 pyzmq<br /> </code></p>
<p>3. Study ZMQ<br /> <code><br /> 消息队列的适用场合<br /> * 可靠传输<br /> * 分布式计算<br /> * 多进程通信<br /> </code></p>
<p>4. 同类产品<br /> <code><br /> ZeroMQ     关注<br /> RabbitMQ(Erlang)     关注<br /> Apache QPID<br /> Red Hat Enterprise MRG<br /> Fedora AMQP Infrastructure<br /> OpenAMQ<br /> </code></p>
<p>Refer to:<br /> 1. ZeroMQ Guide<br /> <a href="http://zguide.zeromq.org/page:all">http://zguide.zeromq.org/page:all</a><br /> 2. AMQP和ZeroMQ的分析<br /> <a href="https://docs.google.com/present/view?id=df85d3vm_316dbhtg3f7&amp;pli=1">https://docs.google.com/present/view?id=df85d3vm_316dbhtg3f7&amp;pli=1</a></p>
</div>
	
</p>

<p><a href="http://liuchangjun.com/howto-zeromq-omq-pyzmq-install-guide">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-zeromq-omq-pyzmq-install-guide#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 27 Apr 2011 09:04:09 -0700</pubDate>
      <title>Howto: Transifex Installation and Configuration</title>
      <link>http://liuchangjun.com/howto-transifex-installation-and-configuratio</link>
      <guid>http://liuchangjun.com/howto-transifex-installation-and-configuratio</guid>
      <description>
        <![CDATA[<p>
	Translation service: <a href="http://www.transifex.net/">http://www.transifex.net/</a>
Open source software: <a href="http://www.transifex.org/">http://www.transifex.org/</a>

1. Installation (CentOS 5.2 &amp; Python 2.6 &amp; Django 1.2.4)
<code>
# easy_install -U transifex
Note 1: some related rpm packages will be installed by yum
Note 2: the following packages will be installed by python
./Jinja2-2.5.5-py2.6.egg
./Pygments-1.4-py2.6.egg
./PIL-1.1.7-py2.6-linux-i686.egg
./polib-0.6.3-py2.6.egg
./httplib2-0.6.0-py2.6.egg
./userprofile-0.7_r422_correct_validation-py2.6.egg
./Markdown-2.0.3-py2.6.egg
./pycurl-7.19.0-py2.6-linux-i686.egg
./ctypes-1.0.2-py2.6-linux-i686.egg
./transifex-1.0.0-py2.6.egg
</code>

2. Configuration for development
<code>
# cd /usr/lib/python2.6/site-packages/transifex-1.0.0-py2.6.egg/transifex
Note: running the following command by python
./manage.py txcreatedirs        # Create necessary directories
./manage.py syncdb              # Setup DB tables, create superuser
./manage.py migrate             # Setup more DB tables
./manage.py txlanguages   # Create a standard set of languages
./manage.py txcreatenoticetypes # Create a standard set of notice types
./manage.py build_static        # Copy all the addons files to the static dir
</code>

3. Running for development
<code>
# cd /usr/lib/python2.6/site-packages/transifex-1.0.0-py2.6.egg/transifex
Note: running the following command by python
./manage.py runserver 0.0.0.0:8000      # Start the development server
</code>

4. Configuration for apache
<code>
# vi /etc/httpd/conf.d/transifex.conf
&lt; IfModule !python_module&gt;
LoadModule python_module modules/python26-mod_python.so
&lt; /IfModule&gt;
&lt; Directory "/var/www/manual/mod/python26-mod_python"&gt;
&lt; Files *.html&gt;
SetHandler default-handler
&lt; /Files&gt;
&lt; /Directory&gt;
&lt; Location "/transifex/"&gt;
SetHandler python-program
PythonHandler django.core.handlers.modpython
SetEnv DJANGO_SETTINGS_MODULE settings
PythonOption django.root /transifex
PythonDebug On
PythonPath "['/usr/lib/python2.6/site-packages/transifex-1.0.0-py2.6.egg/transifex'] + sys.path"
&lt; /Location&gt;</code>

<code> </code>

<code>Alias /site_media    /usr/lib/python2.6/site-packages/transifex-1.0.0-py2.6.egg/transifex/site_media
&lt; Directory /usr/lib/python2.6/site-packages/transifex-1.0.0-py2.6.egg/transifex/site_media&gt;
Order Deny,Allow
Deny from all
#       Allow from 127.0.0.1
Allow from 192.168.1.0/24
&lt; /Directory&gt;

Note: change some file permission to apache, e.g. the database file and its parent directory.
</code>


Refer to:
<a href="http://help.transifex.net/technical/install.html">Installation Guide</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-transifex-installation-and-configuratio">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-transifex-installation-and-configuratio#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 15 Apr 2011 02:45:00 -0700</pubDate>
      <title>Howto: MongoDB Installation Guide</title>
      <link>http://liuchangjun.com/howto-mongodb-installation-guide</link>
      <guid>http://liuchangjun.com/howto-mongodb-installation-guide</guid>
      <description>
        <![CDATA[<p>
	MongoDB (from "hu<strong>mongo</strong>us") is a scalable, high-performance, open source, document-oriented database, written in C++.

Homepage: <a href="http://www.mongodb.org/">http://www.mongodb.org/</a>

1. Download the package
<code>
# uname -a
Linux hzserver1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
# mkdir -p /home/mongo
# cd /home/mongo
# wget http://fastdl.mongodb.org/linux/mongodb-linux-i686-1.8.1.tgz
# tar zxvf mongodb-linux-i686-1.8.1.tgz
# tree mongodb-linux-i686-1.8.1
mongodb-linux-i686-1.8.1
|-- GNU-AGPL-3.0
|-- README
|-- THIRD-PARTY-NOTICES
`-- bin
    |-- bsondump
    |-- mongo
    |-- mongod
    |-- mongodump
    |-- mongoexport
    |-- mongofiles
    |-- mongoimport
    |-- mongorestore
    |-- mongos
    |-- mongosniff
    `-- mongostat

1 directory, 14 files
</code>
Note: 32-bit builds are limited to around 2GB of data. Recommend 64-bit system.



2. Install the package
<div class='p_embed p_image_embed'>
<a href="http://posterous.com/getfile/files.posterous.com/import-ctmr/EosAsEisnmzabnauvAAIDkBaumrmvDphrBzcICocpaalqbahwqwJrytfflxh/media_httpwwwmongodbo_FHEtr.png.scaled1000.png"><img alt="Media_httpwwwmongodbo_fhetr" height="291" src="http://posterous.com/getfile/files.posterous.com/import-ctmr/EosAsEisnmzabnauvAAIDkBaumrmvDphrBzcICocpaalqbahwqwJrytfflxh/media_httpwwwmongodbo_FHEtr.png.scaled500.png" width="500" /></a>
</div>

<strong>Current servers:</strong>
server1(192.168.1.67):
shard1: /home/mongo/data/shard11
shard2: /home/mongo/data/shard21
config1: /home/mongo/data/config
mongos
server2(192.168.1.68):
shard1: /home/mongo/data/shard12
shard2: /home/mongo/data/shard22
config2: /home/mongo/data/config
mongos
Note: server1 &amp; server2 set up to Replica Sets.

1) server1 tree:
<code>
# tree /home/mongo
mongo
|-- bin
|   |-- bsondump
|   |-- mongo
|   |-- mongo.start.sh
|   |-- mongod
|   |-- mongodump
|   |-- mongoexport
|   |-- mongofiles
|   |-- mongoimport
|   |-- mongorestore
|   |-- mongos
|   |-- mongosniff
|   `-- mongostat
`-- data
    |-- config
    |   |-- _tmp
    |   |-- config.0
    |   |-- config.1
    |   |-- config.log
    |   |-- config.ns
    |   |-- diaglog.4da6a3ac
    |   |-- diaglog.4da6a4e1
    |   |-- diaglog.4da6ac00
    |   `-- mongod.lock
    |-- mongos.log
    |-- shard11
    |   |-- local.0
    |   |-- local.1
    |   |-- local.2
    |   |-- local.ns
    |   |-- mongod.lock
    |   `-- shard11.log
    `-- shard21
        |-- local.0
        |-- local.1
        |-- local.2
        |-- local.ns
        |-- mongod.lock
        `-- shard21.log

6 directories, 33 files
</code>
2) server2 tree:
<code>
[root@hzserver2 home]# tree mongo
mongo
|-- bin
|   |-- bsondump
|   |-- mongo
|   |-- mongo.start.sh
|   |-- mongod
|   |-- mongodump
|   |-- mongoexport
|   |-- mongofiles
|   |-- mongoimport
|   |-- mongorestore
|   |-- mongos
|   |-- mongosniff
|   `-- mongostat
`-- data
    |-- config
    |   |-- config.log
    |   |-- diaglog.4da6a371
    |   |-- diaglog.4da6a4f4
    |   |-- diaglog.4da6a573
    |   |-- diaglog.4da6acee
    |   `-- mongod.lock
    |-- mongos.log
    |-- shard12
    |   |-- local.0
    |   |-- local.1
    |   |-- local.2
    |   |-- local.ns
    |   |-- mongod.lock
    |   `-- shard12.log
    `-- shard22
        |-- local.0
        |-- local.1
        |-- local.2
        |-- local.ns
        |-- mongod.lock
        `-- shard22.log

5 directories, 31 files
</code>


3. Configuring the Replica Sets
1) Start shard1 replica set
<code>
# /home/mongo/bin/mongo -port 10000 -host 192.168.1.67
&gt; config = {_id:'shard1',members:[{_id: 0, host: '192.168.1.67:10000'},{_id: 1, host: '192.168.1.68:10000'}]}
&gt; rs.initiate(config);
</code>
2) Start shard2 replica set
<code>
# /home/mongo/bin/mongo -port 10000 -host 192.168.1.67
&gt; config = {_id:'shard2',members:[{_id: 0, host: '192.168.1.67:10001'},{_id: 1, host: '192.168.1.68:10001'}]}
&gt; rs.initiate(config);
</code>



4. Mongo start scripts
1) server1
<code>
# cat /home/mongo/bin/mongo.start.sh
/home/mongo/bin/mongod -shardsvr -replSet shard1 -port 10000 -dbpath /home/mongo/data/shard11 -oplogSize 100 -logpath /home/mongo/data/shard11/shard11.log -fork
/home/mongo/bin/mongod -shardsvr -replSet shard2 -port 10001 -dbpath /home/mongo/data/shard21 -oplogSize 100 -logpath /home/mongo/data/shard21/shard21.log -fork
/home/mongo/bin/mongod -configsvr -dbpath /home/mongo/data/config -port 20000 -logpath /home/mongo/data/config/config.log -logappend -fork
/home/mongo/bin/mongos -configdb 192.168.1.67:20000 -port 30000 -chunkSize 5 -logpath /home/mongo/data/mongos.log -logappend -fork
</code>
2) server2
<code>
# cat /home/mongo/bin/mongo.start.sh
/home/mongo/bin/mongod -shardsvr -replSet shard1 -port 10000 -dbpath /home/mongo/data/shard12 -oplogSize 100 -logpath /home/mongo/data/shard12/shard12.log -fork
/home/mongo/bin/mongod -shardsvr -replSet shard2 -port 10001 -dbpath /home/mongo/data/shard22 -oplogSize 100 -logpath /home/mongo/data/shard22/shard22.log -fork
/home/mongo/bin/mongod -configsvr -dbpath /home/mongo/data/config -port 20000 -logpath /home/mongo/data/config/config.log -logappend -fork
/home/mongo/bin/mongos -configdb 192.168.1.67:20000 -port 30000 -chunkSize 5 -logpath /home/mongo/data/mongos.log -logappend -fork
</code>
Note: mongos only use 1 or 3 configdb.



5. Configuring the Shard Cluster
<code>
# /home/mongo/bin/mongo 192.168.1.67:30000/admin
&gt; db
admin
&gt; db.runCommand({addshard:"shard1/192.168.1.67:10000,192.168.1.68:10000", name:"s1", maxsize:20480});
{ "shardAdded" : "s1", "ok" : 1 }
&gt; db.runCommand({addshard:"shard2/192.168.1.67:10001,192.168.1.68:10001", name:"s2", maxsize:20480});
{ "shardAdded" : "s2", "ok" : 1 }
&gt; db.runCommand({listshards:1})
{
        "shards" : [
                {
                        "_id" : "s1",
                        "host" : "shard1/192.168.1.67:10000,192.168.1.68:10000"
                },
                {
                        "_id" : "s2",
                        "host" : "shard2/192.168.1.67:10001,192.168.1.68:10001"
                }
        ],
        "ok" : 1
}
&gt; db.runCommand({enablesharding:"test_database"})
{ "ok" : 1 }
</code>



Refer to:
<a href="http://www.taobaodba.com/html/525_525.html">1. &#37197;&#32622;mongodb&#20998;&#29255;&#32676;&#38598;(sharding cluster)</a>
<a href="http://blog.csdn.net/yulchaochow/archive/2010/12/02/6050079.aspx">2. MongoDB shard replica config/ &#20998;&#29255; &#22797;&#21046; &#37197;&#32622;</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-mongodb-installation-guide">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-mongodb-installation-guide#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
      <media:content type="image/png" url="http://posterous.com/getfile/files.posterous.com/import-ctmr/EosAsEisnmzabnauvAAIDkBaumrmvDphrBzcICocpaalqbahwqwJrytfflxh/media_httpwwwmongodbo_FHEtr.png" width="572" height="333">
        <media:thumbnail url="http://posterous.com/getfile/files.posterous.com/import-ctmr/EosAsEisnmzabnauvAAIDkBaumrmvDphrBzcICocpaalqbahwqwJrytfflxh/media_httpwwwmongodbo_FHEtr.png.scaled500.png" width="500" height="291"/>
      </media:content>
    </item>
    <item>
      <pubDate>Fri, 08 Apr 2011 08:17:00 -0700</pubDate>
      <title>Howto: RTPproxy Installation Guide</title>
      <link>http://liuchangjun.com/howto-rtpproxy-installation-guide</link>
      <guid>http://liuchangjun.com/howto-rtpproxy-installation-guide</guid>
      <description>
        <![CDATA[<p>
	The Sippy RTPproxy is a high-performance software proxy server for RTP streams that can work together with  SIP Express Router (SER),  OpenSIPS,  Kamailio, Sippy B2BUA or  reSIProcate B2BUA.

The main purpose of RTPproxy originally had been to make the communication between SIP user agents behind NAT(s) (Network Address Translator) possible.

Homepage: <a href="http://www.rtpproxy.org/">http://www.rtpproxy.org/</a>

1. Installation
Download the package
<code>
# cd ~
# wget http://b2bua.org/chrome/site/rtpproxy-1.2.1.tar.gz
# tar zxvf rtpproxy-1.2.1.tar.gz
# cd rtpproxy-1.2.1
</code>
Make and install
<code>
# ./configure
# make
# make install
</code>

2. Running with Kamailio
<code>
# rtpproxy -l xxx.xxx.xxx.xxx -s udp:localhost 7722 -u ftp
</code>
	
</p>

<p><a href="http://liuchangjun.com/howto-rtpproxy-installation-guide">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-rtpproxy-installation-guide#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 08 Apr 2011 08:05:45 -0700</pubDate>
      <title>Howto: Kamailio (OpenSER) Installation Guide</title>
      <link>http://liuchangjun.com/howto-kamailio-openser-installation-guide</link>
      <guid>http://liuchangjun.com/howto-kamailio-openser-installation-guide</guid>
      <description>
        <![CDATA[<p>
	Kamailio (former OpenSER) is an Open Source SIP Server released under GPL, able to handle thousands of call setups per second.

Homepage: <a href="http://www.kamailio.org">http://www.kamailio.org</a>

1. Installation
Download the source package
<code>
# cd ~
# wget http://www.kamailio.org/pub/kamailio/latest/src/kamailio-3.1.3_src.tar.gz
# tar zxvf kamailio-3.1.3_src.tar.gz
# cd kamailio-3.1.3
# make FLAVOUR=kamailio cfg
</code>
Modify "modules.lst", Remove db_mysql from the variable exclude_modules.
<code>
# make all
# make install
</code>
The Kamailio was installed in "/usr/local/sbin", the configuration file was installed in "/usr/local/etc/kaimailio"
<code>
    kamailio - Kamailio (OpenSER) server
    kamdbctl - script to create and manage the Databases
    kamctl - script to manage and control Kamailio (OpenSER) server
    sercmd - CLI - command line tool to interface with Kamailio (OpenSER) server
</code>

2. Configuration
Config the enviroment variables
<code>
# cat /usr/local/etc/kamailio/kamctlrc
# $Id$
#
# The Kamailio configuration file for the control tools.
#
# Here you can set variables used in the kamctl and kamdbctl setup
# scripts. Per default all variables here are commented out, the control tools
# will use their internal default values.

## your SIP domain
# SIP_DOMAIN=kamailio.org
SIP_DOMAIN=hzserver1

## chrooted directory
# $CHROOT_DIR="/path/to/chrooted/directory"

## database type: MYSQL, PGSQL, ORACLE, DB_BERKELEY, or DBTEXT, by default none is loaded
# If you want to setup a database with kamdbctl, you must at least specify
# this parameter.
# DBENGINE=MYSQL
DBENGINE=MYSQL

## database host
# DBHOST=localhost
DBHOST=localhost

## database name (for ORACLE this is TNS name)
# DBNAME=openser
DBNAME=openser

# database path used by dbtext or db_berkeley
# DB_PATH="/usr/local/etc/kamailio/dbtext"

## database read/write user
# DBRWUSER=openser
DBRWUSER=openser

## password for database read/write user
# DBRWPW="openserrw"
DBRWPW="openserrw"

## database read only user
# DBROUSER=openserro
DBROUSER=openserro

## password for database read only user
# DBROPW=openserro
DBROPW=openserro

## database super user (for ORACLE this is 'scheme-creator' user)
# DBROOTUSER="root"
DBROOTUSER="root"

# user name column
# USERCOL="username"
USERCOL="username"


# SQL definitions
# If you change this definitions here, then you must change them
# in db/schema/entities.xml too.
# FIXME

# FOREVER="2020-05-28 21:32:15"
# DEFAULT_ALIASES_EXPIRES=$FOREVER
# DEFAULT_Q="1.0"
# DEFAULT_CALLID="Default-Call-ID"
# DEFAULT_CSEQ="13"
# DEFAULT_LOCATION_EXPIRES=$FOREVER


# Program to calculate a message-digest fingerprint
# MD5="md5sum"

# awk tool
# AWK="awk"

# If you use a system with a grep and egrep that is not 100% gnu grep compatible,
# e.g. solaris, install the gnu grep (ggrep) and specify this below.
#
# grep tool
# GREP="grep"

# egrep tool
# EGREP="egrep"

# sed tool
# SED="sed"

# tail tool
# LAST_LINE="tail -n 1"

# expr tool
# EXPR="expr"


# Describe what additional tables to install. Valid values for the variables
# below are yes/no/ask. With ask (default) it will interactively ask the user
# for an answer, while yes/no allow for automated, unassisted installs.
#

# If to install tables for the modules in the EXTRA_MODULES variable.
# INSTALL_EXTRA_TABLES=ask

# If to install presence related tables.
# INSTALL_PRESENCE_TABLES=ask

# Define what module tables should be installed.
# If you use the postgres database and want to change the installed tables, then you
# must also adjust the STANDARD_TABLES or EXTRA_TABLES variable accordingly in the
# kamdbctl.base script.

# Kamailio standard modules
# STANDARD_MODULES="standard acc lcr domain group permissions registrar usrloc msilo
#                   alias_db uri_db speeddial avpops auth_db pdt dialog dispatcher
#                   dialplan"

# Kamailio extra modules
# EXTRA_MODULES="imc cpl siptrace domainpolicy carrierroute userblacklist htable purple"


## type of aliases used: DB - database aliases; UL - usrloc aliases
## - default: none
# ALIASES_TYPE="DB"

## control engine: FIFO or UNIXSOCK
## - default FIFO
# CTLENGINE="FIFO"

## path to FIFO file
# OSER_FIFO="FIFO"

## check ACL names; default on (1); off (0)
# VERIFY_ACL=1

## ACL names - if VERIFY_ACL is set, only the ACL names from below list
## are accepted
# ACL_GROUPS="local ld int voicemail free-pstn"

## verbose - debug purposes - default '0'
# VERBOSE=1
VERBOSE=1

## do (1) or don't (0) store plaintext passwords
## in the subscriber table - default '1'
# STORE_PLAINTEXT_PW=0

## OPENSER START Options
## PID file path - default is: /var/run/kamailio.pid
# PID_FILE=/var/run/kamailio.pid
PID_FILE=/var/run/kamailio.pid

## Extra start options - default is: not set
# example: start Kamailio with 64MB share memory: STARTOPTIONS="-m 64"
# STARTOPTIONS=
STARTOPTIONS="-u ftp"
</code>
Add the following lines in the config file.
<code>
# cat /usr/local/etc/kamailio/kamailio.cfg
......
#!define WITH_MYSQL
#!define WITH_AUTH
#!define WITH_USRLOCDB
#!define WITH_NAT
......
</code>
Create MySQL database (Do change the passwords for these two users immediately after the database is created)
<code>
# /usr/local/sbin/kamdbctl create
</code>

3. Start the Kamailio
<code>
# /usr/local/sbin/kamailio
</code>

4. Monitor the Kamailio
<code>
# /usr/local/sbin/kamctl moni
</code>

5. Add user
<code>
# kamctl add 80001 80001
</code>



Refer to:
<a href="http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git">http://www.kamailio.org/dokuwiki/doku.php/install:kamailio-3.1.x-from-git</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-kamailio-openser-installation-guide">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-kamailio-openser-installation-guide#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 06 Apr 2011 02:17:54 -0700</pubDate>
      <title>Howto: FFmpeg build in Windows &amp; Linux</title>
      <link>http://liuchangjun.com/howto-ffmpeg-build-in-windows-linux</link>
      <guid>http://liuchangjun.com/howto-ffmpeg-build-in-windows-linux</guid>
      <description>
        <![CDATA[<p>
	FFmpeg is a complete, cross-platform solution to record, convert and stream audio and video. It includes libavcodec - the leading audio/video codec library.

Homepage: <a href="http://ffmpeg.org/">http://ffmpeg.org/</a>

1. Linux
Test release: <a href="http://ffmpeg.org/releases/ffmpeg-0.6.2.tar.gz">http://ffmpeg.org/releases/ffmpeg-0.6.2.tar.gz</a>
<code>
# cd ~/ffmpeg
# wget http://ffmpeg.org/releases/ffmpeg-0.6.2.tar.gz
# tar zxvf ffmpeg-0.6.2.tar.gz
# cd ffmpeg-0.6.2
# ./configure
# make
</code>
Example code: &#65374;/ffmpeg/ffmpeg-0.6.2/libavcodec/api-example.c
<code>
# cd ~/ffmpeg/ffmpeg-0.6.2
# cp ./lib*/*.a .
# cp ./libavcodec/api-example.c .
# touch Makefile.test
</code>
Test Makefile:
<code>
CC=gcc
CFLAGS=-I. -L. -L/usr/lib -lm -lz -lavdevice -lavfilter -lavformat -lavcodec -lpostproc -lswscale -lavutil</code>

<code>OBJECTS = api-example.o</code>

<code>all: api-example

api-example: $(OBJECTS)
$(CC) -o api-example $(OBJECTS) $(CFLAGS)

api-example.o: api-example.c
$(CC) -c api-example.c $(CFLAGS)

</code>

&nbsp;

<code>.PHONY: clean
clean:
-rm -rf $(OBJECTS) api-example
</code>
Note: we should modify the directory of the include files!

2. Windows
Windows builds: <a href="http://hawkeye.arrozcru.org/">http://hawkeye.arrozcru.org/</a>
Test release: <a href="http://hawkeye.arrozcru.org/builds/32-bit/dev/ffmpeg-git-8b8bf89-32-bit-dev.7z">http://hawkeye.arrozcru.org/builds/32-bit/dev/ffmpeg-git-8b8bf89-32-bit-dev.7z</a>

Example code:
unzip ffmpeg-git-8b8bf89-32-bit-dev.7z into the following directory.
<code>
c:\project\ffmpeg\test.win&gt; dir
api-example.c
Makefile.win
doc
include
lib
</code>
Note: include the "include" &amp; "lib" in the project, modify the directory of the include files!
	
</p>

<p><a href="http://liuchangjun.com/howto-ffmpeg-build-in-windows-linux">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-ffmpeg-build-in-windows-linux#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 23 Feb 2011 09:31:02 -0800</pubDate>
      <title>Howto: usage of tools</title>
      <link>http://liuchangjun.com/howto-usage-of-tools</link>
      <guid>http://liuchangjun.com/howto-usage-of-tools</guid>
      <description>
        <![CDATA[<p>
	<h1>yum&#19979;&#36733;&#19981;&#25353;&#29031;RPM&#21253;</h1>
Refer to: <a href="http://297020555.blog.51cto.com/1396304/477757">http://297020555.blog.51cto.com/1396304/477757</a>

1. &#39318;&#20808;&#23433;&#35013;yum-downloadonly
yum install yum-downloadonly

2. &#21482;&#19979;&#36733;&#19981;&#23433;&#35013;
yum update httpd -y --downloadonly

3. &#21482;&#19979;&#36733;&#21040;&#25351;&#23450;&#30446;&#24405;&#65292;&#20294;&#19981;&#23433;&#35013;
yum update httpd -y --downloadonly --downloaddir=/opt
	
</p>

<p><a href="http://liuchangjun.com/howto-usage-of-tools">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-usage-of-tools#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 21 Feb 2011 06:26:21 -0800</pubDate>
      <title>Howto: Voip Performance test - SIPp</title>
      <link>http://liuchangjun.com/howto-voip-performance-test-sipp</link>
      <guid>http://liuchangjun.com/howto-voip-performance-test-sipp</guid>
      <description>
        <![CDATA[<p>
	Homepage: <a href="http://sipp.sourceforge.net/">http://sipp.sourceforge.net/</a>

&#27979;&#35797;&#36719;&#20214;
SIPp v3.2-TLS-PCAP, version unknown, built Feb 17 2011, 10:19:21.

&#23433;&#35013;&#32534;&#35793;&#65306;
&#19979;&#36733;&#28304;&#20195;&#30721;&#21518;&#37325;&#26032;&#32534;&#35793;
# wget <a href="http://sourceforge.net/projects/sipp/files/sipp/3.2/sipp.svn.tar.gz/download?use_mirror=ncu">http://sourceforge.net/projects/sipp/files/sipp/3.2/sipp.svn.tar.gz/download?...</a>
# tar zxvf sipp.svn.tar.gz
# cd sipp.svn
# make pcapplay_ossl

&#22791;&#27880;&#65306;&#27979;&#35797;RTP&#38656;&#35201;pcap&#21253;&#65292;&#27979;&#35797;&#35748;&#35777;&#38656;&#35201;OpenSSL&#21253;&#65292;e.g.
* C++ Compiler
* curses or ncurses library
* For authentication and TLS support: OpenSSL &gt;= 0.9.8
* For pcap play support: libpcap and libnet
* For distributed pauses: Gnu Scientific Libraries

&#27979;&#35797;&#33050;&#26412;&#21629;&#20196;
sipp -sf meeting.xml -inf meeting.csv -l 60 -m 60 -i 192.168.1.67 192.168.1.40:5060

&#27979;&#35797;&#27969;&#31243;
1. &#21019;&#24314;&#20250;&#35758;&#25509;&#20837;&#21495;&#65306;10000&#65307;
2. &#21019;&#24314;&#20250;&#35758;&#65306;123456&#65292;&#23494;&#30721;&#65306;123&#65307;

SIPp UAC               MCU
|(1) INVITE         |
|------------------&gt;|
|(2) 100 (optional) |
|&lt;------------------|
|(3) 183 (optional) |
|&lt;------------------|
|(4) 200            |
|&lt;------------------|
|(5) ACK            |
|------------------&gt;|
|                   |
|(6) RFC2833 DIGIT  |
|    (123456#)      |
|                   |
|==================&gt;|
|(7) RFC2833 DIGIT  |
|                   |
|      (123#)       |
|==================&gt;|
|                   |
|(8) RTP send (600s)|
|==================&gt;|
|                   |
|(9) BYE            |
|------------------&gt;|
|(10) 200           |
|&lt;------------------|

&#30456;&#20851;&#33050;&#26412;&#65306;
gennum.sh
<code>
#!/bin/bash
echo "SEQUENTIAL" &gt; meeting.csv
i=80000
while [ $i != 89999  ]
do
i=$(($i+1))
echo "$i;10000" &gt;&gt;meeting.csv
#  j=$(($i+1))
#echo "$i;[authentication username=$i password=$i]" &gt;&gt;meeting.csv
done
</code>

meeting.csv
<code>
SEQUENTIAL
80001;10000
80002;10000
80003;10000
</code>

meeting.sh
<code>
./sipp -sf meeting.xml -inf meeting.csv -p 10000 -l 60 -m 10000 -i 192.168.1.67 192.168.1.40:15060
</code>

meeting.xml
<a href="http://sipp.sourceforge.net/doc/uac_pcap.xml">&#21442;&#32771;uac_pcap.xml</a>

Refer to:
<a href="http://blogold.chinaunix.net/u/4631/showart_220923.html">SIP&#21387;&#21147;&#27979;&#35797;&#26368;&#22909;&#30340;&#24037;&#20855;&#65292;SIPp&#30340;&#23433;&#35013;&#19982;&#20351;&#29992;</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-voip-performance-test-sipp">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-voip-performance-test-sipp#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sat, 12 Feb 2011 03:33:08 -0800</pubDate>
      <title>Howto: MySQL Master Slave Configuration</title>
      <link>http://liuchangjun.com/howto-mysql-master-slave-configuration</link>
      <guid>http://liuchangjun.com/howto-mysql-master-slave-configuration</guid>
      <description>
        <![CDATA[<p>
	<h1>Mysql Master-Slave configuration</h1>
<h2>&#32593;&#32476;&#29615;&#22659;</h2>
&#20027;&#26381;&#21153;&#22120;&#65306;server1, 192.168.2.231

&#22791;&#20221;&#26381;&#21153;&#22120;&#65306;server2, 192.168.1.78
<h2>&#37197;&#32622;&#20027;&#22791;&#25968;&#25454;&#24211;</h2>
<h3>&#21019;&#24314;&#21516;&#27493;&#29992;&#25143;</h3>
&#22312;&#20027;&#25968;&#25454;&#24211;&#19978;&#21019;&#24314;&#21516;&#27493;&#29992;&#25143;&#65292;&#20197;&#20415;&#35813;&#24080;&#21495;&#21487;&#20197;&#35775;&#38382;&#20027;&#25968;&#25454;&#24211;&#12290;

e.g.

mysql&gt; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'192.168.1.78' IDENTIFIED BY '123456';

&#39564;&#35777;&#26041;&#27861;&#65292;&#21487;&#20197;&#30331;&#24405;&#21040;&#22791;&#20221;&#26381;&#21153;&#22120;&#20351;&#29992;&#19979;&#38754;&#30340;&#21629;&#20196;&#35775;&#38382;&#20027;&#26381;&#21153;&#22120;&#65292;&#22914;&#26524;&#21487;&#20197;&#35775;&#38382;&#35828;&#26126;&#37197;&#32622;&#27491;&#30830;&#65306;

# mysql &ndash;u repl &ndash;p &ndash;h 192.168.2.231
<h3>&#20462;&#25913;&#25968;&#25454;&#24211;&#37197;&#32622;&#25991;&#20214;</h3>
&#27880;&#24847;&#65306;&#25152;&#26377;&#26381;&#21153;&#22120;&#30340;server-id&#19981;&#33021;&#30456;&#21516;&#65281;&#65281;&#65281;

1. &#20462;&#25913;&#20027;&#37197;&#32622;&#25991;&#20214;

# vi /etc/my.cnf

[mysqld]

log-bin=mysql-bin

server-id=1&nbsp;&nbsp; # 1 - 2^32-1

2. &#20462;&#25913;&#22791;&#37197;&#32622;&#25991;&#20214;

# vi /etc/my.cnf

[mysqld]

server-id=101&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # 1 - 2^32-1

3. &#37325;&#21551;&#20027;&#22791;&#25968;&#25454;&#24211;

# service mysqld restart
<h3>&#22791;&#20221;&#20027;&#25968;&#25454;&#24211;&#25991;&#20214;&#24182;&#23548;&#20837;&#22791;&#20221;&#25968;&#25454;&#24211;&#65288;&#26041;&#27861;&#19968;&#65289;</h3>
&#27880;&#24847;&#65306;&#30830;&#35748;&#20027;&#25968;&#25454;&#24211;&#19981;&#34987;&#20462;&#25913;&#65281;&#65281;&#65281;

1. &#20027;&#26381;&#21153;&#22120;&#19978;&#25805;&#20316;&#65306;

&#22791;&#20221;&#25968;&#25454;&#24211;

# mysqldump --all-databases &gt; /root/mysql-backup.sql

&#25171;&#21253;&#22791;&#20221;&#25991;&#20214;

# tar czvf /root/mysql-backup.tar.gz /root/mysql-backup.sql

&#22797;&#21046;&#21040;&#22791;&#20221;&#26381;&#21153;&#22120;

# scp /root/mysql-backup.tar.gz root@server2:/root/

2. &#22791;&#20221;&#26381;&#21153;&#22120;&#19978;&#25805;&#20316;&#65306;

&#35299;&#21387;&#22791;&#20221;&#25991;&#20214;

# cd /root

# tar zxvf /root/mysql-backup.tar.gz

&#23548;&#20837;&#21040;&#22791;&#20221;&#25968;&#25454;&#24211;

# mysql &ndash;u roo &ndash;p &lt; /root/mysql-backup.sql
<h3>&#22791;&#20221;&#20027;&#25968;&#25454;&#24211;&#25991;&#20214;&#24182;&#23548;&#20837;&#22791;&#20221;&#25968;&#25454;&#24211;&#65288;&#26041;&#27861;&#20108;&#65289;</h3>
1. &#20027;&#26381;&#21153;&#22120;&#19978;&#25805;&#20316;&#65306;

&#38145;&#23450;&#25968;&#25454;&#24211;&#21482;&#35835;

mysql&gt; FLUSH TABLES WITH READ LOCK;

&#19981;&#35201;&#36864;&#20986;&#19978;&#38754;&#30340;&#21629;&#20196;&#65292;&#22791;&#20221;&#25968;&#25454;&#24211;&#25991;&#20214;

# tar zcvf /root/backup.tar.gz /var/lib/mysql

&#22797;&#21046;&#21040;&#22791;&#20221;&#26381;&#21153;&#22120;

# scp /root/ backup.tar.gz root@server2:/root/

&#35760;&#24405;master&#29366;&#24577;

mysql&gt; SHOW MASTER STATUS;

&#37322;&#25918;&#25968;&#25454;&#24211;&#38145;

mysql&gt; UNLOCK TABLES;

2. &#22791;&#20221;&#26381;&#21153;&#22120;&#19978;&#25805;&#20316;&#65306;

&#20572;&#27490;mysql&#26381;&#21153;

# service mysqld stop

&#35299;&#21387;&#22791;&#20221;&#25991;&#20214;

# cd /var/lib/mysql

# tar zxvf /root/mysql-backup.tar.gz

&#21551;&#21160;mysql&#26381;&#21153;

# service mysqld start
<h2>&#37197;&#32622;&#20027;&#22791;&#21516;&#27493;</h2>
<h3>&#26597;&#30475;&#20027;&#25968;&#25454;&#24211;&#29366;&#24577;</h3>
&#26597;&#30475;master&#29366;&#24577;&#65292;&#35760;&#24405;&#19979;File&#21644;Position

mysql&gt; show master status;

| File&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;| Position &nbsp;| Binlog_Do_DB | Binlog_Ignore_DB |

| mysql-bin.000001 | 72267996 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|
<h3>&#35774;&#32622;Master&#65292;&#26597;&#30475;&#22791;&#20221;&#25968;&#25454;&#24211;&#29366;&#24577;</h3>
1. &#35774;&#32622;Master

mysql&gt; CHANGE MASTER TO MASTER_HOST='192.168.2.231', MASTER_USER='repl', MASTER_PASSWORD='123456', MASTER_LOG_FILE='mysql-bin.000001', MASTER_LOG_POS=72267996;

2. &#26597;&#30475;slave&#29366;&#24577;

mysql&gt; show slave status;

| Connecting to master | 192.168.2.231 | repl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3306 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 60 | mysql-bin.000001 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 72267996 | mysqld-relay-bin.000001 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 98 | mysql-bin.000001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Yes&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 72267996 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;98 | None&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 | No&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NULL |

3. &#21551;&#21160;slave

mysql&gt; start slave;

4. &#39564;&#35777;&#21516;&#27493;&#29366;&#24577;

&#26816;&#26597;&#20027;&#25968;&#25454;&#24211;&#36827;&#31243;&#29366;&#24577;&#65292;&#20849;1&#20010;&#21516;&#27493;&#36827;&#31243;

mysql&gt; show processlist;

110346 | repl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 192.168.1.78:45597 | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Binlog Dump | 59523 | Has sent all binlog to slave; waiting for binlog to be updated | NULL

&#26816;&#26597;&#22791;&#20221;&#25968;&#25454;&#24211;&#36827;&#31243;&#29366;&#24577;&#65292;&#20849;2&#20010;&#21516;&#27493;&#36827;&#31243;

mysql&gt; show processlist;

|&nbsp;&nbsp;&nbsp; 1 | system user |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Connect | 59472 | Waiting for master to send event&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL |

|&nbsp;&nbsp;&nbsp; 2 | system user |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | NULL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Connect |&nbsp;&nbsp;&nbsp; 35 | Has read all relay log; waiting for the slave I/O thread to update it | NULL |

&#20462;&#25913;&#20027;&#25968;&#25454;&#24211;&#25968;&#25454;&#65292;&#28982;&#21518;&#22312;&#22791;&#20221;&#25968;&#25454;&#24211;&#26597;&#30475;&#22791;&#20221;&#25968;&#25454;&#24211;&#26159;&#21542;&#20063;&#20462;&#25913;&#25104;&#21151;&#12290;
<h2>FAQ</h2>
<h3>Q1&#65306;&#21516;&#27493;&#25968;&#25454;&#24211;&#21551;&#21160;&#22833;&#36133;&#65311;</h3>
# tail -f /var/log/mysqld.log

101117 12:52:25&nbsp; mysqld started

101117 12:52:25&nbsp; InnoDB: Started; log sequence number 0 8769907

101117 12:52:25 [Note] /usr/libexec/mysqld: ready for connections.

Version: '5.0.22'&nbsp; socket: '/var/lib/mysql/mysql.sock'&nbsp; port: 3306&nbsp; Source distribution

101117 12:56:50 [Warning] Neither --relay-log nor --relay-log-index were used; so replication may break when this MySQL server acts as a slave and has his hostname changed!! Please use '--relay-log=hzserver2-relay-bin' to avoid this problem.

101117 13:38:18 [Note] Slave SQL thread initialized, starting replication in log 'FIRST' at position 0, relay log './hzserver2-relay-bin.000001' position: 4

101117 13:38:18 [Note] Slave I/O thread: connected to master 'repl@hzserver1:3306',&nbsp; replication started in log 'FIRST' at position 4

101117 13:41:39 [Note] /usr/libexec/mysqld: Normal shutdown

101117 13:41:39 [Note] Slave I/O thread killed while reading event

101117 13:41:39 [Note] Slave I/O thread exiting, read up to log 'hzserver1-bin.000001', position 98

101117 13:41:39 [Note] Error reading relay log event: slave SQL thread was killed

101117 13:41:39&nbsp; InnoDB: Starting shutdown...

101117 13:41:42&nbsp; InnoDB: Shutdown completed; log sequence number 0 8769907

101117 13:41:42 [Note] /usr/libexec/mysqld: Shutdown complete

-----------------
<h3>A1&#65306;&#20462;&#25913;&#21551;&#21160;&#33050;&#26412;</h3>
&#22686;&#21152;&#21551;&#21160;&#39033;&#65306;'--relay-log=hzserver2-relay-bin'

# vi /etc/init.d/mysqld

/usr/bin/mysqld_safe&nbsp; --defaults-file=/etc/my.cnf --pid-file="$mypidfile" --log-error="$errlogfile" --relay-log=hzserver2-relay-bin&gt;/dev/null 2&gt;&amp;1 &amp;
<h2>&#21442;&#32771;&#36164;&#26009;</h2>
&#23448;&#26041;&#36164;&#26009;&#65306;

<a href="http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html">http://dev.mysql.com/doc/refman/5.5/en/replication-howto.html</a>

&#22914;&#20309;&#35774;&#32622;MySQL&#21516;&#27493;(Replication)

<a href="http://blog.chinaitlab.com/html/30/104830-161852.html">http://blog.chinaitlab.com/html/30/104830-161852.html</a>

MYSQL&#20027;&#20174;&#22797;&#21046;&#25110;&#21452;&#26426;&#20114;&#22791;

<a href="http://hi.baidu.com/ultimated_fantasy/blog/item/f6752d1843f9450034fa4148.html">http://hi.baidu.com/ultimated_fantasy/blog/item/f6752d1843f9450034fa4148.html</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-mysql-master-slave-configuration">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-mysql-master-slave-configuration#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 17 Dec 2010 03:32:54 -0800</pubDate>
      <title>Howto: &#23433;&#35013;&#37197;&#32622;CentOS&#25991;&#20214;&#21516;&#27493;</title>
      <link>http://liuchangjun.com/howto-centos</link>
      <guid>http://liuchangjun.com/howto-centos</guid>
      <description>
        <![CDATA[<p>
	Homepage: <a href="https://github.com/rvoicilas/inotify-tools">inotify-tools</a>

master: the source host
slave: the destination host

1. Download inotify-tools package and installation
<blockquote class="posterous_medium_quote">master # cd ~
master # wget <a href="https://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz">https://github.com/downloads/rvoicilas/inotify-tools/inotify-tools-3.14.tar.gz</a>
master # tar zxvf inotify-tools-3.14.tar.gz
master # cd inotify-tools-3.14
master # ./configure
master # make
master # make install</blockquote>
2. Generate the SSH KEY to access without the password
<blockquote class="posterous_medium_quote">master # cd ~
master # ssh-keygen -t rsa   # two files: id_rsa (private key) &amp; id_rsa.pub (public key) in ~/.ssh/
master # scp ~/.ssh/id_rsa.pub root@slave:~/.ssh/
slave # cat ~/.ssh/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys
slave # service sshd restart</blockquote>
3. Create sync shell
<blockquote class="posterous_short_quote">master # cat /etc/rc.local
<code>nohup /backup/scripts/sync.sh &amp; &gt; /dev/null 2&gt;&amp;1</code>
</blockquote>
<blockquote class="posterous_short_quote">master # cat /backup/scripts/sync.sh
<code>
#!/bin/sh
ip="xxx.xxx.xxx.xxx yyy.yyy.yyy.yyy" # Add multiple IP address of slave hosts
srcdir="/backup/"
dstdir="/backup/"
/usr/local/bin/inotifywait -mrq --timefmt '%d/%m/%y-%H:%M' --format '%T %w%f' -e modify,delete,create,attrib ${srcdir} \
| while read file
do
for i in $ip
do
rsync -aqztH --delete --progress ${srcdir} root@${i}:${dstdir}
done
done</code>
</blockquote>
Refer to:
<a href="http://www.cnblogs.com/captain_jack/archive/2010/09/29/1838493.html">Cent OS 5.4 rsync+inotify&#37197;&#32622;&#35302;&#21457;&#24335;(&#23454;&#26102;)&#36828;&#31243;&#21516;&#27493;</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-centos">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-centos#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 10 Nov 2010 05:43:13 -0800</pubDate>
      <title>Howto: GTD tools</title>
      <link>http://liuchangjun.com/howto-gtd-tools</link>
      <guid>http://liuchangjun.com/howto-gtd-tools</guid>
      <description>
        <![CDATA[<p>
	<a href="http://www.evernote.com/">EverNote: win/mac/web &amp; iPad/iPhone/Android/BlackBerry/Palm/WinMobile</a>
<a href="http://www.dropbox.com">DropBox: win/mac/linux &amp; iphone/ipad/andriod/blackberry</a> Blocked!
<a href="https://www.rememberthemilk.com/">RTM (Remember The Milk): web</a>
<a href="http://www.omnigroup.com/">OmniFocus: mac/iphone/ipad, trial mode for 14 days</a>
<a href="http://culturedcode.com/things/">Things: mac/iphone/ipad</a>


Refer to:
<a href="http://zh.wikipedia.org/zh/GTD">What is GTD</a>
<a href="http://www.xingfuke.net/psyblog/xingfuke1796.html">&#12304;&#24184;&#31119;&#35838;&#12305;&#22914;&#20309;&#25552;&#39640;&#21019;&#20316;&#22411;&#20219;&#21153;&#30340;&#25928;&#29575;&#65311;&#65288;MAC&#29256;&#65289;</a>
<a href="http://www.lifebang.com/archives/145">GTD&#36719;&#20214;&#24037;&#20855;&#21015;&#34920;</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-gtd-tools">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-gtd-tools#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 10 Nov 2010 02:52:32 -0800</pubDate>
      <title>Howto: Translation</title>
      <link>http://liuchangjun.com/howto-translation</link>
      <guid>http://liuchangjun.com/howto-translation</guid>
      <description>
        <![CDATA[<p>
	Gettext
<a href="http://www.gnu.org/software/gettext/gettext.html">Gettext &#20027;&#39029;</a>
<a href="http://zh.wikipedia.org/zh-cn/Gettext">&#31616;&#20171;&#65306;&#26159;GNU&#22269;&#38469;&#21270;&#19982;&#26412;&#22320;&#21270;(i18n)&#20989;&#25968;&#24211;&#12290;&#23427;&#24120;&#34987;&#29992;&#20110;&#32534;&#20889;&#22810;&#35821;&#35328;&#31243;&#24207;&#12290;</a>
<blockquote class="posterous_short_quote">xgettext:   &#28304;&#20195;&#30721; =&gt; .pot&#27169;&#26495;&#25991;&#20214;
# xgettext --help
e.g.
# xgettext -LPHP /xxx/yyy/zzz.php
</blockquote>
<code># xgettext --help
Usage: xgettext [OPTION] [INPUTFILE]...

Extract translatable strings from given input files.

Mandatory arguments to long options are mandatory for short options too.
Similarly for optional arguments.

Input file location:
  INPUTFILE ...               input files
  -f, --files-from=FILE       get list of input files from FILE
  -D, --directory=DIRECTORY   add DIRECTORY to list for input files search
If input file is -, standard input is read.

Output file location:
  -d, --default-domain=NAME   use NAME.po for output (instead of messages.po)
  -o, --output=FILE           write output to specified file
  -p, --output-dir=DIR        output files will be placed in directory DIR
If output file is -, output is written to standard output.

Choice of input file language:
  -L, --language=NAME         recognise the specified language
                                (C, C++, ObjectiveC, PO, Shell, Python, Lisp,
                                EmacsLisp, librep, Scheme, Smalltalk, Java,
                                JavaProperties, C#, awk, YCP, Tcl, Perl, PHP,
                                GCC-source, NXStringTable, RST, Glade)
  -C, --c++                   shorthand for --language=C++
By default the language is guessed depending on the input file name extension.

Input file interpretation:
      --from-code=NAME        encoding of input files
                                (except for Python, Tcl, Glade)
By default the input files are assumed to be in ASCII.

Operation mode:
  -j, --join-existing         join messages with existing file
  -x, --exclude-file=FILE.po  entries from FILE.po are not extracted
  -c, --add-comments[=TAG]    place comment block with TAG (or those
                              preceding keyword lines) in output file

Language specific options:
  -a, --extract-all           extract all strings
                                (only languages C, C++, ObjectiveC, Shell,
                                Python, Lisp, EmacsLisp, librep, Scheme, Java,
                                C#, awk, Tcl, Perl, PHP, GCC-source, Glade)
  -k, --keyword[=WORD]        additional keyword to be looked for (without
                              WORD means not to use default keywords)
                                (only languages C, C++, ObjectiveC, Shell,
                                Python, Lisp, EmacsLisp, librep, Scheme, Java,
                                C#, awk, Tcl, Perl, PHP, GCC-source, Glade)
      --flag=WORD:ARG:FLAG    additional flag for strings inside the argument
                              number ARG of keyword WORD
                                (only languages C, C++, ObjectiveC, Shell,
                                Python, Lisp, EmacsLisp, librep, Scheme, Java,
                                C#, awk, YCP, Tcl, Perl, PHP, GCC-source)
  -T, --trigraphs             understand ANSI C trigraphs for input
                                (only languages C, C++, ObjectiveC)
      --qt                    recognize Qt format strings
                                (only language C++)
      --debug                 more detailed formatstring recognition result

Output details:
  -e, --no-escape             do not use C escapes in output (default)
  -E, --escape                use C escapes in output, no extended chars
      --force-po              write PO file even if empty
  -i, --indent                write the .po file using indented style
      --no-location           do not write '#: filename:line' lines
  -n, --add-location          generate '#: filename:line' lines (default)
      --strict                write out strict Uniforum conforming .po file
      --properties-output     write out a Java .properties file
      --stringtable-output    write out a NeXTstep/GNUstep .strings file
  -w, --width=NUMBER          set output page width
      --no-wrap               do not break long message lines, longer than
                              the output page width, into several lines
  -s, --sort-output           generate sorted output
  -F, --sort-by-file          sort output by file location
      --omit-header           don't write header with `msgid ""' entry
      --copyright-holder=STRING  set copyright holder in output
      --foreign-user          omit FSF copyright in output for foreign user
      --msgid-bugs-address=EMAIL@ADDRESS  set report address for msgid bugs
  -m, --msgstr-prefix[=STRING]  use STRING or "" as prefix for msgstr entries
  -M, --msgstr-suffix[=STRING]  use STRING or "" as suffix for msgstr entries

Informative output:
  -h, --help                  display this help and exit
  -V, --version               output version information and exit</code>
<blockquote class="posterous_medium_quote">msginit:   .pot&#27169;&#26495;&#25991;&#20214; =&gt; .po&#25991;&#20214; (&#32763;&#35793;&#32773;&#38656;&#35201;&#24037;&#20316;&#30340;&#23545;&#35937;)
# msginit --help
Creates a new PO file, initializing the meta information with values from the
user's environment.</blockquote>
<code># msginit --help
Usage: msginit [OPTION]

Creates a new PO file, initializing the meta information with values from the
user's environment.

Mandatory arguments to long options are mandatory for short options too.

Input file location:
  -i, --input=INPUTFILE       input POT file
If no input file is given, the current directory is searched for the POT file.
If it is -, standard input is read.

Output file location:
  -o, --output-file=FILE      write output to specified PO file
If no output file is given, it depends on the --locale option or the user's
locale setting.  If it is -, the results are written to standard output.

Input file syntax:
  -P, --properties-input      input file is in Java .properties syntax
      --stringtable-input     input file is in NeXTstep/GNUstep .strings syntax

Output details:
  -l, --locale=LL_CC          set target locale
      --no-translator         assume the PO file is automatically generated
  -p, --properties-output     write out a Java .properties file
      --stringtable-output    write out a NeXTstep/GNUstep .strings file
  -w, --width=NUMBER          set output page width
      --no-wrap               do not break long message lines, longer than
                              the output page width, into several lines

Informative output:
  -h, --help                  display this help and exit
  -V, --version               output version information and exit</code>
<blockquote class="posterous_medium_quote">msgfmt:   .po&#25991;&#20214; =&gt; &#32534;&#35793;&#20026;.mo&#25991;&#20214;
# msgfmt --help
e.g.
# msgfmt /xxx/yyy/zzz.po
Note:
msgfmt: messages.po: warning: Charset "CHARSET" is not a portable encoding name.
You should update the "CHARSET" with "utf-8" in zzz.po file.
</blockquote>
<code># msgfmt --help
Usage: msgfmt [OPTION] filename.po ...

Generate binary message catalog from textual translation description.

Mandatory arguments to long options are mandatory for short options too.
Similarly for optional arguments.

Input file location:
  filename.po ...             input files
  -D, --directory=DIRECTORY   add DIRECTORY to list for input files search
If input file is -, standard input is read.

Operation mode:
  -j, --java                  Java mode: generate a Java ResourceBundle class
      --java2                 like --java, and assume Java2 (JDK 1.2 or higher)
      --csharp                C# mode: generate a .NET .dll file
      --csharp-resources      C# resources mode: generate a .NET .resources file
      --tcl                   Tcl mode: generate a tcl/msgcat .msg file
      --qt                    Qt mode: generate a Qt .qm file

Output file location:
  -o, --output-file=FILE      write output to specified file
      --strict                enable strict Uniforum mode
If output file is -, output is written to standard output.

Output file location in Java mode:
  -r, --resource=RESOURCE     resource name
  -l, --locale=LOCALE         locale name, either language or language_COUNTRY
  -d DIRECTORY                base directory of classes directory hierarchy
The class name is determined by appending the locale name to the resource name,
separated with an underscore.  The -d option is mandatory.  The class is
written under the specified directory.

Output file location in C# mode:
  -r, --resource=RESOURCE     resource name
  -l, --locale=LOCALE         locale name, either language or language_COUNTRY
  -d DIRECTORY                base directory for locale dependent .dll files
The -l and -d options are mandatory.  The .dll file is written in a
subdirectory of the specified directory whose name depends on the locale.

Output file location in Tcl mode:
  -l, --locale=LOCALE         locale name, either language or language_COUNTRY
  -d DIRECTORY                base directory of .msg message catalogs
The -l and -d options are mandatory.  The .msg file is written in the
specified directory.

Input file syntax:
  -P, --properties-input      input files are in Java .properties syntax
      --stringtable-input     input files are in NeXTstep/GNUstep .strings
                              syntax

Input file interpretation:
  -c, --check                 perform all the checks implied by
                                --check-format, --check-header, --check-domain
      --check-format          check language dependent format strings
      --check-header          verify presence and contents of the header entry
      --check-domain          check for conflicts between domain directives
                                and the --output-file option
  -C, --check-compatibility   check that GNU msgfmt behaves like X/Open msgfmt
      --check-accelerators[=CHAR]  check presence of keyboard accelerators for
                                menu items
  -f, --use-fuzzy             use fuzzy entries in output

Output details:
  -a, --alignment=NUMBER      align strings to NUMBER bytes (default: 1)
      --no-hash               binary file will not include the hash table

Informative output:
  -h, --help                  display this help and exit
  -V, --version               output version information and exit
      --statistics            print statistics about translations
  -v, --verbose               increase verbosity level
</code>
<blockquote class="posterous_medium_quote">&#22791;&#27880;&#65306;&#20351;&#29992;Unix&#31867;&#22411;&#25805;&#20316;&#31995;&#32479;&#30340;&#29992;&#25143;&#21482;&#38656;&#35774;&#32622;&#29615;&#22659;&#21464;&#37327;&#20013;&#30340;LC_MESSAGES&#65292;&#31243;&#24207;&#23558;&#33258;&#21160;&#20174;&#30456;&#24212;&#30340;.mo &#25991;&#20214;&#20013;&#35835;&#21462;&#35821;&#35328;&#20449;&#24687;&#12290;</blockquote>
Mozilla
<a href="http://www.limodev.cn/blog/archives/513">Mozilla&#30340;&#26550;&#26500;&#35774;&#35745;</a>
<a href="http://books.mozdev.org/html/mozilla-chp-11.html">Creating Applications with Mozilla</a>
<blockquote class="posterous_medium_quote">DTD (.dtd)
Files containing entities that host the strings from XUL content files.
Property (.properties) or string bundles
Files containing strings that are accessed by JavaScript, C++, and possibly other scripting or component files.
RDF
RDF files are described in XML syntax, so use entities.
HTML and text
Suitable for long text, HTML and XML documents and other content that needs to be localized.</blockquote>
	
</p>

<p><a href="http://liuchangjun.com/howto-translation">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-translation#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 09 Nov 2010 09:00:52 -0800</pubDate>
      <title>Howto: narro installation and setup</title>
      <link>http://liuchangjun.com/howto-narro-installation-and-setup</link>
      <guid>http://liuchangjun.com/howto-narro-installation-and-setup</guid>
      <description>
        <![CDATA[<p>
	Homepage: <a href="http://code.google.com/p/narro/">Narro</a>

Download version:
<blockquote><a href="http://narro.googlecode.com/files/narro-0.9.4.tar.gz">narro-0.9.4.tar.gz</a></blockquote>

OS version: CentOS 5
<blockquote class="posterous_short_quote"># uname -a
Linux hzserver2 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux</blockquote>
Installation path:
<blockquote class="posterous_short_quote"># cat /etc/httpd/conf.d/narro.conf
......
Alias /narro    /var/www/narro

Order Deny,Allow
Deny from all
#       Allow from 127.0.0.1
Allow from xxx.xxx.xxx.xxx/24
</blockquote>

Modify the config file:
<blockquote class="posterous_medium_quote">
# cat /var/www/narro/includes/configuration.inc.php
......
define ('__DOCROOT__', realpath(dirname(__FILE__) . '/../..'));
define ('__VIRTUAL_DIRECTORY__', '');
define ('__HTTP_URL__', 'http://xxx.xxx.xxx.xxx');
define ('__SUBDIRECTORY__', '/narro');
define ('__PHP_CLI_PATH__', '/usr/bin/php');
define ('ADMIN_EMAIL_ADDRESS', '<a href="mailto:xxx@yyy.com">xxx@yyy.com</a>');
......
define('DB_CONNECTION_1', serialize(array(
'adapter' =&gt; 'MySqli5',
'encoding' =&gt; 'UTF8',
'server' =&gt; 'localhost',
'port' =&gt; null,
'database' =&gt; 'narro',
'username' =&gt; 'narro',
'password' =&gt; 'narro',
'profiling' =&gt; false)));
......
</blockquote>
Install database script
<blockquote class="posterous_short_quote">
# mysql -u narro narro &lt; /var/www/narro/narro.sql
</blockquote>
Modify permission
<blockquote class="posterous_short_quote">
# chmod -R 777 /var/www/narro/data
# chmod -R 777 /var/www/narro/locale
</blockquote>
Restart httpd service
<blockquote class="posterous_short_quote">
# service httpd restart</blockquote>

Access Narro web page
<blockquote class="posterous_short_quote"><a href="http://xxx.xxx.xxx.xxx/narro">http://xxx.xxx.xxx.xxx/narro</a></blockquote>

Register one account of narro
<blockquote class="posterous_short_quote">Note: The first account will get super powers.</blockquote>

Create one new language
<blockquote class="posterous_short_quote">Chinese Simplified</blockquote>

Create one new project
<blockquote class="posterous_short_quote">sandbox</blockquote>

Setup the project
<blockquote class="posterous_short_quote">
Go to manage the project as admin, import project with the archive file (*.tar.gz, *.zip)
</blockquote>

e.g. sandbox.zip (two directories, en-US and zh-CN)
<blockquote class="posterous_short_quote">|- en-US - messages.po
|- zh-CN</blockquote>

e.g. messages.po (one file to be transferred)
<blockquote class="posterous_short_quote">......
msgid "%1$s created platform %2$s"
msgstr "%1$s &#26032;&#22686;&#20102;&#24179;&#21488; %2$s"
......</blockquote>

Refer to:
<a href="http://code.google.com/p/narro/source/browse/narro/INSTALL">http://code.google.com/p/narro/source/browse/narro/INSTALL</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-narro-installation-and-setup">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-narro-installation-and-setup#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 09 Nov 2010 06:54:04 -0800</pubDate>
      <title>Howto: Update php 5.1 to 5.2 in CentOS 5</title>
      <link>http://liuchangjun.com/howto-update-php-51-to-52-in-centos-5</link>
      <guid>http://liuchangjun.com/howto-update-php-51-to-52-in-centos-5</guid>
      <description>
        <![CDATA[<p>
	&#20351;&#29992;yum&#21319;&#32423;php
<blockquote class="posterous_medium_quote"># uname -a
Linux hzserver2 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

# cat /etc/yum.repos.d/CentOS-Testing.repo
[c5-testing]
name=CentOS-5 Testing
#baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
baseurl=http://dev.centos.org/centos/5/testing/i386/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

# yum update php</blockquote>
Refer to:
<a href="http://wiki.centos.org/HowTos/PHP_5.1_To_5.2">PHP 5.1 To 5.2</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-update-php-51-to-52-in-centos-5">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-update-php-51-to-52-in-centos-5#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 09 Nov 2010 05:23:00 -0800</pubDate>
      <title>&#36873;&#25321;&#22312;&#32447;&#21327;&#20316;&#32763;&#35793;&#24179;&#21488;</title>
      <link>http://liuchangjun.com/56855342</link>
      <guid>http://liuchangjun.com/56855342</guid>
      <description>
        <![CDATA[<p>
	&#20027;&#35201;&#24179;&#21488;&#20027;&#35201;&#26377;&#19977;&#31867;&#65306;

&#31532;&#19968;&#31867;&#65306;&#19987;&#19994;&#21327;&#21516;&#32763;&#35793;&#24179;&#21488;&#12290;&#20197;Launchpad.net&#20026;&#20195;&#34920;&#65292;&#21478;&#22806;&#36824;&#26377;Narro&#65292;py3k.cn&#12290;
<blockquote>
<a href="https://launchpad.net">https://launchpad.net</a> &#36866;&#29992;&#20110;&#20114;&#32852;&#32593;&#32763;&#35793;
<a href="http://code.google.com/p/narro/">http://code.google.com/p/narro/</a> &#36866;&#29992;&#20110;&#33258;&#24049;&#26500;&#24314;&#32593;&#31449;&#65292;&#20114;&#32852;&#32593;&#65292;&#20225;&#19994;&#21644;&#20010;&#20154;
<a href="http://djangobook.py3k.cn/">http://djangobook.py3k.cn/</a> &#31243;&#24207;&#21592;
<a href="http://www.transifex.net/">http://www.transifex.net/ &#25552;&#20379;&#26381;&#21153;</a> &amp;  <a href="http://www.transifex.org/">http://www.transifex.org/ &#24320;&#28304;&#36719;&#20214;</a> &#36866;&#29992;&#20110;&#33258;&#24049;&#26500;&#24314;&#32593;&#31449;&#65292;&#31243;&#24207;&#21592;
</blockquote>
&#31532;&#20108;&#31867;&#65306;Wiki&#32593;&#31449;&#12290;&#20197;Wikipedia&#65288;&#32500;&#22522;&#30334;&#31185;&#65289;&#20026;&#20195;&#34920;&#12290;
<blockquote>
<a href="http://www.mediawiki.org/">MediaWiki</a>
<a href="http://moinmoin.wikiwikiweb.de/">MoinMoin</a>
<a href="http://zh.wikipedia.org/zh/Wiki%E8%BD%AF%E4%BB%B6%E6%AF%94%E8%BE%83">&#21442;&#32771;&#65306;Wiki&#36719;&#20214;&#27604;&#36739;</a>
</blockquote>
&#31532;&#19977;&#31867;&#65306;&#22312;&#32447;&#21150;&#20844;&#22871;&#20214;&#12290;&#20197;Google Docs&#20026;&#20195;&#34920;&#12290;

Refer to:
<a href="http://www.adempiere.com/index.php/ZH/Translation_Platform_Selection">&#20013;&#25991;&#21327;&#20316;&#32763;&#35793;&#24179;&#21488;&#30340;&#36873;&#25321; - Translation Platform Selection</a>
	
</p>

<p><a href="http://liuchangjun.com/56855342">Permalink</a> 

	| <a href="http://liuchangjun.com/56855342#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 01 Nov 2010 07:12:19 -0700</pubDate>
      <title>&#32654;&#20029;&#30340;&#38738;&#28023;&#28246;</title>
      <link>http://liuchangjun.com/56853730</link>
      <guid>http://liuchangjun.com/56853730</guid>
      <description>
        <![CDATA[<p>
	&#21313;&#19968;&#30340;&#26102;&#20505;&#21435;&#20102;&#38738;&#28023;&#28246;&#65292;&#32654;&#20029;&#32780;&#23425;&#38745;&#12290;
<a href="http://picture.liuchangjun.com/pm-6128859301810.html">
<div class='p_embed p_image_embed'>
<img alt="" src="http://picture.liuchangjun.com/dt-6128859301810.png" />
</div>

</a>
&#26368;&#20339;&#30340;&#26053;&#28216;&#26102;&#38388;&#26159;&#19971;&#20843;&#26376;&#20221;&#65292;&#21313;&#19968;&#20197;&#21518;&#23601;&#27809;&#20154;&#20102;&#65292;&#21548;&#35828;&#25105;&#20204;&#21018;&#36208;&#23601;&#19979;&#38634;&#20102;&#12290;
	
</p>

<p><a href="http://liuchangjun.com/56853730">Permalink</a> 

	| <a href="http://liuchangjun.com/56853730#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 13 Oct 2010 05:48:04 -0700</pubDate>
      <title>Howto: &#21019;&#24314;&#21644;&#20351;&#29992;&#20010;&#20154;&#22270;&#24202;</title>
      <link>http://liuchangjun.com/howto</link>
      <guid>http://liuchangjun.com/howto</guid>
      <description>
        <![CDATA[<p>
	&#22312;&#21338;&#23458;&#20013;&#26377;&#20960;&#31181;&#26041;&#27861;&#21487;&#20197;&#20351;&#29992;&#23613;&#21487;&#33021;&#20037;&#30340;&#22270;&#29255;&#65306;

<strong>&#20351;&#29992;&#20813;&#36153;&#30340;&#22270;&#24202;</strong>
Yahoo flickr: <a href="http://www.flickr.com/">http://www.flickr.com/</a>
--- wp flickr plutin: <a href="http://wordpress.org/extend/plugins/wordpress-flickr-manager/">WordPress Flickr Manager</a>
Google picasa: <a href="http://picasaweb.google.com/">http://picasaweb.google.com/</a>
--- wp picasa plutin: <a href="http://wordpress.org/extend/plugins/goldengate/">GoldenGate</a>
MicroSoft: <a href="http://skydrive.live.com">http://skydrive.live.com</a>
&#21407;&#21017;&#65306;&#19981;&#29992;&#22269;&#20869;&#30340;&#65292;&#19981;&#29992;&#23567;&#20844;&#21496;&#30340;&#65307;
&#32570;&#28857;&#65306;&#21487;&#33021;&#34987;&#23553;&#26432;&#65307;

<strong>&#21033;&#29992;&#33258;&#24049;&#30340;&#31354;&#38388;&#21019;&#24314;&#22270;&#24202;</strong>
&#20351;&#29992;WordPress&#25554;&#20214;&#25645;&#24314;: <a href="http://wordpress.org/extend/plugins/nextgen-gallery/">NextGEN Gallery</a>
<blockquote class="posterous_short_quote">&#31616;&#20171;&#65306;NextGEN Gallery is a full integrated Image Gallery plugin for WordPress with a slideshow option.</blockquote>
&#20351;&#29992;&#24320;&#28304;&#36719;&#20214;&#25645;&#24314;: <a href="http://www.codefuture.co.uk/projects/imagehost1.3/">CF Image Hosting Script v1.3</a>
<blockquote class="posterous_medium_quote">&#31616;&#20171;&#65306;CF Image Hosting&#26159;&#31616;&#21333;&#22909;&#29992;&#30340;&#22270;&#24202;&#28304;&#30721;&#65292;&#19981;&#38656;&#35201;&#25968;&#25454;&#24211;&#12290;&#22312;&#25552;&#20379;&#22270;&#29255;&#22806;&#38142;&#26041;&#38754;&#30456;&#24403;&#24378;&#22823;&#65292;&#21508;&#31181;&#22823;&#23567;&#30340;&#32553;&#30053;&#22270;&#65292;&#23436;&#25972;&#22270;&#29255;&#30340;&#38142;&#25509;&#12290;&#36866;&#21512;&#35770;&#22363;&#30340;&#36866;&#21512;&#21338;&#23458;&#30340;&#24212;&#26377;&#23613;&#26377;&#12290;&#22810;&#22269;&#35821;&#35328;&#29256;&#26412;&#65292;&#21253;&#21547;&#31616;&#20307;&#20013;&#25991;&#12290;</blockquote>
&#21407;&#21017;&#65306;&#24320;&#28304;&#65292;&#20813;&#36153;&#65292;&#22270;&#24202;&#20351;&#29992;&#29420;&#31435;&#22495;&#21517;&#22909;&#36716;&#31227;&#65307;
&#32570;&#28857;&#65306;&#21344;&#29992;&#31354;&#38388;&#24102;&#23485;&#65292;&#24597;&#30423;&#38142;&#65307;

Refer to:
<a href="http://www.ruanyifeng.com/blog/2010/03/built_a_image_server.html">&#25645;&#24314;&#20102;&#19968;&#20010;&#22270;&#29255;&#24211;</a>
<a href="http://www.21andy.com/blog/20091223/1589.html">&#25512;&#33616;2&#20010;WordPress&#22270;&#29255;&#19978;&#20256;&#21040;Flickr&#21644;Picasa&#30340;&#25554;&#20214;</a>
<a href="http://lucifr.com/2009/04/05/50-image-gallery-programs-scripts-tutorials/">50&#20010;&#20813;&#36153;&#30340;&#30456;&#20876;&#31243;&#24207;</a>
	
</p>

<p><a href="http://liuchangjun.com/howto">Permalink</a> 

	| <a href="http://liuchangjun.com/howto#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 28 Sep 2010 05:18:56 -0700</pubDate>
      <title>Howto: Installation &amp; Config Cacti &amp; Nagios</title>
      <link>http://liuchangjun.com/howto-installation-config-cacti-nagios</link>
      <guid>http://liuchangjun.com/howto-installation-config-cacti-nagios</guid>
      <description>
        <![CDATA[<p>
	<strong>OS: Redhat AS 5</strong>
<code>
# uname -a
Linux hzserver2 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
</code>

<strong>Installation</strong>
<code>
# yum install net-snmp net-snmp-utils
# yum install mrtg
# yum install cacti
# yum install nagios nagios-devel nagios-plugins nagios-plugins-all
</code>

<strong>Cacti Configuration</strong>
<code>
# mysql -u root -p -e 'create database cacti'

# mysql -u root -p
mysql&gt; GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'zYn95ph43zYtq';
mysql&gt; FLUSH privileges;
mysql&gt; \q

# rpm -ql cacti | grep cacti.sql
/usr/share/doc/cacti-0.8.7f/cacti.sql

# mysql -u cacti -p cacti  /dev/null 2&gt;&amp;1
</code>

<strong>Run Cacti installer</strong>
<code>
http://xxx.xxx.xxx.xxx/cacti/
username: admin
password: cacti
</code>



Refer to:
<a href="http://nagios-cn.sourceforge.net/nagios-cn/Nagios-cn.html">Nagios&#22312;&#32447;&#24110;&#21161;&#20013;&#25991;&#29256;</a>
<a href="http://www.cyberciti.biz/faq/fedora-rhel-install-cacti-monitoring-rrd-software/">RedHat / CentOS Install and Configure Cacti Network Graphing Tool</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-installation-config-cacti-nagios">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-installation-config-cacti-nagios#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sat, 25 Sep 2010 03:05:27 -0700</pubDate>
      <title>Howto: sysstat - &#31995;&#32479;&#29366;&#24577;&#26597;&#30475;&#24037;&#20855;</title>
      <link>http://liuchangjun.com/howto-sysstat</link>
      <guid>http://liuchangjun.com/howto-sysstat</guid>
      <description>
        <![CDATA[<p>
	sysstat&#36719;&#20214;&#21253;&#21253;&#25324;&#20197;&#19979;&#24037;&#20855;&#65306;
<blockquote>iostat &#24037;&#20855;&#25552;&#20379;CPU&#20351;&#29992;&#29575;&#21450;&#30828;&#30424;&#21534;&#21520;&#25928;&#29575;&#30340;&#25968;&#25454;&#65307;
mpstat &#24037;&#20855;&#25552;&#20379;&#21333;&#20010;&#22788;&#29702;&#22120;&#25110;&#22810;&#20010;&#22788;&#29702;&#22120;&#30456;&#20851;&#25968;&#25454;&#65307;
sar &#24037;&#20855;&#36127;&#36131;&#25910;&#38598;&#12289;&#25253;&#21578;&#24182;&#23384;&#20648;&#31995;&#32479;&#27963;&#36291;&#30340;&#20449;&#24687;&#65307;
sa1 &#24037;&#20855;&#36127;&#36131;&#25910;&#38598;&#24182;&#23384;&#20648;&#27599;&#22825;&#31995;&#32479;&#21160;&#24577;&#20449;&#24687;&#21040;&#19968;&#20010;&#20108;&#36827;&#21046;&#30340;&#25991;&#20214;&#20013;&#12290;&#23427;&#26159;&#36890;&#36807;&#35745;&#21010;&#20219;&#21153;&#24037;&#20855;cron&#26469;&#36816;&#34892;&#65292;&#26159;&#20026;sadc&#25152;&#35774;&#35745;&#30340;&#31243;&#24207;&#21069;&#31471;&#31243;&#24207;&#65307;
sa2 &#24037;&#20855;&#36127;&#36131;&#25226;&#27599;&#22825;&#30340;&#31995;&#32479;&#27963;&#36291;&#24615;&#24687;&#20889;&#20837;&#24635;&#32467;&#24615;&#30340;&#25253;&#21578;&#20013;&#12290;&#23427;&#26159;&#20026;sar&#25152;&#35774;&#35745;&#30340;&#21069;&#31471; &#65292;&#35201;&#36890;&#36807;cron&#26469;&#35843;&#29992;
sadc &#26159;&#31995;&#32479;&#21160;&#24577;&#25968;&#25454;&#25910;&#38598;&#24037;&#20855;&#65292;&#25910;&#38598;&#30340;&#25968;&#25454;&#34987;&#20889;&#19968;&#20010;&#20108;&#36827;&#21046;&#30340;&#25991;&#20214;&#20013;&#65292;&#23427;&#34987;&#29992;&#20316;sar&#24037;&#20855;&#30340;&#21518;&#31471;&#65307;
sadf &#26174;&#31034;&#34987;sar&#36890;&#36807;&#22810;&#31181;&#26684;&#24335;&#25910;&#38598;&#30340;&#25968;&#25454;&#65307;</blockquote>

<strong>Installation</strong>
<code>
# yum install sysstat
</code>

Refer to:
<a href="http://www.linuxsir.org/main/node/211">&#31995;&#32479;&#29366;&#24577;&#26597;&#30475;&#24037;&#20855;Sysstat</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-sysstat">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-sysstat#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 21 Sep 2010 08:33:01 -0700</pubDate>
      <title>Howto: install &amp; config Samba</title>
      <link>http://liuchangjun.com/howto-install-config-samba</link>
      <guid>http://liuchangjun.com/howto-install-config-samba</guid>
      <description>
        <![CDATA[<p>
	<strong>OS</strong>
Linux server1 2.6.18-8.el5 #1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux

<strong>Samba version</strong>
# rpm -qa |grep samba
samba-common-3.0.23c-2
system-config-samba-1.2.39-1.el5
samba-client-3.0.23c-2

<strong>Configuration</strong>
Samba configuration directory:
<code>
# ls /etc/samba
lmhosts  secrets.tdb  smb.conf  smbpasswd  smbusers
</code>
User management of Samba:
<code>
# smbpasswd -h
When run by root:
    smbpasswd [options] [username]
otherwise:
    smbpasswd [options]

options:
  -L                   local mode (must be first option)
  -h                   print this usage message
  -s                   use stdin for password prompt
  -c smb.conf file     Use the given path to the smb.conf file
  -D LEVEL             debug level
  -r MACHINE           remote machine
  -U USER              remote username
extra options when run by root or in local mode:
  -a                   add user
  -d                   disable user
  -e                   enable user
  -i                   interdomain trust account
  -m                   machine trust account
  -n                   set no password
  -W                   use stdin ldap admin password
  -w PASSWORD          ldap admin password
  -x                   delete user
  -R ORDER             name resolve order
</code>
Add user (user must be existed in Linux):
<code>
# smbpasswd -a test
</code>
Modify user password:
<code>
# smbpasswd test
</code>

<strong>Configuration file smb.conf</strong>
<code>
......
   workgroup = WORKGROUP
......
   security = user
......
   hosts allow = 192.168.1. 192.168.2. 127.
......
[homes]
   comment = Home Directories
   browseable = no
   writable = yes
[projects]
   comment = Projects of xxx
   path = /projects
   public = yes
   browseable = yes
   writable = yes
   write list = @project_group
   force create mode = 0774
   create mode = 0774
   force directory mode = 0774
   directory mode = 0774
</code>

<strong>Share the directories to one group member</strong>
Add one group:
<code>
# groupadd  -g gid project_group
</code>
Add user to the same group:
<code>
# useradd -G project_group user_name
</code>

<strong>Windows client to remove the link of Samba</strong>
List all net links:
<code>
C:\Documents and Settings\Administrator&gt;net use
OK                     \\xxx.xxx.xxx.xxx\IPC$       Microsoft Windows Network
</code>
Remove Samba link:
<code>
C:\Documents and Settings\Administrator&gt;net use \\xxx.xxx.xxx.xxx\IPC$ /del
&#22312;&#19982; \\xxx.xxx.xxx.xxx\IPC$ &#30340;&#36830;&#25509;&#20013;&#65292;&#26377;&#25171;&#24320;&#30340;&#25991;&#20214;&#21644;/&#25110;&#27809;&#26377;&#32467;&#26463;&#30340;&#30446;&#24405;&#25628;&#32034;&#12290;

&#26159;&#21542;&#32487;&#32493;&#26029;&#24320;&#36830;&#25509;&#24182;&#24378;&#34892;&#20851;&#38381;? (Y/N) [N]: y
\\xxx.xxx.xxx.xxx\IPC$ &#24050;&#32463;&#21024;&#38500;&#12290;
</code>

<strong>Refer to</strong>
<a href="http://samba.org/samba/docs/man/Samba-HOWTO-Collection/">The Official Samba 3.5.x HOWTO and Reference Guide</a>
<a href="http://linux.sheup.com/linux/linux5319.htm">SAMBA&#37197;&#32622;&#35814;&#35299;</a>
<a href="http://www.linuxsir.org/main/?q=node/158">&#19968;&#27493;&#19968;&#23398;Linux&#19982;Windows &#20849;&#20139;&#25991;&#20214;Samba</a>
	
</p>

<p><a href="http://liuchangjun.com/howto-install-config-samba">Permalink</a> 

	| <a href="http://liuchangjun.com/howto-install-config-samba#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/829281/star_s.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/people/37loSxKKor0l</posterous:profileUrl>
        <posterous:firstName>Changjun</posterous:firstName>
        <posterous:lastName>Liu</posterous:lastName>
        <posterous:nickName>star</posterous:nickName>
        <posterous:displayName>Changjun Liu</posterous:displayName>
      </posterous:author>
    </item>
  </channel>
</rss>
