王志军个人空间

工作、生活、健康

Subscribe to RSS feed

Sticky post

2006年目标

Technorati Profile




Current Project:
1。〈4W家庭理财〉新增功能,详情请见4W家庭理财主页
2。修改<网络学院>;


Book to read:
1。<Borland传奇>;
2。<富爸爸穷爸爸系列>;
3。<谁动了我的奶酪>;
4。《设计模式》和《设计模式解析》
5。The Mythical Man-Month
6。http://my.opera.com/wangzhijun/blog/show.dml/122448

远期目标:
1。提高英语口语 --- http://www.unsv.comVOA Special TV, 更多网站
2。熟悉Oracle database concept和IAS、OCS;
3。熟悉J2EE和XML相关概念;
4。精通Linux;


软件测试网站:
1.Google testing
2.51testing


Future project:
1。将〈4W家庭理财〉移植到Linux下;
2。编写一个类似<良友.收藏家>但在Linux下运行的文档管理tool;
3。将在〈4W家庭理财〉功能基础上,编写一个面向小企业的共享财务软件,增加库存商品、人员管理、自动锁定等功能。


需要了解的概念:
Thread safe

设计软件,不一定遵循已有的规则,易用性和稳定性就是为用户着想,为用户着想的程序就是好程序,就会得到用户的欢迎,而不管你的算法多么优秀,你的函数写得多么完美,只要用户觉得不好用,用户不买你的帐,一切都是零。

----摘录自<我的软件10年:我的第一个商品化软件>

REHL5系统下jsp环境: Apache2.2.3和Tomcat 5.5.26的整合安装

我们已经知道,Apache只能是单纯支持PHP、Perl、Python的Http服务器,对于ASP、JSP都得需要额外的包才能支持,今天我们主要说说如何支持JSP.

1、准备,下载需要的文件。这里假定你已经正确安装配置好了jdk1.6.0_05。到Apache官方网站下载所需要的文件:
httpd-2.2.3.tar.gz
apache-tomcat-5.5.26.tar.gz
tomcat-connectors-1.2.32-src.tar.gz
其中httpd和tomcat-connectors为源码包,apache-tomcat为二进制包。


2、安装Apache。(跳过这步,使用REHL5默认安装/usr/sbin/httpd)
代码:
# tar xzvf httpd-2.2.3.tar.gz
# cd httpd-2.2.3
# ./configure --prefix=/usr/local/apache2 --enable-so
# make
# make install

看看是否能正常打开http://localhost

注意/etc/httpd/conf/httpd.conf中语句"Include conf.d/*.conf"将包含perl.conf, php.conf, python.conf, ssl.conf, proxy_ajp.conf, auth_mysql.conf等。

3、安装Tomcat。
代码:
# cp apache-tomcat-5.5.26.tar.gz /usr/local/
# cd /usr/local
# tar xzvf apache-tomcat-5.5.26.tar.gz

自己写一个脚本startcat.sh,启动Tomcat.
#!/bin/sh

JAVA_HOME=/scratch/luwang/jdk1.6.0_05
export JAVA_HOME
PATH=$JAVA_HOME/bin:$PATH
export PATH
CATALINA_HOME=/scratch/luwang/apache-tomcat-5.5.26
export CATALINA_HOME
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME/common/lib/servlet-api.jar
export CLASSPATH

echo starting the web server ... ...
echo $CATALINA_HOME/bin/startup.sh
nohup $CATALINA_HOME/bin/startup.sh >$CATALINA_HOME/logs/startcat.log 2>&1 &

打开http://localhost:8080看看正常不。

4、编译生成mod_jk。
代码:
# tar xzvf tomcat-connectors-1.2.32-src.tar.gz
# cd tomcat-connectors-1.2.32-src/native
# ./configure --with-apxs=/usr/sbin/apxs
# make
# cp ./apache-2.0/mod_jk.so /etc/httpd/conf/modules/


5、配置。
在/etc/httpd/conf/下面建立两个配置文件mod_jk.conf和workers.properties。

# vi mod_jk.conf
添加以下内容:
代码:
# 指出mod_jk模块工作所需要的工作文件workers.properties的位置
JkWorkersFile /etc/httpd/conf/workers.properties

# Where to put jk logs
JkLogFile /etc/httpd/logs/mod_jk.log

# Set the jk log level [debug/error/info]
JkLogLevel info

# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y]"

# JkOptions indicate to send SSL KEY SIZE,
JkOptions  +ForwardKeySize +ForwardURICompat -ForwardDirectories

# JkRequestLogFormat set the request format
JkRequestLogFormat "%w %V %T"

