星期一, 十月 29, 2007

杂谈

任何组织和团体,企业,对新来的人员都有个洗脑过程,你读过书的会跟你说你的行动力不行,你没读书的说你知识不足,要更多的付出劳动。在让你仰慕一下少数先辈成功的例子。最后,告诉你坚持就会成功!然后开始没日没夜的榨干你的生命!而这一切过后,你得到的只是维持生命的基本生活。最后也就得出了没有人的成功是考自己的劳动换来的,都是在榨取别的劳动。
你继续读书深造,在某种意义上是在榨取父母的劳动。所以富人是没有清白的,他们不能没有廉耻的挥霍自己的财富,应该回报社会.

星期一, 九月 03, 2007

金融物理学

金融物理学是用统计物理、理论物理、复杂系统理论、非线性科学、应用数学等的概念、方法和理论研究金融市场通过自组织而涌现的宏观规律及其复杂性的一门新兴交叉学科。简言之,金融物理学家将金融市场看作一个复杂系统,其中的各种数据(如个股价格、指数、房价等)则看作是物理实验数据,力图寻找和阐释其中的“物理”规律。
金融物理学的英文为Econophysics,是由波士顿大学的物理学教授H. E. Stanley在1995年首先提出的,从而解决“为什么物理专业的学生可以从事金融学研究并取得物理学位”这一实际问题。从字面上看,应该翻译成经济物理学,但由于该领域的研究主要侧重于金融市场,因而翻译成金融物理学更贴切。事实上,Mantegna和Stanley的名著《An Introduction to Econophysics: Correlations and Complexity in Finance》明确强调了研究的对象是金融系统[1]。曾有学者建议用“Phynance”,也有“Physical finance”的提法,但没有得到广泛使用。 在国内,使用“经济物理学”和“金融物理学”的学者都很多,可以看作是同义词。管理科学研究领域的学者也有建议使用“物理金融学”或“物理经济学”的,就其内涵而言,更符合中文的文法。但是考虑到“经济物理学”和“金融物理学”已经被广泛使用,约定俗成了,改名可能会引起混乱,似乎并无必要。在这里,我们采用“金融物理学”这一名称,相应的英文采用“Econophysics”。 金融物理学的主要研究内容包括四个方面,中国科学技术大学物理系的汪秉宏教授也曾给出了一个十分类似的分类:
第一,金融市场变量(包括收益率、波动率、系综变量、价差等)的统计规律,特别是其中涌现的具有普适性的标度律,其中最基本的性质是关于收益率的尖峰胖尾分布。
第二,证券的相关性、极端事件、金融风险管理和投资组合等。分形市场假说研究相关变量(特别是收益率)的长期记忆性,或自相关性,认为价格演化中存在自相似结构。多重分形理论和方法也被广泛应用于金融市场时间序列的分析。
第三,宏观市场的建模和预测,包括用随机过程对收益率建模、对数周期性幂律模型等。
第四,金融市场的微观模型,主要包括基本面投资者和噪声交易者博弈、逾渗模型、伊辛模型、少数者博弈模型等,以及由此而衍生出来的各种模型。通过对微观模型的模拟研究,可以深入了解金融市场的微观结构和价格形成机制。

社会心理学

社会心理学社会心理学是研究个体和群体的社会心理现象的心理学分支。个体社会心理现象指受他人和群体制约的个人的思想、感情和行为,如人际知觉、人际吸引、社会促进和社会抑制、顺从等。群体社会心理现象指群体本身特有的心理特征,如群体凝聚力、社会心理气氛、群体决策等。

社会心理学是心理学和社会学之间的一门边缘学科,受到来自两个学科的影响。在社会心理学内部一开始就存在着两种理论观点不同的研究方向,即所谓社会学方向的社会心理学和心理学方向的社会心理学。在解释社会心理现象上的不同理论观点,并不妨碍社会心理学作为一门独立学科应具备的基本特点。

一般来说,普通心理学研究主体与客体之间的一般关系 ,客体包括自然客体与社会客体。社会心理学则主要研究主体与社会客体之间的特殊关系,即人与人、人与群体之间的关系;普通心理学的规律可以应用于社会心理学,社会心理学研究主体与社会客体之间的关系所获的规律 ,也可以丰富普通心理学;普通心理学传统上着重于研究个体、个人与物之间的关系,而社会心理学则着重于研究群体中的个体、群体、人与人、人与群体的关系。

社会心理学与个性心理学的关系更加密切、更加复杂。美国心理学会迄今仍把个性与社会心理学放在一个分支里。一般说来个性心理学是研究个性特质形成和发展的规律,涉及自然和教化的关系、涉及较稳定的心理特质,而社会心理学则主要研究直接社会情境对个人的影响以及个人对这个情境的解释的作用。社会心理学的一个重要发现表明,直接社会情境的作用往往被低估了。

社会心理学的专题研究,开始于19世纪下半期。1860年出现了拉察鲁斯和斯坦塔尔关于民族心理学的系列论文 ;此后,塔尔德的《模仿律》西格尔的《犯罪的群众》、勒邦的《群众心理学》等著作陆续出版,为社会心理学的形成奠定了基础;1908年,英国心理学家麦独孤和美国社会学家罗斯分别出版了社会心理学专著 ,这标志着社会心理学已成为一门独立的学科。

第一次世界大战以后,美国心理学家奥尔波特和德国心理学家默德开创了实验社会心理学方向。虽然用实验方法研究社会心理学问题,可以上溯到1898年特里普利特关于社会促进的实验研究,但真正开创、推广这个方向的是奥尔波特和默德。在他们之后,实验社会心理学才开始在西方特别是在美国成了社会心理学研究的主流。

奥尔波特的著作《社会心理学》问世以后,社会心理学进入一个快速发展时期。1928年 ,瑟斯顿提出了态度测量法,把由托马斯和兹纳涅茨基开始,并成为当时社会心理学研究中心的态度研究,提高了一步;1934年,莫雷诺提出了社会测量法,用以测量群体内人际吸引和排斥问题 ;1938年,勒温把场论引进社会心理学,提出了个人生活空间或场的概念,认为行为是个人特点和情境因素相互作用的函数。20世纪40~50年代,在第二次世界大战和勒温的影响下,社会心理学主要研究群体影响和态度问题。

50年代,阿施等人开展顺从的研究。以霍夫兰为首的耶鲁学派发表了一系列有关说服的研究。费斯廷格提出了认知失调理论,这个理论成为60年代的研究中心。到了70年代,由海德的《人际关系心理学》一书奠定了基础的归因理论成了研究重点。80年代以来,认知社会心理学和应用社会心理学日益受到重视。

社会心理学研究的主要课题随着时代的演变而有所不同。早期的社会心理学侧重于研究大型群体和群众的心理现象,如拉察鲁斯、斯坦塔尔、冯特关于民族心理学的研究;塔尔德、西格尔和勒邦关于群众心理的研究。这些研究者所提出的某些思想直至今天还有影响,如塔尔德的模仿律、勒邦的群体极端化和个性消失的思想等。

20世纪初,态度的研究成为中心。实验社会心理学出现以后,社会促进的研究成为中心。以后,群体过程、说服、顺从、认知失调、归因等分别成为某一时期的研究中心。

美国是研究社会心理学最多且最有影响的国家,它的研究课题具有一定的代表性,往往影响到其他国家。

随着社会心理学的日益发展,研究课题也日益丰富和扩大。从早期的社会促进研究 ,发展到社会惰化的研究;从顺从的研究,发展到反顺从和独立性的研究;从侵犯的研究,发展到利他精神的研究;从吸引的研究,发展到爱情的研究;从人际知觉的研究 ,发展到归因的研究等等。显示了社会心理学的研究视野正日益广阔和深入。

