2008年10月30日 星期四

讓apt-get install自動更新recommends and suggests的packages

在/etc/apt/apt.conf.d/20archive中加入下面兩行

APT::Install-Recommends "true";

APT::Install-Suggests "true";

2008年10月14日 星期二

對Blog中的程式碼做色彩強調

1. 修改HTML範本

到版面配置->修改HTML->修改範本
找到

code {
color: #996666;
}

以下面的html code覆蓋貼上

code {
display: block;
font-family: 'Courier New';
overflow: auto;
border: 1px solid #ccc;
padding: 1px 10px 10px 21px;
max-height: 1200px;
line-height: 1.2em;
letter-spacing: 0px;
margin: 5px 5px 0 15px;
}
code.c{
font-size: 9pt;
color: #000;
background: #ccc url(http://sites.google.com/site/chihengchou/Home/blogsource/BG_CODE.gif) left top repeat-y;
}
code.cmd {
font-size: 9pt;
color: #ccc;
background: #000 url(http://sites.google.com/site/chihengchou/Home/blogsource/BG_SHELL.gif) left top repeat-y;
}
code.html{
font-size: 9pt;
color: blue;
background: #FFF url(http://sites.google.com/site/chihengchou/Home/blogsource/BG_HTML.gif) left top repeat-y;
}
code.file{
font-family: 'Georgia';
font-size: 9pt;
color: #000;
background: #FFF url(http://sites.google.com/site/chihengchou/Home/blogsource/BG_FILE.gif) left top repeat-y;
}

儲存為範本

2. 使用方式


在張貼新文章時,使用修改Html,在要寫入的內容用下列符號括弧起來即可

<code class="c"> c code </code>
<code class="cmd"> shell command </code>
<code class="html"> html code </code>
<code class="file"> file </code>


3. 如果在文章中有下列字型時,需要更換


  • < 用&lt;更換
  • > 用&gt;更換
  • & 用&amp;更換

4. 備註



這些背景以及設定都是從網路上蒐集來的,由於原始背景的圖已經失連,所以我自己重做了四個放在我的google site

Ref:
如何在文章裡顯示程式碼的語法
【Blog】文章中引用程式碼的作法

婚紗照

2008年10月6日 星期一

Compile moblin application launcher

Here is a great reference for compile moblin application launcher
http://blog.csdn.net/dxglgd/archive/2008/09/08/2898213.aspx

Other reference
http://www.moblin.org/projects/application-launcher
http://www.moblin.org/projects/genesis-application-lifecycle-manager

Compile clutter 0.8.2

# Download library from http://www.clutter-project.org/sources/

# Install the following libraries before you compile these library
apt-get install build-essential xlibmesa-gl-dev libx11-dev libgtk2.0-dev freeglut3 freeglut3-dev

Ref:
http://www.clutter-project.org/sources/
http://www.clutter-project.org/blog/

Note:
In current Lenny distribution, we can use apt-get to install almost all clutter libraries with version 0.8
In current Ubuntu distribution, we can use apt-get to install almost all clutter libraries with version 0.6

Install minimal debian (lenny) + LXDE

# get the net install image from debian
http://cdimage.debian.org/cdimage/lenny_di_beta2/i386/iso-cd/debian-LennyBeta2-i386-netinst.iso

# Burn this iso image into CD-ROM

# Install minimal debian, follow the steps from screen

# When installation complete, add this line to /etc/apt/sources.list
deb http://ftp.debian.org/debian/ testing main

# Update apt package list
apt-get update
apt-get upgrade

# Install LXDE - Add this line to /etc/apt/sources.list
deb http://people.linux.org.tw/~andrew/debian/lxde/ ./

# Add new gpg key
gpg --keyserver subkeys.pgp.net --recv 9D0633E1B6250985
gpg --export --armor 9D0633E1B6250985 | sudo apt-key add -

# Install LXDE
apt-get install xorg xserver-xorg lxde

Ref:
http://www.debian.org/devel/debian-installer/
http://lxde.org/download.html
http://lxde.org/wiki/Debian

解決無法切換root的問題

有時候剛灌好Linux之後,或是新增一個帳號後,在想要切換為root時,會有錯誤訊息,說此帳號不能切換為root,
經過調查sudo的man page之後,發現只要到"/etc/sudoer"檔案中,將想要能夠切換成root的使用者名稱寫入即可。

dpkg 最常用指令集合

1. 想要找出安裝了哪些套件
dpkg -l PACKAGE

2. 想要找出安裝某套件時,裝了哪些檔案
dpkg -L PACKAGE

3. 找出某個檔案可能裝在那個套件中
dpkg -S FILENAME

4. 安裝套件
dpkg -i PACKAGE.deb

5. 安裝一整個資料夾的套件
dpkg -iR FOLDER

6. 解壓縮某個套件
dpkg -x PACKAGE.deb FOLDER

7. 移除套件
dpkg -r PACKAGE

8. 移除套件含配置文件
dpkg -P PACKAGE

9. 列出deb內容
dpkg -c PACKAGE.deb

10. 列出某套件的狀態
dpkg -s PACKAGE

Ref:
http://www.debian.org/doc/manuals/reference/ch-package.zh-tw.html

林則徐先生十無益

父母不孝,奉神無益;
存心不善,風水無益;
兄弟不和,交友無益;
行止不端,讀書無益;
心高氣傲,博學無益;
作事乖張,聰明無益;
不惜元氣,服藥無益;
時運不通,妄求無益;
妄取人財,佈施無益;
淫惡肆欲,陰騭無益。