Utilize shell scripts,linux commands, open source tools,java, to Maximize the Power of Linux.
Focused on working with linux and shell, search engine technology including Chinese segmenter
Any questions please contact me at gmail: david.ullua

5/31/2007

Utilize hudson and ant to set up a daily build system step by step

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:

0). download hudson from https://hudson.dev.java.net/servlets/ProjectDocumentList.
You can download jnlp release jar or old release war package.

1).Hudson needs a web container such as glassfish, tomcat or winstone.
But Hudson ships with Winstone, so you can run it standalone by run : java -jar hudson.war, or java -jar hudson.jar if you downloaded the jnlp release.

Use the -D option to specify HUDSON_HOME in the invocation:
$ java -DHUDSON_HOME=/path/to/home -jar hudson.war

Alse you can use the environment variable:
$ export HUDSON_HOME=/path/to/hudson_home
$ java -jar hudson.war

HUDSON_HOME: Hudon needs some diskspace to perform builds and keep archives.
(By default, this is set to ~/.hudson , but you can change it: https://hudson.dev.java.net/admin.html)

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.

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 https://hudson.dev.java.net/containers/glassfish.html.

4). you can configure automatic build (like crontab), or periodical build or build by email, ref: https://hudson.dev.java.net/build.html

5). if you met problem when run ant task (), 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.

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.

It should works, else email me your problem.

5/28/2007

gains of subversion (SVN带来的收益)

Author: David Lv Euler
Date: 05/28/2007, Suzhou

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.

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 http://subversion.tigris.org .

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.

当我使用.net和VSS的时候,我们的团队经常被憋足的VSS所绊倒。很多情况下,有人修改了一个公用文件DbHelper.cs 或者一个业务逻辑文件Order.cs, 这时我们也需要修改这个文件。然后我们不得不等他/她签入/提交文件。更糟糕的是,此时他/她可能正在另一个城市旅行,这时我们只好修改本地文件的只读属性,但依然无法签入。大量的时间在等待和签入签出中被浪费了。

如果您正在被VSS的“锁定,签出,修改”模型所困扰,或者您正在寻找一个版本管理系统,那么我向您推荐subversion (SVN). Subversion使用"签出,修改,更新和提交"的模型,当签出一个文件或目录后,每一个人都可以同时修改同样的文件,然后执行更新(如果没有并发修改就不需要更新,可以直接提交), svn会自动合并其他人的修改到您的工作文件中.然后您可以安全地提交您的机器上的拷贝. 如果svn无法合并更改,那么她会告诉您哪些地方有冲突,您可以手工解决这些冲突,然后安全地提交. 您可以参考http://subversion.tigris.org 上面的手册.

即时您在使用dotnet, 仍然有VS.net的subversion插件可以使用。现在我的Team使用java, SVN在代码管理和团队协作上给了我们很大的帮助。我相信她是最优秀的开源项目之一。

5/09/2007

"You can't load TkCximage", could not run amsn as normal user

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.

I download amsn 0.96 from linuxpackages for the slack package.
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.

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.

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 ):
#cd /usr/share/amsn/
#find ./ -type d -exec chown david.users {} \;
#find ./ -type d -exec chmod +x {} \;

then logged as normal user david, run ./amsn, it works now.

About Me

I am a senior developer and a team leader with 3 years development experience in Suzhou, China, focus on mobile web search, linux, Java and machine learning in NLP (natural language processing). My goal is to improve people's life with computer technology.