随笔-69  评论-0  文章-5  trackbacks-0
  2007年7月11日
先占个地儿
http://blog.csdn.net/boat1980/archive/2008/07/23/2698318.aspx

posted @ 2008-09-22 11:36 liunix 阅读(222) | 评论 (0)编辑 收藏
<html>
<head>
<script>
function overlay() {
    el 
= document.getElementById("overlay");
    el.style.visibility 
= (el.style.visibility == "visible"? "hidden" : "visible";
}
</script>
<style>
body 
{
     height
:100%;
     margin
:0;
     padding
:0;
}
/*外层全部*/
#overlay
{
     visibility
: hidden;
     position
: absolute;
     left
: 0px;
     top
: 0px;
     width
:100%;
     height
:100%;
     text-align
:center;
     z-index
: 1000;
     background-color
:#000;
     filter
: alpha(opacity=70); /*ie支持的半透明,下面两名为ff支持的*/
     -moz-opacity
: 0.7;
     opacity
:.70;
}
/*外层的显示区*/
#overlay div 
{
     width
:300px;
     margin
: 100px auto;
     background-color
: #FFFFFF;
     border
:1px solid #000;
     padding
:15px;
     text-align
:center;
}
</style>
</head>
<body id="body">
<div id="overlay">
     
<div>
        用户名:
<input type="text" name="" /><br/>
        密  码:
<input type="text" name="" /><br/>
        
<input type="button" value="关闭" onclick="overlay()" />
     
</div>
</div>

<href='#' onclick='overlay()'>Click here to show the overlay</a>
</body>
</html>   
posted @ 2008-08-29 16:23 liunix 阅读(624) | 评论 (0)编辑 收藏
一、DESede加密(对应SunJCE不提供模式和填充的情况)
declare
    result raw(
2000);
    l_mod number :
= dbms_crypto.ENCRYPT_3DES+dbms_crypto.CHAIN_ECB+dbms_crypto.PAD_PKCS5;
begin
    result :
= dbms_crypto.Encrypt(src => utl_i18n.string_to_raw('wwww'),typ => l_mod,key => hextoraw('123456789012345678901234567890123456')
    );
    dbms_output.put_line(result);
end;
/

二,摘要
dbms_crypto.Hash(utl_i18n.string_to_raw('input'),dbms_crypto.MD5))
posted @ 2008-07-21 14:54 liunix 阅读(653) | 评论 (0)编辑 收藏
用了几天jira管理对它的权限模式有了初步理解:



project和permission schema多对一,从而形成了permission schema的重用
而permission schema本身则代表了group/user和pemission之前的映射关系

另外,jira还有一个Project Role的概念更增加了jira权限管理的灵活性
其实它实质上就是一个角色(RBAC中的R),可以和group/user多对多关联,
(当然也可和Permission通过schema进行关联)
使jira的权限配置更新灵活的同时,也增加了相当的复杂性

posted @ 2008-07-17 16:06 liunix 阅读(1290) | 评论 (0)编辑 收藏
一,造libmysql.def文件
   1, ${mysql_home}/include/libmySQL.def文件如果有直接用
   2, 否则下载pexports工具,执行pexprots libmySQL.dll> libmySQL.def(libmySQL.dll在${mysql_home}/bin目录下一般会有)
二,转换成静态库
   dlltool --input-def libmySQL.def --dllname libmySQL.dll --output-lib libmysql.a -k
三,配置Eclipse(静态库和动态库加法都是-L${DIR} -l${libname},但谁的优先级高呢?)
    1, 加上库目录,如"${workspace_loc:/hello_mysql/libs}"
    2, 加上libmysql.a的库名: mysql
    3, 构建,报错:  #ff0000 reference to `mysql_real_connect@32'之类的错
    4, 修改def文件,将mysql_real_connect改成mysql_real_connect@32,其它错误同理,并重新生成静态库
    5, 重新构建完成
四,示例程序(只须修改连接信息及表名)
#include <stdio.h>
/*下面这一行一定要加上*/
#include 
<my_global.h>
#include 
<mysql.h>

int main() {
    MYSQL mysql;
    MYSQL_RES 
*result;
    MYSQL_ROW row;

    
int numrows, numcols, c;

    mysql_init(
&mysql);

    
if (!mysql_real_connect(&mysql, "localhost""opencart""opencart""opencart"0, NULL, 0)) {
        fprintf(stderr,
"Failed to connect to database: Error %d:%s\n", mysql_errno(&mysql), mysql_error(&mysql));
    }
    
char query[] = "SELECT * FROM product";

    
if (mysql_query(&mysql, query))
    {
        fprintf(stderr,
"Error executing query: Error %d: %s\n", mysql_errno(&mysql), mysql_error(&mysql));
    }

    result 
= mysql_use_result(&mysql);

    
if (!result) {
        fprintf(stderr,
"Error executing query: Error %d: %s\n", mysql_errno(&mysql), mysql_error(&mysql));
    }
    numcols 
= mysql_num_fields(result);

    
while (row = mysql_fetch_row(result)) {
        
for (c = 0; c < numcols; c++) {
            printf(
"%s\t", row[c]);
        }
        printf(
"\n");
    }
}

   
posted @ 2008-07-14 15:36 liunix 阅读(1020) | 评论 (0)编辑 收藏
一、安装
1, 安装xampp
2, 安装zend studio[6]

