2009年9月18日星期五

secuirty Taxonomy

http://www.terena.org/activities/tf-csirt/iodef/docs/i-taxonomy_terms.html

 

sandia-scheme

使用webbench進行壓力測試

對剛搭建好的ngnix+php+mysql環境進行測試

發現http://blog.s135.com/post/288/ 介紹的方法不錯,如法炮製:

[root@CRRACTEST webbench-1.5]# ./webbench -c 500 -t 30 http://172.16.1.70/phpinfo.php
Webbench - Simple Web Benchmark 1.5
Copyright (c) Radim Kolar 1997-2004, GPL Open Source Software.

Benchmarking: GET http://172.16.1.70/phpinfo.php
500 clients, running 30 sec.

Speed=26146 pages/min, 17900220 bytes/sec.
Requests: 13073 susceed, 0 failed.

top - 00:08:20 up  4:32,  4 users,  load average: 11.29, 3.68, 2.21
Tasks: 253 total,  17 running, 235 sleeping,   0 stopped,   1 zombie
Cpu(s): 27.1%us, 24.6%sy,  0.0%ni,  0.0%id,  0.0%wa,  3.2%hi, 45.1%si,  0.0%st
Mem:   1027068k total,   999464k used,    27604k free,     2924k buffers
Swap:  2064376k total,   537392k used,  1526984k free,    83156k cached

phpinfo.php,是通用的

<?php phpinfo() ?>

這是在虛擬機上進行的測試,效果還可以,記錄一下備查

2009年9月17日星期四

隆重推薦Mysql隨機安裝文檔

慚愧啊,本來想做一個實驗,省事,使用tar.gz版本的mysql, 竟然話了我2個小時,一直啟動不起來,查log,google,都沒有解決.

從新解壓,發現mysql包中有一個安裝文檔

mysql-5.1.38-linux-x86_64-glibc23.tar.gz

INSTALL-BINARY

The basic commands that you must execute to install and use a
   MySQL binary distribution are:
shell> groupadd mysql
shell> useradd -g mysql mysql
shell> cd /usr/local
shell> gunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf -
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &

居然過去了,隆重推薦,

看來什麽東西都是要常摸一下,多日不搞Mysql了,手生了!

生词本

inadequate adj
。 不充分的
。 不适当的,不够格的
“I felt inadequate in my new job, so I left of my own accord."

participation n 分享,参与

Deterrent n. 制止物;威慑物 adj. 阻碍的;制止的

Detective n. 侦探

Intrusive adj. 入侵,闯入

Preventive adj. 预防的;阻止的

Permit n 许可证;执照 vt. , vi
. 许可,允许;准许
She won't permit dogs in the house.
Do you permit you children to smoke?
. 容许,有可能
if my health permits
(of) 允许有
The situation does not permit of any delay.

intuitive adj. 直觉的,本能的; 天生的

recipient n. 接受者

aggregate adj. 总的,合计的
what were your aggregate wages last year? 去年你的工资一共是多少?

facilitate vt . 使容易;使便利
it would facilitate matters if you were more co-operative
the broken lock facilitate my entrance into the empty house
the new underground railway will facilitate the journey to all parts of the city.
Tractors and other agricultural machines greatly facilitate farming.

polymorphic adj 多态的, 多形态的

involved adj (常与in连用)(与...)关系密切的,(与...)有牵连的
。复杂的
compartmental adj. 分成隔间的

coordinating vt, 使协调;使调和 adj, 同等的,并列的 n(数)坐标

counterfeit n.伪造;假冒 vt 伪造;假冒 adj 伪造的;假冒的;模仿的
--a counterfeit coin

repudiate vt., vi 拒绝;断绝关系
to repudiate offers of friendship 拒绝友谊
否定;驳倒
to repudiate a charge of murder 否认谋杀的指控
barbed wire 带刺的铁丝网

qualitative adj 性质的;定性的
a qualitative analysis 定性分析

revence n. 国家的收入;税收

diverse --adj. 不同的;相异的 diverse interests 不同的兴趣

contingency planning -- 应变计划

impose --vt, vi 强迫, 强加
Don't impose yourself on people who don't want you.

restrict to 把...限制(控制,保持)在...
to restrict oneself to two cigarettes a day

occupant n. 1占有者,占领者;2居住者

viability --生存能力,发育能力

discretionary -- ADJ, 任意的,自由决定的

combustion --n. 燃烧

remanence --n. 剩磁

autonomy -- n. 自治,自治權

promiscuous -- 不加區分的, 混雜的
---linux有一個網卡模式是 promiscuous mode

arbitrary --adj. 專橫的;武斷的
an arbitrary interpretation 武斷的解釋
an arbitrary decision 武斷的決定

--任性的;隨心所欲的
my choice was quite arbitrary 我的選擇相當隨意


sprinkler system --自動噴水滅火系統 pre-action sprinkler system

deliberately --adv 故意地
deliberate --vt, vi 商討;研討
adj 周密計劃的;深思熟慮的 taking deliberate action
故意的;別有用心的;存心的 He told us a deliberate lie
從容而謹慎的
反義詞: hasty
hasty -- adj 急速的;匆匆的 ate a hasty meal
倉促的;草率的;急躁的
a hasty old man
they shouldn't have made such a hasty decision
His hasty decision was a mistake

