2007年12月24日 星期一

男人本不壞,不是嗎?

除了他太刻意要湊出「你是好人」這個題材,似乎還滿中肯的。
我也到了裡面講二十六歲驚覺自己是好人的年紀,真可怕。
男人本不壞,不是嗎?

十歲以前,他什麼都不懂,就不說了。
十三、四歲的時候,開始對女孩有好感,但是那時候他離女孩遠遠的,並且以討厭女孩自居,生怕被同伴嘲笑。
十五歲的時候,聽到大人們說某某男人好花,把女朋友甩了,女孩自殺了。
他覺得這人真狠毒,自己將來一定要做個痴情的男人,一定要一生只愛一個人。
十六歲的時候,他喜歡上了一個女孩,但是他不敢和她說。
仍然和往常一樣,臟兮兮的在灰土飛揚的操場上踢球。
只在女孩走出校門的時候,躲在二層的窗戶上看她的背影,他覺得她一定是個天使。
十七歲的時候,有個女孩喜歡上了他,但是他離她很遠,心裡面只有自己那個女孩,他覺
得看別的女孩都是對她的不忠。
十八歲的時候,看了一個MTV,感動得想哭;
他想,如果自己的女孩失去了雙眼,他一定會像男主角會毫不猶豫的把自己的眼睛給她,
讓她能看到光明。
十九歲的時候,高考了。
終於和自己暗戀的女孩分別,坐火車去學校的時候,感覺自己離她越來越遠,心像被掏空了一樣。 還在想自己一定不會忘記她,等到自己成功以後一定要去找她。
二十歲的時候,聽到有人講黃色笑話,覺得這人真可恥。
二十一歲的時候,她的回信中告訴他,自己有了男朋友。
他為此偷偷的哭了一個晚上。
二十二歲的時候,他向一個女孩表白,女孩說:「你是個好人,可是我還小。」他想,我
的確是個好人,然後他說:「沒關係,我可以等妳。」
心想,我不會像那些花心的人一樣,三年五年我也能等。
二十三歲的時候,聽說自己還小的女孩跟一個帥哥戀愛了。
他很納悶,長大原來可以這樣快。
二十四歲的時候,
他又向一個女孩表白,女孩說:「你是個好人,可是我並不適合你。」
他納悶很久,我是好人,妳怎麼還不適合我呢?
二十五歲的時候,他又追求一個女孩,女孩接受了他。他開始很幸福的為未來拚搏,他想
,一時的開心只是暫時的,只有努力拚搏,他和她才能有快樂的未來,但是,半年以後,
女孩和他分手了,只是因為另外一個男孩會說讓她開心的話。
女孩說:「你是個好人,是我對不起你。」
至此,他似乎明白了問題所在--他是個好人!
二十六歲的時候,他開始墮落。打扮得時尚而酷,而且漸漸的學習著討好女孩的話。
不久,他有了個女朋友,雖然他對她也很好,可是,他心裡知道,自己並不愛。
二十七歲的時候,
他和女孩分手了。
他對女孩說:「妳是個好女孩,是我對不起妳。」
二十八歲的時候,他嘗試了一夜情,發現別人能做的,自己也一樣。
二十九歲的時候,他學會了講黃色笑話,並且以看旁邊的女孩子臉紅為樂趣。
三十歲的時候,他忽然發現自己變得很有能力追求到女孩,但是卻沒有了愛的能力。
其實每個男孩,本來都是想做一個感情專一的好男人的。
其實每個男人,本來看女孩子都是看臉而不是身材。
其實每個男人,本來都是不會講黃色笑話的。
其實每個男孩,本來都是渴望愛一個人直到永遠的。
只是,沒有任何女孩愛這樣的男孩,她們覺得這樣的男孩太幼稚,太古板,沒有情趣。
於是男孩開始改變,變成女孩喜歡的那種 嘴角掛著壞壞。
開始學會說甜言蜜語而不是心裡想說的話。
開始學會假裝關心,學會給女孩送小飾物討好她,學會如何追求,如何把握愛情。
或者看破紅塵,遊戲情場,成為女人恨恨的那種男人。
他們可以很容易俘獲女孩子的心,但是他們也會在黑的夜裡叼著煙流淚。
心裡有愛的時候,沒有女孩;有了女孩,卻永遠沒有了愛的感覺!
當男人聽到女人抱怨世上沒有一個好男人時候,他們不會再去努力做個好男人,
只是微笑著擦肩而過。