二、配置调式
1,在http.conf中指定php.ini的位置
    PhpIniDir "D:/xampp/php"

2, 在php.ini中的zend的部分指定以下内容(ZendDebugger.dll是从zend studio中搜出来的)
[Zend]
zend_extension_ts = "D:\xampp\php\zendOptimizer\lib\ZendDebugger_5.2.12.dll"
;下面部分可选
zend_debugger.allow_hosts=127.0.0.1/32,127.0.0.1/24
zend_debugger.expose_remotely=allowed_hosts


posted @ 2008-07-07 11:38 liunix 阅读(274) | 评论 (0)编辑 收藏
放在/usr/local/bin下,挺好用
 #!/bin/sh
 # this script converts an rpm into a plain tarball

 mkdir $$.cpio
 rpm2cpio $@ 
> $$.cpio/foo
 cd $$
.cpio
 cpio 
---< foo
 rm 
-f foo
 find 
. -type d -perm 700 -exec chmod 755 {} \;
 tar cvzf 
../`basename $@ .rpm`.tar.gz .
 cd 
../
 rm 
-rf $$.cpio


posted @ 2008-06-18 11:37 liunix 阅读(321) | 评论 (0)编辑 收藏
1,去http://rpm.pbone.net/下载下列rpm包并安装
libnasl-2.2.9-1.fc5.i386.rpm
nessus-core-2.2.9-1.fc5.i386.rpm
nessus-core-debuginfo-2.2.9-1.fc5.i386.rpm(可选)
nessus-libraries-2.2.9-1.fc5.i386.rpm
nessus-server-2.2.9-1.fc5.i386.rpm
nessus-gui-2.2.9-1.fc5.i386.rpm
2, 找个能用的邮箱去http://www.nessus.org/plugins/index.php?view=register注册一下
3, 按邮件中的方式运行nessus-fetch --register ****
4, 运行nessus-adduser增加一个没有rule的用户
5, 运行nessus-mkcert造个证书
6, 运行nessus-fetch --check检查一下状态
7, 如果前面没啥问题,运行service nessusd start
   如果这一步除了成功没啥别的输出就ok啦


posted @ 2008-06-18 10:44 liunix 阅读(260) | 评论 (0)编辑 收藏
限制本机的对外访问(例如不让测试环境访问生产库):
iptables -t filter -A OUTPUT -d 192.168.2.2 -p tcp --dport 1521 -j REJECT

#端口转发到另一台机器上
-A PREROUTING -d $ip1 -i eth0 -p tcp -m tcp --dport $port1 -j DNAT --to-destination $ip2:$port2
-A POSTROUTING -d $ip2 -p tcp -m tcp --dport $port2 -j SNAT --to-source $ip1
#本机端口相互映射
-A PREROUTING -p tcp --dport $port1 -j REDIRECT --to-port $port2
posted @ 2008-06-02 11:07 liunix 阅读(202) | 评论 (0)编辑 收藏
pre-commit.tmpl,然后更名pre-commit并加上执行权限:
#!/bin/sh

REPOS
="$1"
TXN
="$2"

RES
="OK"
# Make sure that the log message contains some text.
SVNLOOK=/app/subversion/bin/svnlook
$SVNLOOK log -"$TXN" "$REPOS" | egrep "[^[:space:]]+" >/dev/null || unset RES
if [ "$RES" != "OK" ]
then
    echo 
"You must input some comments for you commit" >&2
    
exit 1
fi

# All checks passed, so allow the commit.
exit 0


posted @ 2008-05-28 14:18 liunix 阅读(1470) | 评论 (0)编辑 收藏
fisheye(1.4.3):
    cenqua_com_licensing.atlassian.license.DefaultLicense
       isExpired(),getExpiryDate()
    cenqua_com_licensing.atlassian.license.DefaultLicenseType(重点)
       isEvaluationLicenseType(),expires().....

posted @ 2008-05-28 11:13 liunix 阅读(500) | 评论 (0)编辑 收藏

一,将pem格式的key文件导入keystore

摘抄备用:http://www.agentbob.info/agentbob/79-AB.html

说明: 经试验证书的pem文件可能通过keytool直接导入keystore中的

Apache Tomcat and many other Java applications expect to retrieve SSL/TLS certificates from a Java Key Store (JKS). Jave Virtual Machines usually come with keytool  to help you create a new key store.

Keytool helps you to:

  • create a new JKS with a new private key
  • generate a Certificate Signung Request (CSR) for the private key in this JKS
  • import a certificate that you received for this CSR into your JKS

Keytool does not let you import an existing private key for which you already have a certificate. So you need to do this yourself, here's how:

Let's assume you have a private key (key.pem) and a certificate (cert.pem), both in PEM format as the file names suggest.

PEM format is 'kind-of-human-readable' and looks like e.g.

