Sunday, October 24, 2010

Daily Bookmarks 20101024

WWW::Mechanize && Google Group
http://fayland.org/journal/GoogleGroup.html

mechanize 教程
http://blog.hieee.com/2010/08/23/

python mechanize
 http://blog.cycu.org/?e=125

http://www.higherpass.com/Perl/Tutorials/Using-Www-mechanize/3/

http://funningboy.blogspot.com/2010_02_01_archive.html

Saturday, October 23, 2010

blog

fyblog
http://www.flyy.info/index.php

Saturday, October 16, 2010

Friday, October 15, 2010

Search by Hashing

Search by Hashing
intro.

參考來源:

"Some of the most common search algorithms are serial search, binary search and search by hashing. The tool for comparing the performance between the different algorithms is called run-time analysis. Here, we present search by hashing, and discuss the performance of this method. But first, we present a simple search method, the serial search and its run-time analysis."
- Search by Hashing (在「Google 網頁註解」中檢視)

Search by Hashing

Search by Hashing
intro.

參考來源:

"Search by Hashing"
- Search by Hashing (在「Google 網頁註解」中檢視)

Sunday, October 03, 2010

Run a command at boot with Gentoo

Normally in Gentoo you would want to create an init script via rc-update to start a service at boot. However if there are a few miscellaneous commands you would like to run you can add them to local.start.

The local.start init script is similar to rc.local in other distributions. It is the last init script to be run after all other services have been started at the end of the boot process.

Add your commands to local.start file located here.
/etc/conf.d/local.start

You can also make commands run when the system is shutdown. These commands should be placed in local.stop located here.
/etc/conf.d/local.stop

1 Comment
gentooShareThis

參考來源:

"Add your commands to local.start file located here. /etc/conf.d/local.start You can also make commands run when the system is shutdown. These commands should be placed in local.stop located here. /etc/conf.d/local.stop"
- Run a command at boot with Gentoo | WiredRevolution.com (在「Google 網頁註解」中檢視)

Gentoo init.d rc-update 寫法

Gentoo init.d rc-update 寫法
滿獨特方面的如果要再開機就載入某些程式的話可以用的方式

參考來源:

"注意到了嗎?因為我們沒有定義depend() 所以會有dependency warning,但是我們定義的start()就會有正確執行出來。 這種作法我個人認為是相當高度模組化的作法,不同於debian, redhat, mandrake,suse等其他Linux distribution甚至FreeBSD, 一般執行 rc script都是自己寫shell script,使用大量的case conditional來判斷自訂的start|stop|restart 行為,甚至FreeBSD還會判斷start|stop|restart的大小寫,增加rc script的複雜性以及撰寫與維護難度,gentoo這作法只要 follow他的runscript style來寫,"
- Gentoo Taiwan 討論區 • 檢視主題 - 想請問有關no-ip的開機自動執行辦法 (在「Google 網頁註解」中檢視)

Saturday, October 02, 2010

Daily Bookmarks 20101002

rsync - intro
http://www.ntu.beautifulworldco.com/weblog/?p=385

http://news.ols3.net/techdoc/old/rsync.htm

让Google Calendar显示在LINUX桌面
http://blog.netoearth.com/html/201008/%E8%AE%A9google-calendar%E6%98%BE%E7%A4%BA%E5%9C%A8linux%E6%A1%8C%E9%9D%A2.htm

Linux VNC 虛擬桌面
http://cha.homeip.net/blog/2010/09/2643.html

Quick reStructuredText

Quick reStructuredText

http://docutils.sourceforge.net/docs/user/rst/quickref.html
Being a cheat-sheet for reStructuredText
Updated $Date: 2009-07-14 10:05:34 -0400 (Tue, 14 Jul 2009) $

Copyright: This document has been placed in the public domain.

The full details of the markup may be found on the reStructuredText page. This document is just intended as a reminder.

參考來源:

"Quick reStructuredText http://docutils.sourceforge.net/docs/user/rst/quickref.html Being a cheat-sheet for reStructuredText Updated $Date: 2009-07-14 10:05:34 -0400 (Tue, 14 Jul 2009) $ Copyright: This document has been placed in the public domain. The full details of the markup may be found on the reStructuredText page. This document is just intended as a reminder."
- Quick reStructuredText (在「Google 網頁註解」中檢視)

