2010年7月26日 星期一

Terminal and window

1. Terminal: 用 ctrl + alt + F1 to F6
2. window: 用 ctrl + alt + F7

2010年7月23日 星期五

Process

1. basic
顯示目前所有程序, 並對 memory 作排序
ps -e o user,pid,size,cmd | sort -k3 -n -r | more

///////////////////////////////////////
ps report a snapshot of the current processes
///////////////////////////////////////
-e Select all identical
-o userdefine output

command:
KEY LONG DESCRIPTION
c cmd simple name of executable
C pcpu cpu utilization
f flags flags as in long format F field
g pgrp process group ID
G tpgid controlling tty process group ID
j cutime cumulative user time
J cstime cumulative system time
k utime user time
m min_flt number of minor page faults
M maj_flt number of major page faults
n cmin_flt cumulative minor page faults
N cmaj_flt cumulative major page faults
o session session ID
p pid process ID
P ppid parent process ID
r rss resident set size
R resident resident pages
s size memory size in kilobytes
S share amount of shared pages
t tty the device number of the controlling tty
T start_time time process was started
U uid user ID number
u user user name
v vsize total VM size in kB
y priority kernel scheduling priority

/////////////////////////////////////////
sort
//////////////////////////////////////////
-k key
-n number sort
-r reverse


/////////////////////////////////
killall
///////////////////////////////////
說明: 可用程序名稱 刪除程序
like: killall /user/httpd

2010年7月22日 星期四

Time

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日 星期三

Eclipse

匯出與匯入一個專案:
1. 匯出: Export -> Gerneral->ArchieveFile -> zip
2. 匯入: Import -> Existing projects into workspace -> select archieve file

PS. Sometimes you need to set the build path:
project -> java build path -> libaray

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

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
}}}

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