-----BEGIN CERTIFICATE-----
Ulv6GtdFbjzLeqlkelqwewlq822OrEPdH+zxKUkKGX/eN
.
. (snip)
.
9801asds3BCfu52dm7JHzPAOqWKaEwIgymlk=
----END CERTIFICATE-----

Convert both, the key and the certificate into DER format using openssl :

openssl pkcs8 -topk8 -nocrypt -in key.pem -inform PEM -out key.der -outform DER
openssl x509 -in cert.pem -inform PEM -out cert.der -outform DER

Now comes the tricky bit, you need something to import these files into the JKS. ImportKey will do this for you, get the ImportKey.java (text/x-java-source, 6.6 kB, info) source or the compiled (Java 1.5 !) ImportKey.class (application/octet-stream, 3.3 kB, info) and run it like

user@host:~$ java ImportKey key.der cert.der
Using keystore-file : /home/user/keystore.ImportKey
One certificate, no chain.
Key and certificate stored.
Alias:importkey Password:importkey

Now we have a proper JKS containing our private key and certificate in a file called keystore.ImportKey, using 'importkey' as alias and also as password. For any further changes, like changing the password we can use keytool.



二、将私钥导出成pem文件(默认keytool是不能导出私钥的)
import sun.misc.BASE64Encoder;
import java.security.cert.Certificate;
import java.security.*;
import java.io.File;
import java.io.FileInputStream;
 
class ExportPriv {
    
public static void main(String args[]) throws Exception{
    ExportPriv myep 
= new ExportPriv();
    myep.doit();
    }
 
    
public void doit() throws Exception{
 
    KeyStore ks 
= KeyStore.getInstance("JKS");
    String fileName 
= "store.jks";
 
    
char[] passPhrase = "password".toCharArray();
    BASE64Encoder myB64 
= new BASE64Encoder();
    
 
    File certificateFile 
= new File(fileName);
    ks.load(
new FileInputStream(certificateFile), passPhrase);
 
    KeyPair kp 
= getPrivateKey(ks, "alias", passPhrase);
        
    PrivateKey privKey 
= kp.getPrivate();
    
 
    String b64 
= myB64.encode(privKey.getEncoded());
 
    System.out.println(
"-----BEGIN PRIVATE KEY-----");
    System.out.println(b64);
    System.out.println(
"-----END PRIVATE KEY-----");
 
    }
 
// From http://javaalmanac.com/egs/java.security/GetKeyFromKs.html
 
   
public KeyPair getPrivateKey(KeyStore keystore, String alias, char[] password) {
        
try {
            
// Get private key
            Key key = keystore.getKey(alias, password);
            
if (key instanceof PrivateKey) {
                
// Get certificate of public key
                Certificate cert = keystore.getCertificate(alias);
    
                
// Get public key
                PublicKey publicKey = cert.getPublicKey();
    
                
// Return a key pair
                return new KeyPair(publicKey, (PrivateKey)key);
            }
        } 
catch (UnrecoverableKeyException e) {
        } 
catch (NoSuchAlgorithmException e) {
        } 
catch (KeyStoreException e) {
        }
        
return null;
    }
 
}
 

posted @ 2008-04-17 16:27 liunix 阅读(7966) | 评论 (0)编辑 收藏
去年rails正火的时候,仿active record用hibernate实现了一个BasePo,当时用的是一个
静态sessionfactory注入的方式,感觉很不好,当明也没想到好的方案,后来发现有人通过
threadlocal实现了下面这个,可以看看:
 1 public class Persistent implements Lifecycle, Validatable, Serializable {
 2    
 3    protected Serializable _id;
 4    protected int _version;
 5 
 6    public Serializable getIdentifier() {
 7       return _id;
 8    }
 9    public void setIdentifier(Serializable id) {
10       _id = id;
11    }
12    public int getVersion() {
13       return _version;
14    }
15    public void setVersion(int version) {
16       _version = version;
17    }
18 
19    public Long persist() throws HibernateException, SQLException {
20       HibernateSession.currentSession().saveOrUpdate(this);
21       return _id;
22    }
23    public void delete() throws HibernateException, SQLException {
24       HibernateSession.currentSession().delete(this);
25    }
26    public void refresh() throws HibernateException, SQLException {
27       HibernateSession.currentSession().load(this, _id);
28    }
29    public void lock() throws HibernateException, SQLException {
30       HibernateSession.currentSession().lock(this, LockMode.UPGRADE);
31    }
32 
33    public boolean onSave(Session s) throws CallbackException {
34       return NO_VETO;
35    }
36    public boolean onDelete(Session s) throws CallbackException {
37       return NO_VETO;
38    }
39    public boolean onUpdate(Session s) throws CallbackException {
40       return NO_VETO;
41    }
42    public void onLoad(Session s, Serializable id) {
43       _id = id;
44    }
45 
46    public void validate() throws ValidationFailure {
47    }
48 }

原文:http://hibernate.bluemars.net/46.html?cmd=prntdoc

下面是hibernatesession的源码,应该考滤一下如何与spring事务结合的问题(还是加一个doInTransaction 的callback?)
 1 import java.util.Collection;
 2 
 3 import net.sf.hibernate.HibernateException;
 4 import net.sf.hibernate.Session;
 5 import net.sf.hibernate.Transaction;
 6 
 7 import org.apache.commons.logging.Log;
 8 import org.apache.commons.logging.LogFactory;
 9 