自 二十世纪60年代中期以来,社会心理学家的观点有所改变。主要表现在:认识到实验方法的局限性,重视现场研究,重视应用研究,重视以现场应用研究去检验实验室研究所得的理论,加以修正、补充和发展。

今天的社会心理学家强调从现场研究到实验室研究,或从实验室研究到现场研究,往复循环、相互论证。同时,计算机的广泛使用,也为处理从现场获得的大量材料提供了方便,推动了社会心理学的进步

社会心理学是研究个体和群体的社会心理现象的心理学分支。

个体社会心理现象指受他人和群体制约的个人思想、感情和行为,如人际知觉、人际吸引、顺从等;群体社会心理现象指群体本身特有的心理特征,如群体凝聚力、群体决策等。

社会心理学是心理学和社会学之间的一门边缘学科,受到来自两个学科的影响。

早期的社会心理学侧重于研究群体和群众的心理现象;二十世纪初,态度的研究成为中心;实验社会心理学出现以后,社会促进的研究成为中心;以后,群体过程、说服、顺从、认知失调、归因等分别成为某一时期的研究中心。

美国是研究社会心理学最多且最有影响的国家,它的研究课题往往影响到其他国家。

星期四, 八月 23, 2007

ruby lesson2

File.open("s1.txt") do |filed|
while lined = filed.gets
fh = File.new("out.txt", "a") #是追加
if lined=~/^>/
fh.puts lined
else
require 'watir'
include Watir

ie = Watir::IE.new
ie.goto("http://www.imtech.res.in/raghava/eslpred/submit.html")
ie.text_field(:name, "seq").set(lined)
ie.button(:value, "Submit sequence").click

aFile = File.new("lei.htm" , "w")
aFile << ie.html
aFile.close
ie.close
#2
File.open("lei.htm") do |file|
while line = file.gets
if line=~/Reliability Index|Expected Accuracy/

