1. In the java you can use
{{{
DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); //yyyy-MM-dd HH:mm:ss Z//
Date jobSubmitTime = null;
Date nowTime = new Date();
long timeDifferent = 0;
// Get the job
try {
while (sourceJobIterator.hasNext()) {
logger.info("Enter the resubmit job loop. ");
RecordExpr job = (RecordExpr) sourceJobIterator.next();
logger.info("2");
String jobTime = (new GapJDLParser(job)).getSubmissionTime();
//String jobTime = (new GapJDLParser(job)).get;
logger.info("3");
jobSubmitTime = df.parse(jobTime);
logger.info("4");
logger.info("job: " + (new GapJDLParser(job)).getJobId()
+ ", submit Time: " + jobSubmitTime.getTime()
+ ", current Time: " + nowTime.getTime());
timeDifferent = (nowTime.getTime() - jobSubmitTime.getTime()) / SECONDS_IN_MILLION;
}}}
2. but in sql
{{{
String query = "SELECT b.name,b.vo,b.lsa_host,b.lsa_type,b.lsa_pid,";
query += "b.appid,b.tag,b.nprocs,b.status,";
query += "b.id as jid,b.sub_id,b.qpriority,b.outputs,b.inputs,";
query += "to_char(b.sub_dtime, 'YYYY-MM-DD HH24:MI:SS TZ') as sub_dtime,";
query += "to_char(b.run_dtime, 'YYYY-MM-DD HH24:MI:SS TZ') as run_dtime,";
query += "to_char(b.done_dtime, 'YYYY-MM-DD HH24:MI:SS TZ') as done_dtime,";
query += "b.timeout,b.trial_count,b.retry_reason,";
query += "b.share_user,b.share_vo,b.share_role,";
query += "a.dn as dn,a.email FROM ";
query += "udb_user as a, jdb_jlist as b, udb_gproxy as c ";
query += "WHERE b.id=? AND b.sub_id=? AND a.dn=b.dn";
}}}
SQL: becareful the time is the automatic build
{{{
CREATE TABLE jdb_jgroup (
id character(256) NOT NULL,
dn character(256) NOT NULL,
vo character(32) NOT NULL REFERENCES vo_list(vo),
adv_appid character(32) NOT NULL,
command_name character(256),
status character(32) NOT NULL,
sub_dtime timestamp with time zone DEFAULT now() NOT NULL,
description text,
command_fqcn character(256) NOT NULL,
success_rate double precision DEFAULT 0.0 NOT NULL,
job_count integer DEFAULT 1 NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (dn) REFERENCES udb_user(dn) ON UPDATE CASCADE ON DELETE CASCADE
);
}}}
2010年7月21日 星期三
2010年7月19日 星期一
Script for wms-glite and ant
Hi guys:
I will teach u how to compiler the LCG-WMS-GLITE job,
1. you can enter gap31Sub1ShellRunRequire dir
2. edit net/asgc/gap/core/lsa/lqs/LCG2.java file
> vim net/asgc/gap/core/lsa/lqs/LCG2.java
3. setting the enviroment variable
> export PATH=$PATH:/home/Andy/apache-ant-1.7.1/bin
4. build the project
> ant fw_core.clean
> ant fw_core.build
5. put the jar file to gap-LCG-GLITE project (you can copy the old jar to temportay)
> cp /home/Andy/tmp/sour/gap31Sub1ShellRunRequire/fw_core/dist/gap-lsa-3.1-0.jar /opt/gap-LCG-GLITE/dist/gap-lsa-3.1-0.jar
6. start the gap-lsa
>/etc/init.d/lsaservice-lcg-glite restart
I will teach u how to compiler the LCG-WMS-GLITE job,
1. you can enter gap31Sub1ShellRunRequire dir
2. edit net/asgc/gap/core/lsa/lqs/LCG2.java file
> vim net/asgc/gap/core/lsa/lqs/LCG2.java
3. setting the enviroment variable
> export PATH=$PATH:/home/Andy/apache-ant-1.7.1/bin
4. build the project
> ant fw_core.clean
> ant fw_core.build
5. put the jar file to gap-LCG-GLITE project (you can copy the old jar to temportay)
> cp /home/Andy/tmp/sour/gap31Sub1ShellRunRequire/fw_core/dist/gap-lsa-3.1-0.jar /opt/gap-LCG-GLITE/dist/gap-lsa-3.1-0.jar
6. start the gap-lsa
>/etc/init.d/lsaservice-lcg-glite restart
Build a java to class
1. It need many lib, but we use simple to write
cp.sh
{{{
#!/bin/sh
CP=.
for path in $(find /opt/apache-tomcat-5.5.27/webapps/gcp/WEB-INF/lib/ -name *.jar);
do
#echo $path
CP="$CP:$path";
done
#echo $CP;
#CP="$CP:./tmp/code/datawarehouse/";
javac -classpath $CP GapUserInit.java
}}}
2. A comand that to list all data to as a classpath
{{{
[Andy@localhost lib]$ ls | awk '{home = "/home/Andy/Desktop/GRC/Data/TO_Alang_20110222/UniProt/API/uniprotjapi/src"; classpath = classpath ":" home "/" $1; print classpath; }' | less | tail -n 1
}}}
cp.sh
{{{
#!/bin/sh
CP=.
for path in $(find /opt/apache-tomcat-5.5.27/webapps/gcp/WEB-INF/lib/ -name *.jar);
do
#echo $path
CP="$CP:$path";
done
#echo $CP;
#CP="$CP:./tmp/code/datawarehouse/";
javac -classpath $CP GapUserInit.java
}}}
2. A comand that to list all data to as a classpath
{{{
[Andy@localhost lib]$ ls | awk '{home = "/home/Andy/Desktop/GRC/Data/TO_Alang_20110222/UniProt/API/uniprotjapi/src"; classpath = classpath ":" home "/" $1; print classpath; }' | less | tail -n 1
}}}
2010年7月17日 星期六
1. ALU
Alu sequence:
1、分布:
散佈於靈長類,老鼠的genomic DNA。人類的基因組中約有30萬分以上的Alu分散在基因組中,全部Alu佔人類基因組中的5﹪。
2、特性:
a、 約150-300bp DNA,為高度重複(highly repetitive)序列。人類genome有長短不一的Alu形成Alu家族,有些短的序列僅10bp類似Alu存在基因之間或intron內部。
b、 通常具有一段AGCT能被限制脢Alu I認定。
c、 隨種類不同,兩端是7-21bp的直接重複。
d、 Alu也是一種逆轉移子,Alu先轉錄成RNA,真核細胞中能也反轉錄脢,能將Alu RNA轉錄成Alu DNA在插入基因組中。Alu本身不會譯出蛋白質。
Reference:
http://brc.se.fju.edu.tw/nobelist/198x/p1983.htm
Alu sequence:
1、分布:
散佈於靈長類,老鼠的genomic DNA。人類的基因組中約有30萬分以上的Alu分散在基因組中,全部Alu佔人類基因組中的5﹪。
2、特性:
a、 約150-300bp DNA,為高度重複(highly repetitive)序列。人類genome有長短不一的Alu形成Alu家族,有些短的序列僅10bp類似Alu存在基因之間或intron內部。
b、 通常具有一段AGCT能被限制脢Alu I認定。
c、 隨種類不同,兩端是7-21bp的直接重複。
d、 Alu也是一種逆轉移子,Alu先轉錄成RNA,真核細胞中能也反轉錄脢,能將Alu RNA轉錄成Alu DNA在插入基因組中。Alu本身不會譯出蛋白質。
Reference:
http://brc.se.fju.edu.tw/nobelist/198x/p1983.htm
2010年7月15日 星期四
防駭
//////////////// 檔 port ///////////////////
說明: 使用 socket 底層去檔
1. /etc/hosts.allow 允許誰能近入
{{{
sshd: 140.109.98.0/255.255.255.0, 117.103.108.0/255.255.255.0 127.0.0.1 114.32.22.27
}}}
2. or /etc/hosts.deny
{{{
sshd: ALL
}}}
//////////////// 使用 iptable 去檔 ////////////////////
1. 只允許 140.109.98.0/24 的人進入 ssh
{{{
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s ! 140.109.98.0/24 -j DROP
}}}
重啟:
{{{
/etc/init.d/iptables restart
}}}
2. 開放允許的 port
/etc/sysconfig/iptables
{{{
# ssh
#-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 140.109.98.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 117.103.108.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 127.0.0.1 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 114.32.22.27 -j ACCEPT
}}}
說明: 使用 socket 底層去檔
1. /etc/hosts.allow 允許誰能近入
{{{
sshd: 140.109.98.0/255.255.255.0, 117.103.108.0/255.255.255.0 127.0.0.1 114.32.22.27
}}}
2. or /etc/hosts.deny
{{{
sshd: ALL
}}}
//////////////// 使用 iptable 去檔 ////////////////////
1. 只允許 140.109.98.0/24 的人進入 ssh
{{{
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s ! 140.109.98.0/24 -j DROP
}}}
重啟:
{{{
/etc/init.d/iptables restart
}}}
2. 開放允許的 port
/etc/sysconfig/iptables
{{{
# ssh
#-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 140.109.98.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 117.103.108.0/24 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 127.0.0.1 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -s 114.32.22.27 -j ACCEPT
}}}
訂閱:
文章 (Atom)