# 将所有servlet 和jsp请求通过ajp13的协议送给Tomcat,让Tomcat来处理
JkMount /servlet/*  worker1
JkMount /*.jsp worker1
#for webwork
#JkMount /*.action 

注意:最后的几个语句,*.action为配置解析webwork2,这点搞了我两天.同样的,如要用Tomcat解析其它类型,也在这里添加.

# vi workers.properties
添加以下内容:
代码:
# Defining a worker named worker1 and of type ajp13
worker.list=worker1

# Set properties for worker1
worker.worker1.type=ajp13 
worker.worker1.host=localhost 
worker.worker1.port=8009
worker.worker1.lbfactor=50 
#下面这句好象不支持了,还是换了格式?
#worker.worker1.cachesize=10 
worker.worker1.cache_timeout=600 
worker.worker1.socket_keepalive=1 
worker.worker1.socket_timeout=300

再配置/etc/httpd/conf/httpd.conf,作以下修改:
在DirectoryIndex中添加 index.jsp
我的网页放在/var/wwwroot下,所以要修改DocumentRoot
代码:
DocumentRoot "/var/wwwroot"
<Directory "/var/wwwroot">
    Options Includes FollowSymLinks
    AllowOverride None
    Order deny,allow
    Allow from all
    XBitHack on  #这行没加,不知道有什么用?
</Directory>
<Directory "/var/wwwroot/WEB-INF">    
    Order deny,allow
    Deny from all
</Directory>

增加关于加载mod_jk的语句:
代码:
LoadModule jk_module modules/mod_jk.so
Include /etc/httpd/conf/mod_jk.conf

最后编辑Tomcat的配置文件server.xml,在HOST段中加入:
代码:
<Context path="" docBase="/var/wwwroot" debug="0" reloadable="true" crossContext="true"/>

在/var/wwwroot下建立一个index.jsp,启动Apache和Tomcat,用浏览器访问http://localhost/,应该可以看到正确的页面了。

如果发现有问题,可以先分别测试Apache和Tomcat,然后再一起测试。

参考资料:
http://www.linuxidc.com/Linux/2007-08/7091.htm
http://tomcat.apache.org/connectors-doc/webserver_howto/apache.html

IBM T42双系统使用"一键恢复"功能

硬件存在问题: 电池不用使用, 光驱工作不正常, 下排鼠标左键有时无响应
现状: 自从2006年购买T42至今,没有重装过系统. 现在Windows XP启动时间超过4分钟,已经无法忍受. 于是打算重装一下Windows XP.
Red Hat 5.5 + Windows XP双系统

隐藏分区遭损坏是误导
安装Linux时,使用过diskdruid分区; 使用过Disk Genius activate隐藏分区,然后又恢复了, PQ不能正常识别分区

进入Linux后,使用root修改/boot/grub/menu.lst, 为IBM隐藏分区增加一个菜单.

重新启动机器,选择IBM恢复菜单启动,进入<>后,选择restore to factory content,然后可选择全盘或C盘安装,然后只需要等待40多分钟就可以重装成功. 注意,安装过程中需要直接连接网络.我在家里使用ADSL时,恢复时显示"Failed",重启显示要求激活Windows.就在我准备放弃时,带到公司接上网络,一切都很顺利,恢复过程不需要用户干预,它会自动完成,直到提示用户configure.

安装成功后,可以使用Start - Program - Access IBM - Create Recovery Discs生成一张IBM R&R光盘,不需要向IBM售后购买光盘.


参考资料:
http://hi.baidu.com/deshanyang/blog/item/c7e506d5c28e56c451da4b96.html
http://www.51nb.com/forum/thread-222232-1-1.html
http://blog.163.com/tuchao520@126/blog/static/3604414620105581427240/
http://think.lenovo.com.cn/htmls/knowledge/detail_12651015370332033.html
http://hi.baidu.com/deshanyang/blog/item/1b0a13f47535266eddc47496.html

Makefile: ifeq directive doesn't work with $*

今天在修改Makefile时,发现如果condition中包含$*(automatic variables),无论取什么值,ifeq语句永远只执行true语句或false语句。
do_lrg%: 
ifeq ("$(findstring $*,$(ALL_SHIPHOME_LRGS))", "")
        echo "regression test..."
else
        echo "shiphome test..."
endif

通过参照Makefile: ifeq directive compares special variable to constant does not work找到了答案。

Conditional Statements All instances of conditional syntax are parsed immediately, in their entirety; this includes the ifdef, ifeq, ifndef, and ifneq forms. Of course this means that automatic variables cannot be used in conditional statements, as automatic variables are not set until the command script for that rule is invoked. If you need to use automatic variables in a conditional you must use shell conditional syntax, in your command script proper, for these tests, not make conditionals.



但可以使用$(if condition,then-part[,else-part])去workaround它。
do_lrg%: 
        $(if $(findstring $*, $(ALL_SHIPHOME_LRGS)), \
           echo "shiphome test", \
           echo "regress test" \
        )

REHL5上拨号连接和无线网卡设置

虽然也可以用ifconfig来设置IP,用route来配置默认网关,用hostname来配置主机名,但是重启后设置会丢失。
可以将设置保存到相关的配置文件:
/ect/hosts 配置主机名和IP地址的对应
/etc/sysconfig/network 配置主机名和网关
/etc/sysconfig/network-scripts/ifcfg-eth0 eth0配置文件,eth1则文件名为ifcfg-eth1,以此类推
/etc/resolv.conf DNS设置

拨号网络设置
#/usr/sbin/adsl-setup输入ISP帐号、密码,生成配置文件/etc/sysconfig/network-scripts/ifcfg-ppp0。
或者使用命令system-config-network或者菜单“System->Network Device Control”在图形界面下创建一个新的拨号连接。

参考:
http://dev.firnow.com/course/6_system/linux/Linuxjs/20100224/195861.html
http://www.shocr.com/rhel-adsl-network/
http://www.linuxdiyf.com/bbs/viewthread.php?tid=13275&extra=page%3D&page=1

rpm包rp-pppoe中其它命令:
/sbin/adsl-setup 
/sbin/adsl-start   开始拨号
/sbin/adsl-status 
/sbin/adsl-stop
/sbin/adsl-connect  连接


如果不能上网的话 ,检查网关、DNS的设置文件。
/etc/sysconfig/network
/etc/resolv.conf


无线网络设置:

安装无线网卡驱动参见http://my.opera.com/wangzhijun/blog/ibm-t42-ntfs
确保内核配置中启动了无线局域网支持:
#grep CONFIG_NET_RADIO /boot/config-`uname -r`
CONFIG_NET_RADIO=y

# modprobe ipw2200 #启动 ipw2200模块
启动模块的时候可以使用参数来指定一些设置。比如可以用ifname参数来指定网络接口的名称:
# modprobe ipw2100 ifname=eth1
# lspci | grep Wireless #确认无线网卡的型号
# dmesg #检查网卡状态

启动系统自带的无线网卡图形管理配置工具NetworkManager,并设置开机自启动
service NetworkManager start
chkconfig NetworkManager on

使用命令system-config-network或者菜单“System->Network Device Control”,图形界面下修改eth1配置或创建一个新的无线网络连接。
或者直接修改无线网卡对应的配置文件/etc/sysconfig/network-scripts/ifcfg-eth1(这个在驱动安装重启后,就自动创建了),

参考:
http://dev.firnow.com/course/6_system/linux/Linuxjs/20100526/205132.html
http://www.cublog.cn/u1/44908/showart_1854137.html

增加以下行:
TYPE=Wireless
ESSID=ChinaNet-luwang  #AP网络名
MODE=Managed 
RATE=Auto 


如果MODE=Auto,需要正确设置CHANNEL,否则dhclient无法成功获得IP。可以用命令“iwlist eth1 scanning”检索区域内的无线网络查看Channel。

我的无线猫不知道为什么,加密使用WPA总是无法在Windows下成功连接,显示IBM Access Connections与驱动程序不兼容,可是以前就是采用WPA模式连接的,改用WEP加密后一切都正常了,因此Linux也采用WEP加密。

WEP加密需要输入WEP的密码。如果密码是ASCII,需要在最前面加s:表示密码是ASCII字符,密码保存在/etc/sysconfig/network-scripts/keys-eth1。注意:system-config-network配置界面里ASCII密码前不要再加“s:”,否则无法成功连接。
vi /etc/sysconfig/network-scripts/keys-eth1
KEY='s:luwang1234567'


vi /etc/sysconfig/network-scripts/ifcfg-eth1
# Intel Corporation PRO/Wireless 2200BG Network Connection
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=dhcp
HWADDR=00:16:6f:89:9e:b6
NETMASK=
DHCP_HOSTNAME=192.168.1.1
IPADDR=
DOMAIN=
TYPE=Wireless
USERCTL=yes
IPV6INIT=no
PEERDNS=yes
ESSID=ChinaNet-luwang
MODE=Managed
RATE=Auto
CHANNEL=11

说明:同一AP的CHANNEL每天都可能在不同,因此采用MODE=Auto每次连接都需要检查CHANNEL设置是否正确,否则获取IP时可能失败,最好设置MODE=Managed,就不用管CHANNEL值了。

将无线网卡重启一下,应该就能上网了。如果只用无线的话,可以同时将有线禁用掉。
ifdown eth0 或 ifconfig eth0 down
ifdown eth1
ifup eth1 或 ifconfig eth1 up
ping 192.168.1.1

network restart

在system-config-network配置界面将ppp0复制成ppp1, 将ETH=eth0替换成eth1,然后激活ppp1或者执行命令“ifup ppp1”拨号成功就可以上网了。

其它相关命令:
iwconfig是查看设置无限网卡配置的,和有线的ifconfig对应。
ifconfig eth1
iwconfig eth1

手工启动无线网卡:
ifconfig eth1 up  #启用无线
iwconfig eth1 essid ChinaNet-luwang    (配置SSID,用区分是想连到那个ap上)
iwconfig eth1 mode Managed (配置ap模式,一般情况下不需要进行配置)
iwconfig eth1 channel 6 (配置ap的信道,mode=Managed时不用)
iwconfig eth1 key open s:luwang1234567 (配置ap的协议,以及密码。s:表示ACSII码)
dhclient eth1

#iwlist eth1 scanning  # 扫描无线AP
#iwconfig eth1 txpower on  #打开无线网卡电源

Linux renew ip command
#dhclient -r //release ip 释放IP
#dhclient //获取IP
#dhclient eth1

# ifdown eth0
# ifup eth0
# /etc/init.d/network restart 
OR
# /etc/init.d/networking restart



下面需要进行无线网卡的配置。


  # /sbin/ifconfig ath0 159.226.204.197 netmask 255.255.255.0
  上面一句配置接口ath0的属性。此时再执行/sbin/ifconfig,应当能够看到ath0接口了。虽然接口是建立起来了,但是ping交换机是不通的。需要再用iwconfig配置无线接入的参数。
  # /sbin/iwconfig ath0 essid “gait-wifi” mode managed key “s:13位ASCII密码” rate auto
  然后用iwconfig应该可以看到网卡成功的连接,速率应该是54M. 这时ping159.226.204.199应该可以ping通:
  # ping 159.226.204.199


还有很多其他工具,包括 iwevent, iwgetid, iwpriv, iwspy, 用来获取网卡工作状态、对网卡进行管理。


3. 拷贝ifcfg-ath0至/etc/sysconfig/network-scripts和/etc/sysconfig/networking/profiles/default,将其下面的ifcfg-wifi0删除(共三处,即以上三处)。

  但是上外网还不行。因为路由没有配置。加一句默认路由:
  # route add default gw 159.226.204.199
  同时在/etc/resolve.conf里加上默认DNS,否则是无法解析域名的。例如:
  # cat /etc/resolv.conf
  nameserver 202.112.128.51
  这时就可以上外网了。


http://www.5dlinux.com/article/9/2008/linux_15988.html

问题:虽然将eth1和ppp1设为开机启动,但还需要手工激活才能使用。
原因:eth1在开机时曾经被激活,但进入KDE又显示为disable状态,可能有其它程序导致它fail了。
方法: 将REHL5.2升级到5.5后安装NetworkManager 0.7.0后,即使将eth1取消开机启动,eth1还是可以自动开机激活的,我想可以是因为NetworkManager是最后被启动的缘故吧。(使用NetworkManager后在Tray里有个小图标,Wired/Wireless网络管理和切换变得超极easy,值得推荐安装。参考Tools/NetworkManager)

另外:由于开机自动激活网卡或无线网卡会在网卡无链接的情况下启动过慢。最好办法就是取消启动计算机机时自动激活。这样就必免了开启过慢。

参考资料:
Wireless tools
Wireless LAN under Linux
Quick HOWTO : Ch13 : Linux Wireless Networking - Linux Home Networking


REHL5上多媒体软件安装

安装xmms
下载xmms-1.2.10-1.i386.rpm, 执行rpm -ivh命令安装。

xmms中显示中文歌曲名
参照http://www.fish888.com/xmms-FC-t151691http://linuxsir.com/bbs/thread13584.html, 设置完就可以正常显示中文歌曲名了。

第一步:禁用ID3V2标签
首选项=>音频输入输出插件 选中 MPEG Layer 1/2/3 播放器 然后再点下面的 “配置 ” 切换到标题后选择“禁用ID3V2标签” => “确定”
第二步:选择字体
我的是
引用:(点击首选项的字体标签,直接copy下面的就可以了)
播放清单:
-sony-*-*-*-*-*-12-*-*-*-*-*-iso8859-1,-*-*-*-*-*-*-12-*-*-*-*-*-gbk-0
把前面那两个勾都打上。还有其它的字体设置如:
主窗口:
-sony-*-*-*-*-*-12-*-*-*-*-*-iso8859-1,-*-*-*-*-*-*-12-*-*-*-*-*-gbk-0
第三步:修改标题显示:
很多贴子里面都没提到这一步!
在标题格式里只填上 %f , 默认的好象是 %p-%t ,不要默认的



支持wma播放
参考http://wenwen.soso.com/z/q11542505.htm, 在http://mcmcc.bat.ru/xmms-wma/下载安装xmms-wma-1.0.4.1-1.i386.rpm

TODO:
安装mplayer
目前UUSee还没有Linux版本,可以安装SopCast Player或者PPS网络电视 for Linux。
http://forum.ubuntu.org.cn/viewtopic.php?f=73&t=188055
http://www.d9down.com/download/6524.html

REHL5中文字体及fcitx安装和设置

安装中文字库
安装Linux OBI 5.2.01后,发现虽然session language选择了中文,但进入KDE后中文都显示为方块乱码,应该是缺少中文字库。

参照http://www.liuzd.com/blog/219.html安装中文字体美化包linuxsir-fontconfig-3.4.bin,但发现安装后/usr/bin/system-config-network和其它KDE管理工具运行时出现下面错误。

Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/sbin/system-config-network-gui", line 67, in <lambda>
PROGNAME, PRG_VERSION)
File "/usr/lib/python2.4/site-packages/rhpl/exception.py", line 337, in handleException
import gtk
File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 48, in ?
from gtk import _gtk
ImportError: /usr/lib/libcairo.so.2: undefined symbol: FT_GlyphSlot_Embolden

Original exception was:
Traceback (most recent call last):
File "/usr/sbin/system-config-network-gui", line 70, in ?
import gtk
File "/usr/lib/python2.4/site-packages/gtk-2.0/gtk/__init__.py", line 48, in ?
from gtk import _gtk
ImportError: /usr/lib/libcairo.so.2: undefined symbol: FT_GlyphSlot_Embolden



重装系统后,比较发现美化包所带的freetype,fontconfig, libXft, pango等版本太旧,下面是美化包所带rpm包。
fcitx-2.1.0-2.i386.rpm
fontconfig-2.2.92-0.5.linuxsir.i386.rpm
fontconfig-devel-2.2.92-0.5.linuxsir.i386.rpm
freetype-2.1.7-4.linuxsir.i386.rpm
freetype-demos-2.1.7-4.linuxsir.i386.rpm
freetype-devel-2.1.7-4.linuxsir.i386.rpm
freetype-utils-2.1.7-4.linuxsir.i386.rpm
libXft-2.1.2-4.i386.rpm
pango-1.2.5-10.linuxsir.i386.rpm
pango-devel-1.2.5-10.linuxsir.i386.rpm
simsun-2.2-linuxsir.noarch.rpm


这是我在Linux OBI 5.2.01中查到的软件版本。除了simsun和fcitx外,其它包的版本都比它新。
fontconfig-2.4.1-7.el5
fontconfig-devel-2.4.1-7.el5
freetype-2.2.1-19.el5
freetype-devel-2.2.1-19.el5
libXft-2.1.10-1.1
libXft-devel-2.1.10-1.1
pango-1.14.9-3.el5
pango-devel-1.14.9-3.el5


另外打开美化包带的setup.kde,发现它在安装时使用“rpm -Uvh --force”,难怪我使用”rpm -e“时因为软件包相互依赖无法卸载它安装的包。于是修改setup.kde,删除所有”rpm -Uvh --force“行,只保留后面的修改conf文件,如下setup2。
#!/bin/bash
if [ -f /etc/ld.so.conf ] ; then
	mv /etc/ld.so.conf /etc/ld.so.conf.old
	echo "/usr/lib" > /etc/ld.so.conf
	cat /etc/ld.so.conf.old >> /etc/ld.so.conf
fi
cp -rf /etc/fonts/fonts.conf.example /etc/fonts/fonts.conf
cp -rf /etc/fonts/local.conf.example /etc/fonts/local.conf
fc-cache -f  > /dev/null 2>&1
if ! grep -i "font_name" /etc/gtk-2.0/gtkrc  > /dev/null 2>&1  ; then
cat >> /etc/gtk-2.0/gtkrc << EOF
style "default"
{
font_name = "Tahoma,SimSun 10"
}
widget_class "*" style "default"
EOF
fi
chkfontpath -a /usr/share/fonts/simsun
/etc/init.d/xfs restart > /dev/null 2>&1
ldconfig

先运行“rpm -ivh simsun-2.2-linuxsir.noarch.rpm”安装simsun,再运行上面的代码。
删除/etc/profile.d/cfxmms.sh;

安装后console执行命令时会出现下面Warning,只要注释掉/etc/fonts/fonts.conf和/etc/fonts/local.conf中的”other_family“就可以了。

Fontconfig warning: "local.conf", line 84: unknown element "other_family"
Fontconfig warning: line 460: unknown element "other_family"



或者不用安装中文字体美化包,参见http://www.hacms.com/html/2010/0228/5985.html直接安装中文字体。
1. mkdir /usr/share/fonts/local
2. cp simsun.ttc /usr/share/fonts/local/simsun.ttf
3. cd /usr/share/fonts/local; ttmkfdir; cp fonts.scale fonts.dir;
4. chkfontpath -a /usr/share/fonts/local
5. service xfs reload


另外还有一种简单的方式设置中文显示,参见http://hi.baidu.com/jackjiaxiong/blog/item/c0284e6e52839ef74216942a.html
# rpm -ivh fontconfig-2.4.1-7.el5.i386.rpm
# rpm -ivh fontconfig-devel-2.4.1-7.el5.i386.rpm
# rpm -ivh fonts-chinese-3.02-12.el5.noarch.rpm
# service xfs reload



安装fcitx
下载安装fcitx-3.0.2-1.i386.rpm,在~/.bashrc中增加下面一行,就可以输入中文了。可以参照http://my.opera.com/wangzhijun/blog/show.dml/108169修改配置文件。
export XMODIFIERS="@im=fcitx"


[*]设置自动启动fcitx:
cd ~/.kde/Autostart/; 
ln -s /usr/bin/fcitx .

[*]reboot机器

安装完,发现fcitx和openoffice 3.0冲突,openoffice启动就没响应,将openoffice升级到3.2,问题依旧。


设置locale
为了使菜单保持为英文,但可以显示和输入中文,我在OBI Configuration Center选择English(USA),在Administration -> Language中选择English(USA),在Session language选择中国大陆,就可以使Firefox显示为英文版,mount分区时可以正常显示中文。

为了使Thundbird也显示为英文版,需要在/usr/bin/thunderbird头部增加
export LANG=en_US.UTF-8


为了在Thundbird和Firefox中使用fcitx,需要增加两行:
export LC_CTYPE="zh_CN.UTF-8"
export XMODIFIERS="@im=fcitx"


下面是env输出的locale相关变量:
LANG=zh_CN.UTF-8
GDM_LANG=zh_CN.UTF-8
LC_CTYPE=zh_CN.UTF-8


/etc/sysconfig/i18n的内容:
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"



Acrobat显示中文
http://ardownload.adobe.com/pub/adobe/reader/unix/8.x/8.1.2/misc/FontPack81_chs_i486-linux.tar.gz下载FontPack81_chs_i486-linux.tar.gz。
tar xvfz FontPack81_chs_i486-linux.tar.gz
cd CHSKIT
./INSTALL

从这可以找到最新Acrobat和中文包:
http://www.adobe.com/support/downloads/product.jsp?platform=unix&product=10
ftp://ftp.adobe.com/pub/adobe/reader/unix/

参考资料:
linux乱码问题:LANG变量的秘诀
LANG,LC_ALL,local详解(转)
Redhat 9中,几个关于中文字体和输入法的小结
fcitx 关于多语言,不同编码的一点说明;同时也可以用于解决fcitx不能输入问题
fcitx安装错误

注意:尽量使用"System" - "Add/Remove software"界面,避免执行yum install或rpm -Uvh,以免造成KDE崩溃。

IBM T42设置无线网卡和支持NTFS

大部分网卡可以通过以下三种方式驱动:
方法一, 使用内核自带的网卡驱动程序,需要重新编译内核,make xconfig对内核模块配置,支持NTFS ,无线网络,蓝牙等等; 但比较耗时间,优点运行速度更快、 更稳定,缺点使内核变得庞大。 具体步骤可以参考:
http://my.opera.com/wangzhijun/blog/show.dml/114357
http://my.opera.com/wangzhijun/blog/show.dml/113470

方法二,为特定的网卡编译安装驱动模块(比如madWifi),动态加载模块,比较容易做。

安装无线网卡
参见http://hi.baidu.com/landnow/blog/item/b6ee2829d79baff998250a03.html,下载安装ipw2200-firmware-3.0-9.0.1.noarch.rpm和ipw2200-1.2.2.tgz。

可以在/usr/bin/system-config-network中deactivate无线网卡,也可以修改/etc/sysconfig/network-scripts/ifcfg-eth1,将onboot=no,然后执行/etc/init.d/network restart。

方法三,使用 NDIS wrapper 利用面向MS Windows®的驱动程序驱动网卡。由于Linux对Intel Pro/Wireless 2200支持比较好,我没有使用这种方法。

NTFS模块
参见http://hi.baidu.com/landnow/blog/item/76bf371fdf4ef1cca686691d.html,下载安装kernel-module-ntfs-2.6.18-92.el5-2.1.27-0.rr.10.11.i686.rpm。

在/etc/fstab中增加两行,并将NTFS分区设置为Read Only。
/dev/hda1               /home/luwang/win_C      ntfs    ro,umask=0222,uid=luwang,gid=luwang 0 0
/dev/hda5               /home/luwang/win_D      vfat    uid=luwang,gid=luwang 0 0

将REHL5.2升级到5.5后,内核是2.6.18-194.el5,没有找到对应NTFS模块,不知道下面的方法能不能行得通。
http://hi.baidu.com/linywh/blog/item/9be49dc6bf1a17160ef477e2.html

全程记录下重装RHEL5系统过程

有两年没有更新opera blog了,今天回来继续玩Linux桌面.

全程记录下重装LinuxOBI 5.2.01系统过程,以备下次参考。

原因:
自从2006年7月购买小黑IBM T42后,一直使用预置WinXP至今,没有重装过系统,现在每次开机需要2分钟,关机需要8分钟以上,实在忍无可忍了。因为重新安装一次系统花太多时间,还要安装Delphi7和有关插件,本来也想改用公司的Windows XP OBI v6安装,但因Delphi7是crack版本,不想被公司网络检测到。因此还是决定保留WinXP,平时改用Linux。

从2006年底安装Debian后,Linux桌面一直闲置着,现在使用了一下,感觉不错,我使用的Gnome,中文桌面显示不错,另外我以前编译过Linux内核来设置无线网络,但没有使用过,结果它自动搜索到公司无线网络,赞一下。缺点是稳定不足,有时一个应用不响应了,结果整个Gnome也没反应了,只能reboot。鉴于此,我打算卸载掉重新安装公司的LinuxOBI 5.2.01 (Enterprise Linux server 5.2)。

过程:
首先下载LinuxOBI,刻录了一张DVD;然后用DVD启动机器时发现CDROM不正常,偶尔读一下盘,大部分时间没反应,询问同事也没有类似型号laptop,于是考虑使用USB启动,然后采用网络安装方式。

首先下载diskboot.img,制作一个USB启动盘;
dd if=diskboot.img of=/dev/sda1

用USB启动正常进入Redhat安装界面,选择5,使用网络安装;选择Create custom layout分区删除原Linux分区,然后选择Use free space on selected drivers and create default layout后继续安装,结果出现一个错误”Resource hda5 is busy“,安装退出。hda5是Windows D盘分区,原来的Debian全部分区都和hda5放在Extended分区里,现在看来不行了。由于原Grub被删除,新配置未被写入,因此Windows XP现在也不能启动了。My God,我的数据还没备份,于是找来移动硬盘盒,接上laptop硬盘,在另一台机器上备份数据。

现在可以放手大胆偿试了,不怕数据丢失了。缩小Extended分区,创建/boot分区为primary partition,将swap和/还放在Extended分区,结果正常通过,可以继续安装了。但网络安装速度实在太慢,等了半小时进度不到1%。
 
   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1       30555    15399688+   7  HPFS/NTFS                      ntfs  -  primary
Partition 1 does not end on cylinder boundary.
/dev/hda2           30556       67503    18621414    f  W95 Ext'd (LBA)                extended 
Partition 2 does not end on cylinder boundary.
/dev/hda3           67512       67703       96390   83  Linux                          ext3  /boot  -  primary
Partition 3 does not end on cylinder boundary.
/dev/hda4           67711       77520     4944240   12  Compaq diagnostics             IBM services - primary
Partition 4 does not end on cylinder boundary.
/dev/hda5           30556       38880     4195768+   b  W95 FAT32                      vfat
/dev/hda6           47128       51160     2032191   82  Linux swap / Solaris           swap
/dev/hda7           51160       67496     8233281   83  Linux                          ext3 /
/dev/hda8           38888       47128     4152771   83  Linux                          ext3 /home



我想即然USB-HDD能作引导盘,那USB-CD应该也可以引导。于是从台式机上折下光驱,找到我的3.5寸硬盘盒,发现5寸光驱装不上去,突然想起以前买的IDE USB数据线,找来一试,果然可以用。于是用DVD引导,选择2,使用光盘安装,安装过程中提示在CDROM中插入DVD光盘,我以为又不能安装了,就在准备放弃时,按Cancel后发现它又继续读取USB-CD,后面的安装就很顺利了。


下载了QQ for Linux RPM包,用root执行rpm -ivh 就可以了,然后运行/usr/bin/qq

安装Firefox插件,下载安装Flash和Java后在plugins下建立链接:
cd /usr/lib/firefox-3.0b5/plugins/
libflashplayer.so -> /usr/lib/flash-plugin/libflashplayer.so
libjavaplugin_oji.so -> /usr/java/jre1.5.0_10/plugin/i386/ns7/libjavaplugin_oji.so



注意:修改LinuxOBI profile后,要修改thunderbird Email的user name和lightning的Timezone。

待解决问题:
拨号设置
升级grub(现在version 0.97)
设置Calendar,下载Beehive Extensions for Lightning插件


推荐:
这次安装发现一个很好用的免费工具-DiskGenius3(原diskman),可以修改、检测、恢复、备份分区表,另外还可以制作USB启动盘。
在Windows XP下运行DiskGenius3,选择“工具-制作USB-ZIP启动盘”,可以制作USB DOS引导盘,USB启动后按X关闭DiskGenius后可以退到DOS下。


参考链接:


WebAii - tools for Ajax

URL: http://www.artoftest.com/Products.aspx


* IE/Firefox Browser Automation
o Rich, simple and easy to use API set
o Supports automating both Internet Explorer and Firefox using one consistent API and DOM.
o Control browser instances to do basic browser actions like GoBack, GoForward, Refresh ...etc.
o Supports automating multiple browser instances of the same or different types within the same test.

* Ajax Testing
o Rich support for defining and waiting on 1-N page changes for Ajax application testing.
o Supports both direct DOM actions and pure UI Mouse/Keyboard actions.
o High performance rich markup parser and .NET DOM implementation that provides a complete document object model accessible from your test code to navigate and inspect for easier and more comprehensive test verification.
o Perform pure UI actions using coordinate offsets easily. Again great for automating rich UI content like Flash plug-ins, image maps or DragDrop.

* ASP.NET Testing
o ASP.NET In-Process Host for fast browser-less without a webserver.
o Use ASP.NET Development Server (Cassini) to run your tests instead of IIS.
o New ASP.NET TestRegion custom control to use for designing testablility with TestRegions in your ASP.NET application. The control provides design-time visual rendering to easily visualize your TestRegions within the application on VS's design surface. At runtime the control renders as HTML comments.

* Rich and easy to use element identification methods
o Support for wide range of rules from XPath identification to basic name/id identification.
o Support for finding elements using element text content like (InnerText, InnerMarkup, OuterMarkup & StartTagContent. Use partial, literal or regexs text compare to define your search.
o Rich short-cut notation to easily define complex element identification. (i.e. use Find.ByAttribute(foo=~bar) with the '~' to signify partial value).
o Implements a new 'NodeIndexPath' identification that provides XPath like identification with lesser levels of markup dependency for more resilient automation.
o Provides chained identification to allow users to employ different identification methods within one search.
o Integrates TestRegions as identification reference points to produce resilient test beds that have lower cost of maintenance and ownership.
o Serialization/Deserialization of element identifications (FindParams) so you can separate test logic from application specifics. Define FindParams as XML files and have WebAii directly load them from file for your tests.

* JavaScript Unit Testing
o Support for calling JavaScript methods directly from your .NET code and logging from JavaScript directly into your test log. Use it to unit test your JavaScript.
o Support for invokation of JavaScript events directly on elements. Invoke onBlur/OnMouse out events ... etc.
o Enable logging directly from JavaScript. Use it to trace and perform error logging from your JavaScript. All logging is unified in one log.

* HTML Pop-ups, Dialogs & Win32 Windows Handling
o Support for both HTML pop-up dialogs and browser dialogs. WebAii comes with native support for Alert, Logon & FileUpload dialogs for both IE & Firefox in addition to an extensible framework to implement your own custom dialog handling for your custom dialogs.
o Win32 Windows support to help manage custom windows & basic Win32 window automation.

* Web Unit Testing Extensions
o Unit Testing extensions that target web testing scenarios for both NUnit & VS Team Test. The extensions introduce new test fixtures to allow you to share common elements definitions across tests and help structure your web testing better. Also the extensions provide dialog fixtures to help define the dialogs to handle for your test methods or across all tests.

* TestRegions
o Native Implementation of TestRegions to allow users to build highly resilient test automation and radically reduce maintenance costs and lower the total cost of ownership.

* Visual Capturing
o Capture browser screen shots for easy diagnosis of test failures.
o Capture specific elements on the page as bitmaps to use for visual verification.

* Visual Studio Team Test / NUnit Integration
o Tight integration with Visual Studio Team Suite unit testing framework. Unified logging with ready to use VS item templates.
o Tight integration with NUnit 2.4. Unified logging with ready to use VS item templates.

* Extensibility
o Pluggable logging that can be integrated into any automation system.
o Supports .NET configuration of its settings (using .config files) which allows tests to be re-configured without recompilation. For example, you can configure a test to run under InternetExplorer and then reconfigure to run against Firefox without a need to recompile the test.
o Built using Microsoft.NET framework and can easily be used in Microsoft Visual Studio and integrated in any .NET application using any .NET language." >

* Samples & Documentation
o Rich set of samples with 50 unit tests that cover most of the WebAii framework. Samples come as ready to use solutions you can open and start running tests. Solutions are provided for both NUnit or VS Team Test in both C# & VB.NET.
o Documentation and API references for the whole framework.

February 2012
S M T W T F S
January 2012March 2012
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29