2009年9月29日星期二
創建一個github
將一些命令記錄一下,備忘:
http://github.com/bangnew/iPhoneDev
bangnew / iPhoneDev
Description: iPhoneDev edit
Homepage: Click to edit edit
Public Clone URL: git://github.com/bangnew/iPhoneDev.git
Your Clone URL:
git@github.com:bangnew/iPhoneDev.git
Global setup:
Download and install Git
git config --global user.name "Your Name"
git config --global user.email bangbangnew@gmail.com
Next steps:
mkdir iPhoneDev
cd iPhoneDev
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin git@github.com:bangnew/iPhoneDev.git
git push origin master
Existing Git Repo?
cd existing_git_repo
git remote add origin git@github.com:bangnew/iPhoneDev.git
git push origin master
Importing a Subversion Repo?
Click here
When you're done:
Continue
-------------------
參考:
Git for OS X
http://code.google.com/p/git-osx-installer/
不錯的文章
http://www.dotblogs.com.tw/billy3321/archive/2009/02/06/7064.aspx
http://zh-tw.whygitisbetterthanx.com/#github
subversion
http://twpug.net/docs/Subversion/
2009年9月18日星期五
使用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了,手生了!
生词本
。 不充分的
。 不适当的,不够格的
“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 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