10 /**
11  * @author Ralph Schaer
12  * @version $Revision: 1.6 $ $Date: 2004/05/22 12:24:32 $
13  */
14 public class HibernateSession {
15 
16   private static final Log LOG = LogFactory.getLog(HibernateSession.class);
17   public static final ThreadLocal SESSION = new ThreadLocal();
18 
19   public static Session currentSession() throws HibernateException {
20 
21     Session s = (Session) SESSION.get();
22     if (s == null) {
23       s = HibernateFactoryManager.getSessionFactory().openSession();
24       SESSION.set(s);
25     }
26     return s;
27   }
28 
29   public static Session getSession() throws HibernateException {
30     return HibernateFactoryManager.getSessionFactory().openSession();
31   }
32 
33   public static void closeSession() {
34     try {
35       Session s = (Session) SESSION.get();
36       SESSION.set(null);
37       if (s != null) {
38         s.close();
39       }
40 
41     } catch (HibernateException e) {
42       LOG.error("HibernateSession:  closeSession", e);
43     }
44 
45   }
46 
47   public static void rollback(Transaction tx) {
48     if (tx != null) {
49       try {
50         tx.rollback();
51         closeSession();
52       } catch (HibernateException he) {
53         LOG.error("HibernateSession: rollback", he);
54       }
55     }
56   }
57 
58   //Utility methods
59   public static int collectionSize(Collection coll) throws HibernateException {
60     return ((Integer) currentSession().createFilter(coll, "select count(*)").iterate().next()).intValue();
61   }
62 
63 }


还有一种考虑泛型的方式可以参考:
http://privacyneed.info/index.php?hl=f5&q=uggc%3A%2F%2Fcrgreonpxyhaq.oybtfcbg.pbz%2F2007%2F07%2Fvzcyrzragvat-npgvirerpbeq-va-wnin.ugzy
posted @ 2008-03-28 11:30 liunix 阅读(458) | 评论 (0)编辑 收藏
从网上找了一段,写得挺麻烦,但可以借一下思路
cat watch.sh

#!/bin/sh
cd /root/bin

PID
=`ps -aef | grep Xms500M | grep -grep | gawk '{print $2}'`
PID
=`expr $PID + 1 - 1`

date
free
echo 
$PID
echo 
"------------------"

if [ $PID -eq 0 ]
then
sleep 10
/usr/java/tomcat/bin/startup.sh
sleep 160
fi

while [ 1 ]
do
date
free
echo 
"Tomcat process ID is $PID"
wget http
://192.168.1.101/jsp/w_blog/blog.jsp -O working.jpg 2>> /dev/null &
sleep 120
touch working
.jpg
SIZE
=`du working.jpg | gawk '{print $1}'`
if [ $SIZE -le 20 ]
then


WID
=`ps -aef | grep 192.168.1.101 | grep -grep | gawk '{print $2}'`
WID
=`expr $WID + 1 - 1`

if ! test -$WID
then
killall wget
fi


echo 
"Tomcat restart checking"
free
vmstat
FREEMEM
=`free | grep Mem | gawk '{print $4}'`

if [ $FREEMEM -le 15000 ]
then

if [ $PID -ne 0 ]
then
kill -9 $PID
ls 
-l
/usr/java/tomcat/bin/shutdown.sh
fi

/usr/java/tomcat/bin/shutdown.sh
sleep 10
/usr/java/tomcat/bin/startup.sh
sleep 30
fi

date
ps 
-aef | grep -v httpd
ls 
-l
PID
=`ps -aef | grep Xms500M | grep -grep | gawk '{print $2}'`
PID
=`expr $PID + 1 - 1`

fi

rm 
-f working.jpg

done


posted @ 2008-03-24 19:25 liunix 阅读(1289) | 评论 (0)编辑 收藏
1,设置好WEB-INF/classes/xplanner-customer.properties中的数据连接,建mysql库[xplanner]
2, 运行会自动创建数据库表和sysadmin/admin用户
3, 中文乱码,先导出数据库[主要保存用户维护数据]
    mysqldump --opt --database xplanner > xplanner.sql
4, 将sql中的create database语句改成default charset utf8;
5, souce xplanner.sql
6, 将server-config.wsdd[WEB-INF]下的附件上传位置改成合适目录
7, 重启xplanner即可

posted @ 2008-03-20 20:22 liunix 阅读(250) | 评论 (0)编辑 收藏
概念:
    唯一的就是一个候选键(数据库理论基础)
所以要增加唯一性就是增加一个Alternate key

操作:
    单击表模型,选中keys签,增加一个key,不选primary即可

信息来源sybooks online:
    http://infocenter.sybase.com/help/index.jsp
查找unique constraint找出和PDM相关的内容

posted @ 2008-03-19 15:36 liunix 阅读(165) | 评论 (0)编辑 收藏
网上说的比较多
不过一定要记住看服务进程的log:
view /var/log/mysql.log
在我这里问题是:


