2008年9月18日 星期四

vmstat


kthr      memory            page            disk          faults      cpu

r b w   swap  free  re  mf pi po fr de sr f0 m2 m2 m2   in   sy   cs us sy id

0 0 0 156352 168880 29  94 147 0  0  0 67  0  0  0  0  441  481   76  6  4 89在命令行收集虛擬記憶體性能的資料

procs:

r-->在運行佇列中等待的進程數

b-->在等待io的進程數

w-->可以進入運行佇列但被替換的進程

memoy

swap-->現時可用的交換記憶體(k表示)

free-->空閒的記憶體(k表示)

pages

re--》回收的頁面

mf--》非嚴重錯誤的頁面

pi--》進入頁面數(k表示)

po--》出頁面數(k表示)

fr--》空餘的頁面數(k表示)

de--》提前讀入的頁面中的未命中數

sr--》通過時鐘演算法掃描的頁面

disk 顯示每秒的磁片操作。 s表示scsi盤,0表示盤號

fault 顯示每秒的中斷數

in--》設備中斷

sy--》系統中斷

cy--》cpu交換

cpu 表示cpu的使用狀態

cs--》用戶進程使用的時間

sy--》系統進程使用的時間

id--》cpu空閒的時間

如果 r經常大於 4 ,且id經常少於40,表示cpu的負荷很重。

如果pipo 長期不等於0,表示記憶體不足。

如果disk 經常不等於0 且在 b中的佇列 大於3 表示 io性能不好。

2008年9月16日 星期二

找檔案的大小

檔案大小:
使用 find 程式時,透過 -size 參數的使用,可以精準的搜尋出
特定檔案長度的檔案。-size 參數的使用,支援的單位有:

b:block (1 block = 512 byte)
c:byte
k : kbyte
w : word byte

實際在使用時,可以搭配 + 與 – 表示大於或者是小於指定的大小。

使用範例 1:
搜尋 /bin 目錄內,檔案長度為大約為 10K 的一般檔案
find /bin -type f -size 10k

使用範例 2:
搜尋 /bin 目錄內,以 a ~ m 開頭,檔案長度大於 10K 的一般檔案
find /bin -type f -name “[a-m]*” -size +10k

使用範例 3:
搜尋 /usr/bin 目錄內,檔案長度在 50k ~ 100k 範圍內的檔案
find /usr/bin -type f -size +50k –size -100k

2008年8月23日 星期六

GT4 免費改裝

1.到設定把自動存檔關掉(※一定要關掉)

2.從車庫裡選一台自己想改裝的車或是買一台想改裝的車然後換乘此輛車

3.隨便再換乘另一台車然後手動存檔

4.在換乘剛才想改裝的車然後去改裝

5.改裝完後再隨便買一台新車然後換乘該輛新車(※不要存檔)

6.PS2主機重新啟動然後在車庫選擇剛才改的車換乘後就會發現已經改裝了

*第5點,不必買新車,隨便換臺別的就好.

*還有是重新進入後,在列表上看到的是原來的馬力,再換成它就變成改裝後的馬力

2008年8月20日 星期三

OpenWebMail

1、安装openwebmail 2.51软件:
安裝環境:RH4 + Sendmail + Apach + Openwebmail
# service httpd restart (启动httpd服务)
停止 httpd: [ 确定 ]
启动 httpd: [ 确定 ]

# rpm -ivh perl-5.8.5-12.1.i386.rpm
# rpm -ivh perl-CGI-SpeedyCGI-2.22-1.2.el4.rf.i386.rpm
# rpm -ivh perl-Compress-Zlib-1.34-1.2.el4.rf.i386.rpm
# rpm -ivh perl-suidperl-5.8.5-12.1.1.i386.rpm
# rpm -ivh perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm

# rpm -ivh openwebmail-2.51-1.i386.rpm

warning: openwebmail-2.51-1.i386.rpm: V3 DSA signature: NOKEY, key ID cfb164d8
Preparing... ######################################### [100%]
1penwebmail ###################################### [100%]

You may login with non-root account from
http://mail.easy.com/cgi-bin/openwebmail/openwebmail.pl

# cd /var/www/cgi-bin/openwebmail/

# ./openwebmail-tool.pl --init

Please change './etc/dbm.conf' from

dbm_ext .db
dbmopen_ext none
dbmopen_haslock no

to

dbm_ext .db
dbmopen_ext .db
dbmopen_haslock no


And execute './openwebmail-tool.pl --init' again!

ps: If you are running openwebmail in persistent mode,
don't forget to 'touch openwebmail*.pl', so speedycgi
will reload all scripts, modules and conf files in --init.
2、修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf 文件:

domainnames auto
更改为:
domainnames zoomsky.com (更改为自己定义的域名)

default_language en
更改为:
default_language zh_CN.GB2312 (更改为简体中文版介面)

default_iconset Cool3D.Englist
更改为:
default_iconset Cool3D.Chinese.Simplified (更改为中文3D按键)

3、修改/var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf文件:

smtpserver 127.0.0.1
更改为:
smtpserver 192.168.0.77 (更改smtp服务器的地址)

authpop3_server localhost
更改为:
authpop3_server 192.168.0.77 (更改pop3服务器的地址)

4、修改/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf文件:

dbmopen_ext none
更改为:
dbmopen_ext .db

dbmopen_haslock no
更改为:
dbmopen_haslock yes

smtpserver 192.168.1.253 (添加smtp服务器的地址)
5、继续运行openwebmail-tool.pl文件:

# ./openwebmail-tool.pl --init

creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b ...done.
creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar ...done.
Welcome to the Open WebMail!

This program is going to send a short message back to the developer,
so we could have the idea that who is installing and how many sites are
using this software, the content to be sent is:

OS: Linux 2.6.9-11.EL i686
Perl: 5.008005
WebMail: Open WebMail 2.51 20050228

Send the site report?(Y/n) y (输入y,然后按回车键)
sending report...

Thank you.


6、测试webmail方式收发电子邮件:

在ie中输入以下地址:

http://127.0.0.1/cgi-bin/openwebmail/openwebmail.pl


以上資料截自 http://www.ixpub.net/redirect.php?fid=223&tid=672660&goto=nextnewset

2008年8月7日 星期四

啟動 Oracle DB / 停用 Oracle DB

起動 db
su - oracle
lsnrctl start
sqlplus /nolog
conn / as sysdba; 本機的DB
startup
exit

停止 db
su - oracle
sqlplus /nolog
conn / as sysdba; 本機的DB
shutdown

若停不下來,則再執行以下指令
shutdown abort
startup
shutdown immediate

2008年7月22日 星期二

set IP object

NetScreen-25
以Telnet 方式加 IP object
set address "區域" "Name" IP Mask "Comment"
Ex.
set address "Untrust" "A0006-05" 111.222.1.2 255.255.255.255 "xxx Source IP"

2008年7月16日 星期三

MySQL reset root password

service mysqld stop
mysqld_safe --skip-grant-tables &
mysql -u root mysql

UPDATE user SET password=PASSWORD("abcd") WHERE user="root";
FLUSH PRIVILEGES;
exit
service mysqld restart