Archive for the ‘Linux’ Category
Fedora 11 in 16 days
Sunday, May 10th, 2009Java timezone problem with F7
Saturday, June 14th, 2008Under fedora 7, you might find an incorrect time problem for java log4j output. The reason should be F7 using America/New York as the timezone name for New York, which is invalid for Java (should be America/New_York, with the underline instead of space). A solution is using system-config-date tool change it to America/Toronto.
Maven release
Saturday, May 3rd, 2008You can use maven release plugin to make your release job much easier. it will automatically test build the project and run all unit test. After that, it will create a tag for you, and then update the current snapshot version to a newer one.
For using the release plugin, you will need to set up the scm info first:
<project>
...
<scm>
<connection>...</connection>
<developerConnection>...</developerConnection>
<url>...</url>
</scm>
The ‘connection’ tag is for read only checkout, and ‘developerConnection’ is with commit permission.
The value of them will look like: ’scm:svn:http://….’, given you are using SVN/Webdav as your SCM system.
After that, you can use: ‘mvn release:prepare’ for preparing your release. And you can use ‘mvn release:perform’ for doing the release.
Please note that if you don’t have a repository set up, the release:perform will fail. That’s okay is you don’t really need to release it by repository. You can just delete those 2 generated release property file.
Get Maven project from svn to Eclipse
Saturday, May 3rd, 2008When you put a maven project under source control like SVN, you don’t have to check in the IDE’s project file. What you will do is check in the pom.xml and the source folder. That is enough for you to rebuild the project.
If you want to continue work on this project on your favorite IDE (like Eclipse) again, you can simply choose “File-import” and from the dialog box, select “Other – Check out Maven Project from scm” and the locate you source repository in the following wizard, and you are good to go. The Maven plugin will generate the project file for you according to pom file settings.
How to get the absolute path to the folder of current program
Monday, December 24th, 2007How to determine Current Fedora version
Sunday, December 23rd, 2007Setup rsync server
Thursday, December 20th, 2007For example, we want to set up an rsync server to duplicate the subversion server data to other computers.
First, of cause we have to have rsync installed. For fedora, this should be included in default installation.
Then we will create the config folder and config in Fedora’s style:
cd /etc mkdir rsyncd cd rsyncd touch rsyncd.conf touch rsyncd.motd touch rsyncd.secrets chmod 600 rsyncd.secrets
Then will edit rsyncd.conf file:
pid file=/var/run/rsyncd.pid port=873 address=192.168.2.111 uid=root gid=root use chroot=yes read only=yes # limit access to LANS hosts allow=192.168.2.0/255.255.255.0 host deny=* max connections=5 motd file=/etc/rsyncd/rsyncd.motd log format=%t%a%m%f%b syslog facility=local3 timeout=300 [svn] path=/var/www/svn list=yes ignore errors auth users=svnsyncer secrets file=/etc/rsyncd/rsyncd.secrets comment=SVN Repository
We will add the welcome message to /etc/rsyncd/rsyncd.motd
Welcome the SVN rsync service
Add user/password to /etc/rsyncd/rsyncd.secrets
svnsyncer:123456
And then, we will create our init start up script named /etc/init.d/rsyncd
#!/bin/sh
#
# Startup script for rsyncd daemon
#
# chkconfig: 35 90 10
# description: Server data for sync to other server
# processname rsync
# Source function library
. /etc/rc.d/init.d/functions
prog=rsync
conf=/etc/rsyncd/rsyncd.conf
case "$1" in
start)
echo -n "Starting rsync daemon: "
daemon /usr/bin/$prog --daemon --config=$conf
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch /var/lock/subsys/$prog
;;
stop)
echo -n "Shutting down $prog: "
killproc -d 60 $prog
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f /var/lock/subsys/$prog
;;
status)
status $prog
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
exit 0
We will register and this service by
/sbin/chkconfig --add rsyncd /sbin/service rsyncd start
Install sun JDK on Fedora 8
Friday, December 7th, 2007Download JDK from Sun’s website, and install it. The default install path should under /usr/java.
We create a new alternative entry:
/usr/sbin/alternatives --install
/usr/bin/java java
/usr/java/latest/jre/bin/java 2
and then we config the java alternative settings, select the sun version:
/usr/sbin/alternatives --config java
And we are good to go.
How to set up fcitx under FC7 with en_US.utf-8 locale
Friday, October 12th, 2007First, you can download the source tarball and use the regular configure, make and make install procedure to install it.
Then create a new input method entry: /etc/X11/xinit/xinput.d/fcitx.conf, with the content:
XIM=fcitx XIM_PROGRAM=fcitx GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx
Create and set up alternatives using fcitx
alternatives --install /etc/X11/xinit/xinputrc xinputrc /etc/X11/xinit/xinput.d/fcitx.conf 100 alternatives --config xinputrc
Now, fcitx should be good to use under zh_CN locale. If you want to use under en_US locale, do the following as well.
Edit /etc/X11/xinit/xinitrc.d/xinput.sh, add “en” to the “_language_list” string.
Edit /etc/gtk-2.0/x86_64-redhat-linux-gnu/gtk-immodules, add “en” to “xim” section.