/usr/libexec/mysqld: Can't create/write to file '/tmp/'


说明mysql用户无权使用/tmp目录,改一下目录权限就好了
chmow -R 777 /tmp

posted @ 2008-03-18 14:29 liunix 阅读(163) | 评论 (0)编辑 收藏
一,JIRA安装
    1, 下载最新的JIRA(要注册才能得到测试liense)
    2,  创建数据库用户[注意:jira用的utf8],create database jira default charset utf8; (mysql)
    3,  按官网WIKI配置数据库,所有表会自动创建


二,SUBVERSION-PLUGIN
    1, 下载插件
    2,  拷完lib到指定位置即可(不要拷properties)   
    3, 在管理端增加仓库位置

三,svnwebclient
    1, enscript不是语法加亮,只是加彩而已(而且大部分linux版本自带)

posted @ 2008-03-18 14:04 liunix 阅读(209) | 评论 (0)编辑 收藏
1, 下载http://www.allwiki.com/wiki/Mediawiki
2,  解压放到/var/www/html下,将config目录权限改为777
3,  给apache增加一个配置文件mediawiki.conf,内容如下:
<Directory "/var/www/html/mediawiki">
    AllowOverride None
    Options +ExecCGI
    Order allow,deny
    Allow from all
</Directory>
4,浏览器中输入:http://hostname/mediawiki/index.php
5,安装看是否缺php-mysql,如果缺到fc5的cd-rom中安装
6, 创建数据库
    mysql -u root
    create database mediawiki;
    grant all on mediawiki.* to mediawiki@'localhost' identified by 'mediawiki';
6, 输入各项配置
7, mysql5创建表有问题,尚未解决,实在不行只能换个wiki看看了

posted @ 2008-03-15 15:59 liunix 阅读(146) | 评论 (0)编辑 收藏
1, 下载bugzilla
    运行./checksetup.pl
2, 根据提示安装perl模块
    位置:http://search.cpan.org/search?query=IO%3A%3AScalarArray&mode=all
    下载后:
    perl Makefile.pl
    make
    make test
    make install
    (过程如果有依整性错误,请安装相应模块)
3,配置mysql
    mysql -u root
    create database bugs
    grant all on bugs.* to bugzilla@'localhost' identified by 'bugs'
4,配置vi ./localconfig设置数据库
5, 再次运行./checksetup.pl会创建数据库和设置bugzilla管理员(以mail作为登录名)
6, 将bugzilla目录拷到/www/html/下
7, 在/etc/httpd/conf.d/下增加bugzilla.conf内容如下:
AddHandler cgi-script .cgi .pl
<Directory "/var/www/html/bugzilla">
    AllowOverride None
    Options +ExecCGI
    Order allow,deny
    Allow from all
</Directory>
8,运行apachectl restart
9,访问:http://hostname/bugzilla/index.cgi
   

posted @ 2008-03-15 14:41 liunix 阅读(154) | 评论 (0)编辑 收藏
常用操作:
-- job 权限
grant create job to somebody;

-- job 创建
begin
 dbms_scheduler.create_job (
     job_name 
=> 'AGENT_LIQUIDATION_JOB',
     job_type 
=> 'STORED_PROCEDURE',
     job_action 
=> 'AGENT_LIQUIDATION.LIQUIDATION'--存储过程名
     start_date => sysdate,
     repeat_interval 
=> 'FREQ=MONTHLY; INTERVAL=1; BYMONTHDAY=1;BYHOUR=1;BYMINUTE=0;BYSECOND=0',  -- 按月,间隔为1个(月),每月1号,凌晨1点
     comments => '执行代理商清分程序'
 );
end;
/

-- job 执行时间测试
DECLARE
    start_date date;
    return_date_after date;
    next_run_date date;
BEGIN
    start_date :
= sysdate;--to_timestamp_tz('10-OCT-2004 10:00:00','DD-MM-YYYY HH24:MI:SS');
    return_date_after := start_date;
FOR i IN 1..10 LOOP
     DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING(
'FREQ=MONTHLY; INTERVAL=1; BYMONTHDAY=1;BYHOUR=1;BYMINUTE=0;BYSECOND=0',start_date, return_date_after, next_run_date);
     DBMS_OUTPUT.PUT_LINE(
'next_run_date: ' || to_char(next_run_date,'yyyy-mm-dd HH24:MI:SS'));
     return_date_after :
= next_run_date;
    
END LOOP;
END;
/

-- job 查询
select owner, job_name, state from dba_scheduler_jobs;
select job_name, state from user_scheduler_jobs;

-- job 启用
begin
    dbms_scheduler.enable(
'BACKUP_JOB');
end;
/

-- job 运行
begin
    dbms_scheduler.run_job(
'COLA_JOB',TRUE); -- true代表同步执行
end;
/

-- job 停止(不太好用)
begin
    dbms_scheduler.stop_job(job_name 
=> 'COLA_JOB',force => TRUE);
end;
/

-- job 删除(对停job来说好用)
begin
    dbms_scheduler.drop_job(job_name 
=> 'COLA_JOB',force => TRUE);)
end;
/

