2008-11-30

Linux 中使用NetBeans部署、运行Web应用要注意目录权限设置

使用的是 tomcat
要注意以下几个目录的权限要当前用户可写

$CATALINA_HOME/conf/Catalina/localhost/
$CATALINA_HOME/webapps/
$CATALINA_HOME/work/Catalina/localhost/
$CATALINA_HOME/temp/

否则,有可能会出现无法写入部署目录而部署失败:

Failed to deploy application at context path /xxx

另外,还要注意
$CATALINA_HOME/bin/
下几个.sh文件的当前用户执行权限,不然tomcat都无法运行。

//EOF Read More...

2008-11-23

限用存储过程

存储过程是个好东西,但是偶尔用用就好了,不要过分的使用!
特别的在业务逻辑较复杂的应用中 或 在表间关系较复杂的应用中。这时候如果大量使用了存储过程,在后期系统维护、功能改进的过程中你会非常痛苦的~~!!!
业务逻辑尽量交给应用来做。

// EOF Read More...

2008-11-18

Linux Admin IQ Test

問題見:
http://www.infoworld.com/tools/quiz/news/IQ2008linux-news-quiz.php

只的了 65 分啊~~

Question 1: Which vendor has never branded its own Linux?

5 points
c. IBM

Even SCO briefly offered its own Linux product. Big Blue, despite being an enthusiastic Linux backer, has always partnered with other distributors instead of packaging its own version of the OS.

Question 2: Why GRUB over LILO?

5 points
d. You want to boot from a network

LILO supports a wide variety of boot configurations, but you'll need the more modern GRUB if you want to boot from a network.

Question 4: What's a "shebang"?

5 points
a. A unique sequence of characters that indicates the start of a shell script

Short for "shell bang," shebang is a hash or pound sign (#) followed by an exclamation mark (!), known in Unix parlance as a "bang."

Question 8: Which graphics chip vendor hasn't released a Linux driver?

5 points
c. Nvidia

Although most of the competition has released open source drivers for at least some of their graphics chips, Nvidia has remained a staunch holdout.

Question 15: What's the benefit of noatime?

5 points
a. It improves performance by reducing the frequency of disk writes

Normally, Linux will update the time stamp on a file every time it is accessed. With the noatime option, the kernel will update files only when their contents are changed.

Question 16: Which virt tech allows Windows VMs to run on Linux?

5 points
c. Xen

Most of the virtualization software listed can only launch other instances of Linux. Xen can support Windows virtual machines also, provided your processor supports Intel VT or AMD-V technology.

Question 17: What's a "binary blob"?

5 points
a. A driver that is loaded into the kernel as a binary object, for which no source code is available

The Linux community is divided over the practice of running closed source code as part of the Linux kernel, but when hardware vendors refuse to release their specifications, it's often the only option.

//EOF Read More...

2008-11-02

javascript 中判断是否为IE的技巧

利用 IE 中 jscript/javascript 的“条件编译”
条件编译:
/*@cc_on, @if, @elif, @else, @end, @*/
如:

/*@cc_on
   @if (@_win32)
      document.write("操作系统是32位windows。浏览器是IE。");
   @else
      document.write("操作系统不是32位windows。浏览器是IE。"); // 这个是不会输出的
   @end
@*/
技巧:
    if (!/*@cc_on!@*/0) { //if not IE
        //Firefox2、Firefox3、Safari3.1+、Opera9.6+ support 
    } else {
        //IE6、IE7 support 
    }

//EOF Read More...