repudiate --- vt, vi 拒絕;斷絕關系 to repudiate offers of friendship
否定;駁倒 to repudiate a charge of murder

badges -- n 徽章;證章 We wear the school badge on our coats

burden--vt, 使負重擔;使麻煩
n, 負荷;負擔;重載
He could not carry the burden alone.

重任
要點;主題;主旨
The burden of the story

instigate --vt.
發起;促成
He instigated the ending of a free working lunch in the company. 他煽動取消公司的免費工作午餐

hierarchy (ies) n 等級制度;階層
A hierarchy of moral values //道德價值的層次
The government is a hierarchy // 政府是官階分明的統治集團








OSI session layer and presentation layer 到底是干啥的?

the Session layer is responsible for establishing ,maintaining, and terminating communication sessions between two computers
the primary technology within layer is a gateway.
--這個層次主要的作為類似應用網關
the following protocols operate within the Session layer:
Secure Socket Layer(SSL)
Network File System(NFS)
Structured Query Language(SQL)
Remote Procedure Call(RPC)

The presentation layer is responsible for transforming data received from the application layer into a format that any system following the OSI model can understand. it imposes common or standardized structure and formatting rules onto the data.
--這個層次主要是標准化,格式化數據
the Presentation layer is also responsible for encryption and compression
出自

python寫的改變圖片大小的腳本

用python寫了一個處理圖片的腳本,當然用到了另一個opensource的軟件ImageMagick-6.5.5-5.tar.gz,

安裝是三板斧 configure, make , make install

這裡用到的是python的一個系統調用subprocess.call

#! /usr/bin/env python
import sys, os, subprocess
fileSrc = open('./testClass2.txt','r')
aDict = dict()                  #創建一個dictionary
for line in fileSrc:
        head, tail = line.split(',')
        aDict[head]= tail    #生成一個dictionary
fileSrc.close()

for atom in aDict:

        if int(aDict[atom]) == 1:    
                srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
                destStr=str('/home/demotest/source/yes/1/1_p9_%08d.jpg' % int(atom))
               subprocess.call(['convert', srcStr, '-resize', '180x180', '-bordercolor', 'yellow', '-border', '10x10', destStr])
                print '1----True'
        elif int(aDict[atom]) == 9:
                srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
                destStr=str('/home/demotest/source/yes/9/9_p9_%08d.jpg' % int(atom))
                subprocess.call(['convert', srcStr, '-resize', '580x580', '-bordercolor', 'yellow', '-border', '10x10', destStr])
                print '9----True'
        elif int(aDict[atom]) == 4:
                srcStr=str('/home/demotest/source/yes/p9_%08d.jpg' % int(atom))
                destStr=str('/home/demotest/source/yes/4/4_p9_%08d.jpg' % int(atom))
                subprocess.call(['convert', srcStr, '-resize', '380x380', '-bordercolor', 'yellow', '-border', '10x10', destStr])
                print '4----True'
        else:
                print 'no----True'

我這裡本來嘗試使用cmd.split()方式來,但是測試了半天沒有通過,放棄了,所以就用比較笨的辦法拼出來.

記錄一下! 繼續研究python

2009年9月16日星期三

MAC OS 上删除QIM/IMKQIM

一直使用MAC自帶的中文輸入感覺好慢,原來查過,沒有很好的中文系統,當時是10.4,重裝之後,昨天突然想起來了,能不能提高一下效率,果然有了:
QIM FOR搜狗,下載之安裝上了,心存疑慮,我下的是不是最新版呢,繼續GOOGLE,發現最新的是IMKQIM1.7了,下載之,怎麼用呢?
有用了幾分鍾在本子上照阿找,找到了,就是"多國語言"那裡,勾上即可.

再有疑問?是不是免費的,繼續GOOGLE發現確實要收費,唉,卸載之!!怎麼卸載是一個問題!!!

繼續GOOGLE,發現有免費的FIT
http://fit.coollittlethings.com/
下載之,安裝上了,現在這個用起來還是不錯的,呵呵!
以後再MAC上干活就用他了

如何卸載PIM呢?GOOGLE之
http://terrywang.net/archives/595 寫的不錯,摘錄之:

1.4.5的dmg中的文档带了如何删除的方法

请按照下面步骤删除QIM:
1. 首先在输入法菜单里取消QIM
2. 然后关闭所有当前使用过QIM的程序
3. 进入/Library/Components目录
4. 删除QIM.component
5. 重新登录即可完全删除QIM,QIM在~/Library/QIM目录里保存有用户的一些自定义信息和词库,如果用户不想保留,可以删除这个目录。


删除IMKQIM 1.6的具体步骤:
1. 首先在输入法菜单里取消QIM
2. 然后关闭所有当前使用过QIM的程序
3. 进入/Library/Input Methods目录
4. 删除IMKQIM.app
5. 重新登录即可完全删除QIM,QIM在~/Library/QIM目录里保存有用户的一些自定义信息和词库,如果用户不想保留,可以删除这个目录。

依法操作,果然刪除干淨了!
此文就是用FIT寫得,還支持繁體!!!
記錄一下,備查!