posted @ 2008-03-14 10:36 liunix 阅读(613) | 评论 (0)编辑 收藏
位置:
http://xfire.codehaus.org/HTTP+Transport
posted @ 2008-03-13 14:58 liunix 阅读(520) | 评论 (0)编辑 收藏
1,一定不要下载.zip,而用tar.gz或bz2
2, 安装到/usr/local/subverion时再启apache
    出现: /usr/local/subverion/lib/libaprutil-0.so.0: undefined symbol: gdbm_errno
    解决:export LD_PRELOAD=/usr/lib/libgdbm.so.2 再执行 apachectl start(或 service httpd start)
    可以将export这一行放入apachectl脚本中
3, 安装可以自动更新apache中的moudle, 不用换rpm安装剩下的svn等命令,这些只不过是服务器上的客户端
    只要以后执行/usr/local/subverion/bin下的命令即可(可以在profile中修改PATH)

posted @ 2008-03-11 13:40 liunix 阅读(218) | 评论 (0)编辑 收藏
1, 准备相关JAVA包
2,  jce_policy-1_4_2.zip中的两个jar到D:\jdk14\jre\lib\security
3,  bcprov-jdk14-138.jar到D:\jdk14\jre\lib\ext并修改D:\jdk14\jre\lib\security\java.security加入
    security.provider.6=org.bouncycastle.jce.provider.BouncyCastleProvider


posted @ 2008-03-07 20:13 liunix 阅读(196) | 评论 (0)编辑 收藏
 


posted @ 2008-03-03 16:21 liunix 阅读(911) | 评论 (0)编辑 收藏
一,基本安装

如果不能获得额外的IP
vmware-tool的安装:
0, 将fc5安装CD中的kernel-devel安装上
1,将CD-ROM置为默认状态
2, 在菜单中选取安装vmware-tool
3,将cd mount上
4, install
5, 运行vmware-any-any-update101.tar.gz中的runme.pl(改其中的路径/etc/vmware --> /etc/vmware-tools   /usr/bin/vmware-config.pl -->/usr/bin/vmware-tool-config.pl)


-- 下面这个可能依赖前一项的成功
vm:网卡配置选nat
vm的linux中:netconfig 指定与"VMware Network Adapter VMnet8"相同的IP网段地址和子网
vm的linux中:子网默认网关和edit->virtual network setting->nat 中的网关地址一样(还可以在neat中加上路由)
vm的dns: 和主机相同
vm的linux中:service network restart

二、添加硬盘
基本知识:
      硬盘命名规则-----hda代表硬盘名,hda1则代表hda上的第1个分区
过程如下:
0,   在vmware中用新增硬盘向导添加一块硬盘,下面就是操作linux的fdisk的事情了
1,   fdisk -l   ----------查看当前硬盘的分区情况
2,   fdisk  /dev/hdb  --为指定硬盘分区
3,   m          -----------查看帮助
4,   n           -----------新建分区(要选主分区,不知何为)
5    w           -----------写入磁盘的分区表
6,   mkfs -t ex2 /dev/hdb1  --为新建分区创建文件系统(或mkfs.ex2  /dev/hdb1,都是mkfs.$type 命令系列)
##7,   mount  /hdb1   /dev/hdb1 加载新建文件系统
若使用了逻辑卷管理器:则用system-config-lvm调整,可以将新建的分区逻辑地加到原来的
mount点下,等于动态扩展了原来的磁盘(比较好用)



posted @ 2008-02-27 09:19 liunix 阅读(174) | 评论 (0)编辑 收藏
xplanner         进度
bugzilla(--jira) bug
eclipse mylyn    任务
emma             覆盖
cs               集成
SVN              版本
ant              构建
selenium         黑盒测试
--wiki           文档

junit            白盒测试
ant              构建

--powerdesigner    数据库设计
--rose/vision      UML/流程图工具
--word             文档工具

人个schedule     qorganizer


说明: --为收费工具
posted @ 2008-02-26 11:07 liunix 阅读(122) | 评论 (0)编辑 收藏
ant

<?xml version="1.0"?>
<project name="PGAgent" basedir="." default="default">
    
    
<target name="default" depends="deploy" description="代理商平台构建" />
    
    
<property name="build.path" value="build" />
    
    
<tstamp>
        
<format property="date.MMdd" pattern="MMdd"/>
    
</tstamp>
    
    
<filterset id="filter.test">
        
<filter token="dataSource.url" value="jdbc:oracle:thin:@1.2.3.4:1521:p5dbb1"/>
        
<filter token="dataSource.username" value="gagent"/>
        
<filter token="dataSource.password" value="gagent"/>
        
<filter token="log4j.path" value="/home/xuzhijin/logs/pgagent/pgagent.log"/>
    
</filterset>
    
    
<filterset id="filter.deploy">
        
<filter token="dataSource.url" value="null"/>
        
<filter token="dataSource.username" value="null"/>
        
<filter token="dataSource.password" value="null"/>
        
<filter token="log4j.path" value="null"/>
    
</filterset>    

    
<target name="deploy" depends="test_tidy,deploy_tidy">
        
<antcall target="clean_before" />
           