2007年12月11日 星期二

清除你電腦中的垃圾

要輕鬆流暢上網你是否注意到你的電腦系統磁盤的可用空間正在一天天在減少呢?

在Windows在安裝和使用過程中都會產生相當多的垃圾文件,包括臨時文件(如:*.tmp、*._mp)日誌文件(*.log)、臨時幫助文件(*.gid)、硬碟檢查文件(*.chk)、臨時備份文件(如:*.old、 *.bak)以及其他臨時文件。

特別是如果一段時間不清理IE的臨時文件夾「Temporary Internet Files」,其中的緩存文件有時會佔用上百MB的磁盤空間。這些文件不僅僅浪費了寶貴的磁盤空間,嚴重時還會使系統運行慢如蝸牛。這點相信你肯定忍受不了吧!所以應及時清理系統的文件,輕鬆流暢上網!

下面是步驟很簡單就兩步!

「程式集→附屬應用程式→記事本」,把下面的文字複製進去,點「另存為」,路徑選「桌面」,保存類型為「所有文件」, 文件名為「清除系統.bat」,就完成了。記住附檔名一定要是.bat

ok,你的垃圾清除器就這樣製作成功了!

在桌面上雙擊它就能很快地清理垃圾文件,大約一分鐘不到。

這段文字就是:

@echo off

echo 正在清除系統垃圾文件,請稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系統垃圾完成!
echo. & pause

2007年12月5日 星期三

用聽的學英文單字

使用軟體 Dr.eye 8.0

使用功能及設定:

= 1. 生字筆記 -- 匯入生字,匯出生字
= 2. 單字通 -- 設定 1) 功能列:發音,級別(生字筆記)
2) 系統設定 - 單詞通設定 - 瀏覽設定
A.顯示時間(秒) : 10
B.取消 [] 隨機顯示

