Saturday, November 19, 2005

Issues with utf-8 and zh_CN.gb2312:
When u set the locale of Linux to utf-8, and create a file named with chinese charactors. Then u put the file to other Linux which's locale is zh_CN.gb2312 or other differrent with utf-8. Other Linux cann't recognize the file.
Sometimes, I have to change the locale from utf-8 to gb2312, or gb2312 to utf-8.
Edit ~/.bashrc, add export LANG=utf-8 export LC_ALL=utf-8
There is a tool can change the filename from one locale to another: convmv
iconv can change the content of the file.

Wednesday, November 16, 2005

Install RHEL AS3 notes:
1. Install with SATA hard drive:
The install programme cann't recognize the SATA hard drive, you should get into the BIOS when booting, change the SATA to legacy parrallel ATA(or PATA), maybe your motherbord support it. After that
, proceding the installation.
When completed installation, we can rebuild the kernel to support our SATA drive. see the reference:
http://linuxmafia.com/faq/Hardware/sata.html
2. config vsftp
a. create a ftp user, can't login, home directory is /ftp when logining with ftp client tool, group is ftp, don't create home directory for this user.
useradd -d /ftp -G ftp -M -s /sbin/nologin sudy
b. edit /etc/vsftpd/vsftpd.conf:
anonymous_enable=no #deny anonymous login
local_enable=yes #enable local user to login in
local_umask=022 #the uploaded file's properity is 755
chroot_local_user=yes #restrict user in there home directory.
userlist_enable=yes
userlist_deny=no # conjunction with userlist_enable and userlist_deny, can specifiy which local user can login or not. if userlist_enable=yes,userlist_deny=no, local users list in userlist_file can login. if userlist_enable=yes,userlist_deny=yes, local users list in userlist_file cann't login. userlist_deny is yes default
userlist_file=/etc/vsftpd.user_list
c. /etc/init.d/vsftpd restart
3. config NFS:
a. /etc/init.d/nfs start and /etc/init.d/nfslock start
can use nfs tools see the result, "rpcinfo -p", "ps aux |grep rpc*"
the rpc.statd, rpc.mountd, portmap, nlockmgr must be in the list.
b. edit /etc/exports on nfs server
/share/download eda5(rw,sync,no_root_squash)
this means we will share /share/download with eda5(can use ip address or domain name), eda5 have read and write rights. treate remote root as local root, this enable remote root mount file on the server.
c. exportfs -rv
every time, when change the /etc/exports, must run this command to allow our changed to be effective.
d. mount eda1:/share/download /mnt/
this mount file from nfs server eda1 to local /mnt. we can edit /etc/fstab to allow auto mount when booting. add this line : eda1:/share/download /mnt nfs rw,hard,intr 0 0
4. share home directory on nfs server
we can put the home directory of every user on local machine to a centered server, thus login from every machine, every user have the same home directory.
a. in every local machine, mount a directory from server, which directory store home directory of local users. eg. in server eda1, nfs share the directory /export/workspace. in local machine eda5, mount it in /mnt/workspace.
b. useradd sudy in every local machine, specifying the home directory is /mnt/workspace.
c. on every local machine, edit /etc/profile.d/gnome-ssh-askpass.sh, add export GCONF_LOCAL_LOCKS=1

Sunday, November 13, 2005

Using svn:
1. create a user account, such as svn. Do not use root account. Then login with that user accout.
2. svnadmin create an empty repository.
svnadmin create /rep_dir/project
3. start svn server.
svnserve -d -r /rep_dir, start the server as a daemon and restricted in /rep_dir.
4. edit config file to allow user to import or commit to repository.
edit /rep_dir/project/conf/svnserve.conf:
[general]
auth_access=write
realm = xxx
password-db=userfile
then create a file called userfile under /rep_dir/project/conf/, edit it like this USERNAME=PASSOWRD:
[users]
svn=svn
4. import a file to our newly created repository.
svn import tpmnew svn://localhost/project -m "initial import" --username svn --password svn
tpmnew is the directory or file which you want to import to repository
5. checkout from repository and get a working a copy .
svn checkout svn://localhost/project
6. commit your changes in working copy,
svn commit tpmnew --username svn --password svn -m "made a modification"
7. show the modification you do in the working copy.
svn diff
8.

Wednesday, November 09, 2005

install eclipse+jre1.5:
I want to use eclipse for developing, but pre-installed eclipse in fc4 using gnu's vm has no response when i run it. i have no idea what's wrong with it. i have to change the vm to sun's.
In this article: http://stanton-finley.net/fedora_core_4_installation_notes.html#Java tells about how to install jre 1.5 on fc4.
The command "alternertives" lets users chose which programme to run when u type the same command name in shell, such as when i install sun's java in /usr/java/xx/bin, gnu's java in /usr/bin/,

Friday, November 04, 2005

Linux command :
1. set environment variable:
export PATH=$PATH:/share, thus, "env" can list all the variables. and if want to unset it, use
unset PATH.
2. "source" : open a script and execute it in current shell.
3. "ldconfig" : update dynamic linker library which is under the /usr/lib and /lib.
Add another library path:
1). edit /etc/ld.so.conf, add directory in the file, then run "ldconfig".
2). on the gcc command line, -L specify the directory, -llibrary specify the library which has a prefix "lib",postfix "so". eg: gcc -o out prog.c -L/usr/xx -lsharelib ,which means that libsharelib.so under the /usr/xx dir.
after u compile the program, you should set the LD_LIBRARY_PATH env variable.
"ldconfig -p" can list the path cache.
4. "gcc -v dummy.c" can list the detailed information about preprocessor, compilation, assembly stages and gcc's included paths and their order.
5. "gcc -o out mypro.c requiredlib.a " produce a static link with requiredlib.a
hello world\n