<zip destfile="${build.path}/${ant.project.name}_test_${date.MMdd}.zip" basedir="${build.path}/test" />
           
<zip destfile="${build.path}/${ant.project.name}_deploy_${date.MMdd}.zip" basedir="${build.path}/deploy" />
        
<antcall target="clean_after" />
    
</target>
    
    
<target name="deploy_tidy">
        
<copy todir="${build.path}/deploy/${ant.project.name}/">
            
<fileset dir="${basedir}/WebRoot/">
                
<exclude name="**/.svn"/>
                
<exclude name="**/.svn/*.*"/>
            
</fileset>
        
</copy>
        
<copy todir="${build.path}/deploy/${ant.project.name}/WEB-INF/classes" overwrite="true" >
            
<fileset dir="${basedir}/buildFilter/">
                
<include name="*.properties"/>
            
</fileset>                
            
<filterset refid="filter.deploy" />
        
</copy>
    
</target>
    
    
<target name="test_tidy">
        
<copy todir="${build.path}/test/${ant.project.name}/">
            
<fileset dir="${basedir}/WebRoot/">
                
<exclude name="**/.svn"/>
                
<exclude name="**/.svn/*.*"/>
            
</fileset>
        
</copy>
        
<copy todir="${build.path}/test/${ant.project.name}/WEB-INF/classes/" overwrite="true" >
            
<fileset dir="${basedir}/buildFilter/">
                
<include name="*.properties"/>
            
</fileset>            
            
<filterset refid="filter.test" />
        
</copy>
    
</target>    
    
    
<target name="clean_after">
        
<delete dir="${build.path}/test" />
        
<delete dir="${build.path}/deploy" />
    
</target>
    
    
<target name="clean_before">
        
<delete file="${build.path}/${ant.project.name}_test_${date.MMdd}.zip" />
        
<delete file="${build.path}/${ant.project.name}_deploy_${date.MMdd}.zip" />
    
</target>

</project>



bash:
#!/bin/bash
file_prefix=PGAgent_test
dest_dir
=/usr/local/ciecc/webapps/
today
=`date +%m%d`
 
rm 
-rf $dest_dir${file_prefix%_*}
unzip 
-$dest_dir $file_prefix'_'$today.zip
tail 
-/home/xuzhijin/logs/pgagent/pgagent.log

posted @ 2008-02-22 20:28 liunix 阅读(147) | 评论 (0)编辑 收藏
    String.prototype.trim = function() {
        return this.replace(/^\s+|\s+$/g,"");
    }
   
    String.prototype.isBlank = function() {
        return this == null || this == "";
    }
    
    function validate_required(form){
        for(var i=0;i<form.elements.length;i++){
            var element  = form.elements[i];
            if(null != element.getAttribute('required') && 'TRUE' == element.getAttribute('required').toUpperCase()){
                if(element.value.trim().isBlank()){
                    alert('所有必填项都不能为空');
                    return false;
                }
            }
       }
       return true;
    }
   
    function validate_pattern(form){
        for(var i=0;i<form.elements.length;i++){
            var element  = form.elements[i];
            if(null != element.getAttribute('pattern')){
                if( !element.value.trim().isBlank() && !new RegExp(element.getAttribute('pattern').split("/")[0]).test(element.value.trim())){
                    alert(element.getAttribute('pattern').split("/")[1]);
                    return false;
                }
            }
       }
       return true;                         
    }
   
    -- 校验不必填的传真只填一半的特殊情况
    function validate_other(form){
        if(form.cpFaxPart1.value.isBlank() != form.cpFaxPart2.value.isBlank()){
           alert('公司传真未填写完整(也可完全不填)');
           return false;
        }
        return true;
    }
           
    function validate(form){
        return validate_required(form) && validate_pattern(form) && validate_other(form);
    }
posted @ 2008-02-15 15:52 liunix 阅读(153) | 评论 (0)编辑 收藏
alter session set max_dump_file_size=unlimited;
alter session set timed_statistics=true;
alter session set events '10046 trace name context forever, level 12';
select 'Hello, world; today is '||sysdate from dual; exit;

tkprof card_ora_13226.trc trace.txt print=100 record=sql.txt sys=no

然后查年trace.txt就是分析内容了
posted @ 2007-11-06 09:52 liunix 阅读(367) | 评论 (0)编辑 收藏
#少了一步安装 fcgi本身的
#将public下面的所有ruby路径改正确
#详细说明如何启用fcgi而不是cgi(改.htpaccess)
#将ruby-fcgi按README安装完全
#启用SYBASE要设置/etc/ld.so.conf加上sybase的lib路径(APACHE以NOBODY启动,LD_LIBRARY_PATH似乎没用)


1,为编译fastcgi,安装httpd-dev包
    rpm -ivh httpd-dev***.rpm    #会要求安装其它依赖包
2,构建mod_fastcgi.so,正常构建会报缺少文件(对fc4自动安装apache而言),会自动加入/usr/lib/httpd/module中,/etc/httpd/conf/httpd.conf也会自动加载(但语法不对)
    apxs -n mod_fastcgi -i -a -c mod_fastcgi.c fcgi_buf.c fcgi_config.c fcgi_pm.c fcgi_protocol.c fcgi_util.c  #在解压后的mod_fast2.4.2包中执行,构建mod_fast.so
    chmod 755 /usr/lib/httpd/modules/mod_fastcgi.so #修改访问权限
