<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6886811715076147315</id><updated>2012-01-09T23:58:19.470-08:00</updated><category term='linux'/><category term='mysql'/><category term='java'/><category term='shell'/><category term='php'/><category term='common tools'/><category term='tools for developer'/><category term='working with linux'/><category term='linux virtualization'/><title type='text'>Effective Linux - Euler's Blog (http://www.effectivelinux.com)</title><subtitle type='html'>Utilize shell scripts,linux commands, open source tools,java, to &lt;B&gt;Maximize the Power of Linux&lt;/B&gt;. &lt;br&gt;
Focused on working with linux and shell, search engine technology including Chinese segmenter &lt;br&gt;
Any questions please contact me at gmail: david.ullua</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-1468736193856784558</id><published>2008-12-06T08:32:00.001-08:00</published><updated>2008-12-06T08:49:51.025-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='linux virtualization'/><title type='text'>Using VirtualBox From Linux to virtualize windows and from windows to virtualize linux</title><content type='html'>1. How to Adjust resolution of guest OS: &lt;br /&gt;启动guest操作系统，安装virtualbox的增强功能,先选择“设备”-&gt;“安装增强功能”。&lt;br /&gt;(booted guest OS, Devices -&gt; Install Guest Additions)&lt;br /&gt;&lt;br /&gt;若是在linux的Virtual Box上虚拟windows， guest os为windows （主操作系统为linux）。&lt;br /&gt;安装增强功能后，在windows的我的电脑中会看到光驱变成了“VirtualBox Guest Additions"， 点击光驱直接安装 Guest Addtions， 安装完重启windows即可。 (Windows would load VirtualBox Guest Additions CD automatically, all you need to do is to run the CD and install Guest Additions , then reboot Windows)&lt;br /&gt;&lt;br /&gt;若是在Windows的Virtual Box上虚拟linux，guest os 为linux（主操作系统为windows)。&lt;br /&gt;安装增强功能后，Ubuntu会自动挂载VBoxGuestAdditions.ISO，并显示在桌面上。 (All you need to do is run BoxLinuxAdditions.run ) :&lt;br /&gt;打开终端，利用su或者sudo指令进入root模式，然后依次输入：&lt;br /&gt;#cd /cdrom 注意：cd命令后面有一个空格）&lt;br /&gt;#sh VBoxLinuxAdditions.run &lt;br /&gt;&lt;br /&gt;2.若使用NAT方式， guest os可以通过原操作系统的路由功能直接访问网络。&lt;br /&gt;&lt;br /&gt;3.允许guest OS访问原操作系统中的目录。 (How to allow folder share between guest OS and the primal OS)&lt;br /&gt;启动guest os后， 点"设备" -&gt;　"分配数据空间" ("devices" -&gt; "share folders" )&lt;br /&gt;增加共享目录，选择目录， 给共享目录取一个名字即可。 比如取名为share。&lt;br /&gt;那么当guest os为windows时，可以运行：&lt;br /&gt;net use x: \\vboxsvr\share 来使用共享的目录。（映射到x:盘)&lt;br /&gt;&lt;br /&gt;当guest os为linux时，可以运行：&lt;br /&gt;mount -t vboxsf share /mnt/mount_point 来通过linux上的mount_point目录来访问共享的share。&lt;br /&gt;&lt;br /&gt;4.如果遇到声音出不来的情况， 那么关闭guest os后，选择虚拟机，设置一下声音(Audio)，确保Enable Audio有被勾选上，并选择了合适的驱动，如果一个驱动不行，就换其他的，然后重启guest os，多试几次就好了。&lt;br /&gt;(If no sound in the guest OS, you can shutdown the guest os, and enable Audio in the Settings for the virtual machine.)&lt;br /&gt;&lt;br /&gt;5.安装增强功能以后，主系统和虚拟的操作系统之间不在需要来回切换，可以很方便地当作一个操作系统使用。&lt;br /&gt;特别是全屏(Full Screen Mode)和无缝显示(Seamless Mode)感觉用户体验相当棒！&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-1468736193856784558?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/1468736193856784558/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=1468736193856784558' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/1468736193856784558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/1468736193856784558'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2008/12/using-virtualbox-from-linux-to.html' title='Using VirtualBox From Linux to virtualize windows and from windows to virtualize linux'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-5547973872623479236</id><published>2008-09-19T08:19:00.000-07:00</published><updated>2008-09-19T08:35:40.637-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mysql'/><category scheme='http://www.blogger.com/atom/ns#' term='linux'/><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>PHP, MySQL中使用UTF-8编码，以及中文乱码的解决</title><content type='html'>若在linux/unix服务器上使用&lt;br /&gt;注意如下事项：&lt;br /&gt;1、设置mysql服务使用的编码：&lt;br /&gt;#vi /etc/&lt;br /&gt;在 [mysqld]以及[mysqld_safe]后面都加上以下两行：&lt;br /&gt;&lt;pre class="code"&gt;default-character-set=&lt;span class="search_hit"&gt;utf8&lt;/span&gt;&lt;br /&gt;default-collation=&lt;span class="search_hit"&gt;utf8&lt;/span&gt;_general_ci&lt;br /&gt;&lt;br /&gt;然后重启mysqld服务： /etc/init.d/mysqld restart (fedora 9) 为例。&lt;br /&gt;&lt;/pre&gt;2.php的页面代码，执行sql语句前（或者在数据库连接建立后）设置本次连接的字符集，示例如下：&lt;br /&gt;           mysql_query("SET NAMES 'utf8'");&lt;br /&gt;           $result=mysql_query("select * from t_userlog");&lt;br /&gt;&lt;br /&gt;3.Terminal登录mysql时指定字符集：&lt;br /&gt;mysql --default-character utf8 -u root -pmypass&lt;br /&gt;这样也可以：&lt;br /&gt;mysql --default-character-set utf8 -u root -pmypass&lt;br /&gt;&lt;br /&gt;4.apache的配置文件httpd.conf中，找到 AddDefaultCharset一行，注释掉，或者改成如下：&lt;br /&gt;AddDefaultCharset off&lt;br /&gt;&lt;br /&gt;（这一步是为了让不同字符集，比如utf-8，gbk的网页放到服务器上都可以正常在客户端显示）&lt;br /&gt;&lt;br /&gt;5.每一个php页面中，都在head部分设定meta头的charset：&lt;br /&gt;&lt; meta equiv="Content-Type" content="text/html; charset=UTF-8" &gt;&lt;br /&gt;&lt;br /&gt;6. 以终端登录mysql中可以用如下sql语句来显示以character开头的变量：&lt;br /&gt;&lt;pre class="code"&gt;SHOW VARIABLES LIKE 'character_set_database';&lt;br /&gt;&lt;br /&gt;SHOW VARIABLES LIKE 'character_set_client';&lt;br /&gt;&lt;/pre&gt;show variables like 'character%';&lt;br /&gt;&lt;br /&gt;可以通过 show character set; 语句来显示有哪些可用的字符集。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-5547973872623479236?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/5547973872623479236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=5547973872623479236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5547973872623479236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5547973872623479236'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2008/09/php-mysqlutf-8.html' title='PHP, MySQL中使用UTF-8编码，以及中文乱码的解决'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-6322162226396461985</id><published>2007-05-31T04:38:00.000-07:00</published><updated>2007-05-31T05:11:27.464-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>Utilize hudson and ant to set up a daily build system step by step</title><content type='html'>Hudson is popular daily build system and a continuous integration engine. It is easy to setup and maintenance. Here's the brief introduction of the deploy process:&lt;br /&gt;&lt;br /&gt;0). download hudson from &lt;a href="https://hudson.dev.java.net/servlets/ProjectDocumentList"&gt;https://hudson.dev.java.net/servlets/ProjectDocumentList&lt;/a&gt;.&lt;br /&gt;You can download jnlp release jar or old release war package.&lt;br /&gt;&lt;br /&gt;1).Hudson needs a web container such as glassfish, tomcat or winstone.&lt;br /&gt;But   Hudson ships with Winstone, so you can run it standalone by run : &lt;tt&gt;java -jar hudson.war&lt;/tt&gt;, or java -jar hudson.jar if you downloaded the jnlp release.&lt;br /&gt;&lt;br /&gt;Use the -D option to specify HUDSON_HOME  in the invocation:&lt;br /&gt;$ java -DHUDSON_HOME=/path/to/home -jar hudson.war&lt;br /&gt;&lt;br /&gt;Alse you can use the environment variable:&lt;br /&gt;$ export HUDSON_HOME=/path/to/hudson_home&lt;br /&gt;$ java -jar hudson.war&lt;br /&gt;&lt;br /&gt;HUDSON_HOME: Hudon needs some diskspace to perform builds and keep archives.&lt;br /&gt;(By default, this is set to &lt;tt&gt;~/.hudson , but you can change it: &lt;a href="https://hudson.dev.java.net/admin.html"&gt;https://hudson.dev.java.net/admin.html&lt;/a&gt;&lt;/tt&gt;)&lt;br /&gt;&lt;br /&gt;2).If you don't have container yet, you can run hudson standalone (with shipped container Winstone), then you can access the portal of hudson by http://hostname:8080/ (default port is 8080), and create a new job, set some basic configurations. it will run by the schedule you configured.&lt;br /&gt;&lt;br /&gt;3).If you have a container already (like tomcat),  just deploy hudson.war to the webapps directory of tomcat, restart tomcat. then you can access the portal from http://hostname:8081/hudson, assume 8081 is the port for tomcat. for glassfish please take a reference at &lt;a href="https://hudson.dev.java.net/containers/glassfish.html"&gt;https://hudson.dev.java.net/containers/glassfish.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;4). you can configure automatic build (like crontab), or periodical build or build by email,  ref: &lt;a href="https://hudson.dev.java.net/build.html"&gt;https://hudson.dev.java.net/build.html &lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5). if you met problem when run ant task (&lt;label for="oe_c8"&gt;Invoke top-level Ant targets&lt;/label&gt;), make sure your ant target is correct. My ant target is "-f CustomBuild.xml makepackage", it runs makepackage in ant build file CustomBuild.xml. If still fails, you can just checkout your project from repository to a clean directory, and run ant command to check whether it runs through, if fails check ant build file.&lt;br /&gt;&lt;br /&gt;6).if can't send email successfully, just click "Manage Hudson" in the index page of the hudson portal, click "System Configuration" to configure smtp related info. If your SMTP need authentication, click "Advanced" in the "E-mail Notification" section, and enter the username plus password.&lt;br /&gt;&lt;br /&gt;It should works, else email me your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-6322162226396461985?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/6322162226396461985/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=6322162226396461985' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6322162226396461985'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6322162226396461985'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/05/utilize-hudson-and-ant-to-set-up-daily.html' title='Utilize hudson and ant to set up a daily build system step by step'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-2674853972355702636</id><published>2007-05-28T06:19:00.000-07:00</published><updated>2007-05-28T07:09:03.839-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>gains of subversion (SVN带来的收益)</title><content type='html'>Author: David Lv Euler&lt;br /&gt;Date: 05/28/2007, Suzhou&lt;br /&gt;&lt;br /&gt;When I working on .Net and VSS. Our team was often troubled by the crippled VSS.  In many cases, someone modified a common file like DbHelper.cs,  or a business logic class Order.cs,  and we need to modify the file too.  Then we need to wait for him/her to checkin/commit the file, even worse, he/she is taking a vacation in another city, then we have to modify the file's read-only attribute on local disk, however could not checkin/commit the changes. It wasted us lots of time in waiting and in checkin/checkout.&lt;br /&gt;&lt;br /&gt;If you are suffering from "lock, checkout and modify" model of VSS (Visual Source Safe) in team cooperation, or you are searching for a version control system,  I suggest you to try subversion (SVN) as source management system. Subversion has a model of "checkout, modify, update and commit".  After checkout a file/folder, anyone can modify a file in the same time, then when execute updating(if no concurrent modification you don't need to update, just commit directly), svn will merge other's modification to your working copy automatically, then you can commit your copy safely. If it can't merge these modifications, it would tell you where are conflicts, and you can resolve them manually and then commit safely. you can reference the manual in &lt;a href="http://subversion.tigris.org"&gt;http://subversion.tigris.org&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;Even if you are using dotnet, there is subversion plugins for VS.net. Now my team are using java,  SVN has helped us in source code management and team cooperation greatly.  I believe that it is one of the most successful open source project.&lt;br /&gt;&lt;br /&gt;当我使用.net和VSS的时候，我们的团队经常被憋足的VSS所绊倒。很多情况下，有人修改了一个公用文件DbHelper.cs 或者一个业务逻辑文件Order.cs, 这时我们也需要修改这个文件。然后我们不得不等他/她签入/提交文件。更糟糕的是，此时他/她可能正在另一个城市旅行，这时我们只好修改本地文件的只读属性，但依然无法签入。大量的时间在等待和签入签出中被浪费了。&lt;br /&gt;&lt;br /&gt;如果您正在被VSS的“锁定，签出，修改”模型所困扰，或者您正在寻找一个版本管理系统，那么我向您推荐subversion (SVN). Subversion使用"签出，修改，更新和提交"的模型，当签出一个文件或目录后，每一个人都可以同时修改同样的文件，然后执行更新（如果没有并发修改就不需要更新,可以直接提交）, svn会自动合并其他人的修改到您的工作文件中.然后您可以安全地提交您的机器上的拷贝. 如果svn无法合并更改,那么她会告诉您哪些地方有冲突,您可以手工解决这些冲突,然后安全地提交. 您可以参考&lt;a href="http://subversion.tigris.org"&gt;http://subversion.tigris.org&lt;/a&gt; 上面的手册.&lt;br /&gt;&lt;br /&gt;即时您在使用dotnet, 仍然有VS.net的subversion插件可以使用。现在我的Team使用java, SVN在代码管理和团队协作上给了我们很大的帮助。我相信她是最优秀的开源项目之一。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-2674853972355702636?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/2674853972355702636/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=2674853972355702636' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2674853972355702636'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2674853972355702636'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/05/gains-of-subversion-svn.html' title='gains of subversion (SVN带来的收益)'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-2924063984279799219</id><published>2007-05-09T00:08:00.000-07:00</published><updated>2007-05-09T00:27:31.735-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>"You can't load TkCximage", could not run amsn as normal user</title><content type='html'>gaim or Kopete would miss lots of messages. what's the most worse is file transfer often fails. so i tried amsn under linux as MSN messenger.&lt;br /&gt;&lt;br /&gt;I download amsn 0.96 from linuxpackages for the slack package.&lt;br /&gt;First time when i run ./amsn, it said "exec wish" failed, then I googled and installed TCL/tk in the slackware 11 second ISO file.&lt;br /&gt;&lt;br /&gt;Then run ./amsn, it said could not find ComboBox, oh, then googled and find that the package is installed by root, and normal users does not have the rights of /usr/share/amsn/utils/combobox.  So I chown the rights to a normal user. Still, it said  "You can't load TkCximage, this is now needed to run aMSN. please compile amsn first..." , oh, God, the cause is /usr/share/amsn/ and all it's sub-directories doesn't have the execute permission, so  can't load TkCximage.&lt;br /&gt;&lt;br /&gt;Then I logged in xfce as root , run amsn, it works.  So I tried to give all subdirectories under  /usr/share/amsn/  with execute permission,  ( add execute permission for all subdirectories under folder ):&lt;br /&gt;#cd /usr/share/amsn/&lt;br /&gt;#find  ./ -type d -exec chown david.users {} \;&lt;br /&gt;#find  ./ -type d -exec chmod +x {} \;&lt;br /&gt;&lt;br /&gt;then logged as normal user david, run ./amsn, it works now.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-2924063984279799219?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/2924063984279799219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=2924063984279799219' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2924063984279799219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2924063984279799219'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/05/you-cant-load-tkcximage-could-not-run.html' title='&quot;You can&apos;t load TkCximage&quot;, could not run amsn as normal user'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-154118205936674505</id><published>2007-04-09T03:23:00.000-07:00</published><updated>2007-05-09T00:29:22.523-07:00</updated><title type='text'>mysql error -- /etc/rc.d/rc.mysqld restart</title><content type='html'>in Slackware 11, when i connect mysql (5.0.24a) by ip/remotely: &lt;p&gt;$mysql -u roboo -h 172.16.100.30 -p &lt;/p&gt;&lt;p&gt;error showed as following:&lt;br /&gt;Enter password:&lt;br /&gt;ERROR 2003 (HY000): Can't connect to MySQL server on '172.16.100.30' (111)&lt;/p&gt;&lt;p&gt;i googled around, someone said can edit the my.cnf , comment this line:&lt;br /&gt;skip-networking&lt;br /&gt;but there isn't any my.cnf on the file system. even type locate my.cnf,nothing&lt;br /&gt;happened, i got stuck on the problem. then tried to find which configuration&lt;br /&gt;file (my-huge.cnf, my-large.cnf, my-medium.cnf, my-small.cnf ?) mysql is&lt;br /&gt;using, and didn't find anything in /usr/bin/mysqld-safe. however, find&lt;br /&gt;something useful by ps command:&lt;/p&gt;&lt;p&gt;$ps aux|grep mysql&lt;br /&gt;root      3896  0.0  0.0   2328   432 ?        S    08:56  &lt;br /&gt;0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --skip-networking&lt;br /&gt;mysql     3921  0.0  0.5  52840  5416 ?        S    08:56  &lt;br /&gt;0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking&lt;br /&gt;mysql     3922  0.0  0.5  52840  5416 ?        S    08:56  &lt;br /&gt;0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking&lt;br /&gt;mysql     3923  0.0  0.5  52840  5416 ?        S    08:56  &lt;br /&gt;0:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --user=mysql --pid-file=/var/run/mysql/mysql.pid --skip-locking --skip-networking&lt;br /&gt;.....&lt;/p&gt;&lt;p&gt;yes,--skip-networking is the key.it means when mysqld is started,&lt;br /&gt;a "--skip-networking" parameter is passed. I opened /etc/rc.d/rc.mysqld ,&lt;br /&gt;and see this line:&lt;br /&gt;SKIP="--skip-networking" &lt;/p&gt;&lt;p&gt;and in the later lines SKIP is taken as a parameter of mysqld. so comment the&lt;br /&gt;SKIP line, restart mysqld.&lt;br /&gt;#/etc/rc.d/rc.mysqld restart&lt;/p&gt;&lt;p&gt;it works! &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-154118205936674505?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/154118205936674505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=154118205936674505' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/154118205936674505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/154118205936674505'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/04/mysql-error-etcrcdrcmysqld-restart.html' title='mysql error -- /etc/rc.d/rc.mysqld restart'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-2999275829653727730</id><published>2007-03-31T19:25:00.001-07:00</published><updated>2007-03-31T19:25:47.406-07:00</updated><title type='text'>how to package jar easily with find command</title><content type='html'>Eclipse jar packing function isn&amp;#39;t very easy and comfort to use. Sometimes the packaged jar does not include some classes.&lt;br&gt;&lt;br&gt;we can use find and jar command to make a jar package easily:&lt;br&gt;assume $project is where your project located, and bin is the output directory.  &lt;br&gt;com.xxx.yyy is the parent package of the project.&lt;br&gt;&lt;br&gt;cd $project/bin&lt;br&gt; find ./com&amp;nbsp; &amp;gt; classlist&amp;nbsp; (or find ./com -name *.class if you have .cass files only)&lt;br&gt;jar -cvf project.jar @classlist&lt;br&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-2999275829653727730?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/2999275829653727730/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=2999275829653727730' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2999275829653727730'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2999275829653727730'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/03/how-to-package-jar-easily-with-find.html' title='how to package jar easily with find command'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-6138244674285952648</id><published>2007-02-04T20:15:00.000-08:00</published><updated>2007-02-04T20:19:05.968-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><title type='text'>Shell Programming FAQ(为什么shell脚本无法运行?)</title><content type='html'>&lt;table style="border-collapse: collapse; color: rgb(0, 0, 0);" bg="" align="center" border="0" cellpadding="0" cellspacing="0" width="760"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td align="center"&gt;&lt;table style="border-collapse: collapse;" border="0" cellpadding="0" cellspacing="0" width="740"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td width="740"&gt;&lt;div id="art" width="560" style="margin: 15px;"&gt;&lt;span style="font-size:85%;"&gt;上 个月在CU（ChinaUnix）的论坛上看到有人贴出帖子说在shell下面运行不了if...else语句，而且还大骂linux说linux连最简 单的事情都做不了。这几天写了几个脚本处理日常工作，也遇到一些问题，也许CU论坛上骂linux的这位仁兄，也是因为遇到类似的问题，所以才会骂 linux。总结一下常见的问题如下,其中涵盖有赋值表达式，逻辑运算符(if)，命令替换,环境变量设置(export)等，希望对初学shell编程 的朋友有所帮助。有任何问题可在论坛上联系我,或者email到david.ullua at gmail。 -- &lt;/span&gt;&lt;span style="font-size:85%;"&gt;David Euler，2006/12/14&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Q1.我在shell脚本中加入如下:i = 1 ,运行的时候脚本报错，难道shell下面不可以对变量赋值吗？&lt;br /&gt;A1.&lt;span style="color: rgb(255, 1, 2); font-weight: bold;"&gt;赋值运算符前后不可以有等号=&lt;/span&gt;。试试i=1&lt;br /&gt;&lt;br /&gt;Q2.我再shell上运行i=1;i++报错"-bash: i++: command not found", 运行i=1;i=i+1;echo $i 结果不是2,而是"i+1", shell如何支持算术运算呢？&lt;br /&gt;A2.i++的表达方法在shell中是不被支持的;&lt;span style="color: rgb(255, 1, 2); font-weight: bold;"&gt;表达式的右边引用变量，变量名前面要加$;表达式求值时表达式要用$((expression))的形式把表达式expression括起来&lt;/span&gt;。所以正确的是: &lt;/span&gt;&lt;span style="font-size:85%;"&gt;i=1;i=$(($i+1));echo $i&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;Q3.我需要设置JAVA_HOME变量，于是按照一些教程，使用下面命令，为什么会报错?是不是shell不兼容？&lt;br /&gt;  export JAVA_HOME = /working/jdk1.5.0_09&lt;br /&gt;A3.试试&lt;/span&gt;&lt;span style="font-size:85%;"&gt;export JAVA_HOME=/working/jdk1.5.0_09, 两个有什么区别呢，前面的=前后多了1个空格,&lt;span style="color: rgb(255, 1, 2); font-weight: bold;"&gt;shell下面=作为赋值运算符时前后不可有空格&lt;/span&gt;。&lt;br /&gt;&lt;br /&gt;Q&lt;/span&gt;&lt;span style="font-size:85%;"&gt;4.我按照教科书上说的使用命令替换，把date命令的运行结果保存到DATE变量，DATE='date';echo $DATE; 可运行结果是:date, 而不适date命令的结果。&lt;br /&gt;A4.&lt;span style="color: rgb(255, 1, 2); font-weight: bold;"&gt;命令替换是要用后引号(`,Shift+~)而不是单引号把命令括起来。&lt;/span&gt; 运行DATE=`date`;echo $DATE; 试试&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q5.我运行if 语句来测试逻辑表达式：&lt;br /&gt;  if[ "$SHELL"="/bin/bash" ]; then echo "bash";fi&lt;br /&gt;中括号[]的前后都用了空格，为什么还会报错呢？&lt;br /&gt;A5.上面的shell句子有两处语法错误:&lt;span style="color: rgb(255, 1, 2); font-weight: bold;"&gt;if后面也需要有空格;等于号"="作为逻辑运算符时，前面和后面都必须要有空格，否则会被shell作为赋值表达式&lt;/span&gt;,linux下面赋值运算符与逻辑运算符等于都用"="表示，区别在于前后有无空格。正确的如下：&lt;/span&gt;&lt;span style="font-size:85%;"&gt;if [ "$SHELL" = "/bin/bash" ]; then echo "bash";fi&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt; &lt;p style="margin: 5px; line-height: 150%;"&gt;     &lt;/p&gt; &lt;/td&gt;&lt;/tr&gt;     &lt;tr&gt;&lt;td align="center" height="25"&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-6138244674285952648?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/6138244674285952648/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=6138244674285952648' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6138244674285952648'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6138244674285952648'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/shell-programming-faqshell.html' title='Shell Programming FAQ(为什么shell脚本无法运行?)'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-5889972035085298444</id><published>2007-02-04T20:14:00.000-08:00</published><updated>2007-02-04T20:21:18.969-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>使用fdisk -l 快速查找可用的移动设备（移动硬盘，优盘，SD/MMC卡等）</title><content type='html'>插入移动硬盘或者优盘以后，对于不一样的USB设备，不一样的机器，移动硬盘（或优盘）在系统中的设备标识(/dev目录下的链接)都是不一样的。&lt;br /&gt;&lt;br /&gt;有时候是在/sdb1下面，有时候是在/sdc1, 或者/sda5下，也可能是其他的路径标识。在尝试了"mount /dev/sdxn /mnt/udisk" 3次，5次都没有找到后，任何人都可能感觉到泄气。&lt;br /&gt;&lt;br /&gt;其实在我们可以用&lt;span style="font-weight: bold;"&gt;fdisk -l &lt;/span&gt;(注意是小写的-L，list的意思) 命令查看系统的所有存储设备信息。fdisk是磁盘格式化工具，所以在磁盘，包括移动存储设备还没有mount的时候，就可以检测到这些设备。&lt;br /&gt;&lt;br /&gt;下面是我的电脑插上优盘约30秒（接上优盘后，会有片刻的检测时间）后，运行fdisk -l的结果：&lt;br /&gt;&lt;span style="color: rgb(255, 1, 2);"&gt;Disk /dev/sda: 512 MB, 512229376 bytes&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 1, 2);"&gt;9 heads, 8 sectors/track, 13895 cylinders&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 1, 2);"&gt;Units = cylinders of 72 * 512 = 36864 bytes&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 1, 2);"&gt;   Device Boot      Start         End      Blocks   Id  System&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 1, 2);"&gt;/dev/sda1               4       13896      500107+   6  FAT16&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Disk /dev/hda: 80.0 GB, 80023182848 bytes&lt;br /&gt;255 heads, 63 sectors/track, 9728 cylinders&lt;br /&gt;Units = cylinders of 16065 * 512 = 8225280 bytes&lt;br /&gt;&lt;br /&gt;  Device Boot      Start         End      Blocks   Id  System&lt;br /&gt;/dev/hda1   *           1        1736    13944388+   7  HPFS/NTFS&lt;br /&gt;/dev/hda2            1737        9729    64203772+   f  W95 Ext'd (LBA)&lt;br /&gt;/dev/hda5            1737        2884     9221278+   b  W95 FAT32&lt;br /&gt;/dev/hda6            2885        3648     6136798+  83  Linux&lt;br /&gt;/dev/hda7            3649        8512    39070048+   7  HPFS/NTFS&lt;br /&gt;/dev/hda8   *        8513        9156     5172898+  83  Linux&lt;br /&gt;/dev/hda9   *        9157        9666     4096543+  83  Linux&lt;br /&gt;/dev/hda10           9667        9729      506016   82  Linux swap&lt;br /&gt;&lt;br /&gt;这里可以看到/dev/sda1是有盘，可以mount /dev/sda1 /mnt/udisk加载u盘。&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-5889972035085298444?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/5889972035085298444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=5889972035085298444' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5889972035085298444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5889972035085298444'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/fdisk-l-sdmmc.html' title='使用fdisk -l 快速查找可用的移动设备（移动硬盘，优盘，SD/MMC卡等）'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-6644442364934356962</id><published>2007-02-04T20:10:00.000-08:00</published><updated>2007-02-04T20:14:07.367-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>JAVA (JDK 1.5, slackware/debian linux)中文显示乱码问题的解决</title><content type='html'>我用的是slackware, jre的版本是1.5.0_09, 按jhuangjiahua的方法java应用程序的乱码问题可以解决。&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;标题: &lt;span style="font-weight: bold;"&gt;再提 Ubuntu/Debian 下 JAVA 中文显示&lt;/span&gt; 作者：jhuangjiahua&lt;br /&gt;来自：http://www.linuxsir.org/bbs/&lt;br /&gt;&lt;br /&gt;IRC 上又有朋友问到这 JAVA 的 ，&lt;br /&gt;&lt;br /&gt;1.&lt;br /&gt;在 jre/lib/fonts/ 下建立个目录 fallback&lt;br /&gt;比如我这儿就是&lt;br /&gt;mkdir /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/&lt;br /&gt;&lt;br /&gt;2.&lt;br /&gt;在 fallback 里弄个中文字体&lt;br /&gt;拷贝或链接都可以&lt;br /&gt;&lt;br /&gt;比如我这就是&lt;br /&gt;ln -s /usr/share/fonts/truetype/arphic/uming.ttf /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3.&lt;br /&gt;进入 jre/lib/fonts/fallback/ 执行 mkfontscale&lt;br /&gt;再把 jre/lib/fonts/fonts.scale 的内容加到 jre/lib/fonts/fonts.dir&lt;br /&gt;&lt;br /&gt;我这儿就是&lt;br /&gt;cd /usr/lib/j2sdk1.5-sun/jre/lib/fonts/fallback/&lt;br /&gt;mkfontscale&lt;br /&gt;cd ..&lt;br /&gt;cat fallback/fonts.scale &gt;&gt; fonts.dir&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;原文地址 http://www.linuxsir.org/bbs/&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-6644442364934356962?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/6644442364934356962/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=6644442364934356962' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6644442364934356962'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6644442364934356962'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/java-jdk-15-slackwaredebian-linux.html' title='JAVA (JDK 1.5, slackware/debian linux)中文显示乱码问题的解决'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-8103457650283975608</id><published>2007-02-02T01:38:00.000-08:00</published><updated>2007-02-02T22:02:47.665-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>Apache 2.2.4, tomcat5.0.28 整合，以及中文乱码问题解决</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;Author: David Euler, 2007, david.ullua _at_ gmail (请用gmail.com替换gmail)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;这篇文章主要参考从google搜索到的整合方法和问题解决方法,以及apache.org官方网站的文档。&lt;/p&gt;&lt;p&gt;并经过实际的验证 (os: slackware 11, 软件版本参考安装)。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;目录&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:16;"&gt;I.安装Apache, Tomcat, tomcat-connector (mod_jk) , 并整合apache与tomcat&lt;/span&gt;&lt;/p&gt;&lt;p&gt;II.tomcat, apache整合后，去掉tomcat的8080端口服务，用户只能通过80端口访问服务器&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:16;"&gt;III.Tomcat/Apache乱码问题解决.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;IV.虚拟主机配置&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600;font-size:16;" &gt;I.安装Apache, Tomcat, tomcat-connector (mod_jk) , 并整合apache与tomcat&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:16;"&gt;共分5个步骤，详述如下&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;1、准备，下载需要的文件。这里假定你已经正确安装配置好了JDK。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;到Apache官方网站下载所需要的文件：&lt;/p&gt;&lt;p&gt;httpd-2.2.4.tar.gz , apache的httpd server包 (需要编译安装,安装时)&lt;/p&gt;&lt;p&gt;apache-tomcat-5.5.20.tar.gz, apache的tomcat包， 不需要编译安装（解压即可）&lt;/p&gt;&lt;p&gt;tomcat-connectors-1.2.20-src.tar.gz (mod_jk的安装包)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;2、安装Apache。&lt;/span&gt;&lt;/p&gt;&lt;p&gt;# tar xzvf httpd-2.2.4.tar.gz &lt;/p&gt;&lt;p&gt;或 tar jxvf httpd-2.2.4.tar.bz2&lt;/p&gt;&lt;p&gt;# cd httpd-2.2.4&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;参考INSTLL安装文档，如下即可安装apache(自带有cgi,perl, apxs的支持)：&lt;/p&gt;&lt;p&gt;# ./configure --prefix=/usr/local/apache2 (不需要加--enable-so参数，&lt;/p&gt;&lt;p&gt;# make&lt;/p&gt;&lt;p&gt;# make install&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;3、安装Tomcat (解压即可)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# cp apache-tomcat-5.5.20.tar.gz /usr/local/&lt;/p&gt;&lt;p&gt;# cd /usr/local&lt;/p&gt;&lt;p&gt;# tar xzvf apache-tomcat-5.5.20.tar.gz &lt;/p&gt;&lt;p&gt;# ln -s apache-tomcat-5.5.20 tomcat&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;4、编译生成mod_jk&lt;/span&gt;&lt;/p&gt;&lt;p&gt;# tar xzvf tomcat-connectors-1.2.20-src.tar.gz &lt;/p&gt;&lt;p&gt;# cd tomcat-connectors-1.2.20-src/jk/native&lt;/p&gt;&lt;p&gt;# ./configure --with-apxs=/usr/local/apache2/bin/apxs&lt;/p&gt;&lt;p&gt;# make&lt;/p&gt;&lt;p&gt;# cp ./apache-2.0/mod_jk.so /usr/local/apache2/modules/&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;5、配置&lt;/span&gt;&lt;/p&gt;&lt;p&gt;在/usr/local/apache2/conf/下面建立两个配置文件mod_jk.conf和workers.properties。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# vi mod_jk.conf&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;添加以下内容：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# 指出mod_jk模块工作所需要的工作文件workers.properties的位置&lt;/p&gt;&lt;p&gt;JkWorkersFile /usr/local/apache2/conf/workers.properties&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# Where to put jk logs&lt;/p&gt;&lt;p&gt;JkLogFile /usr/local/apache2/logs/mod_jk.log&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# Set the jk log level [debug/error/info]&lt;/p&gt;&lt;p&gt;JkLogLevel info&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# Select the log format&lt;/p&gt;&lt;p&gt;JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# JkOptions indicate to send SSL KEY SIZE,&lt;/p&gt;&lt;p&gt;JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# JkRequestLogFormat set the request format&lt;/p&gt;&lt;p&gt;JkRequestLogFormat "%w %V %T"&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat，让Tomcat来处理&lt;/p&gt;&lt;p&gt;JkMount /servlet/* worker1&lt;/p&gt;&lt;p&gt;JkMount /*.jsp worker1&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# vi workers.properties&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;添加以下内容：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# Defining a worker named worker1 and of type ajp13,&lt;/p&gt;&lt;p&gt;# 注意8009是tomcat的ajp13端口，注意不是8080&lt;/p&gt;&lt;p&gt;worker.list=worker1&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;# Set properties for worker1&lt;/p&gt;&lt;p&gt;worker.worker1.type=ajp13 &lt;/p&gt;&lt;p&gt;worker.worker1.host=localhost &lt;/p&gt;&lt;p&gt;worker.worker1.port=8009&lt;/p&gt;&lt;p&gt;worker.worker1.lbfactor=50 &lt;/p&gt;&lt;p&gt;#worker.worker1.cachesize=10 &lt;/p&gt;&lt;p&gt;worker.worker1.cache_timeout=600 &lt;/p&gt;&lt;p&gt;worker.worker1.socket_keepalive=1 &lt;/p&gt;&lt;p&gt;worker.worker1.socket_timeout=300&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;6.再配置httpd.conf，作以下修改：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;将Listen 80 修改为 Listen 127.0.0.1:80&lt;/p&gt;&lt;p&gt;将ServerName 修改为 ServerName localhost:80&lt;/p&gt;&lt;p&gt;在DirectoryIndex中添加 index.jsp, 假设网页放在/var/wwwroot下，要修改DocumentRoot&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;DocumentRoot "/var/wwwroot"&lt;/p&gt;&lt;p&gt;&amp;lt;Directory "/var/wwwroot"&amp;gt;&lt;/p&gt;&lt;p&gt;Options Includes FollowSymLinks&lt;/p&gt;&lt;p&gt;AllowOverride None&lt;/p&gt;&lt;p&gt;Order deny,allow&lt;/p&gt;&lt;p&gt;Allow from all&lt;/p&gt;&lt;p&gt;XBitHack on&lt;/p&gt;&lt;p&gt;&amp;lt;/Directory&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;Directory "/var/wwwroot/WEB-INF"&amp;gt; &lt;/p&gt;&lt;p&gt;Order deny,allow&lt;/p&gt;&lt;p&gt;Deny from all&lt;/p&gt;&lt;p&gt;&amp;lt;/Directory&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;增加关于加载mod_jk的语句：&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;LoadModule jk_module modules/mod_jk.so&lt;/p&gt;&lt;p&gt;Include /usr/local/apache2/conf/mod_jk.conf&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;在/var/wwwroot下建立一个index.jsp，启动Apache和Tomcat，用浏览器访问http://localhost/，应可看到正确的页面。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;II.tomcat, apache整合后，去掉tomcat的8080端口服务，用户只能通过80端口访问服务器 &lt;/span&gt;(以统一日志分析等的处理)：&lt;/p&gt;&lt;p&gt;找到server.xml, 去掉port="8080"&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;Connector port="8080" maxHttpHeaderSize="8192"&lt;/p&gt;&lt;p&gt;maxThreads="5000" minSpareThreads="25" maxSpareThreads="75"&lt;/p&gt;&lt;p&gt;enableLookups="false" redirectPort="8443" acceptCount="100"&lt;/p&gt;&lt;p&gt;connectionTimeout="20000" disableUploadTimeout="true"&lt;/p&gt;&lt;p&gt;URIEncoding="UTF-8" useBodyEncodingForURI="true" /&amp;gt;&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underlinefont-size:16;" &gt;III.Tomcat/Apache乱码问题解决&lt;/span&gt;&lt;/p&gt;&lt;p&gt;首先，确保 httpd.conf中的下面一行的注释没有打开(未配置AddDefaultCharset )：&lt;/p&gt;&lt;p&gt;#AddDefaultCharset ISO-8859-1 &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;然后依情况按步骤1), 2)操作&lt;/p&gt;&lt;p&gt;如果你的网页中定义的charset为UTF-8, 如下&lt;/p&gt;&lt;p&gt;&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&amp;gt;&lt;/p&gt;&lt;p&gt;那么步骤1-2用UTF-8替代GBK&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;1）如果你将apache和tomcat整合了，那么修改tomcat/conf中的server.xml&lt;/p&gt;&lt;p&gt;&amp;lt;Connector port="8009" enableLookups="false" redirectPort="8443" debug="0" &lt;/p&gt;&lt;p&gt;protocol="AJP/1.3" URIEncoding="GBK"/&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;添加URIEncoding="GBK"，请确保你的jsp的开头:&lt;/p&gt;&lt;p&gt;&amp;lt;%@page contentType="text/html;charset=GBK"%&amp;gt;&lt;/p&gt;&lt;p&gt;里的charset和URIEncoding一致。 (均为GBK或UTF-8)&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;2）如果没有将tomcat和apache整合，那么修改如下的标签：&lt;/p&gt;&lt;p&gt;&amp;lt;Connector&lt;/p&gt;&lt;p&gt;port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75"&lt;/p&gt;&lt;p&gt;enableLookups="false" redirectPort="8443" acceptCount="100"&lt;/p&gt;&lt;p&gt;debug="0" connectionTimeout="20000"&lt;/p&gt;&lt;p&gt;disableUploadTimeout="true" URIEncoding="GBK"/&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;参考：&lt;/p&gt;&lt;p&gt;http://www.gbunix.com/htmldata/2006_08/15/23/article_1383_1.html&lt;/p&gt;&lt;p&gt;http://dev.cbw.com/web/apache/2005524308_3480676.shtml&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;---------------------------------------------------------------------------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;span style="FONT-WEIGHT: 600; TEXT-DECORATION: underline"&gt;IV.虚拟主机配置：&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;删除掉下面这一行的#（取消注释)&lt;/p&gt;&lt;p&gt;#Include conf/extra/httpd-vhosts.conf&lt;/p&gt;&lt;p&gt;vi conf/extra/httpd-vhosts.conf, 根据文件中的例子添加虚拟主机。&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;参考：&lt;/p&gt;&lt;p&gt;http://httpd.apache.org/docs/2.2/vhosts/name-based.html&lt;/p&gt;&lt;p&gt;http://httpd.apache.org/docs/2.2/vhosts/examples.html&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-8103457650283975608?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/8103457650283975608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=8103457650283975608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/8103457650283975608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/8103457650283975608'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/apache-224-tomcat5028.html' title='Apache 2.2.4, tomcat5.0.28 整合，以及中文乱码问题解决'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-6297895664742818602</id><published>2007-02-02T00:43:00.000-08:00</published><updated>2007-02-02T02:11:28.504-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>hacking linux - find an unkown command for a desired function in a special linux distribution</title><content type='html'>If you use linux everyday, sometimes you post a problem on the newsgroup, someone would tell you a command called foobar would solve the problem. But when you type foobar in terminal, it shows "-bash: foobar: command not found", then you may wondering whether linux is as good as said, or whether your distribution is as good as others, or people  had given a wrong answer. Stop wondering now,&lt;br /&gt;&lt;br /&gt;I met the problem sometimes. and got the solution by "man -k command" .&lt;br /&gt;&lt;br /&gt;Case 1: when i use ant files to build eclipse project, error occurred as "&lt;a href="http://effectivelinux.blogspot.com/2007/01/use-eclipse-with-ant-to-deploy-your.html"&gt;ant: /bin/sh^M: bad interpreter: No such file or directory.&lt;/a&gt;" , which is described on the post:&lt;br /&gt;&lt;a href="http://effectivelinux.blogspot.com/2007/01/use-eclipse-with-ant-to-deploy-your.html"&gt;Use eclipse with ant to deploy your java project -- from beginning of env setup to ant build&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;I googled and find a post on &lt;a href="http://mail-archives.apache.org/mod_mbox/lenya-user/200309.mbox/%3C1063970144.3f6ae560c9797@test.intranet.moritzi.ch%3E"&gt;apache mailing list&lt;/a&gt;, people suggest use unixdos to convert text file "ant" from dos format to unix format. I type unixdos, failed with "command not found". After thinking a while, I type :&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;$ man -k dos  |grep -i unix&lt;/span&gt;&lt;br /&gt;ExtUtils::MM_DOS     (3)  - DOS specific subclass of ExtUtils::MM_Unix&lt;br /&gt;fromdos              (1)  - convert DOS text file format to UNIX&lt;br /&gt;mcopy                (1)  - copy MSDOS files to/from Unix&lt;br /&gt;mtools               (1)  - utilities to access DOS disks in Unix&lt;br /&gt;todos                (1)  - convert UNIX text file format to DOS&lt;br /&gt;&lt;br /&gt;Yes, fromdos, it is what i am finding. here i use man and grep to find the proper command.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Case 2: I need to convert GBK encoded text file to UTF-8 format. and googled around several times, couldn't get any useful info.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;%man -k convert |grep -i encoding&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the command could not find any useful command,  thought it a lit while, hmmm, i need a command for character conversion&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;%man -k convert | grep -i character&lt;/span&gt;&lt;br /&gt;...&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;%man -k conversion |grep -i character&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;fwprintf [wprintf]   (3)  - formatted wide character output conversion&lt;br /&gt;iconv                (3)  - perform character set conversion&lt;br /&gt;iconv_close          (3)  - deallocate descriptor for character set conversion&lt;br /&gt;iconv_open           (3)  - allocate descriptor for character set conversion&lt;br /&gt;...&lt;br /&gt;&lt;br /&gt;Yes, iconv is exactly what i need.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-6297895664742818602?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/6297895664742818602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=6297895664742818602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6297895664742818602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6297895664742818602'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/linux-hacking-find-unkown-command-for.html' title='hacking linux - find an unkown command for a desired function in a special linux distribution'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-3600687323230527705</id><published>2007-02-02T00:36:00.000-08:00</published><updated>2007-02-02T00:33:19.756-08:00</updated><title type='text'>Google is dangerous</title><content type='html'>Nowadays, excellent developers use google to help them solve problems or learn &lt;br&gt;new things. If you post an article on a newsgroup saying that you use yahoo &lt;br&gt;or baidu.com to hack a problem, someone would tell you &amp;quot;developers all use &lt;br&gt;google to solve problem&amp;quot;.&lt;p&gt;Yes, it is true, google has been more &amp;#39;n more important in our life, and it &lt;br&gt;does help, especially for developers. Sometimes, I spend a whole day or more &lt;br&gt;in googling a solution (it does has great help).&lt;p&gt;The problem is, when I use google more and more, someday I found that even I &lt;br&gt;need google to find some common knowledge. But I think these googled common &lt;br&gt;knowledge and other similar( ungoogled ) should be learned from books or an &lt;br&gt;official web site. &lt;p&gt;The keypoint is, there are lots of common knowledge, if I don&amp;#39;t know these &lt;br&gt;things, even i don&amp;#39;t kown what to google; Also when using google to learn a &lt;br&gt;new technology, it would cost much time than deserved when you know little &lt;br&gt;about the technology.&lt;p&gt;So if i use google more &amp;#39;n more, i would be more &amp;#39;n more lazy, impetuous.&lt;p&gt;The solution: to read more books, and learn from newgroups, some website.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-3600687323230527705?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/3600687323230527705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=3600687323230527705' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/3600687323230527705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/3600687323230527705'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/google-is-dangerous.html' title='Google is dangerous'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-3183359853349138016</id><published>2007-02-02T00:13:00.000-08:00</published><updated>2007-02-02T22:04:51.304-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>SVN 项目管理使用FAQ</title><content type='html'>/******************* SVN 项目管理使用FAQ. **********************&lt;br /&gt;* Author David Lv Euler&lt;br /&gt;* Createddate 2007-2-1&lt;br /&gt;* Contact david.ullua at gmail (please add .com to gmail)&lt;br /&gt;* You can redistribute the total file wherever you like, but pls keep the&lt;br /&gt;author's info. The document is provided WITHOUT any warranty.&lt;br /&gt;****************************************************************/ &lt;p&gt;1.如何将eclipse的项目添加到SVN管理:&lt;br /&gt;a.对于建立好的项目（未受SVN管理），在eclipse中，右键点击项目名，点"ShareProject", 选"SVN",点"下一步＂ &lt;p&gt;b.选择"创建新的资源库位置"，或者"使用已有的资源库位置"，选择资源库后点"下一步"， &lt;p&gt;c.假定选择或者创建的资源库位置为svn://172.16.100.26， 通常要选择服务器上特定的目录下面保存项目，&lt;br /&gt;比如在svn://172.16.100.26/dev-source/app/下面，那么就选择"使用指定的模块名"，&lt;br /&gt;点浏览并选择：svn://172.16.100.26/dev-source/app/，&lt;br /&gt;这个时候在输入框里面会有一个"New Folder"被选中， 把New Folder改为项目的名称。点"下一步"。 &lt;p&gt;2.如何利用eclipse(已安装subclipse插件), 从SVN上取得项目到本地的Workspace中:&lt;br /&gt;a. Eclipse 中点"File" -&amp;gt; "New" -&amp;gt; "other" , 选择SVN, "从SVN取出项目". &lt;p&gt;b. 选择"创建新的资源库位置"，或者"使用已有的资源库位置"，选择资源库后点"下一步" &lt;p&gt;c. 选择要导出的项目在SVN上的路径，比如dev-source/monternet/Server,&lt;br /&gt;点"Next", 选择"做为新项目取出，&lt;br /&gt;并使用新建项目向导进行配置", 点Finish. 这时会弹出New Project的向导，&lt;br /&gt;因为项目在SVN上，本地上没有，所以会出现这个向导。&lt;br /&gt;&lt;br /&gt;d. 在新建项目向导中，选择"Java" -&amp;gt; "Java Project"(比如ServerCore可能需要选择这个),&lt;br /&gt;或者 "Web" -&amp;gt; "Dynamic Web Project" (比如LinuxWebSite项目可能需要选择这个).&lt;br /&gt;点"Next", 输入Project name, 比如RobooProject. 点Next, 点"Finish"。&lt;br /&gt;这样就完成了从SVN服务器上取出项目到Eclipse的workspace中 &lt;p&gt;3. 为什么提交总是失败。&lt;br /&gt;需要注意两点：&lt;br /&gt;a.若与Tortoise 同时使用，那么尽量不要同时使用Tortoise和eclipse对一个目录进行操作。&lt;br /&gt;b.在把其他目录的文件拷贝到受SVN管理的项目中时， 需要按目录提交，而不是按文件提交。&lt;br /&gt;c.在对类名/文件名进行重构时，需要按目录(文件所在的目录)提交，而不是对单个的文件进行提交。 &lt;p&gt;4.SVN客户端的常用命令有哪些？&lt;br /&gt;如果装了Subversion, 在windows和linux下都可以用命令行来获取SVN上的信息。 有几个命令比较常用：&lt;br /&gt;svn co&lt;br /&gt;svn list&lt;br /&gt;svn info&lt;br /&gt;svn add&lt;br /&gt;svn commit &lt;p&gt;比如&lt;br /&gt;svn list svn://172.16.100.26/dev-doc/ , 显示服务器上指定目录的内容&lt;br /&gt;svn co svn://172.16.100.26/dev-doc/ , 获取服务器上的内容&lt;br /&gt;svn info svn://172.16.100.26/dev-doc/tools/subversion/svn_tutorial.txt , 显示SVN&lt;br /&gt;上指定文件的信息。&lt;br /&gt;svn info 显示当前受SVN 管理的目录信息。&lt;br /&gt;svn add files_on_local_disk 添加本地文件到SVN 管理（此命令尚未将文件上传到SVN中）&lt;br /&gt;svn commit (提交所做的改动， 上传用svn add 命令添加的文件) &lt;p&gt;5. 如何使用命令获取SVN的项目到eclipse中进行管理?&lt;br /&gt;用命令获取项目， 再从eclipse打开项目会更方便。比如获取ServerCore项目， 我这样做：&lt;br /&gt;1. svn co svn://172.16.100.26/dev-src/ServerCore(获取服务器上的项目到当前目录下，会产生RobooCore&lt;br /&gt;目录)&lt;br /&gt;2.从eclipse新建项目， 指定步骤1中获取到的项目目录. 这样就完成了从SVN获取项目到Eclipse.&lt;br /&gt;比前面问题2中的a, b, c, d 四步要方便很多。 &lt;p&gt;6. 为什么会遇到 Authentication Failed?&lt;br /&gt;Authentication Failed通常是因为没有对应目录的权限所导致。 &lt;p&gt;7. 为什么我遇到 Out of date: '/dev-src/xxx/yyy' in transaction '102-1'&lt;br /&gt;当本机修改的文件不是服务器上的最新版本，修改本机文件后commit， 会提示out of date的错误。&lt;br /&gt;需要先从服务器上获取最新版本(update), 然后进行修改，这时候再提交就可以了。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-3183359853349138016?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/3183359853349138016/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=3183359853349138016' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/3183359853349138016'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/3183359853349138016'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/02/svn-faq.html' title='SVN 项目管理使用FAQ'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-462228854268651239</id><published>2007-01-29T03:03:00.000-08:00</published><updated>2007-02-02T22:08:52.637-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>Mysql starting error: ... STOPPING server from pid file /var/lib/mysql/roboo-lvzg.pid , mysqld ended</title><content type='html'>&lt;p&gt;&lt;/p&gt;&lt;p&gt;When I start mysqld server (in slackware linux 11), got error as follows:&lt;/p&gt;&lt;p&gt;root@kseeker-lvzg:~# &lt;span style="FONT-WEIGHT: 600"&gt;mysqld_safe --user='mysql' &amp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;[1] 10624&lt;/p&gt;&lt;p&gt;root@kseeker-lvzg:~# Starting mysqld daemon with databases from /var/lib/mysql&lt;/p&gt;&lt;p&gt;STOPPING server from pid file /var/lib/mysql/kseeker-lvzg.pid&lt;/p&gt;&lt;p&gt;070129 18:55:45 mysqld ended&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;oh, you need to su mysql and run &lt;span style="FONT-WEIGHT: 600"&gt;mysql_install_db&lt;/span&gt; to fix the problem.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;root@kseeker-lvzg:~#&lt;span style="FONT-WEIGHT: 600"&gt; su mysql&lt;/span&gt;&lt;/p&gt;&lt;p&gt;mysql@kseeker-lvzg:/root$&lt;span style="FONT-WEIGHT: 600"&gt; mysql_install_db&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Installing all prepared tables&lt;/p&gt;&lt;p&gt;Fill help tables&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;To start mysqld at boot time you have to copy support-files/mysql.server&lt;/p&gt;&lt;p&gt;to the right place for your system&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !&lt;/p&gt;&lt;p&gt;To do so, start the server, then issue the following commands:&lt;/p&gt;&lt;p&gt;/usr/bin/mysqladmin -u root password 'new-password'&lt;/p&gt;&lt;p&gt;/usr/bin/mysqladmin -u root -h kseeker-lvzg password 'new-password'&lt;/p&gt;&lt;p&gt;See the manual for more instructions.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;You can start the MySQL daemon with:&lt;/p&gt;&lt;p&gt;cd /usr ; /usr/bin/mysqld_safe &amp;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:&lt;/p&gt;&lt;p&gt;cd sql-bench ; perl run-all-tests&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Please report any problems with the /usr/bin/mysqlbug script!&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;The latest information about MySQL is available on the web at&lt;/p&gt;&lt;p&gt;http://www.mysql.com&lt;/p&gt;&lt;p&gt;Support MySQL by buying support/licenses at http://shop.mysql.com&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-462228854268651239?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/462228854268651239/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=462228854268651239' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/462228854268651239'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/462228854268651239'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/mysql-starting-error-stopping-server.html' title='Mysql starting error: ... STOPPING server from pid file /var/lib/mysql/roboo-lvzg.pid , mysqld ended'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-1361886111967693210</id><published>2007-01-29T01:44:00.000-08:00</published><updated>2007-02-02T22:57:25.192-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><title type='text'>java knowledge tree</title><content type='html'>this java knowlege tree is composed and exported by FreeMind 0.8 (&lt;a href="http://freemind.sourceforge.net/"&gt;http://freemind.sourceforge.net&lt;/a&gt;) a little regret is the expand and collapse function is lost on the blog.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="basetop"&gt;&lt;a onclick="expandAll(document.getElementById('base'))" href="http://www2.blogger.com/post-edit.g?blogID=6886811715076147315&amp;postID=1361886111967693210#"&gt;Expand&lt;/a&gt; - &lt;a onclick="collapseAll(document.getElementById('base'))" href="http://www2.blogger.com/post-edit.g?blogID=6886811715076147315&amp;amp;postID=1361886111967693210#"&gt;Collapse&lt;/a&gt;&lt;/div&gt;&lt;div class="basetext" id="base"&gt;&lt;ul&gt;&lt;br /&gt;&lt;li class="col" id="FMFreemind_Link_24167221FM"&gt;java learning list &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_1880621928FM"&gt;&lt;a href="http://www.theserverside.com"&gt;theserverside的书评&lt;/a&gt; &lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_684742787FM"&gt;java基础 &lt;ul class="subexp"&gt;&lt;li class="col" id="FMFreemind_Link_550988532FM"&gt;books &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_109451381FM"&gt;&amp;lt;&amp;lt;Refactoring: Improving the Design of Existing Code &amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1173013806FM"&gt;Oreilly的&amp;lt;&amp;lt;XXXX in Action&amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_65557543FM"&gt;Oreilly的&amp;lt;&amp;lt;Java Threads， Second Edition &amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1683043935FM"&gt;&amp;lt;&amp;lt;Thinking In Java&amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1032335350FM"&gt;&amp;lt;&amp;lt; Core Java™ 2， Volume I: Fundamentals &amp;gt;&amp;gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_998551190FM"&gt;进阶 &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_693942057FM"&gt;&amp;lt;&amp;lt;Core Servlet and JSP 2Edition&amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_651411205FM"&gt;&amp;lt;&amp;lt;More Servlets and Java Server Pages&amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_914396799FM"&gt;&amp;lt;&amp;lt;Servlet 与JSP权威指南&amp;gt;&amp;gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1756136760FM"&gt;&amp;lt;&amp;lt;Core J2EE Patterns&amp;gt;&amp;gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_1905991054FM"&gt;应用服务器 &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_515205667FM"&gt;jboss&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_621586548FM"&gt;Weblogic&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_35625044FM"&gt;websphere&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_918624459FM"&gt;&lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/index.html"&gt;Java API 学习&lt;/a&gt; &lt;a href="http://java.sun.com/j2se/1.5.0/docs/api/index.html"&gt;&lt;/a&gt;&lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_879611557FM"&gt;lang包&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1485201582FM"&gt;util包 &lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_29335361FM"&gt;swing包&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_255240114FM"&gt;net包 &lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_700381737FM"&gt;sql包 &lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_1387029832FM"&gt;Servlet Container &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_552752169FM"&gt;tomcat&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1698049237FM"&gt;jetty&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_1477176754FM"&gt;technique &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_920824175FM"&gt;DOC文档生成与更新&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_771797271FM"&gt;spring&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1324107222FM"&gt;Hibernate&lt;/li&gt;&lt;li class="basic" id="FM_FM"&gt;structs&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_339036030FM"&gt;JarkartaCommons Log&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_798561870FM"&gt;JUnit、ANT、Jive论坛、PetStore宠物店&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_883452823FM"&gt;&lt;a href="http://www.jcp.org"&gt;技术规范&lt;/a&gt; &lt;a href="http://www.jcp.org"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_862004519FM"&gt;&lt;a href="http://java.sun.com/docs/codeconv"&gt;java编码规范&lt;/a&gt; &lt;a href="http://java.sun.com/docs/codeconv"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_16774464FM"&gt;Jsp+Struts+Spring+Hibernate&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_266389129FM"&gt;Tapsetry+Spring+Hibernate&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1578285486FM"&gt;Axis2&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_1209631135FM"&gt;ajax&lt;/li&gt;&lt;li class="col" id="FMFreemind_Link_670608783FM"&gt;JSF &lt;ul class="subexp"&gt;&lt;li class="basic" id="FMFreemind_Link_1844023511FM"&gt;&lt;a href="http://java.sun.com/javaee/javaserverfaces"&gt;Sun Java Server Faces&lt;/a&gt; &lt;a href="http://java.sun.com/javaee/javaserverfaces"&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="basic" id="FMFreemind_Link_507636372FM"&gt;&lt;a href="http://www.myeclipseide.com/ContentExpress-display-ceid-56.html"&gt;Eclipse JSF Developer&lt;/a&gt; &lt;a href="http://www.myeclipseide.com/ContentExpress-display-ceid-56.html"&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;br /&gt;&lt;br /&gt;&lt;/ul&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-1361886111967693210?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/1361886111967693210/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=1361886111967693210' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/1361886111967693210'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/1361886111967693210'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/java-knowledge-tree.html' title='java knowledge tree'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-37037842874979984</id><published>2007-01-25T01:11:00.000-08:00</published><updated>2007-01-25T02:16:00.467-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><title type='text'>利用~/.netrc文件自动ftp下载文件 (当天或昨天的tomcat日志)</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: 600; text-decoration: underline;"&gt;home目录中添加文件.netrc,内容如下：&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;#download files begin with test under user david's home&lt;/p&gt; &lt;p&gt;machine 172.16.100.30 login david password 3287&lt;/p&gt; &lt;p&gt;macdef init&lt;/p&gt; &lt;p&gt;binary&lt;/p&gt; &lt;p&gt;prompt&lt;/p&gt; &lt;p&gt;!clear&lt;/p&gt; &lt;p&gt;mget test*&lt;/p&gt; &lt;p&gt;!clear&lt;/p&gt; &lt;p&gt;bye&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;#get the log of yesterday:&lt;/p&gt; &lt;p&gt;#echo "catalina.`date --date='1 days ago'  +%Y-%m-%d `.log" | ftp www.kseeker.com&lt;/p&gt; &lt;p&gt;#download file specified by the second arg (the log filename)&lt;/p&gt; &lt;p&gt;machine www.kseeker.com login david password pass92342@#$@**(89&lt;/p&gt; &lt;p&gt;macdef init&lt;/p&gt; &lt;p&gt;binary&lt;/p&gt; &lt;p&gt;prompt&lt;/p&gt; &lt;p&gt;cd /home/tomcat/logs&lt;/p&gt; &lt;p&gt;mget $2&lt;/p&gt; &lt;p&gt;bye&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;ins&gt;注意：bye后要有一空行,.netrc文件的属性须是600,&lt;/ins&gt;&lt;/p&gt;  &lt;p&gt;可以使用这个命令下载172.16.100.30上面/home/david/目录test开头的文件：%ftp 172.16.100.30&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: 600; text-decoration: underline;"&gt;可以使用这个命令来下载服务器上昨天的tomcat日志&lt;/span&gt;（文件名如: &lt;span style="font-weight: 600; text-decoration: underline;"&gt;catalina.2007-01-24.log&lt;/span&gt;）：&lt;/p&gt;  &lt;p&gt;%echo "catalina.`date --date='1 days ago'  +%Y-%m-%d `.log" | ftp www.kseeker.com&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p style="font-weight: bold;"&gt;man netrc, 可以看到更多信息：&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;NETRC(5)                    BSD File Formats Manual                   NETRC(5)&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;NAME&lt;/p&gt; &lt;p&gt;     &lt;span style="font-weight: 600; text-decoration: underline;"&gt;netrc, .netrc -- user configuration for ftp&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;DESCRIPTION&lt;/p&gt; &lt;p&gt;     This file contains configuration and autologin information for the File Transfer Protocol client ftp(1).&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;     The .netrc file contains login and initialization information used by the auto-login process.  It resides in the user's&lt;/p&gt; &lt;p&gt;     home directory.  The following tokens are recognized; they may be separated by spaces, tabs, or new-lines:&lt;/p&gt; &lt;p&gt;......&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-37037842874979984?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/37037842874979984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=37037842874979984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/37037842874979984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/37037842874979984'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/netrcftp-utf-8b5b2t5asp5oiw5pio5asp55qe.html' title='利用~/.netrc文件自动ftp下载文件 (当天或昨天的tomcat日志)'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-5355373369998392871</id><published>2007-01-22T19:44:00.000-08:00</published><updated>2007-01-25T02:17:43.730-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>KMail提示用户可能忘了附件的有趣功能</title><content type='html'>今天发邮件的时候，KMail居然提示我"可能有附件，要不要附加文件，还是原样发送？"&lt;br /&gt;原来我的邮件的内容中含有attachment这个单词， 新建一封邮件， 里面有"附件"这个词，发送的时候KMail也提示是否要附加附件。&lt;br /&gt;看起来KMail会自动检测邮件中是否有attachment,或者"附件"的单词存在,存在的时候，如果没有附加附件，在发送时会提醒是否附加附件。&lt;p&gt;这项功能实在蛮有趣的，开发者考虑的还真周到，象我这种粗心的人，曾饱受outlook发送邮件忘记附件之苦， 用KMail问题都解决了。&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-5355373369998392871?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/5355373369998392871/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=5355373369998392871' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5355373369998392871'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5355373369998392871'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/kmail.html' title='KMail提示用户可能忘了附件的有趣功能'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-5769041228664002993</id><published>2007-01-22T19:35:00.000-08:00</published><updated>2007-01-25T02:17:50.399-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>use crontab and mail command to backup your firefox bookmarks</title><content type='html'>&lt;p&gt;&lt;/p&gt; &lt;p&gt;add the following line to ~/cron.yourname , (yourname is your real login name) &lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;&lt;span style="font-weight: 600;"&gt;30 12 * * * date '+%m/%d/%Y' | mail -s "bookmark"" `date '+%m/%d/%y'`"  -a /home/yourname/.mozilla/firefox/68k8bqg9.default/bookmarks.html receiver1@abc.com receiver2@abc.com&lt;/span&gt;&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;maybe 68k8bqg9.default should be replaced by your actual bookmarks directory.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;and run:&lt;/p&gt; &lt;p&gt;%crontab ~/cron.yourname&lt;/p&gt; &lt;p&gt;then crontab would run at 12:30 am to send firefox bookmark to your email receiver1 and receiver2.&lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;date '+%m/%d/%Y' : to show date as "01/23/2007"&lt;/p&gt; &lt;p&gt;it use filter to current date as the mail's content. and use -a to specify the attachment. &lt;/p&gt; &lt;p&gt;&lt;/p&gt; &lt;p&gt;it use -s spesify subject as: "bookmark"" `date '+%m/%d/%y'`" , &lt;/p&gt; &lt;p&gt;here date is backquoted.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-5769041228664002993?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/5769041228664002993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=5769041228664002993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5769041228664002993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/5769041228664002993'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/use-crontab-and-mail-command-to-backup.html' title='use crontab and mail command to backup your firefox bookmarks'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-8914249364419233387</id><published>2007-01-22T19:25:00.000-08:00</published><updated>2007-01-25T02:18:17.558-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='shell'/><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>send mail with attachment in command line</title><content type='html'>if it is a normal text file, you can use redirection to send the file as&lt;br /&gt;content:&lt;p&gt;mail -s "hello, david" someone@abc.com someone2@kseeker.com &amp;lt; attachfile&lt;/p&gt;&lt;p&gt;if it is a binary file, or you want to send text file as real attachment:&lt;/p&gt;&lt;p&gt;mail -s "hello, david" -a attachfile someone@abc.com someone2@kseeker.com&lt;/p&gt;&lt;p&gt;btw, mail is often the alias of mailx command in linux.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-8914249364419233387?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/8914249364419233387/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=8914249364419233387' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/8914249364419233387'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/8914249364419233387'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/send-mail-with-attachment-in-command.html' title='send mail with attachment in command line'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-4055840320939085518</id><published>2007-01-15T23:54:00.000-08:00</published><updated>2007-01-16T00:22:20.316-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='tools for developer'/><title type='text'>add authentication for awstats in apache</title><content type='html'>awstats does not require an authentication by default.&lt;br /&gt;but we can use apache's auth_module to add authentication for a specified directory( in this case is awstats). &lt;p&gt;assume awstats config file is  /etc/awstats/awstats.kseeker.com.conf ,&lt;br /&gt;awstats is installed at /usr/local/awstats/, awstats.pl is located at /usr/local/awstats/wwwroot/cgi-bin.&lt;br /&gt;and httpd.conf is located at /etc/httpd/conf/.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;step 1: config awstats to enable authentication access&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;%vi  /etc/awstats/awstats.kseeker.com.conf&lt;/span&gt;,&lt;/span&gt;  find the line contains AllowAccessFromWebToAuthenticatedUsersOnly, and the line contains&lt;br /&gt;AllowAccessFromWebToFollowingAuthenticatedUsers, change them as follows:&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   AllowAccessFromWebToAuthenticatedUsersOnly=1  &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 102, 255);"&gt;   AllowAccessFromWebToFollowingAuthenticatedUsers="david"&lt;/span&gt;  &lt;/p&gt;&lt;p&gt;step 2:  enable apache authentication for awstats directory&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;%vi /etc/httpd/conf/httpd.conf,&lt;/span&gt; set AllowOverride to All for "/usr/local/awstats/wwwroot/cgi-bin" directory:&lt;/p&gt;&lt;p style="color: rgb(51, 51, 255);"&gt;&amp;lt;Directory "/usr/local/awstats/wwwroot/cgi-bin"&amp;gt;&lt;br /&gt;  AllowOverride All&lt;br /&gt;  Options None&lt;br /&gt;  Order allow,deny&lt;br /&gt;  Allow from all&lt;br /&gt;&amp;lt;/Directory&amp;gt;&lt;/p&gt;&lt;p&gt;step 3: add authentication file and .htacess file, add user , and restart apache&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;%cd /usr/local/awstats/wwwroot/cgi-bin&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;%htpasswd -c userfile david    &lt;/span&gt;//create user file, it will prompt for user's password.&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;%cat &amp;gt; .htaccess &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;AuthUserFile /usr/local/awstats/wwwroot/cgi-bin/userfile&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;AuthName "Restricted Area For Customers"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;AuthType Basic&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;require valid-user&lt;/span&gt;&lt;br /&gt;Ctrl + D&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 51, 204);"&gt;% apachectl restart&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-4055840320939085518?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/4055840320939085518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=4055840320939085518' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4055840320939085518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4055840320939085518'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/add-authentication-for-awstats-in.html' title='add authentication for awstats in apache'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-2919133413034765800</id><published>2007-01-15T19:03:00.000-08:00</published><updated>2007-01-15T19:01:55.938-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><category scheme='http://www.blogger.com/atom/ns#' term='common tools'/><title type='text'>vim与gvim 转换highlight的文本到html网页</title><content type='html'>今天发现用gvim居然可以把vim中着色显示的文本文件(c, php, sh, java, ...)转换成html,&lt;br /&gt;且保留显示的格式和颜色，不必再为发布源代码到blog上显示格式混乱的问题了。&lt;p&gt;在gvim中点syntax =&amp;gt; convert to html, 这样会产生一个后缀名加上html的文件,&lt;br /&gt;然后保存即可(:w ).如果要对.html文件或者源文件作适当的编辑，&lt;br /&gt;可以用Ctrl+ww 可以切换源文件与产生的html文件的窗口。&lt;/p&gt;&lt;p&gt;google 了一下"vim convert to html", 原来vim中也可以使用&lt;/p&gt;&lt;p&gt;:runtime! syntax/2html.vim  命令来保存按语法高亮显示的文本到html文件。&lt;/p&gt;&lt;p&gt;参考： &lt;a href="http://vimdoc.sourceforge.net/vimfaq.html"&gt;http://vimdoc.sourceforge.net/vimfaq.html&lt;/a&gt;&lt;/p&gt;&lt;p&gt;24.14. How do I convert a source file (.c, .h, etc) with the Vim syntax&lt;br /&gt;     highlighting into a HTML file?&lt;/p&gt;&lt;p&gt;You can use the 2html.vim script to convert a source file into a HTML file&lt;/p&gt;&lt;p&gt;with the Vim syntax highlighting. Use the following command:&lt;br /&gt;  :runtime! syntax/2html.vim&lt;/p&gt;&lt;p&gt;For more information, read&lt;/p&gt;&lt;p&gt;    :help convert-to-HTML&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-2919133413034765800?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/2919133413034765800/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=2919133413034765800' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2919133413034765800'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/2919133413034765800'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/vimgvim-highlighthtml.html' title='vim与gvim 转换highlight的文本到html网页'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-4697606775863884026</id><published>2007-01-12T01:09:00.000-08:00</published><updated>2007-01-15T22:45:39.726-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='java'/><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>Use eclipse with ant to deploy your java project -- from beginning of env setup to ant build</title><content type='html'>&lt;span style="font-weight: bold;"&gt;1.export project to ant build file.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;2.run junit testing default build file&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.make your own build file,add unit test and junitreport to build.&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;4.create target of : makepackage,deployapp&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 0);"&gt;5.run ant under linux terminal or win command line, or add it to scheduled tasks.&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;Q1: "Ant-junit, build failed: Could not create task or type of type: junit"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;&lt;span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;Q2: "&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ant: /bin/sh^M: bad interpreter: No such file or directory."&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This tutorial shows how to use ant within eclipse to build, test, make package and deploy your app using eclipse step by step. Any questions, please feel free to contact me at david.ullua at gmail, or leave a comment. The tutorial is tested under eclipse 3.1.2, ant 1.6.5. in other higher version in the future should also works. The tutorial is oriented for readers without any knowledge about make,ant or similar build tools, while also can be as a reference for middle experienced developer.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1. export project to ant build file.&lt;/span&gt;&lt;br /&gt;Open your java project in eclipse,select your project, right click mouse, click "export", choose "General" =&gt; "Ant BuildFiles", click "Finish", it will generate a build.xml file. The default build file includes project build target and junitreport target. we can use the default build.xml as a start.&lt;br /&gt;&lt;br /&gt;Open build.xml, here is the first line( space after &gt; is added for web display ) :&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt; basedir="." default="build" name="twoway-analyzer"&gt;&lt; /project&gt;&lt;/span&gt;&lt;br /&gt;It mean the build file would take project path as basedir, and use build target as default task when running "ant" or "ant -f build.xml" in project dir without args specifying target(s).&lt;br /&gt;&lt;br /&gt;Look at this line in build.xml:&lt;br /&gt;&lt;span style="font-weight: bold; font-style: italic;"&gt;&lt; depends="build-subprojects,build-project" name="build"&gt;&lt;/span&gt;&lt;br /&gt;the line means build task depends on 2 sub-tasks, and does not contain any other independent actions in the build project. that's to say, if we run "ant -f build.xml", or "ant build", it will call 2 sub-tasks: build-subprojects, build-project.&lt;br /&gt;&lt;br /&gt;ok, now you can right click "build.xml" =&gt; "Run As" =&gt;  "Ant Build" (choose the one which you can select task else it would build default tasks) , then choose targets to excute,  click "run", it will run the build task.&lt;br /&gt;&lt;br /&gt;If you met the error of &lt;span style="color: rgb(51, 51, 255);"&gt;"Could not create task or type of type: junit"&lt;/span&gt;, see Q1 in the end of this article as reference.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2. run junit testing default build file&lt;/span&gt;&lt;br /&gt;the default build file contains tests and junitreport,&lt;br /&gt;you can merge seperate unit tests to one  target as follows,&lt;br /&gt;it combines all 4 unit tests into one target called &lt;span style="color: rgb(255, 0, 255);"&gt;unitTest&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;target&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"unitTest"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;br /&gt;&lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;mkdir&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;dir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${junit.output.dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;    &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;junit&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;fork&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"yes"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;printsummary&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"withOutAndErr"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;formatter&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;type&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"xml"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;test&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"com.roboo.segmenter.unitTest.DictionaryTest"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${junit.output.dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;test&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"com.roboo.segmenter.unitTest.MMTokenizerTest"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${junit.output.dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;test&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"com.roboo.segmenter.unitTest.OriginTokenizerTest"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${junit.output.dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;test&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"com.roboo.segmenter.unitTest.RMMTokenizerTest"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${junit.output.dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;classpath&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;refid&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"twoway-analyzer.classpath"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;  &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;target&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;now in eclipse you can choose &lt;span style="color: rgb(255, 0, 255);"&gt;unitTest &lt;span style="color: rgb(0, 0, 0);"&gt;to run all tests.&lt;br /&gt;and you can choose junitreport, this time the report would be generated. Attention if you have chosen junitreport before unitTest, then need to adjust targets order to make sure that unitTest is done before junitreport. else the report would be generated by old data.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3.make your own build file,add unit test and junitreport to build.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;every time when you export Ant Buildfiles, the default build.xml will be override. so just make your own build file. save build.xml to custbuild.xml. Also we want ant run not only as eclipse plugin but also in terminal by a single command, ok, we can add these targets to the depends of build target. find this line in custbuild.xml(which we copied from build.xml):&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;target&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;depends&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build-subprojects,build-project"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;br /&gt;&lt;br /&gt;change it to :&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;target&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;depends&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build-subprojects,build-project,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;unitTest,junitreport&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;now can run "ant -f custbuild.xml" in command line to run project build,unitTest and junitreport in 1 step.&lt;br /&gt;&lt;br /&gt;when running ant, if you met the error of "&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;ant: /bin/sh^M: bad interpreter: No such file or directory.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;", see Q2 as reference in the end of this article.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4.create target of : makepackage,deployapp&lt;/span&gt;&lt;br /&gt;now we want to make a jar package for the project, then add the following target:&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;        &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;br /&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;-- jar task to make package --&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;target&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"makepackage"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt; &lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;echo&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;message&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"Making jar package ....."&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt; &lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;delete&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;file&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}${package.version}.jar"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt; &lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;jar&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;destfile&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}${package.version}.jar"&lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;basedir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"bin"&lt;/span&gt; &lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;excludes&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"*.*,**/allwords.dict"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;update&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"false"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;-- exclude normal files under bin directory --&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;br /&gt;&lt;/span&gt;    &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;/span&gt;&lt;br /&gt;don't forget to add the target name to the depends for "build" target.&lt;br /&gt;here package.name and package.version is predefined in the properties of the build file(after xml file's root element):&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;property&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"package.name"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;value&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"roboosegmenter"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;property&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"package.version"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;value&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"1.3.2.0"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;after making the jar package, we need to deploy it to web apps.&lt;br /&gt;here &lt;span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;app_lib_dir,&lt;/span&gt;&lt;/span&gt;&lt;span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;tomcat_web_lib_dir&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0, 0, 0);"&gt; is predefined &lt;/span&gt;in the properties of the build file(after xml file's root element) &lt;pre&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 0, 255);"&gt;&lt;!--&lt;/span--&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;-- deploy segmenter lib to app_lib_dir and tomcat_web_lib --&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;target&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"deployapp"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;delete&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;      &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;fileset&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;dir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${app_lib_dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;includes&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}*jar"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt; &lt; /delete&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;          &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;/span&gt;&lt;br /&gt;     &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;copy&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;file&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}${package.version}.jar"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;  &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${app_lib_dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;     &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;delete&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;fileset&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;dir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${tomcat_web_lib_dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;includes&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}*.jar"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt; &lt; /delete&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt; &lt;/span&gt;          &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt;    &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;copy&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;file&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${package.name}${package.version}.jar"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;  &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;todir&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"${tomcat_web_lib_dir}"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;/span&gt; &lt;span style="color: rgb(0, 139, 139);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;don't forget to add the deployapp target to your build define, like this:&lt;br /&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;&lt;&lt;/span&gt;&lt;span style="color: rgb(165, 42, 42);"&gt;&lt;b&gt;target&lt;/b&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt; &lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;depends&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build-subprojects,build-project,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;unitTest,junitreport&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;,&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;makepackage,&lt;/span&gt;&lt;span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;deployapp&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 0, 255);"&gt;"&lt;/span&gt;&lt;span style="color: rgb(46, 139, 87);"&gt;&lt;b&gt;name&lt;/b&gt;&lt;/span&gt;=&lt;span style="color: rgb(255, 0, 255);"&gt;"build"&lt;/span&gt;&lt;span style="color: rgb(0, 139, 139);"&gt;/&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5.run ant under linux terminal or windows command line, or add it to scheduled tasks.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;to build project, run unit test, make jar package and deploy app:&lt;br /&gt;%ant -f custbuild.xml&lt;br /&gt;&lt;br /&gt;to build project do not run unit test or deploy:&lt;br /&gt;%ant -f custbuild.xml unitTest&lt;br /&gt;&lt;br /&gt;to build project and run just unitTest without deploy:&lt;br /&gt;%ant -f custbuild.xml build-project unittest&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Q1: Ant - junit, build failed: Could not create task or type of type: junit&lt;/h2&gt;  &lt;p&gt;When running JUnit tasks in ant and you get the following error:&lt;/p&gt; &lt;div class="code"&gt;&lt;div class="codeContent"&gt; &lt;pre class="code-java"&gt;BUILD FAILED&lt;br /&gt;path\to\...\build.xml:259: Could not create task or type of type: junit.&lt;br /&gt;Ant could not find the task or a class &lt;span class="code-keyword"&gt;this&lt;/span&gt; task relies upon.&lt;/pre&gt; &lt;/div&gt;&lt;/div&gt; &lt;p&gt;To fix this problem, you need to copy a JUnit.jar file to your eclipse/plugins/org.apache.ant_1.65/lib directory,&lt;br /&gt;Go into Eclipse then click on Window-&gt;Preferences-&gt;ant-&gt;Runtime,&lt;br /&gt;select 'Ant Home Entries (Default). Click on the button 'Add External JARs'. Locate the junit.jar file you copied, select it and hit 'OK'. Hit 'Apply', then 'OK' and try your ant task again. That should fix it.&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Q2:when i run ant in unix/linux terminal it shows the following error:&lt;/span&gt; eclipse/plugins/org.apache.ant_1.6.5/bin/ant: /bin/sh^M: bad interpreter: No such file or directory.&lt;br /&gt;A2:caused by file format under dos/windows is different to unix ,&lt;br /&gt;%fromdos &lt;&gt; file2   or use dos2unix to change the file format. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-4697606775863884026?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/4697606775863884026/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=4697606775863884026' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4697606775863884026'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4697606775863884026'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/use-eclipse-with-ant-to-deploy-your.html' title='Use eclipse with ant to deploy your java project -- from beginning of env setup to ant build'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-7819182636488348734</id><published>2007-01-11T19:25:00.000-08:00</published><updated>2007-01-11T20:08:16.205-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='working with linux'/><title type='text'>Eclipse and gaim font settings under KDE</title><content type='html'>When I opened gaim under KDE, the menus and dialogs are very ugly. And I have use  eclipse day by day under KDE about 2 months. The dialog and menu, and editor fonts are fairly ugly for both English and Chinese. So I decide to change these fonts.&lt;br /&gt;&lt;br /&gt;In eclipse Windows -&gt; Preferences, -&gt; General -&gt; Appearance -&gt; Color and Fonts, type "font" as filter , all fonts settings would be shown, dialog font, text editor font, java editor font, console fonts, etc. I change all fonts to WenQuanYi BitMap Song which support Chinese perfectly.&lt;br /&gt;&lt;br /&gt;However in eclipse settings it's own menu font cannot be changed. after googled "elipse menu font" and "eclipse 菜单字体", found the solution:&lt;br /&gt;download and install &lt;a href="http://www.freedesktop.org/Software/gtk-qt"&gt;gtk-qt-engine here&lt;/a&gt; .&lt;br /&gt;&lt;br /&gt;Then under the KDE Control-Center -&gt; Appearence &amp;&amp;amp; Themes (外观和主题) , a submenu called "GTK Styles and Fonts" would be available, you can change the  gtk Fonts here.&lt;br /&gt;&lt;br /&gt;Now gaim also look fine.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The eclipse and gaim font problem's root cause is that :&lt;br /&gt;1.Eclipse use SWT to show its UI; SWT is implemented by windows/gtk/motif&lt;br /&gt;2.Running Eclipse on linux/gtk, need gtk libraries.&lt;br /&gt;3.KDE is based on QT not GTK, so it need gtk-qt-engine to config  GTK Style  and Fonts. gtk-qt-engine is used to do it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-7819182636488348734?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/7819182636488348734/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=7819182636488348734' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/7819182636488348734'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/7819182636488348734'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/eclipse-and-gaim-font-settings-under.html' title='Eclipse and gaim font settings under KDE'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-4108153435320240559</id><published>2007-01-11T03:28:00.000-08:00</published><updated>2007-01-11T19:22:37.287-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><category scheme='http://www.blogger.com/atom/ns#' term='common tools'/><title type='text'>to implement SVN password changing function by shell and php</title><content type='html'>We have install SVN as our version control system. It doesn't provide a remote password changing function on the web. I googled on the internet and didn't found a good solution. So I wrote a script in bash and a php front end page to do it.&lt;br /&gt;(if you need a jsp or perl front end page, you can write one yourself)&lt;br /&gt;&lt;br /&gt;Here's the shell script to change password for svn:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;#!/bin/sh&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;#changepass.sh , function: change password for svn&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;#usage: changepass.sh username oldpass newpass newpassretype&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;if [ ! "$#" = 4 ]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        echo "Usage:`basename $0` username oldpass newpass newpassretype"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        exit 1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;passfile="/home/svn/passwd"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;username=&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;oldpass=&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;newpass1=&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;newpass2=&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;username=$1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;oldpass=$2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;newpass1=$3&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;newpass2=$4&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;if [ ! $newpass1 = $newpass2  ]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        #echo "password does not match!";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        echo "password does not match!"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        exit 2&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;export NEWPASS=$newpass1&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;export USERNAME=$username&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;i=`sed /^"$username"[" ""\t"]*=[" ""\t"]*$oldpass\$/p $passfile -n|wc -l`&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;if [ $i = 1 ]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;awk '{ if(index($0,ENVIRON["USERNAME"])==1) {print  ENVIRON["USERNAME"] " = " ENVIRON["NEWPASS"] }else {print $0} }' $passfile &gt; /home/svn/newpass&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;rm /home/svn/newpass 2&gt;&amp;1 1&gt; /dev/null&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;cp /home/svn/newpass $passfile&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;echo 'password changed!'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;elif [ `sed /"$username"/p $passfile -n |wc -l` &gt; 0 ]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;then&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;echo ' username and password does not match'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;        echo 'could not find username'&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 102, 0);"&gt;fi&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;here's the php front end changepass.php , it is for php 5, if you use php 4, maybe you need use $HTTP_POST_VARS instead $_POST ( just guess, i haven't test it):&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;if(strlen($_POST["pwd1"]) &gt;0 ){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                if($_POST["pwd1"]!=$_POST["pwd2"]){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        print("&lt;span style=""&gt;Passwords do not match, try again.&lt;/span&gt;&lt;p&gt;\n");&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                }else{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                $LoginName = $_POST["loginname"];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                $OldPassword = $_POST["oldpwd"];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                $NewPass1 = $_POST["pwd1"];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                $NewPass2 = $_POST["pwd2"];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                $retval='';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                #echo $LoginName;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                #echo $OldPassword;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                // user apache or nobody(who runs httpd daemon) needs the permission of passwd file and temp file&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        $command = "/mnt/apache/changepass.sh ".$LoginName." ".$OldPassword." ".$NewPass1." ".$NewPass2 ;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        #$command = "/bin/cat /mnt/apache/changepass.sh "." 2&gt;&amp;1";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        $command = &lt;span style="color: rgb(51, 51, 255);"&gt;$command." 2&gt;&amp;1"; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        #system("/bin/echo abc",$retval);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        system($command, $retval);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        echo "&lt;br /&gt;" ;echo $retval;echo '&lt;br /&gt;';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        if($retval!=0){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                                print("&lt;span style=""&gt;&lt;br /&gt;Error while setting password:&lt;br /&gt;&lt;/span&gt;\n");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;        else{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;                ;#echo "parameters not set!";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;?&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;br /&gt;&lt;form action="changepass.php" method="post"&gt;&lt;/form&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;table&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Login Name:&lt;/td&gt;&lt;td&gt;&lt;input name="loginname" type="text"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;tr&gt;&lt;td&gt;Old Password:&lt;/td&gt;&lt;td&gt;&lt;input name="oldpwd" type="password"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;tr&gt;&lt;td&gt;New Password:&lt;/td&gt;&lt;td&gt;&lt;input name="pwd1" type="password"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;tr&gt;&lt;td&gt;Repeat Password:&lt;/td&gt;&lt;td&gt;&lt;input name="pwd2" type="password"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;input value="Change Password" type="submit"&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;/span&gt; &lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 102, 0);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the php page and shell scripts should works ok, but the php page shows nothing after click "submit" in fedora, however in slackware it is ok.&lt;br /&gt;&lt;br /&gt;After debug step by step, found that shell script error message would not be ouput on the web page, so i add this line: &lt;span style="color: rgb(255, 102, 0);"&gt;$command = &lt;span style="color: rgb(51, 51, 255);"&gt;$command." 2&gt;&amp;1";&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;And finally found that SELinux would block some function on the web server. I disabled SELinux in the firewall settings, and it works.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-4108153435320240559?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/4108153435320240559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=4108153435320240559' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4108153435320240559'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4108153435320240559'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/to-implement-svn-password-changing.html' title='to implement SVN password changing function by shell and php'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-6265893516538797595</id><published>2007-01-11T02:43:00.000-08:00</published><updated>2007-01-11T03:28:04.350-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='php'/><title type='text'>difference on class between php version 4.4.4 and 5.2.0</title><content type='html'>Different PHP versions behalves differently. The only two distribution on &lt;a href="http://www.php.net/downloads.php"&gt;php.net&lt;/a&gt; is 4.4.4 and 5.2.0.  The experience of the article describes class difference between 4.4.4 and 5.2.0 is that:&lt;br /&gt;1). class members variable is decorated by "private" in 5.2.0,  as "var" in 4.4.4&lt;br /&gt;2). class functions is decorated by "public function" in 5.2.0,  as "function" in 4.4.4&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Several days ago, i wrote a php proxy for wap.roboo.com to transfer jsp response to a php server. And grabed a HTTPRequest class from google, the class code is as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;class HTTPRequest&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; $_fp;        // HTTP socket&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; $_url;        // full URL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; $_host;        // HTTP host&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;var&lt;/span&gt; $_protocol;    // protocol (HTTP/HTTPS)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;var&lt;/span&gt; $_uri;        // request URI&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;var&lt;/span&gt; $_port;        // port&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // scan url&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;function&lt;/span&gt; _scan_url()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        ....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // constructor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;function&lt;/span&gt; HTTPRequest($url)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        $this-&gt;_url = $url;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        $this-&gt;_scan_url();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // download URL to string&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;function&lt;/span&gt; DownloadToString()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        ....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I use Slackware 11 to do most works, slack use php 4.4.4 by default. the HTTPRequest works ok on my machine. After deploy it on another fedora machine which has php 5.0 by default, it fails.  Then I updated it to php 5.2.2, with the help of one colleague, I changed the class as follows to support 5.2.2:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;class HTTPRequest&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt; $_fp;        // HTTP socket&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; $_url;        // full URL&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; $_host;        // HTTP host&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; $_protocol;    // protocol (HTTP/HTTPS)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; $_uri;        // request URI&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="font-weight: bold; color: rgb(51, 51, 255);"&gt;private&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; $_port;        // port&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // scan url&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;public function&lt;/span&gt; _scan_url()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        ....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // constructor&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;public function&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; HTTPRequest($url)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        $this-&gt;_url = $url;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        $this-&gt;_scan_url();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    // download URL to string&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    &lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;&lt;span style="color: rgb(51, 51, 255); font-weight: bold;"&gt;public function&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt; DownloadToString()&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;        ....&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: lucida grande; color: rgb(255, 102, 0);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;By the way, i use vi(vim actually) to edit source, just use :0,$s/var/private/g , :0,$s/function/public function/g to do the substitution.&lt;br /&gt;&lt;br /&gt;After disabled SELinux on fedora , it works ok.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-6265893516538797595?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/6265893516538797595/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=6265893516538797595' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6265893516538797595'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/6265893516538797595'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2007/01/difference-on-class-between-php-version.html' title='difference on class between php version 4.4.4 and 5.2.0'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6886811715076147315.post-4637237168951120322</id><published>2006-12-18T22:15:00.000-08:00</published><updated>2006-12-18T22:37:57.844-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='common tools'/><title type='text'>Gaim 1.5/2.0 with SSL support</title><content type='html'>Compile GAIM with SSL support on Linux (for MSN, gtalk/Google Talk)&lt;br /&gt;&lt;br /&gt;when running gaim to connect to MSN/gtalk, it failed and said: SSL support is needed for MSN. Please install a supported SSL library. MSN (Microsoft Messenger) and Google Talk (GTalk or Gmail Talk) both require SSL authentication enabled when using GAIM instant messenger. See http://gaim.sf.net/faq-ssl.php for more information.&lt;br /&gt;&lt;br /&gt;That mean you have not compiled GAIM with SSL support enabled or you don't have libraries (NSS and NSRP) in proper directories.&lt;br /&gt;For gaim 1.5, you can just add "/usr/lib/firefox2.0/"(where your firefox is located) to the end of file  /etc/ld.so.conf, and run ldconfig as root, then you can run gaim with SSL ; For gaim 2.0, you can install it from tarball and configure SSL support by the following steps:&lt;br /&gt;&lt;br /&gt;1,Download SSL support libraries from Mozilla to /home/soft/gaim/:&lt;br /&gt;#cd /home/soft/gaim/&lt;br /&gt;#wget ftp://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_9_RTM/Linux2.4_x86_glibc_PTH_OPT.OBJ/nss-3.9.tar.gz&lt;br /&gt;#wget ftp://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v4.4.1/Linux2.4_x86_glibc_PTH_OPT.OBJ/nspr-4.4.1.tar.gz&lt;br /&gt;&lt;br /&gt;2.Copy SSL library files to proper locations (system libraries directory):&lt;br /&gt;#cd /home/soft/gaim/&lt;br /&gt;#tar xzvf nss-3.9.tar.gz&lt;br /&gt;#tar xzvf nspr-4.4.1.tar.gz&lt;br /&gt;&lt;br /&gt;#cp -rf nss-3.9/lib/* /usr/local/lib/&lt;br /&gt;#cp -rf nspr-4.4.1/lib/* /usr/local/lib/&lt;br /&gt;(you can use /usr/lib/ instead if required)&lt;br /&gt;&lt;br /&gt;3.Install gaim 2.0 with ssl support&lt;br /&gt;#tar xzvf gaim-2.0.0beta5.tar.gz (assume you have download gaim-2.0 to /home/soft/gaim )&lt;br /&gt;#cd gaim-2.0.0beta5&lt;br /&gt;#./configure --with-nss-includes=/home/soft/gaim/nss-3.9/include --with-nspr-includes=/home/soft/gaim/nspr-4.4.1/include --with-nss-libs=/home/soft/gaim/nss-3.9/lib --with-nspr-libs=/home/soft/gaim/nspr-4.4.1/lib&lt;br /&gt;&lt;br /&gt;Configure should finish without an error - look for this line:&lt;br /&gt;SSL Library/Libraries......... : Mozilla NSS&lt;br /&gt;&lt;br /&gt;If the lines contains Mozilla NSS, then you are set.&lt;br /&gt;&lt;br /&gt;#make&lt;br /&gt;#make install&lt;br /&gt;&lt;br /&gt;Now run GAIM and you should be done, if the previous steps went without the errors. Create MSN or Google Talk account and it should connect correctly.&lt;br /&gt;&lt;br /&gt;ps, if you use KDE, kopete is good substitute for gaim. It works fine with MSN/gtalk, while gaim has a more extensive support for plugins, like tencent QQ.&lt;br /&gt;&lt;br /&gt;Reference: http://www.ambience.sk/gaim-compile-ssl-linux-msn-google-talk&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/6886811715076147315-4637237168951120322?l=effectivelinux.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://effectivelinux.blogspot.com/feeds/4637237168951120322/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=6886811715076147315&amp;postID=4637237168951120322' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4637237168951120322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6886811715076147315/posts/default/4637237168951120322'/><link rel='alternate' type='text/html' href='http://effectivelinux.blogspot.com/2006/12/gaim-1520-with-ssl-support.html' title='Gaim 1.5/2.0 with SSL support'/><author><name>euler</name><uri>http://www.blogger.com/profile/04037785797440539906</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
