Archive for 十一月, 2009

Howto: Google Wave reference implementation with ejabberd

11.06.2009 by star - 0 Comment
Posted in Tech Language

Refer to:  http://www.process-one.net/en/blogs/article/using_google_wave_reference_implementation_with_ejabberd/

Installation steps (#Bourne shell):

1. Erlang installation
Download the Erlang source from http://erlang.org/download.html
# tar zxvf otp_src_R13B02-1.tar.gz
# cd otp_src_R13B02-1
# LANG=C; export LANG
# ./configure
# make
# make install
# erl -version
Erlang (ASYNC_THREADS,HIPE) (BEAM) emulator version 5.7.3

2. Ejabberd installation
Download Ejabberd from http://www.process-one.net/en/ejabberd/downloads. I download “Linux x86 32-bits Installer”.

# gunzip ejabberd-2.0.5-linux-x86-installer.bin.gz
# chmod +x ejabberd-2.0.5-linux-x86-installer.bin
# ./ejabberd-2.0.5-linux-x86-installer.bin
# /opt/ejabberd-2.0.5/bin/ejabberdctl start
# /opt/ejabberd-2.0.5/bin/ejabberdctl status
Node ejabberd@localhost is started. Status: started
ejabberd is running

Document: ejabberd Installation and Operation Guide (HTML)
Open the Web Admin (http://server:port/admin/). Make sure to enter the full JID as username (in this example: admin1@example.org). The reason that you also need to enter the suffix, is because ejabberd’s virtual hosting support.

http://xxxx.xxx.xxx.xxx:5280/admin

admin@backupsrv/xxxxxx

3. Java 6 installation
Download JDK 6 from http://java.sun.com/javase/downloads/widget/jdk6.jsp. You should set up the environment variables “JAVA_HOME” & “CLASSPATH”.

4. Wave protocol installation
About HG usage, please refer to HG – Mercurial is a free, distributed source control management tool
Download Apache Ant from http://ant.apache.org/bindownload.cgi. For windows user, you should set up the environment variable “ANT_HOME”.

# hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol
# cd wave-protocol
# ant

5. Creating the certificates for Google Wave server
The process to create those self-signed certificates are described on Google Wave wiki: Certificates. You will get two files, e.g. test.crt and test.key .

6. Configuring ejabberd
To configure ejabberd, simply add a new listener service in the listen section of the configuration file:
{listen,
[
...
{8888, ejabberd_service, [{access, all}, {shaper_rule, fast},
{hosts, ["backupsrv"],
[{password, "secret"}]}
]}
]}.
You can then restart ejabberd. The port 8888 should now be open and ready to accept connections from the Google Wave server.

7. Starting the Google Wave server
# cd wave-protocol
# cat start.sh
java -jar dist/fedone-server-0.2.jar --client_frontend_hostname localhost --client_frontend_port 3456 --xmpp_component_name=wave --xmpp_server_hostname=backupsrv --xmpp_server_ip=127.0.0.1 --xmpp_server_port=8888 --xmpp_server_secret secret --xmpp_server_ping="" --certificate_domain backupsrv --certificate_private_key test.key --certificate_files test.cert --waveserver_disable_verification true --waveserver_disable_signer_verification true

Parameters modified:
–xmpp_server_hostname=backupsrv
–xmpp_server_port=8888
–xmpp_server_secret secret
–certificate_domain backupsrv
–certificate_files test.cert
–waveserver_disable_signer_verification true

HG – Mercurial is a free, distributed source control management tool

11.05.2009 by star - 0 Comment
Posted in Tech Tools

官网:http://mercurial.selenic.com/
Mercurial is a free, distributed source control management tool. It efficiently handles projects of any size and offers an easy and intuitive interface.

Basic install

$ make # see install targets
$ make install # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg # see help

Quick Start

Clone a project and create a patch

$ hg clone http://hg-scm.org/hello
$ cd hello
$ (edit files)
$ hg add (new files)
$ hg commit -m ‘My changes’
$ hg export tip > patch.diff

Create a project and commit

$ hg init (project-directory)
$ cd (project-directory)
$ (add some files)
$ hg add
$ hg commit -m ‘Initial commit’

FAQ

abort: couldn’t find mercurial libraries in [/usr/local/bin / /usr/lib/python25.zip /usr/lib/python2.5 /usr/lib/python2.5/plat-linux2 /usr/lib/python2.5/lib-tk /usr/lib/python2.5/lib-dynload /usr/lib/python2.5/site-packages /usr/lib/python2.5/site-packages/Numeric /usr/lib/python2.5/site-packages/gst-0.10 /usr/lib/python2.5/site-packages/gtk-2.0 /usr/lib/python2.5/site-packages/scim-0.1]
(check your install and PYTHONPATH)

A: You should set up the environment variable PYTHONPATH.

PYTHONPATH=/usr/local/lib/python2.5/site-packages
export PYTHONPATH

Example

http://www.process-one.net/en/blogs/article/using_google_wave_reference_implementation_with_ejabberd/

$> hg clone https://wave-protocol.googlecode.com/hg/ wave-protocol

一定记得要拔电源呀,省的都是米

11.04.2009 by star - 0 Comment
Posted in BLOG, My life

收藏:http://www.wretch.cc/blog/Uphoto/2977199

+ 耗電量 +

現在是電價高漲的時後!你知道你身邊有哪些東西很耗電嗎?沒拔插頭電也是在消耗嗎?

今天我來個例子讓大家知道身邊有什麼東西是最耗電的!!

首先要有個測試機吧!!(小小東西賣超貴真的買不下手)

看起來真的感覺沒那價值!!

我先來測試一下辦公室的電器設備!!
在我桌上有一台hp的事務機還有一台15吋lcd在來是一台很陽春的電腦主機(配備 賽陽2.0hz power是350w 一顆 80g的HD) ~~~都是共同在同一條延長線上~~

這張W數是電腦沒開機只有事務機開著的W數 11W

這張W數是電腦剛開機 109.8W

這張W數是電腦AND務機都關機但沒拔插頭的W數 4W

這張W數是電腦AND務機都開機進XP時的耗電量176W

第二場所~廚房用電量~廚房3寶   1.冰箱 2.大同電鍋 3.煮飯鍋

這張W數是冰箱單獨耗電量2W

這張W數是當我打開冰箱門的耗電量41W   (冰箱門不要常開呀)

2.大家熟悉的大同電鍋~~

這張W數是這張W數是電鍋關機但沒拔插頭的W數 36W 沒開機真的也會耗電(大同電鍋沒用真的要把插頭拔掉呀!!)

這張W數是電鍋起動的W數 792W (嚇死人!!)

第三是煮飯鍋保溫狀態

在來補個烤麵包機

這張W數是烤箱起動的W數 550W

以下就是在下我的耗電量!!
我只插上我的電腦主機測試這張照片是沒開機的W數 沒開機真的也會耗電

開機後的W數  190W  E8400  超頻4.5G 電壓1.4V     P35FR  4GRAM  3顆RAID0    顯卡8800GTS 320MB 這樣超頻也才190W 那我換620W幹麻!!!自找麻煩~~

我跑3DMARK06的W數

11476好像不是很理想的分數

跑SUPER PI 的分數 1M  11.890S 這算快嗎??我也不曉得!!!

165W是待機W數 193是我將檔案從C槽COPY到D槽 瓦數也差太大吧!!

這瓦數是完全沒超頻的W 待機中 149W 也不低!!

在來是我24HR都要開著的東西~~

-什麼要33W~~ 0.033W X24小時 X60天(電費2個月計算一次)X5.1(每一度電夏季電費)=243元 (2個月的費用)

單單LCD 要32W

以上我房間的電量算超貴!!
172W是這三台的W數(電腦主機未超頻)再加上LCD 32W =202w
0.202W X 10(每天開機10小時)X60(2個月)X 5.1(每度電)=619元
619元 +243元(防潮箱)=862元
超貴!!夏計電價我真的不能常開電腦跟超頻~~~以上不包含冷氣跟電燈!!!!!

1.不用的電器請將插頭拔除!!否則一樣會浪費電~  !!!!!!!!!!!大同電鍋一定要拔要插頭!!!!!!!!!!!!!!!

2.冰箱門不能常開會很耗電

3.晚上離開辦公室要關電腦

4.防潮箱也太耗電了!!

大家要節省電能  節省自己的荷包!!