3,ruby的fcgi模块正确安装方法
   1,下载ruby-fcgi-0.8.7.tar.gz
   2,ruby install.rb config -- --with-fcgi-include=/usr/local/include --with-fcgi-lib=/usr/local/lib  (指向正确的fcgi安装路径)
   3,其余按readme
4,为apache配置虚拟主机(客户机的host要配合指向)---还要加上一条时间选项
    <Directory /var/www/>
        AllowOverride all
    </Directory>

    LoadModule fastcgi_module modules/mod_fastcgi.so
    FastCgiConfig -singleThreshold 100 -killInterval 300 -autoUpdate -idle-timeout 240  -pass-header HTTP_AUTHORIZATION
    AddHandler fastcgi-script .fcgi

    <VirtualHost *:80>
        ServerAdmin webmaster@example.com
        DocumentRoot /var/www/rails/testapp/public        #testapp即为你rails程序的根目录
        ServerName www.example.com
        ErrorLog /var/log/httpd/testapp-error_log
        CustomLog /var/log/httpd/testapp-access_log common
        Options Indexes ExecCGI FollowSymLinks
        RewriteEngine On
    </VirtualHost>
6,启动apache,看欢迎页面
    apachectl start   #用这种方式可以在控制台查看错误消息(应该会报一条无效的加截so的行190?)
7,根据需要修改rails应用(producation环境,facgi的dispatch,数据库支持)


8,后续修改如下
    chown -R apache.apache ${railsapp}
    mkdir /tmp/fcgi_ipc
    httpd.conf-->FastCgiIpcDir "/tmp/fcgi_ipc/"
    chown -R apache.apache /tmp/fcgi_ipc





错误情况分析:
1,apache的error.log或app的error.log会报:(权限问题)
    [Sun Nov 19 14:05:29 2006] [crit] (13)Permission denied:
    FastCGI: can't create (dynamic) server "/var/www/rails/testapp/public/dispatch.fcgi":
    bind() failed [/etc/httpd/logs/fastcgi/dynamic/3c713fbde3044b67e240a7bf3791f36b]

2,测试dispatch.fcgi的方法ruby -d dispatch.fcgi

3,app下面的fastcgi.crash.log中产生----注意,说方法丢失可能是c的动态库没有找到
   Dispatcher failed to catch: undefined method `is_cgi?' for FCGI:Class (NoMethodError)
   fcgi的问题


posted @ 2007-08-10 11:46 liunix 阅读(953) | 评论 (0)编辑 收藏
1, 安装系统时尽量不要选择ruby,如果已安装
    rpm -qa | grep ruby
    rpm -e ${已安装上ruby包名}

2, 检查系统,确定已安装gcc,make
    gcc -v
    make -v

3, 安装ruby 1.8.5
    wget ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.5.tar.gz
    tar xzvf ruby-1.8.5.tar.gz
    cd ruby-1.8.5
    ./configure --prefix=/usr/local/ruby
    make && make install
    export PATH=$PATH:/usr/local/ruby/bin/

4, 安装rubygems
    wget http://rubyforge.org/frs/download.php/20990/rubygems-0.9.4.zip
    unzip rubygems-0.9.4.zip && cd rubygems-0.9.4
    ruby setup.rb

5, 安装rails
    gem install rails  -v=1.2.3
    各种依赖库均选Y

6, 安装mongrel(有平台选项的均选ruby)
    gem install mongrel
    各种依赖库均Y

7, 安装sybase-ruby库
    wget http://enjoy1.bb-east.ne.jp/~tetsu/sybct-ruby-0.2.9.tar.gz
    tar xzvf sybct-ruby-0.2.9.tar.gz
    cd sybct-ruby-0.2.9
    编缉extconf.rb文件,指向正确sybase路径
    ruby extconf.rb
    make
    cp sybct.o sybct.so sybct.rb sybsql.rb /usr/local/ruby/lib/ruby/site_ruby/1.8/i686-linux
    export LD_LIBRARY_PATH=${SYBASE_HOME}/OCS-12_5/lib

8, 结合apache与mongrel (APP_ROOT为应用程序根目录)
   参见文章: http://mongrel.rubyforge.org/docs/apache.html

9, 安装ImageMagick和RMagic(不要安装RMagic的gem包)
    先检查依赖库:libpng,libjpeg,libtiff,gd-devel
    unzip ImageMagick-6.3.4-4.zip
    cd ImageMagick-6.3.4-4
    ./configure --prefix=/usr/local/ImageMagick
    make && make install
    export PATH=$PATH:/usr/local/ImageMagic/bin
    编辑:/etc/ld.so.conf,加入
    /usr/local/ImageMagick/lib
    执行:ldconfig

   
    tar xzvf RMagick-1.15.6.tar.gz
    cd RMagick-1.15.6
    ./configure
    make && make install


posted @ 2007-07-11 12:44 liunix 阅读(618) | 评论 (0)编辑 收藏