Friday, October 01, 2010

Port Forwarding(SSH tunneling)

Port Forwarding(SSH tunneling)
張貼者: barkley 於 1/25/2010 01:09:00 上午 | 2010/01/25
透過 ssh and sshd 能夠轉移 TCP 通訊的傳輸
但是需要先瞭解難以理解且愚蠢的語法
-L clientport:host:hostport

參考來源: 熱血OB: Port Forwarding(SSH tunneling) (在「Google 網頁註解」中檢視)

Remote port forwarding - exposing an internal webserver

Example 4: Remote port forwarding - exposing an internal webserver

Remote port forwarding is sometimes useful for granting temporary access to services on clients which are otherwise unreachable (perhaps the client has an unreachable rfc1918 address behind a NAT or firewall). If the client is not configured to accept inbound SSH connections, this can be done with remote port forwarding on an outbound connection. (For OpenSSH, note that you may need to set "GatewayPorts yes" in "sshd_config" to achieve on the server what "ssh -g" would do on the client (allow any host to connect to the forwarded port).

Consider a PC which is running a webserver but is protected by firewall rules to accept no inbound connections (except from itself). Furthermore imagine this host has the unrouted private address 192.168.1.1 and can access the internet only outbound through a NAT. If you believe it is not too risky, you can briefly make that server publicly available with ssh port forwarding (such as while you're on the phone with someone) if you think the risk of serving sensitive data to a random hacker while it is publicly exposed is acceptably low and you can ssh from the PC to a host with a public address. To do so, you can establish an ssh connection such as this:

ssh -R4567:localhost:80 some-server
which will make it look like your PC's webserver is a server on "some-server" at port: 4567. Anyone who connects to:
http://some-server:4567/some/path
will get the same webpage you get on your PC when you connect to:
http://localhost:80/some/path

參考來源:

"ssh -R4567:localhost:80 some-server which will make it look like your PC's webserver is a server on "some-server" at port: 4567. Anyone who connects to: http://some-server:4567/some/path"
- NDC Logical Firewall - SSH Port Forwarding (在「Google 網頁註解」中檢視)

Promise Supertrak SX6000 Raid Card

Promise Supertrak SX6000 Raid Card
Q1.System 不要 Build 在 Array 內?

近來用一台 N 年前的高檔機器 HP LC2000 NetServer,其 CPU 為 P3-533 想說這機器放著也是放著,剛好拿來當 Backup Server 剛好,反正只裝 NFS Server 相信 P3-533 應該夠用了,安裝的 Raid Card 為 Promise SX6000,找到在 Google 上找到了一下些相關問題,順便就貼一下,主要是說 SX6000 所 Build 的 Array 最好是不要讓 System 也在內不然在系統 boot 時會出現不明的錯誤

參考來源:

"Q1.System 不要 Build 在 Array 內? 近來用一台 N 年前的高檔機器 HP LC2000 NetServer,其 CPU 為 P3-533 想說這機器放著也是放著,剛好拿來當 Backup Server 剛好,反正只裝 NFS Server 相信 P3-533 應該夠用了,安裝的 Raid Card 為 Promise SX6000,找到在 Google 上找到了一下些相關問題,順便就貼一下,主要是說 SX6000 所 Build 的 Array 最好是不要讓 System 也在內不然在系統 boot 時會出現不明的錯誤。"
- 不自量力 の Weithenn: Promise Supertrak SX6000 Raid Card (在「Google 網頁註解」中檢視)

CentOS 5.2+Raid 0+LVM+ISCSI配置详解

系统环境:CentOS 5.2

硬件配置:ASUS P5GC-MX +Intel E2160+Kinston 1GB 667*2+D-Link 530 1Gbps

硬盘1:Seagate 80GB/7200S/8MB/SATA

硬盘2:Seagate 1TB/7200S/32MB/SATA

硬盘3:Seagate 1TB/7200S/32MB/SATA

參考來源: CentOS 5.2+Raid 0+LVM+ISCSI配置详解 - LingPing的日志 - 网易博客 (在「Google 網頁註解」中檢視)

Thursday, September 30, 2010

vim 支援 utf-8 中文

經理解消化之後,在自己的 .vimrc 加入了以下的設定,令 vim/gvim 遇到中文檔時,懂得選擇正確的編碼。而在建立新檔時,也自動以 utf-8 編碼:

“Default encoding
set fileencodings=utf-8,big5,gbk,latin1
set fileencoding=utf-8

實驗証明,這已能滿足大部份所需,讀寫都不成問題。最後,有時要強迫改變檔案的編碼,所以再加入以下設定:

“Hot key to switch between Big5 and UTF-8
set =^U
set =^B
map :set fileencoding=utf-8
map :set fileencoding=big5

參考來源:

"經理解消化之後,在自己的 .vimrc 加入了以下的設定,令 vim/gvim 遇到中文檔時,懂得選擇正確的編碼。而在建立新檔時,也自動以 utf-8 編碼: “Default encoding set fileencodings=utf-8,big5,gbk,latin1 set fileencoding=utf-8 實驗証明,這已能滿足大部份所需,讀寫都不成問題。最後,有時要強迫改變檔案的編碼,所以再加入以下設定: “Hot key to switch between Big5 and UTF-8 set <C-u>=^U set <C-b>=^B map <C-u> :set fileencoding=utf-8<CR> map <C-b> :set fileencoding=big5<CR>"
- vim 支援 utf-8 中文 « 有涯小札 (在「Google 網頁註解」中檢視)

FreeBSD 的系統改為 UTF8

要將 FreeBSD 的系統改為 UTF8 只需修改下面這個檔案
#vi /etc/csh.cshrc

setenv LC_ALL zh_TW.UTF-8
setenv LANG zh_TW.UTF-8
setenv CLICOLOR
set color
setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx

改完後先登出後再登入輸入 locale 就可看到如下的系統預設語系已經不是 C
#locale
LANG=zh_TW.UTF-8
LC_CTYPE=”zh_TW.UTF-8″
LC_COLLATE=”zh_TW.UTF-8″
LC_TIME=”zh_TW.UTF-8″
LC_NUMERIC=”zh_TW.UTF-8″
LC_MONETARY=”zh_TW.UTF-8″
LC_MESSAGES=”zh_TW.UTF-8″
LC_ALL=zh_TW.UTF-8

參考來源:

"要將 FreeBSD 的系統改為 UTF8 只需修改下面這個檔案 #vi /etc/csh.cshrc setenv LC_ALL zh_TW.UTF-8 setenv LANG zh_TW.UTF-8 setenv CLICOLOR set color setenv LSCOLORS ExGxFxdxCxDxDxBxBxExEx 改完後先登出後再登入輸入 locale 就可看到如下的系統預設語系已經不是 C #locale LANG=zh_TW.UTF-8 LC_CTYPE=”zh_TW.UTF-8″ LC_COLLATE=”zh_TW.UTF-8″ LC_TIME=”zh_TW.UTF-8″ LC_NUMERIC=”zh_TW.UTF-8″ LC_MONETARY=”zh_TW.UTF-8″ LC_MESSAGES=”zh_TW.UTF-8″ LC_ALL=zh_TW.UTF-8"
- Bryan手札-生活記趣 » FreeBSD 系統 utf8 化 (在「Google 網頁註解」中檢視)

Wednesday, September 29, 2010

Git原始碼管理

文章範圍
安裝 和 設定 Git
Git 基本操作
長樹枝了(分叉成不同的版本)
Ruby on Rails 上使用
Git 維護
本文章的來源大部分是由 Git 官方網站裡的基本 和更先進一點的教學翻譯的, 然後加入了自己寫的範例。 Railscasts裡的資料也有參考到。 此文章的內容會談到 Git 基本管理, 維護, 還有資料分枝。 此文章不會談到架設自己的 Git 伺服器 或 push 跟 pull 等跟別人合作的方法。

參考來源:

"文章範圍 安裝 和 設定 Git Git 基本操作 長樹枝了(分叉成不同的版本) Ruby on Rails 上使用 Git 維護 本文章的來源大部分是由 Git 官方網站裡的基本 和更先進一點的教學翻譯的, 然後加入了自己寫的範例。 Railscasts裡的資料也有參考到。 此文章的內容會談到 Git 基本管理, 維護, 還有資料分枝。 此文章不會談到架設自己的 Git 伺服器 或 push 跟 pull 等跟別人合作的方法。"
- 國網中心 Web 2.0 技術推廣 » Blog Archive » Git 原始碼管理 (在「Google 網頁註解」中檢視)