使用方法:
1. 下載 單字字庫
2. 打開字庫複製 字彙 貼到 notepad 上, 並且存成 .txt 格式;
檔案內容應該類似下方內容 -- (每個單字佔一列)
abandon
abstract
academy
3. 啟動 "生字筆記" > 檔案 > 匯入生字 (若匯入前以有生字,可先刪除既有筆記,以匯入新的筆記");
4. 啟動 "單詞通" (並依照上述設定,設定 發音及載入級別 "生字筆記",顯示時間等);
5. 啟動 你的錄音軟體 我是用 Cool Edit 編輯
;
6. 將音效卡的聲音輸出用音源線連接至Line的孔位,按下錄音的按鍵;
7. 在 "單詞通" 中點選 [繼續], [發音], [級別] > 生字筆記 以重新載入 生字筆記 (目的:重頭開始唸);
9. 重複步驟 7到 錄完 500 個單字. (因為生字筆記最多只能紀錄 500個單字)
10. 停止 你的錄音裝置或軟體 並儲存;
11. 同步到你的 MP3 Player;
12. 背熟後,再用 "生字筆記" > "生字測驗" 來驗收一下成果吧.

建議使用時機:

1. 搭交通工具時; (再也不怕患 "閃光")(再也不怕暗)(再也不怕背單字暈車)(再也不怕不好意思,怕別人覺得自己裝用功)
2. 等待時;
3. 眼睛累時;
4. 睡覺時; (請調低音量至需專心聽才聽的到為止)(睡眠學習法)(熟音調)

2007年12月3日 星期一

IPKG - the Itsy Package Management System

IPKG is a very lightweight package management system. It was designed for Linux installations with severe storage limitations such as handheld computers. iPKG is more than just an embedded Linux flash image builder, (although it does that fairly well). It also allows for dynamic installation/removal of packages on a running system.


iPKG is itsy in several ways:

The control programs themselves are small, (currently about 13kB)

The installed meta-data tries to be only what is absolutely essential, (currently about 38kB for a 16MB compressed flash iPAQ distribution)

The available packages are small. (The idea is that the package tree should be as fine-grain as possible. Much of this still needs some work)


Configuration Files

The /etc/ipkg.conf file controls the server from which ipkg-update and ipkg-get will pull package information and packages. As of Familiar v0.7 (ipkg 0.99.87) the configuration files are as follows:

A: /etc/ipkg.conf Defines destination locations and proxy settings (e.g. dest root /)
B: /etc/ipkg/familiar-ipaqsa.conf - Architectures listing.
C: /etc/ipkg/.conf Defines individual feed locations.

See the comments in ipkg.conf for more details.

How do I use it?

he ipkg program has many different sub-commands, (provided by the first command-line
argument in a manner similar to cvs).

Here is a current snapshot of the available commands:

usage: ipkg [options...] sub-command [arguments...]
where sub-command is one of:
  Package Manipulation:
 update                         Update list of available packages
upgrade
Upgrade all installed packages to
latest version

install
Download and install
                                (and dependencies)
install Install package
configure [] Configure unpacked packages

remove
Remove package
flag ... Flag package(s)
                                (=hold|noprune|user|ok|installed|unpacked (one per invocation))
 Informational Commands:
 list                           List available packages and descriptions
files
List all files belonging to
search
Search for a package providing
info [pkg []]
Display all/some info fields for or all
status [pkg []]
Display all/some status fields for or all
download
Download to current directory.
compare_versions
(compare versions using <= < > >= = << >>)
print_architecture prints the architecture.
print_installation_architecture
whatdepends [-A] [pkgname|pat]+
whatdependsrec [-A] [pkgname|pat]+
whatprovides [-A] [pkgname|pat]+
whatconflicts [-A] [pkgname|pat]+
whatreplaces [-A] [pkgname|pat]+
 Options:
-A Query all packages with whatdepends,
                                whatprovides, whatreplaces, whatconflicts
-V Set verbosity level to . If no value is
--verbosity provided increase verbosity by one. Verbosity levels:
0 errors only
1 normal messages (default)
2 informative messages
3 debug output
 -f                  Use  as the ipkg configuration file
-conf Default configuration file location
                                is /etc/ipkg.conf
-d Use as the the root directory for
-dest package installation, removal, upgrading.
                                 should be a defined dest name 
                                from the configuration file, (but can also
                                be a directory name in a pinch).
-o Use as the root directory for
-offline offline installation of packages.
-verbose_wget more wget messages
 
 Force Options (use when ipkg is too smart for its own good):
 -force-depends                 Make dependency checks warnings instead of 
errors and install/remove package in spite offailed dependences
 -force-defaults                Use default options for questions asked 
                                ipkg. (no prompts). Note that this will not
                                prevent package installation scripts from
                                prompting.
 -force-reinstall               Allow ipkg to reinstall a package.
 -force-overwrite               Allow ipkg to overwrite files from another
                                package during an install.
 -force-removal-of-dependent-packages
 -force_space                   Install even if there does not seem to be
                                enough space.
 -noaction                      No action -- test only
 -nodeps                        Do not follow dependences
 -recursive                     Allow ipkg to remove package and all that
                                depend on it.
 -test                          No action -- test only
 -t                             Specify tmp-dir.
 --tmp-dir                      Specify tmp-dir.
 
Examples:

Install the ftp program:
ipkg install ftp
Install from an url (ipkg version >=0.9):
ipkg install http://url/to/some/package.ipk
 Perform a limited local "ipkgfind" (assuming you've already run ipkg update):
ipkg list|grep searchstring

將Source code 編譯成 deb

簡介

deb檔要包裝前要寫一堆資訊檔才行,其中包括了 像pkgtools一樣的scriptsdebian也有像Solaris裡的 postinstall preinstall postremove preremove這些scripts可以用, 其中最重要的資訊檔是一個名叫control的檔

需要的一些工具

dpkg

dpkg-deb 這兩個是最基本的

如果想成為Debiandistribution開發者,因為他們有一些遊戲規矩, 包括source code的改版,必要文件等規則, 下面的套件會幫你,如果不想submit你的deb檔給Debian,就不用裝了

dh-make 製做必要資訊檔的sample檔案 這其實還蠻有用的

debhelper dh-make dependency

devscripts 一些scripts

fakeroot 假裝是root的工具

lintian 測試與檢查package檔的工具

建立步驟

deb必須先有source tree,站在source tree的最上面, 解開後直接用

$ dh_make

幫你建一個叫debian的目錄及寫一堆sample後再自己改, cscope 15.6 做例子。

1. 先去cscope.sourceforge.net捉原始檔.tar.gz回來

2. 解開在/home/waynel/cscope-15.6,這邊一定要用 pkgname-version這樣形式的目錄

3. 進去cscope-15.6source code最上層直接執行dh_make, 會創造一個目錄叫debian,然後改這裡面的資訊檔

$ dh_make -e wayne_teng@compal.com -f ../cscope-15.6.tar.gz

在此次執行dh_make之後,上游的套裝軟體將會被打包裝檔為cscope-15.6.tar.gz並放在父目錄中,以便 用diff.gz建立非Debian原有的來源程式碼包裝檔。請注意檔案名稱中的兩個 關鍵點:

· 包裝檔名稱和版本是以_分割的。

· 在之前tar.gzorig.

$ dpkg-buildpackage -rfakeroot

,會自己叫configure創造Makefile, 不然必需自己想辦法創造一個Makefile再叫 dpkg-buildpackage -rfakeroot就會自己創造出xxxx.deb

如果下載的source code裡面有一個目錄debian,就直接執行

$ dpkg-buildpackage

已經多次運行了上邊的命令, 也可以使用下邊的命令快速構建臨時 .deb :

$ fakeroot debian/rules binary

Rsync + SSH 完成遠端備份

.完成單向Trusted SSH Authorized
我要 A (10.0.0.1) 要對 B (192.168.0.1) 做異地備援 ...所以我針對 A 讓它使用SSH連到 B ...不需要輸入密碼...User Root...SSH Version2的版本..首先要先在A(10.0.0.1)產生public/private dsa key pair..

[root@mondeo home]# cd /root/.ssh/
[root@mondeo .ssh]# ssh-keygen -d
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase): <--
此處不打passphrase..下次才不會詢問password
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
11:22:33:44:55:66:77:88:99:00:11:22:33:44:55:66 root@mondeo.adj.idv.tw
[root@mondeo .ssh]#

這時會在系統下看到兩個檔案...id_dsaid_dsa.pub 現在要把id_dsa.pub丟到192.168.0.1 並且更名為 authorized_keys2

[root@mondeo .ssh]# scp id_dsa.pub 192.168.0.1:/root/.ssh/authorized_keys2
root@192.168.0.1's password:
id_dsa.pub 100% |***************************************************************************| 612 00:00
[root@mondeo .ssh]#

現在您可以執行ssh 192.168.0.1 看看能否登入而不需要輸入密碼...

2.使用rsync Remote sync

rsync特性簡介 :

rsyncunix-like系統下的數據鏡像備份工具,從命名上就可以看出來了remote sync。它的特性如下:

1、可以鏡像保存整個目錄樹和文件系統。
2
、可以很容易做到保持原來文件的權限、時間等等。
3
、無須特殊權限即可安裝。
4
、優化的流程,文件傳輸效率高。
5
、可以使用rcpssh等方式來傳輸文件,當然也可以通過直接的socket連接。
6
、支持匿名傳輸。

首先要先對B(192.168.0.1)RsyncServer on起來...

[root@linux /]#chkconfig --list rsync
rsync off
[root@linux /]#chkconfig rsync on

現在我先在A(10.0.0.1)上建一個 Backup directory...然後對B(192.168.0.1)mysqlhtml的目錄做異地備援...偶寫一個簡單的script如下:

[root@mondeo /]# mkdir backup
[root@mondeo backup]#vi sync

rsync -avRz /src/ /home/test #Local Backup

rsync -arRHz --progress -e ssh 10.110.131.225:/src/ /home/2006.04.06

# Remote Backup


rsync -avlR --delete -e ssh 192.168.0.1:/var/lib/mysql /backup/
rsync -avlR --delete -e ssh 192.168.0.1:/var/www/html /backup/

[root@mondeo backup]#chmod 700 sync

參數意義如下﹕

-a, --archive
It is a quick way of saying you want recursion and want to preserve almost everything.
-v, --verbose
This option increases the amount of information you are given during the transfer.
-l, --links
When symlinks are encountered, recreate the symlink on the destination.
-R, --relative
Use relative paths.
保留相對路徑...才不會讓子目錄跟 parent 擠在同一層...
--delete
是指如果Server端刪除了一文件,那客戶端也相應把這一文件刪除,保持真正的一致。
-e ssh
建立起加密的連接。

參數的使用因人而異...您可以man rsync來使用更多的參數...

測試看看:

[root@mondeo backup]# ./sync

receiving file list ... done
.
.
.
done
wrote 16 bytes read 107 bytes 82.00 bytes/sec
total size is 0 speedup is 0.00
receiving file list ... done
.
.
.
done
wrote 16 bytes read 921 bytes 624.67 bytes/sec
total size is 308331 speedup is 329.06
[root@mondeo backup]#

看到沒詢問密碼....以及有把檔案copy過來就沒問題囉....當然你可以把遠端的資料做個變動...看是否真有同步啦....

3.使用crontab 來做自動排程

現在設好之後...我希望每天的00...夜深人靜的時後再來幫我做sync....當然您想要多久做 sync 看個人需求囉...

[root@mondeo backup]# crontab -e

0 0 * * * /backup/sync


Who is OpenEmbedded ?

1. OpenEmbedded is a build system that can generate (cross-compile) Software packages for embedded targets.
2. OpenEmbedded is a tool which allows developers to create a fully usable Linux base for various embedded systems.
3. OpenEmbedded is a collection of meta data, configuration, and patches.

How OpenEmbedded works?

clip_image001

Setting up the toolchain and doing a build

Directory Structure

$ mkdir -p /stuff/build/conf
$ cd /stuff/
Using Subversion

$ cd /stuff/
$ svn co http://svn.berlios.de/svnroot/repos/bitbake/branches/bitbake-1.6/ bitbake

Updating bitbake

$ cd /stuff/bitbake;svn info
$ cd /stuff/bitbake; svn update

Obtaining OpenEmbedded

1. Install Monotone 0.32
2. Go to the base directory of your OpenEmbedded environment
$ cd /stuff/
3. Download and bunzip2 the OE database snapshot
$ wget http://www.openembedded.org/snapshots/OE.mtn.bz2
$ bunzip2 <OE.mtn.bz2 >OE.mtn
4. Update your local copy of the OpenEmbedded database:
$ mtn --db=/stuff/OE.mtn pull monotone.openembedded.org org.openembedded.dev
5. Checkout your local copy of the OpenEmbedded tree.
$ mtn --db=/stuff/OE.mtn checkout --branch=org.openembedded.dev

Updating OE

$ mtn --db=/stuff/OE.mtn pull monotone.openembedded.org org.openembedded.dev

Then update the branch(es) you are using. This will update the contents of the files in the local database. For example:

$ cd /stuff/org.openembedded.dev && mtn update

Create local configuration
$ cd /stuff/
$ cp org.openembedded.dev/conf/local.conf.sample build/conf/local.conf
$ vi build/conf/local.conf
Edit local.conf example: 
#DL_DIR = "${HOME}/sources"
DL_DIR = "/stuff/build/sources"
#BBFILES := "${@bb.fatal('Edit your conf/local.conf: BBFILES')}"
BBFILES :="/stuff/org.openembedded.dev/packages/*/*.bb"
# Don't use symlinks in in the path to avoid problems
TMPDIR = /stuff/build
# of TARGET_ARCH
MACHINE = "x86"
If you compile other CPU code, you can change
TARGET_OS = "linux"
DISTRO = "generic"
# following MACHINE types: poodle, tosa and simpad.
remake“#”MACHINE_KERNEL_VERSION = "2.6"
make“#”REMOVE_THIS_LINE:="${@oe.fatal('Read the comments in your conf/local.conf')}"


Setup the environment
1. Edit ~/bash_profile
$ export PATH=/stuff/bitbake/bin:$PATH
$ export BBPATH=/stuff/build:/stuff/org.openembedded.dev
2. Check environment
$ echo $BBPATH

Start building
example:

$bitbake -D -b org.openembedded.dev/packages/zip/zip_2.32.bb


製作自己個人的Ubuntu Live CD

一、安裝:
請到官網 reconstructor 的下載頁面,下載 deb 檔。下載時,可以選 『開啟方式』- GDebi package Installer,GDebi 會幫你把需要的其他套件一併安裝。

二、使用:
1.開始
clip_image002

2.升級:按左下角的Update

3.第一關:選擇source

clip_image004

第1次用,3個 create 都要勾,之後換 iso 檔才需要勾。
指定 iso 檔後,按 Next 進入下1關。

4.第二關:設定 gnome、新增/移除程式

clip_image006

這裡可以設定開機splash,如果不設,會用 iso 檔原來的。

clip_image008

這裡可以設定gnome的佈景主題、桌布、圖示、字型等。

clip_image010

這裡則指定sources.list的內容,將我的內容直接貼上

clip_image012

設定帳號、密碼、主機名稱等。

clip_image014

新增移除程式用,可以使用內建的模組,也可以開啟左下角的 Terminal,利用 apt-get install來安裝。
最後,要按 Apply 讓改變生效!

5.第三關:設定輸出,產生ISO檔

clip_image016

在 Filename 指定 iso 檔名。
產生ISO檔約10多分鍾,可以休息一下。

6.第四關:完成,燒錄。

clip_image018

完成後,按 Burn ISO可以直接燒錄,或是使用 qemu 模擬看看。
qemu install:
sudo apt-get install qemu bochsbios vgabios
use:
sudo mount -t tmpfs -o size=272m none /dev/shm
qemu -cdrom ~/ubuntu-custom.iso -boot d -m 256

PS:
1.不要急著按 Finish,先將成果試用看看,要修改的話,按 Back 直接修改即可,不用重頭來。
2. 官方 live cd有很多用不到的套件,像ttf-xxxxxx-fonts,很多是其他語系用的;
language-pack-XX、language-pack-gnome-xx、language-pack-kde-xx用不到的也都可以移除。
3.中文語系 language-pack-zh, language-pack-gnome-zh, language-pack-kde-zh 裝好後,再裝language-support-zh ,會把缺的都裝好。

 Ubuntu has a mechanism, that is, the installed network card (NIC) will be renamed to another name when the system is booted. Although there...