2010年10月28日 星期四

Cooking Content

---------------------------------------
紅豆湯
a. 紅豆先泡一個晚上
b. 一鍋看比例放水, 在放入電鍋
c. 最後在加糖

-------------------------------------
Lemon juice
a. 一顆 lemon, 一升的水
b. 在放水前先加糖, 使 lemon 和糖 1:1

--------------------------------------
potato 乳酪
0. potato 削皮
a. potato 切丁
b. 放入 microware 大約 6 minutes, 能分成interspre 2 ms
c. 過濾掉水
c. 最後將乳酪片切成小片放入 potato
d. micro 30 second

---------------------------------------
烤 omit
a. 將

2010年10月18日 星期一

key generate SSH

LOOK:
http://plog.longwin.com.tw/post/1/293


1。创建了用户abc
2.#su - abc
3.#mkdir .ssh
4.#chmod 700 .ssh
5.#ssh-keygen -t rsa
6.#cd .ssh
7.#cat ./id_rsa.pub >> authorized_keys
8.#chmod 644 ./authorized_keys

2010年10月12日 星期二

Reference

1. good content
http://www.perlmeme.org/howtos/using_perl/dereferencing.html



2. orielly book
http://oreilly.com/catalog/advperl/excerpt/ch01.html

3. office good
http://perldoc.perl.org/perlref.html

Object

1. network tutourial

http://www.tutorialspoint.com/perl/perl_oo_perl.htm

http://www.perl.com/pub/2001/11/07/ooperl.html

2. book
http://www.tutorialspoint.com/perl/perl_oo_perl.htm

2010年10月11日 星期一

File exist

File Checking

The -e part is the existence test. After that we have a space, followed by the file we want to test. As in the other sections, we could also use a variable to hold the file name:

$neededfile="myfile.cgi";
if (-e $neededfile)
{
#proceed with your code
}


Reference:
http://www.pageresource.com/cgirec/ptut17.htm

2010年10月7日 星期四

BIO

1. MICROBES 微生物
2. plasmid 質體
3. methylobacterium 嗜中溫甲基桿菌 (微生物)
4. methanol 甲醇 (養份)
5. succinate 琥珀酸 (養分)
6. fitness 適應環境的能力 (分析)
7. fitness cost 減少環境適應能力 (分析)
8. transition 過渡, 轉變 (分析)
9. stationary 不變 (分析)
10. heat shock 熱沖擊 (環境變因)
11. formaldehyde 甲醛
12. peroxide 過氧化氫
13. ampicillin 盤尼西林
14. pleiotropic 多效
15. effect 影響
16. phenotype 顯型

Performance

Memory

1. look the memory usage
{{{
[Andy@localhost source]$ free -m
total used free shared buffers cached
Mem: 4038 3631 406 0 248 2219
-/+ buffers/cache: 1163 2875
Swap: 5535 120 5415


}}}




-------------------------------------------
Release cache memory

{{{
I have cleaned the blast2 cache memory from 378G uesed memory to 38G used memory.

The following is the blast2 memory status in processing clean processing:
Original memory status:
Mem: 528654244k total, 377,362,648k used (377G), 151,291,596k free (151G), 56240k buffers
After cleaned chache memory:
Mem: 528654244k total, 38,823,964k used (38G), 489,830,280k free (489G), 3216k buffers

Conclusion:
Data will in cache becuase previous we interrupt some jobs,
we can use sync; echo 3 > /proc/sys/vm/drop_caches command to release cache memory.
there we are 489G free memory.



Solution:
Because most memory is in cache and can release
{{{
[Andy@blast2 Data]$ free -m
total used free shared buffers cached
Mem: 516263 368477 147786 0 54 315990 (315G)
}}}

I refer to the 'google' and type following command:
{{{
[root@blast2 ~]# sync
[root@blast2 ~]# echo 3 > /proc/sys/vm/drop_caches
}}}

Note: Sync is used to synchronize the data in the memory to disk, as some data in disk might be cached in the memory for easy access. Use of sync will prevent any sort of data loss or file system corruption.


Reference:
http://www.linuxforums.org/forum/miscellaneous/29900-release-cache-memory.html


}}}

2010年10月3日 星期日

Edit command

--------------------------------------------------------
1. cut
sample
{{{
hostname | cut -d “.” -f 1
}}}
represent using the dot to seperate, and f mean print filed 1

--------------------------------------------------------
2. list direction
{{{
ls -d */
}}}

--------------------------------------------------------
3. awk
Using the awk to list the filed 1 (start 1) value is 6
{{{
[Andy@localhost summary]$ awk '$1==6' eles | less
}}}

---------------------------------------------------------
4. uniq can reduce the same element in one element.
Becarefully: u need sorting before show single line data, because uniq using the delete method in succive
{{{
file name.dat
[
Andy
Merry
David
Andy
]
[Andy@localhost pracice]$ sort Field.data | uniq -c
2 Andy
1 David
1 Marry

}}}

--------------------------------------------------
sed

* list content
{{{
sed -n '4,$p' 454AllContigs_change.fna.out | less
}}}

* Insert line 1 before as the tilte
{{{
sed -i ''1i tiltle" file
}}}

Substation command
* remove many spaces to a tab
sed 's/\s\s*/\t/g' mean one space and many space to a tab
{{{
[Andy@localhost TestResult]$ cat simpleData
rnd-3_family-30 1 1066 1066 1066.00 1066

cat simpleData | sed 's/\s\s*/\t/g' > ~/Desktop/tmp/
}}}

* change the (number*) to number, and not change the (charcate*) to (character),
becareful the group operator is \(\) and the get is \1
{{{
sed 's/(\([0-9][0-9]*\))/\1/g'
}}}

* list the email
{{{
cat tmp | sed 's/.*<\([a-z.0-9][a-z.0-9]*@..*\)>.*/\1/' | awk '{ print $1","}'
}}}

* sed remove control A
{{{
less Parsed_Blastp_ORF_FGSH_ASP.txt | sed 's/\cA/\t/'
}}}

*sed find the length
{{{
>contig00005 gene=isogroup00001 length=1854
>contig00006 gene=isogroup00001 length=715
>contig00007 gene=isogroup00001 length=773

[Andy@blast2 newbler26_CPU1_cDNA]$ cat 454Isotigs.fna.header | sed 's/.*length=\([0-9]*\).*/\1/'
}}}


Notice:
1. Sed no + quality
2. sed group operation is specail using the \( character \), and get using \1 ... \n
perl is () and $1... $n

Reference:
http://www.panix.com/~elflord/unix/sed.html
------------------------------------------------
awk
final column is RNF
{{{
awk '{print $NF}' consensi.fa.classified.LTR.lengthTable > consensi.fa.classified.LTR.lengthTable.OnlyLength
}}}

------------------------------------------------
split
can split the content of file like lines or size
split -l 1000 file sffix
{{{
split -l 1000 sfile
}}}

--------------------------------------------------
problem The windown file have \r\n generate ^M symbol
we need remove it on comand
{{
head -n 3 AUG.txt | tr -d '^M' | less
}}}
reference:
http://bogdan.org.ua/2009/03/30/linux-how-to-remove-trailing-control-m-carriage-return.html