line=line.gsub(/
  • |\ \;|<\/B><\/LI><\/UL><\/FONT><\/TD><\/TR>|<\/B>/,'')
    fh.puts line

    end
    end
    end
    end
    end
    end
  • 星期三, 八月 22, 2007

    MYSQL远程连接问题

    MYSQL远程连接问题
    GRANT ALL PRIVILEGES ON *.* TO 用户名@"%" IDENTIFIED BY '密码' WITH GRANT OPTION;

    %表示所有。也可以限制成:10.10.10.10 (IP)

    星期一, 八月 20, 2007

    FireWatir,可以控制浏览器,包括输入东西超级简单,强大!支持linux, Mac machine,windows

    http://code.google.com/p/firewatir/downloads/list
    所有文件都在上面:
    Installation guide for FireWatir:
    1.Install JSSh XPI using following steps:
    firefox 插件,用firefox打开就可以了。
    2.gem install firewatir.gem


    命令:
    require 'firewatir'
    include FireWatir

    ff = Firefox.new
    ff.goto 'www.google.com'
    ff.text_field(:name, 'q').set('keyword')
    ff.button(:name, 'btnG').click

    语法:
    http://wtr.rubyforge.org/watir_user_guide.html

    星期日, 八月 19, 2007

    Text Mode Browser 文本浏览器大全ELinks offers the beginnings of Javascript support

    CURL --- 命令行浏览器CURL

    CURL --- 命令行浏览器

    CURL? 嗯,说来话长了~~~~

    这东西现在已经是苹果机上内置的命令行工具之一了,可见其魅力之一斑

    Lynx

    Ported to almost every current system under the sun and available on most general purpose SSH-accessible systems in the world, Lynx is a mature piece of software. As such, it has accumulated well over a hundred command-line options and obscure features. It still does the basics well, including SSL these days, and it is quick compared to any graphical browser.

    Lynx renders pages in color or monochrome, based on your preference. It can display pages in any of a few dozen character sets--Arabic, Hebrew and Japanese, to name a few--and can be integrated into any printing and storage regime. This is due to supporting user/administrator-defined commands on print and download requests. Lynx comes with extensive documentation, including a speech-friendly set of help files tailored for blind and visually handicapped users. Lynx also has a kiosk mode, so you can restrict the set of allowable actions and URLs.

    Lynx does have a few shortcomings, however. It downloads only one file at a time and does so in the foreground, so you cannot continue browsing while the download is underway. Lynx also does not render frames, and it lays out tables strangely. Finally, Javascript links will frustrate you every time you encounter them on less-accessible Web sites.
    Emacs/W3

    At the time of its release, Emacs/W3 was touted as yet another reason why a user would never have to leave Emacs. It can do UTF-8 as well as Emacs can, and it understands simple CSS. Emacs/W3 has suffered bit rot since 1999, and it is hard to get up and running these days. It does not understand XHTML, so modern pages have bits and pieces of code sticking out all over the place. Currently, Emacs/W3 needs quite a bit of rework and is not recommended for use.
    W3M

    W3M originally was intended to be a pager, like the less pager but with HTML support. The original author felt Lynx was big and slow and wanted a quick, light replacement. Thus, W3M came into being. Over time, W3M has grown, and nowadays it has a somewhat bigger memory image than Lynx does while viewing the same page.

    W3M was the first text browser to handle table rendering well, and it transforms frames to tables for convenient viewing. Coming from Japan, it has good support for exotic scripts and UTF-8. At first W3M was purely bilingual, offering good support for English and Japanese scripts, but improvements to support the broader world languages is ongoing. In addition, the browser offers the unexpected feature of being able to render images in-line on your xterm or framebuffer console. This feature is not really relevant to this comparison, but it is worth a mention. W3M also offers tabbed browsing.

    W3M's shortcomings are few. W3M does not do incremental rendering. Also, you cannot do anything else while W3M is loading a page, even if you have several tabs open.
    Links

    As the name suggests, Links was created as a Lynx replacement to offer saner table renderings and a smaller footprint. In these areas, Links has succeeded; Links 1.0.0pre12 has the smallest footprint of the tested browsers discussed here. On a side note, Links2 seems to be a mostly graphical fork and thus was not considered for this review.

    Links does offer saner table rendering than Lynx does; Links rendering is on par with W3M's. Development is frozen, so only bug fixes are being accepted. As a result, Links is both fast and stable. It can run downloads in the background, and it does incremental rendering. Like Lynx, Links has an anonymous/kiosk mode for use on public computers.

    As for drawbacks, Links does not support HTTP authentication. UTF-8 support is partial, and no support is offered for Chinese, Japanese or Korean languages (CJK), even when the page is UTF-8-encoded.
    ELinks

    ELinks started out as a feature patch set to Links. ELinks became a fork when it became clear that no further features would be accepted into Links. As such, it inherits Links' features and flaws and adds a few of its own.

    ELinks sports the most features of any text browser--good table rendering, background downloads, incremental rendering--all inherited from Links. Tabbed browsing has been added for convenience. Some CSS support is present, but little more than highlighting text seems to be honored; alignment and positioning mostly are ignored. Alone among text browsers, ELinks offers the beginnings of Javascript support as a standard feature, using Mozilla's SpiderMonkey Javascript engine. With this feature, finally some less-accessible pages can be used in text mode. ELinks' behaviour can be customized by way of Guile, Perl, Ruby and Lua scripts.

    As is typical with development forks, ELinks has a large footprint compared to all the other tested browsers. It also has the most visible bugs. Due to its Links inheritance, ELinks has no support for Chinese, Japanese and Korean languages and limited support for UTF-8.

    Table 1. Text Mode Browser Feature Comparison Lynx Emacs/W3 w3m Links ELinks
    Tables Y Y Y Y Y
    Frames N N Y Y Y
    SSL/TLS Y Y Y Y Y
    CSS N CSS1 N N Y
    Javascript N N N N Y
    UTF-8 Y Y Y N N


    Erik Inge Bolsø is a UNIX consultant and epee fencer who lives in Molde, Norway, and who has been running Linux since 1996. Another of his hobbies can be found by doing a Google search for "balrog genealogy", and he can be reached at ljcomment@tvilsom.org.

    CURL --- 命令行浏览器CURL

    CURL --- 命令行浏览器CURL

    CURL --- 命令行浏览器

    CURL? 嗯,说来话长了~~~~

    这东西现在已经是苹果机上内置的命令行工具之一了,可见其魅力之一斑

    1)
    二话不说,先从这里开始吧!

    curl http://www.yahoo.com

    回车之后,www.yahoo.com 的html就稀里哗啦地显示在屏幕上了~~~~~

    2)
    嗯,要想把读过来页面存下来,是不是要这样呢?
    curl http://www.yahoo.com > page.html

    当然可以,但不用这么麻烦的!
    用curl的内置option就好,存下http的结果,用这个option: -o
    curl -o page.html http://www.yahoo.com

    这样,你就可以看到屏幕上出现一个下载页面进度指示。等进展到100%,自然就OK咯

    3)
    什么什么?!访问不到?肯定是你的proxy没有设定了。
    使用curl的时候,用这个option可以指定http访问所使用的proxy服务器及其端口: -x
    curl -x 123.45.67.89:1080 -o page.html http://www.yahoo.com


    4)
    访问有些网站的时候比较讨厌,他使用cookie来记录session信息。
    像IE/NN这样的浏览器,当然可以轻易处理cookie信息,但我们的curl呢?.....
    我们来学习这个option: -D <-- 这个是把http的response里面的cookie信息存到一个特别的文件中去
    curl -x 123.45.67.89:1080 -o page.html -D cookie0001.txt http://www.yahoo.com

    这样,当页面被存到page.html的同时,cookie信息也被存到了cookie0001.txt里面了


    5)
    那么,下一次访问的时候,如何继续使用上次留下的cookie信息呢?要知道,很多网站都是靠监视你的cookie信息,
    来判断你是不是不按规矩访问他们的网站的。
    这次我们使用这个option来把上次的cookie信息追加到http request里面去: -b
    curl -x 123.45.67.89:1080 -o page1.html -D cookie0002.txt -b cookie0001.txt http://www.yahoo.com

    这样,我们就可以几乎模拟所有的IE操作,去访问网页了!


    6)
    稍微等等~~~~~我好像忘记什么了~~~~~
    对了!是浏览器信息~~~~

    有些讨厌的网站总要我们使用某些特定的浏览器去访问他们,有时候更过分的是,还要使用某些特定的版本~~~~
    NND,哪里有时间为了它去找这些怪异的浏览器呢!?

    好在curl给我们提供了一个有用的option,可以让我们随意指定自己这次访问所宣称的自己的浏览器信息: -A
    curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -o page.html -D cookie0001.txt http://www.yahoo.com

    这样,服务器端接到访问的要求,会认为你是一个运行在Windows 2000上的IE6.0,嘿嘿嘿,其实也许你用的是苹果机呢!

    而"Mozilla/4.73 [en] (X11; U; Linux 2.2; 15 i686"则可以告诉对方你是一台PC上跑着的Linux,用的是Netscape 4.73,呵呵呵


    7)
    另外一个服务器端常用的限制方法,就是检查http访问的referer。比如你先访问首页,再访问里面所指定的下载页,这第二次访问的referer地址就是第一次访问成功后的页面地址。这样,服务器端只要发现对下载页面某次访问的referer地址不 是首页的地址,就可以断定那是个盗连了~~~~~

    讨厌讨厌~~~我就是要盗连~~~~~!!
    幸好curl给我们提供了设定referer的option: -e
    curl -A "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)" -x 123.45.67.89:1080 -e "mail.yahoo.com" -o page.html -D cookie0001.txt http://www.yahoo.com

    这样,就可以骗对方的服务器,你是从mail.yahoo.com点击某个链接过来的了,呵呵呵


    8)
    写着写着发现漏掉什么重要的东西了!----- 利用curl 下载文件

    刚才讲过了,下载页面到一个文件里,可以使用 -o ,下载文件也是一样。
    比如, curl -o 1.jpg http://cgi2.tky.3web.ne.jp/~zzh/screen1.JPG
    这里教大家一个新的option: -O
    大写的O,这么用: curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen1.JPG
    这样,就可以按照服务器上的文件名,自动存在本地了!

    再来一个更好用的。
    如果screen1.JPG以外还有screen2.JPG、screen3.JPG、....、screen10.JPG需要下载,难不成还要让我们写一个script来完成这些操作?
    不干!
    在curl里面,这么写就可以了:
    curl -O http://cgi2.tky.3web.ne.jp/~zzh/screen[1-10].JPG

    呵呵呵,厉害吧?!~~~

    9)
    再来,我们继续讲解下载!
    curl -O http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG

    这样产生的下载,就是
    ~zzh/001.JPG
    ~zzh/002.JPG
    ...
    ~zzh/201.JPG
    ~nick/001.JPG
    ~nick/002.JPG
    ...
    ~nick/201.JPG

    够方便的了吧?哈哈哈

    咦?高兴得太早了。
    由于zzh/nick下的文件名都是001,002...,201,下载下来的文件重名,后面的把前面的文件都给覆盖掉了~~~

    没关系,我们还有更狠的!
    curl -o #2_#1.jpg http://cgi2.tky.3web.ne.jp/~{zzh,nick}/[001-201].JPG

    --这是.....自定义文件名的下载?
    --对头,呵呵!

    #1是变量,指的是{zzh,nick}这部分,第一次取值zzh,第二次取值nick
    #2代表的变量,则是第二段可变部分---[001-201],取值从001逐一加到201
    这样,自定义出来下载下来的文件名,就变成了这样:
    原来: ~zzh/001.JPG ---> 下载后: 001-zzh.JPG
    原来: ~nick/001.JPG ---> 下载后: 001-nick.JPG

    这样一来,就不怕文件重名啦,呵呵


    9)
    继续讲下载
    我们平时在windows平台上,flashget这样的工具可以帮我们分块并行下载,还可以断线续传。
    curl在这些方面也不输给谁,嘿嘿

    比如我们下载screen1.JPG中,突然掉线了,我们就可以这样开始续传
    curl -c -O http://cgi2.tky.3wb.ne.jp/~zzh/screen1.JPG

    当然,你不要拿个flashget下载了一半的文件来糊弄我~~~~别的下载软件的半截文件可不一定能用哦~~~

    分块下载,我们使用这个option就可以了: -r
    举例说明
    比如我们有一个http://cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 要下载(赵老师的电话朗诵 :D )
    我们就可以用这样的命令:
    curl -r 0-10240 -o "zhao.part1" http:/cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
    curl -r 10241-20480 -o "zhao.part1" http:/cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
    curl -r 20481-40960 -o "zhao.part1" http:/cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3 &\
    curl -r 40961- -o "zhao.part1" http:/cgi2.tky.3web.ne.jp/~zzh/zhao1.mp3

    这样就可以分块下载啦。
    不过你需要自己把这些破碎的文件合并起来
    如果你用UNIX或苹果,用 cat zhao.part* > zhao.mp3就可以
    如果用的是Windows,用copy /b 来解决吧,呵呵

    上面讲的都是http协议的下载,其实ftp也一样可以用。
    用法嘛,
    curl -u name:passwd ftp://ip:port/path/file
    或者大家熟悉的
    curl ftp://name:passwd@ip:port/path/file



    10)
    说完了下载,接下来自然该讲上传咯
    上传的option是 -T

    比如我们向ftp传一个文件: curl -T localfile -u name:passwd ftp://upload_site:port/path/

    当然,向http服务器上传文件也可以
    比如 curl -T localfile http://cgi2.tky.3web.ne.jp/~zzh/abc.cgi
    注意,这时候,使用的协议是HTTP的PUT method

    刚才说到PUT,嘿嘿,自然让老服想起来了其他几种methos还没讲呢!
    GET和POST都不能忘哦。

    http提交一个表单,比较常用的是POST模式和GET模式

    GET模式什么option都不用,只需要把变量写在url里面就可以了
    比如:
    curl http://www.yahoo.com/login.cgi?user=nickwolfe&password=12345

    而POST模式的option则是 -d

    比如,curl -d "user=nickwolfe&password=12345" http://www.yahoo.com/login.cgi
    就相当于向这个站点发出一次登陆申请~~~~~

    到底该用GET模式还是POST模式,要看对面服务器的程序设定。

    一点需要注意的是,POST模式下的文件上的文件上传,比如




    这样一个HTTP表单,我们要用curl进行模拟,就该是这样的语法:
    curl -F upload=@localfile -F nick=go http://cgi2.tky.3web.ne.jp/~zzh/up_file.cgi

    罗罗嗦嗦讲了这么多,其实curl还有很多很多技巧和用法
    比如 https的时候使用本地证书,就可以这样
    curl -E localcert.pem https://remote_server

    再比如,你还可以用curl通过dict协议去查字典~~~~~
    curl dict://dict.org/d:computer

    Ref :http://spaces.msn.com/members/j5/Blog/cns!1pZg82u3mPDMPEPUbr4uX_lQ!134.entry

    另外的介绍:http://www.cnblogs.com/abiao/articles/33170.html

    星期日, 八月 05, 2007

    ruby rails 开发环境搭建

    1.安装ruby,ruby -v
    ruby 1.8.6 (2007-03-13 patchlevel 0) [i386-mswin32]

    2.gem 安装rail: gem install rails --remote
    Bulk updating Gem source index for: http://gems.rubyforge.org
    Install required dependency activesupport? [Yn] y
    Install required dependency activerecord? [Yn] y
    Install required dependency actionpack? [Yn] y
    Install required dependency actionmailer? [Yn] y
    Install required dependency actionwebservice? [Yn] y
    Successfully installed rails-1.2.3
    ....

    3.MySQL Server and MySQL Clinet:
    MySQL:
    http://dev.mysql.com/downloads/mysql/5.0.html#downloads
    不需要选择,Congfigure the MySQL Sever now

    MySQl Clinet:
    http://dev.mysql.com/downloads/gui-tools/5.0.html

    星期一, 七月 30, 2007

    UltraEdit for ruby

    UltraEdit for ruby
    1.高级》工具栏配置》
    命令行:C:\ruby\bin\ruby.exe -w "%f"
    工作目录:%p
    菜单项名称:Ruby
    选取“输出到列表窗口” 和“捕捉输出” 单击“插入”再”确定“

    3.从此地址ftp://www.ultraedit.com/wf/ruby.txt下载ruby语法文件。

    4、修改UltraEdit根目录下的wordfile.txt文件,将上面下载过来的ruby.txt里的内容加裁到wordfile.txt末尾。

    5、修改wordfile.txt文件,查找HTML位置,将RHTML加到HTML位置的后面,就可以支持.rhtml高亮显示。

    OK,所有步骤已经全部完成,如果您也是RUBY爱好者不防也试试。

    星期二, 七月 24, 2007

    设置centos5 yum源

    1.修改/etc/yum.repos.d/CentOS-Base.repo为:

    [base]
    name=CentOS-5 - Base
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever5&arch=$basearch&
    repo=os
    #baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/os/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

    #released updates
    [update]
    name=CentOS-5 - Updates
    #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=updates
    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/updates/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

    #packages used/produced in the build but not released
    [addons]
    name=CentOS-5 - Addons
    #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=addons

    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/addons/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

    #additional packages that may be useful
    [extras]
    name=CentOS-5 - Extras
    #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=extras

    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/extras/$basearch/
    gpgcheck=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-5 - Plus
    #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=centosplus
    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/centosplus/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5

    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-5 - Contrib
    #mirrorlist=http://mirrorlist.centos.org/?release=4&arch=$basearch&repo=contrib
    baseurl=http://ftp.sjtu.edu.cn/centos/5.0/contrib/$basearch/
    gpgcheck=1
    enabled=0
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos5






    64位:
    rpm --import http://ftp.sjtu.edu.cn/centos/5.0/os/x86_64/RPM-GPG-KEY-CentOS-5

    32位:
    rpm --import http://ftp.sjtu.edu.cn/centos/5.0/os/i386/RPM-GPG-KEY-CentOS-5

    3.执行
    yum update


    第三方软件仓库,这里推荐的是 Dag Wieers 库(现在叫 RPMForge 了),安装方法如下:
    到安装库的网页http://dag.wieers.com/rpm/packages/rpmforge-release/,找到合适的软件包,事实上很简单,我们是centos5.0,由于是和红帽子企业版5.0同样的源编译出来的,那么要的就是rhel5.0的就可以,备选的就只有以下两个

    rpmforge-release-0.3.6-1.el5.rf.i386.rpm Fri 09 Mar 2007 16 kB Red Hat EL 5 - i386
    rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm Fri 09 Mar 2007 16 kB Red Hat EL 5 - x86_64


    我的是32位的系统,我就选择上面那个地址下载,如果是64位的,选下面那个,呵呵。

    [root@localhost src]# wget http://dag.wieers.com/rpm/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
    [root@localhost src]# rpm -ivh rpmforge-release-0.3.6-1.el5.rf.i386.rpm


    后面没有其他提示,那差不多好了。我们就可以安装我们的memcache相关的模块了.

    ubuntu 教育网源

    apt-get 的源(注意,请将dapper改为你所对应的版本):

    #传说中的中国科技大学 速度: 5M/s
    deb http://debian.ustc.edu.cn/ubuntu dapper main restricted universe multiverse
    deb http://debian.ustc.edu.cn/ubuntu dapper-security main restricted universe multiverse
    deb http://debian.ustc.edu.cn/ubuntu dapper-updates main restricted universe multiverse
    deb http://debian.ustc.edu.cn/ubuntu dapper-backports main restricted universe multiverse
    deb http://debian.ustc.edu.cn/ubuntu dapper-proposed main restricted universe multiverse

    #传说中的北京交大 速度 2M/s
    deb http://mirror.bjtu.edu.cn/ubuntu/ feisy main restricted universe multiverse
    deb http://mirror.bjtu.edu.cn/ubuntu/ dapper-updates main restricted universe multiverse
    deb http://mirror.bjtu.edu.cn/ubuntu/ dapper-security main restricted universe multiverse
    deb http://mirror.bjtu.edu.cn/ubuntu/ dapper-backports main restricted universe multiverse



    #传说中的上海交通大学
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-security main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ dapper-updates main multiverse restricted universe
    deb-src http://ftp.sjtu.edu.cn/ubuntu/ dapper main multiverse restricted universe
    deb-src http://ftp.sjtu.edu.cn/ubuntu/ dapper-backports main multiverse restricted universe
    deb-src http://ftp.sjtu.edu.cn/ubuntu/ dapper-proposed main multiverse restricted universe
    deb-src http://ftp.sjtu.edu.cn/ubuntu/ dapper-security main multiverse restricted universe
    deb-src http://ftp.sjtu.edu.cn/ubuntu/ dapper-updates main multiverse restricted universe

    ##传说中的兰州大学
    deb http://mirror.lzu.edu.cn/ubuntu/ dapper main multiverse restricted universe
    deb http://mirror.lzu.edu.cn/ubuntu/ dapper-backports main multiverse restricted universe
    deb http://mirror.lzu.edu.cn/ubuntu/ dapper-proposed main multiverse restricted universe
    deb http://mirror.lzu.edu.cn/ubuntu/ dapper-security main multiverse restricted universe
    deb http://mirror.lzu.edu.cn/ubuntu/ dapper-updates main multiverse restricted universe
    deb http://mirror.lzu.edu.cn/ubuntu-cn/ dapper main multiverse restricted universe
    #清华大学的源
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu/ dapper main restricted universe multiverse
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu-cn/ dapper main restricted universe multiverse
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu/ dapper-proposed restricted universe multiverse
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu/ dapper-backports restricted universe multiverse
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu/ dapper-security main restricted universe multiverse
    deb ftp://ftp3.tsinghua.edu.cn/mirror/ubuntu/ubuntu/ dapper-updates main restricted universe multiverse

    星期日, 七月 22, 2007

    get_response

    require 'net/https'
    response = Net::HTTP.get_response('http://www.sina.com.cn','index.html')
    puts response.body

    ruby抱错了:
    c:/ruby/lib/ruby/1.8/net/http.rb:560:in `initialize': getaddrinfo: no address as
    sociated with hostname. (SocketError)
    from c:/ruby/lib/ruby/1.8/net/http.rb:560:in `open'
    from c:/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'
    from c:/ruby/lib/ruby/1.8/timeout.rb:48:in `timeout'
    from c:/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
    from c:/ruby/lib/ruby/1.8/net/http.rb:560:in `connect'
    from c:/ruby/lib/ruby/1.8/net/http.rb:553:in `do_start'
    from c:/ruby/lib/ruby/1.8/net/http.rb:542:in `start'
    from c:/ruby/lib/ruby/1.8/net/http.rb:374:in `get_response'
    from D:/my ruby/get.rb:3


    不需要http://否则会出错的!

    response = Net::HTTP.get_response('www.sina.com.cn','index.html')
    这样就可以了。

    星期三, 七月 11, 2007

    金边吊兰


    我种的金边吊兰,现在越冬成功,长出了株芽,希望能开出小白花。

    吊兰 百合科,多年生常绿草本植物。叶片呈宽线形,嫩绿色,着生于短茎上,具有肥大的圆柱状肉质根。总状花序长30-60厘米,弯曲下垂,小花白色;常在花茎上生出数丛由株芽形成的带根的小植株,十分有趣。它生长快,栽培容易,在较明亮的房间内可常年栽培欣赏。是悬吊或摆放在橱顶或花架上最适宜的种类之一。
    温度:喜温暖的环境,适应性强;越冬最低温度10℃左右。
    光线:喜明亮光线,忌夏季阳光直射,遮光50%左右,冬季不遮光。
    水分:常年喜盆土中有充足的水分,但有一定的抗干旱能力;忌盆中积水。
    空气湿度:在干旱季节和夏季高温时期,经常向植株周围及叶面喷水。
    换盆:根据需要,可于春季换盆。
    繁殖:将花茎上已生根的小植株取下盆栽;结合换盆进行分株繁殖

    这种有着灰白的叶子的植物喜欢生活在恒温环境中。 被放置在浴室、窗台或者搁架这些狭小的空间里的吊兰是非常引人注目的,它细长、优美的枝叶可以有效地吸收窗帘甚至卫生绵纸释放出的甲醛,并充分净化空气。吊兰自然下垂的枝叶非常美观,枝繁叶茂时,它还会偶尔微微转动。而且照顾它一点也不复杂。

    星期二, 七月 10, 2007

    RHEL4 yum 安装配置

    利用CentOS 的yum库升级RHEL AS4
    1.下载并安装yum-2.4.0-1.centos4.noarch.rpm文件,下载地址为:
    http://rpm.pbone.net/index.php3里面搜索

    yum有问题:
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:

    /usr/lib/python2.3/site-packages/cElementTree.so: cannot open shared object file: No such file or directory

    Please install a package which provides this module, or
    verify that the module is installed correctly.

    cElementTree.so cannot open shared !!!
    所以我们找另一个具有cElementTree.so的文件,在http://rpmfind.net/linux/rpm2html/search.php?query=cElementTree.so
    中发现这个
    smart-0.50-45.el4.at.x86_64.rpm也具有cElementTree.so文件.
    把这个装上后,果然可以yum了!

    2.修改或建立/etc/yum.repos.d/CentOS-Base.repo为如下内容:


    清华大学的centos源
    [base]
    name=CentOS-$releasever - Base
    baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/centos/4.5/os/$basearch/
    gpgcheck=1

    #released updates
    [update]
    name=CentOS-$releasever - Updates
    baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/centos/4.5/updates/$basearch/
    gpgcheck=1

    #packages used/produced in the build but not released
    [addons]
    name=CentOS-$releasever - Addons
    baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/centos/4.5/addons/$basearch/
    gpgcheck=1

    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras
    baseurl=ftp://ftp3.tsinghua.edu.cn/mirror/centos/4.5/extras/$basearch/
    gpgcheck=1

    3.修改或建立/etc/yum.repos.d/dag.repo为如下内容:
    [dag]
    name=Dag RPM Repository for RHEL4
    baseurl=http://ftp.riken.jp/Linux/dag/redhat/el4/en/$basearch/dag/
    enabled=1
    gpgcheck=1
    gpgkey=http://ftp.riken.jp/Linux/dag/packages/RPM-GPG-KEY.dag.txt

    4.导入key
    rpm --import RPM-GPG-KEY-CentOS-4.txt(自己找找)

    5.运行update:
    yum update

    6.升级:
    yum upgrade

    7.安装其它软件,例如:
    yum install mplayer

    星期日, 四月 22, 2007

    Ubuntu 7.04 notebook ALC883 fanlly have sound

    notebook ALC883 fanlly have sound!!!!!!!!!!!!!
    修改源并更新升级到Ubuntu feisty(下面的源也是feisty正常使用的源)
      不同的网络状况连接以下源的速度不同,所以cn99并不一定是最快的源。建议在添加前手动验证以下源的连接速度(ping下就行),比如说北京网通用户连接cn99就非常慢,选择最快的源可大大节省下载时间,请根据自己网络环境设置更新服务器,以达到最快的速度。(经试验,执行下文中需要的apt-get命令或使用《新立得软件包管理器》时,必须更改了默认的更新服务器才可以使用,否则可能找不到很多安装包,或者安装包版本低。)
      注意,你可以同时加入几个源。或者将官方的源(也就是下面的Archive.ubuntu.com的条目)直接加在文件的最后,以避免出现 404 Not Found 文件未发现的错误。建议电信用户使用cn99和台湾大学的源,建议网通用户使用台湾大学的源。

    sudo gedit /etc/apt/sources.list

    # Ubuntu.cn99.com 更新服务器(江苏省常州市电信,推荐电信用户使用。)
    deb http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ feisty-proposed main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
    deb-src http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
    deb-src http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
    deb-src http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
    deb-src http://ubuntu.cn99.com/ubuntu/ feisty-proposed main restricted universe multiverse
    deb-src http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
    deb http://ubuntu.cn99.com/ubuntu-cn/ edgy main restricted universe multiverse
    #(注意ubuntu-cn源没有feisty,直接使用edgy就可以)

    # mirror.rootguide.org 更新服务器 (上海市 电信):
    deb http://mirror.rootguide.org/ubuntu/ edgy main restricted universe multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ edgy main restricted universe multiverse
    deb http://mirror.rootguide.org/ubuntu/ edgy-updates main restricted universe multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ edgy-updates main restricted universe multiverse
    deb http://mirror.rootguide.org/ubuntu/ edgy-backports main restricted universe multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ edgy-backports main restricted universe multiverse
    deb http://mirror.rootguide.org/ubuntu/ edgy-security main restricted universe multiverse
    deb-src http://mirror.rootguide.org/ubuntu/ edgy-security main restricted universe multiverse
    deb http://mirror.rootguide.org/ubuntu/ edgy-proposed main multiverse restricted universe
    deb-src http://mirror.rootguide.org/ubuntu/ edgy-proposed main restricted universe multiverse
    deb http://mirror.rootguide.org/ubuntu-cn/ edgy main multiverse restricted universe

    #Mirror.vmmatrix.net 更新服务器(上海市电信,推荐电信网通用户使用)
    deb http://mirror.vmmatrix.net/ubuntu/ feisty main restricted universe multiverse
    deb-src http://mirror.vmmatrix.net/ubuntu/ feisty main restricted universe multiverse
    deb http://mirror.vmmatrix.net/ubuntu/ feisty-updates main restricted universe multiverse
    deb-src http://mirror.vmmatrix.net/ubuntu/ feisty-updates main restricted universe multiverse
    deb http://mirror.vmmatrix.net/ubuntu/ feisty-backports main restricted universe multiverse
    deb-src http://mirror.vmmatrix.net/ubuntu/ feisty-backports main restricted universe multiverse
    deb http://mirror.vmmatrix.net/ubuntu/ feisty-security main restricted universe multiverse
    deb-src http://mirror.vmmatrix.net/ubuntu/ feisty-security main restricted universe multiverse
    deb http://ftp.sjtu.edu.cn/ubuntu-cn/ feisty main multiverse restricted universe

    # Mirror.lupaworld.com 更新服务器(浙江省杭州市电信,亚洲地区官方更新服务器)
    deb http://cn.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu feisty-security main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu feisty-updates main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
    deb http://cn.archive.ubuntu.com/ubuntu feisty-proposed main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu feisty main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu feisty-security main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu feisty-updates main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu feisty-backports main restricted universe multiverse
    deb-src http://cn.archive.ubuntu.com/ubuntu feisty-proposed main restricted universe multiverse
    deb http://mirror.lupaworld.com/ubuntu/ubuntu-cn edgy main restricted universe multiverse

    # ubuntu.cnsite.org 更新服务器(福建省福州市 电信)
    deb http://ubuntu.cnsite.org/ubuntu/ feisty main restricted universe multiverse
    deb-src http://ubuntu.cnsite.org/ubuntu/ feisty main restricted universe multiverse
    deb http://ubuntu.cnsite.org/ubuntu/ feisty-updates main restricted universe multiverse
    deb-src http://ubuntu.cnsite.org/ubuntu/ feisty-updates main restricted universe multiverse
    deb http://ubuntu.cnsite.org/ubuntu/ feisty-backports main restricted universe multiverse
    deb-src http://ubuntu.cnsite.org/ubuntu/ feisty-backports main restricted universe multiverse
    deb http://ubuntu.cnsite.org/ubuntu/ feisty-security main restricted universe multiverse
    deb-src http://ubuntu.cnsite.org/ubuntu/ feisty-security main restricted universe multiverse
    deb http://ubuntu.cnsite.org/ubuntu/ feisty-proposed main multiverse restricted universe
    deb-src http://ubuntu.cnsite.org/ubuntu/ feisty-proposed main restricted universe multiverse
    deb http://ubuntu.cnsite.org/ubuntu-cn/ edgy main multiverse restricted universe

    # 北京市清华大学 更新服务器(教育网,推荐校园网和网通用户使用)
    deb http://mirror9.net9.org/ubuntu/ feisty main multiverse restricted universe
    deb http://mirror9.net9.org/ubuntu/ feisty-backports main multiverse restricted universe
    deb http://mirror9.net9.org/ubuntu/ feisty-proposed main multiverse restricted universe
    deb http://mirror9.net9.org/ubuntu/ feisty-security main multiverse restricted universe
    deb http://mirror9.net9.org/ubuntu/ feisty-updates main multiverse restricted universe
    deb-src http://mirror9.net9.org/ubuntu/ feisty main multiverse restricted universe
    deb-src http://mirror9.net9.org/ubuntu/ feisty-backports main multiverse restricted universe
    deb-src http://mirror9.net9.org/ubuntu/ feisty-proposed main multiverse restricted universe
    deb-src http://mirror9.net9.org/ubuntu/ feisty-security main multiverse restricted universe
    deb-src http://mirror9.net9.org/ubuntu/ feisty-updates main multiverse restricted universe
    deb http://mirror9.net9.org/ubuntu-cn/ edgy main multiverse restricted universe

    #北京市清华大学 更新服务器(教育网,推荐校园网和网通用户使用):
    deb http://mirror.net9.org/ubuntu/ feisty main multiverse restricted universe
    deb http://mirror.net9.org/ubuntu/ feisty-backports main multiverse restricted universe
    deb http://mirror.net9.org/ubuntu/ feisty-proposed main multiverse restricted universe
    deb http://mirror.net9.org/ubuntu/ feisty-security main multiverse restricted universe
    deb http://mirror.net9.org/ubuntu/ feisty-updates main multiverse restricted universe
    deb http://mirror.net9.org/ubuntu-cn/ feisty main multiverse restricted universe

    #教育网用户请使用上海交通大学的源(教育网,推荐校园网和网通用户使用)
    deb http://ftp.sjtu.edu.cn/ubuntu/ feisty main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-security main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-updates main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-backports main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu/ feisty-proposed main multiverse restricted universe
    deb http://ftp.sjtu.edu.cn/ubuntu-cn/ feisty main multiverse restricted universe bleeding

    保存编辑好的文件,执行以下命令更新:

    sudo apt-get update
    sudo apt-get dist-upgrade

    安装ntfs-3g
      Ubuntu feisty源里已经有了ntfs-3g,可以直接安装
    sudo apt-get install ntfs-config

      找到 应用程序→系统工具→ntfs configuration tool并打开,输入密码。把第两个钩钩上。如果进入系统无法自动挂载,那么在终端输入sudo mount -a 即可。

    安装RAR压缩/解压缩程序
      安装
    程序代码 程序代码

    sudo apt-get install rar unrar

      建立软链接
    程序代码 程序代码

    sudo ln -fs /usr/bin/rar /usr/bin/unrar

      这样,以后只要在命令行输入unrar,就可以解压或者压缩文件了,安装完成后,归档管理器也同时集成了rar组件。

    安装gstreamer的解码器和安装xine及解码器
      gstreamer是gnome主推的多媒体平台。xine是另外一个多媒体平台,功能非常强大。把系统自带的totem卸载(在新立得里搜索totem,把找到的全删掉),改为使用xine后端的totem,这样就可以播放rmvb等视频了。
    程序代码 程序代码

    sudo apt-get install gstreamer0.10-pitfdll gstreamer0.10-ffmpeg gstreamer0.10-plugins-bad gstreamer0.10-plugins-bad-multiverse gstreamer0.10-plugins-ugly gstreamer0.10-plugins-ugly-multiverse
    sudo apt-get install libxine-extracodecs totem-xine ffmpeg lame faad sox mjpegtools libxine-main1 w32codecs

      这时totem可能无法播放wmv,rmvb等格式。打开一次totem(让totem自己建立默认配置文件),再改一下配置文件
    程序代码 程序代码

    gedit ~/.xine/config

      添加
    引用内容 引用内容

    decoder.external.win32_codecs_path:/usr/lib/win32

      xine播放rmvb没有声音的话,试试编辑~/.xine/catalog.cache文件,找到 [/usr/lib/xine/plugins/1.1.4/xineplug_decode_real_audio.so],把 decoder_priority增加到10。

      安装beep-media-player并播放wma
    程序代码 程序代码

    sudo apt-get install beep-media-player bmp-wma

      Beep Media Player会出现歌名乱码现象,可在"Beep Media Player"上面右键→首选项→播放列表中,把标题格式改为“自定”,再把自定格式改为设为“GBK”就行了。
      还有就是混音问题:在首选项→插件→输出中,默认是“OSS输出插件”。用它当你想同时使用多个声音时,常收到“音频占用”的提示,最好改为 “eSound输出插件”。当然,里面还有一个“ALSA0.9.7”,有人说也可用它,可我用时,Beep Media Player的播放会突然停止,无声音。

      安装浏览器的Flash支持(仅x86)
    程序代码 程序代码

    sudo apt-get install flashplugin-nonfree


      安装设置XGL+Beryl
      ATI显卡的fglrx驱动不支持aigxl,而支持aigxl的开源radeon驱动则不支持很多显卡,且没有blur,水波等特效,所以选择安装fglrx驱动+XGL+Beryl。
      feisty的源里提供了0.2.1版本的Beryl,但Beryl官方源提供的稳定版本却是0.2.0,0.2.1至少在我的机器上无法使用,建议想用Beryl的还是安装Beryl官方的0.2.0版本。

      安装XGL
    程序代码 程序代码

    sudo apt-get install xserver-xgl

      在登录对话界面加入xgl选框
    程序代码 程序代码

    sudo gedit /usr/local/bin/startxgl.sh

      内容如下:
    引用内容 引用内容

    #!/bin/sh
    Xgl -fullscreen :1 -ac -br -accel glx:pbuffer -accel xv:pbuffer &
    sleep 4
    export DISPLAY=:1
    cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
    xauth -i add :1 . "$cookie"
    exec gnome-session

      如果出现问题的话,尝试
    引用内容 引用内容

    #!/bin/sh
    Xgl :1 -fullscreen -ac -br -accel glx:pbuffer -accel xv:pbuffer &
    sleep 4
    export DISPLAY=:1
    cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
    xauth -i add :1 . "$cookie"
    exec gnome-session

      然后
    程序代码 程序代码

    sudo chmod a+x /usr/local/bin/startxgl.sh

      注:如果使用以上脚本导致你的字体或鼠标配置不能正常载入,那么用"exec /etc/X11/Xsession"代替上面的"exec gnome-session"。
      然后
    程序代码 程序代码

    sudo gedit /usr/share/xsessions/xgl.desktop

      内容:
    引用内容 引用内容

    [Desktop Entry]
    Encoding=UTF-8
    Name=Xgl
    Exec=/usr/local/bin/startxgl.sh
    Icon=
    Type=Application

      重启,在选择会话选框里面就会出现xgl选项了。

      安装Beryl
      加入密钥
    程序代码 程序代码

    wget http://ubuntu.beryl-project.org/root@lupine.me.uk.gpg -O- | sudo apt-key add -

      添加beryl源
    程序代码 程序代码

    sudo gedit /etc/apt/sources.list

      然后加入
    引用内容 引用内容

    deb http://ubuntu.beryl-project.org feisty main
    deb-src http://ubuntu.beryl-project.org feisty main

      需要安装0.2.0的请把其他所有源都加#号注释掉。
    程序代码 程序代码

    sudo apt-get update
    sudo apt-get install beryl emerald emerald-themes

      然后到新立得里搜索"beryl",把能找到的已经安装的软件包锁定版本,防止以后被自动升级成0.2.1。(愿意安装0.2.1的不需要这个步骤。)
      编写脚本,当xgl已经启动的时候beryl启动,否则不启动。
    程序代码 程序代码

    sudo gedit /usr/local/bin/start_beryl.sh

      内容:
    引用内容 引用内容

    #!/bin/bash
    #
    # Start beryl-manager within gnome-session
    #
    if [ `ps -A -o comm | grep -c '^Xgl$'` == "1" ]; then
    DISPLAY=:1 beryl-manager
    DISPLAY=:1 beryl-xgl
    else echo "${0}: Error: beryl-manager not launched. Xgl not running?"
    fi

      赋予权限
    程序代码 程序代码

    sudo chmod a+x /usr/local/bin/start_beryl.sh

      系统→首选项→会话→启动程序 添加 /usr/local/bin/start_beryl.sh
      OK,重启。
      让Emerald装饰器与Gnome的主题合作,通过Gnome的主题更换图标:在“首选项→会话”中,加入gnome-settings-daemon。

      解决Evince中文显示不正常
      安装xpdf-chinese-simplified。

      更换Gnome的飞溅屏幕
      配置编辑器→apps→gnome session→options→splash_image,这里图片的路径是以/usr/share/pixmaps/打头的,只要输入后面的部分就行了。
      更换grub的背景
      在/boot/grub/menu.lst里加入
    引用内容 引用内容

    # Splash file info
    splashimage (hd0,5)/grub/splashimages/blubuntu.xpm.gz

      (hd0,5)/grub/splashimages/blubuntu.xpm.gz是图片的路径。

      硬盘提速(IDE硬盘,SATA硬盘我没试验,主要我没有)
      先测试硬盘当前速度:
    程序代码 程序代码

    sudo hdparm -tT /dev/hda

      得到结果如下:
    引用内容 引用内容

    /dev/hda:
    Timing cached reads: 696 MB in 2.00 seconds = 347.79 MB/sec
    Timing buffered disk reads: 48 MB in 3.05 seconds = 15.75 MB/sec

      再测试硬盘参数:
    程序代码 程序代码

    sudo hdparm -i /dev/hda

      得到结果如下:
    引用内容 引用内容

    /dev/hda:

    Model=TOSHIBA MK4025GAS, FwRev=KA101A, SerialNo=95MT5035S
    Config={ Fixed }
    RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=48
    BuffType=unknown, BuffSize=0kB, MaxMultSect=16, MultSect=off
    CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=78140160
    IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
    PIO modes: pio0 pio1 pio2 pio3 pio4
    DMA modes: sdma0 sdma1 sdma2 mdma0 mdma1 mdma2
    UDMA modes: udma0 udma1 udma2 udma3 udma4 *udma5 udma3 udma4 *udma5
    AdvancedPM=yes: unknown setting WriteCache=enabled
    Drive conforms to: Unspecified: ATA/ATAPI-1 ATA/ATAPI-2 ATA/ATAPI-3 ATA/ATAPI-4 ATA/ATAPI-5 ATA/ATAPI-6

    * signifies the current active mode

      查看当前硬盘模式:
    程序代码 程序代码

    sudo hdparm /dev/hda

      得到结果如下:
    引用内容 引用内容

    /dev/hda:
    multcount = 0 (off)
    IO_support = 0 (default 16-bit)
    unmaskirq = 0 (off)
    using_dma = 1 (on)
    keepsettings = 0 (off)
    readonly = 0 (off)
    readahead = 256 (on)
    geometry = 65535/16/63, sectors = 78140160, start = 0

      OFF代表此参数不起作用,ON表示打开此功能或模式。上面的参数列表写的非常清楚,Multcount(多扇区读)没有打开;此硬盘格式为16位格式;DMA数据传输模式打开。很显然,这样的参数并没有使硬盘达到最佳的优化,没有能完全发挥当今高速IDE硬盘的性能。
      设置参数:
    程序代码 程序代码

    sudo hdparm -X69 -d1 -u1 -m16 -c3 /dev/hda

    引用内容 引用内容

    说明:
    -i 这个参数 提供一些信息是由系统的驱动程序判断出硬盘的性能而得出的
    它不一定准确,但是能为我们提供一点帮助。
    -c 设定 32-bit 存取模式。这个 32-bit 存取模式指的是在硬件于pc界面
    之间的传输模式,而影碟本是依照 16-bit 在运转
    -d 设定是否启用DMA模式 -d1 启动 -d0 关闭
    -m 设定同步读取多个 sector 的模式。一般来说,设定此模式,可降低因为
    读取磁碟而损失的效能,16/32为最佳化,具体数字请根据 -i 得出的 信息中MaxM
    ultSect来设定。
    -X 设定 UtraDMA 的模式。一般来说,UDMA 的模式值加64就可以了。但是现
    在的电脑普遍性能强劲,在这里请参考自己的电脑配置。
    33 MHz DMA mode 0~2 (X64~X66)
    66 MHz DMA mode 3~4 (X67~X68)
    100 MHz DMA mode 5 (X69)
    如果你的硬盘上面显示的UATA 100以上的,那么 X69 也许不错

      得到硬盘参数模式:
    引用内容 引用内容

    /dev/hda:
    setting 32-bit IO_support flag to 3
    setting multcount to 16
    setting unmaskirq to 1 (on)
    setting using_dma to 1 (on)
    setting xfermode to 69 (UltraDMA mode5)
    multcount = 16 (on)
    IO_support = 3 (32-bit w/sync)
    unmaskirq = 1 (on)
    using_dma = 1 (on)

      能打开都全部打开了(要根据自己的硬盘参数确定啊!!!)
      再来测试读写效果:
    程序代码 程序代码

    sudo hdparm -tT /dev/hda

      得到效果:
    引用内容 引用内容
    /dev/hda:
    Timing cached reads: 758 MB in 2.00 seconds = 379.12 MB/sec
    Timing buffered disk reads: 76 MB in 3.04 seconds = 25.02 MB/sec

      保存对参数的修改:
    程序代码 程序代码

    sudo hdparm -k1 /dev/hda


      GNOME环境下麦克风的调节
      默认状态下麦克风是被屏蔽的,在面板上有一个音量的喇叭图标,如果没有可在面板上点击右键,然后添加即可。双击该喇叭图标,将会弹出音量控制面板。点击 “编辑”菜单栏下的“首选项”,在弹出的窗口中点选“麦克风”和“麦克风截取”,还有“Mic Boost(+20db)”。点击关闭。如果音量控制面板中没有出现“线路输入”、“麦克风”,以及“录音”、“开关”标签,则关闭音量面板,然后重新打开。将“麦克风”的音量拖动到最大,然后点选“录音”标签,如果出现的面板中有红叉则点击取消。点击“开关”标签,选中“麦克风截取”、“Mic Boost(+20db)”,然后关闭音量控制面板即可。

    星期三, 三月 28, 2007

    Fedora Core 6 (FC6)下 WPA-PSK TKIP 加密上网。

    Fedora Core 6 (FC6)下 WPA-PSK TKIP 加密上网。

    NetworkManager provides automatic network detection and configuration for the system. Once enabled, the NetworkManager service also monitors the network interfaces, and may automatically switch to the best connection at any given time. Applications that include NetworkManager support may automatically switch between on-line and off-line modes when the system gains or loses network connectivity.

    These facilities are most useful for modern laptops, where the user may move between wireless networks, and plug in to a variety of wired networks, but NetworkManager also provides features that are relevant to workstations. Current versions of NetworkManager support modem connections, and certain types of VPN. Development of these features is ongoing.
    NetworkManager requires Fedora to have drivers for the wired and wireless interfaces on the computer. Many manufacturers of modems and wireless devices provide limited support for Linux. You may need to install additional drivers or firmware on your Fedora system in order to activate these interfaces.

    Intel Wireless Adapters

    To enable the wireless interfaces on Centrino laptops and other computers that use Intel PRO/Wireless adapters, copy the firmware files to /lib/firmware/ on your system. You may download these files from the IPW2200 Project Website: http://ipw2200.sourceforge.net/.

    Reboot your system after installing firmware files, to ensure that the adapter initializes correctly.
    See the http://fedoraproject.org/wiki/IPW2200 page for more information.



    The installation process for Fedora Core 6 automatically provides NetworkManager. To enable it, enter the following commands in a terminal window:

    1.

    Set the main service to automatically start on boot: su -c '/sbin/chkconfig --level 345 NetworkManager on'
    2.

    Set the dispatcher service to automatically start on boot: su -c '/sbin/chkconfig --level 345 NetworkManagerDispatcher on'
    3.

    Start the services: su -c '/sbin/service NetworkManager start ; /sbin/service NetworkManagerDispatcher start'

    For each su command, enter the root password at the prompt.
    The NetworkManager tray icon automatically appears on your desktop once the services are started. If the NetworkManager service is active, then the tray icon appears each time that you log in to your desktop.

    星期六, 三月 03, 2007

    2007年3月3日

    什么才是最有价值和最值得珍惜的在生命中?
    金钱,权利,美貌….?
    可是仔细想想这些却如此短暂!
    在你二十岁前你根本不会很去在意这些!
    20~30岁的时间你才开始去意识这些,并慢慢在意这些!
    你会得到你所想得到金钱,权力。。。在你的"不懈"努力下。
    但30几岁后大多数人能过着平淡的生活,那时其实也不用再刻意的在去追逐金钱,权利!
    平淡的生活中相貌也不重要了。
    总之所有的一切都是这短短十几年的事情,
    并在宝贵的生命中只占如此的短暂。
    也许人生只是只能参与一次的游戏,一定要用全部的心与灵魂去压出去,才爽。
    因为在这个由上帝与魔鬼制定的规则中,只有把自己的心赌上去,才有意义,决不让它锁在保险箱里腐朽,浪费!
    真切的体会生命,就算被现实蹂躏的也不要虚伪的腐烂。
    至少,I want to live, pure-hearted and free! Don't afraid anything!
    I believe:
    每个人都是个独立的个人,不论他在社会中处于什么角色,大家都是平等的!People are equal!
    我们在努力的学习,努力工作,努力争钱。。。并不是为了高人一等,也不能!是为了充实自身,实现自我的价值,追求自己的幸福!
    所以我们必须尊重彼此的想法和选择权利!
    人都是平等,这样才能互相尊重对方,才会有信任(现在社会最宝贵的东西),产生幸福感!
    -2007年3月3日

    星期六, 二月 24, 2007

    Tokyo love

    web blog

    http://biocona.blogspot.com/

    http://wanguan2000.blogspot.com/


    http://nacoo.blogspot.com/


    http://cona.bioon.cn

    Tokyo Love Stroy

    恋爱,只要是参加了就是有意义的,即使是没有结局~~当你喜欢上一个人的那一刹,是永远都不会消失的~~这都将会变成你生活的勇气,而且会变成你在黑暗中的一线曙光.

    不是常常有机会遇到可以爱他一生的人的,所以我很珍惜爱过你的一切回忆!爱过你的回忆,被你爱过的回忆,这些回忆都一直都珍藏在我心里唷~~

    你好,丸子。应该是晚上好了吧!趁你去买东西的时候,我写了这些话。就要跟你分别了,虽然有点儿令人难过~~ 但不管怎么样,能与你在相同的季节,相同的道路上走在一起,对我来说都是值得珍惜和怀念的。丸子,现在这个时刻最美,跟你离别的时候,能够这样和你在一起,我想我将来也一定能坚强的过下去的。遇到你是我人生的一大收获,不想说再见,也不想约定什么,因为我们一定还会再见面的。――赤名リカ
    PS:你好么?


    你知道嘛,一生中能爱上别人并不事一件简单的事。
    .......但也许很快就能喜欢上。
    ......喜欢过完治,因此觉得很珍惜。
    会想著......我喜欢你,你也喜欢我。
    (拍拍胸口)永远都活在这里。
    有时候会想明天有恋爱会是怎麽样的?
    ......可是不会想出会爱上什麽样的人。
    有过去的我,才会有现在的我。
    能对自己说......做得好......就是这样。


    没事的,笑一下吧。人生在世正所谓今日不知明日事,你有何必担心那么多啊。所以做人最紧要放开怀抱 !