preload
Dec 31

要先安裝 minicom

# yum install -y minicom

在設定 minicom

# minicom -s

選 “Serial port setup” 由

Serial Device : /dev/modem

改為

Serial Device : /dev/ttyUSB0

記得 “Save setup as dfl” :)

如果你直接打 minicom 指令進入 minicom 也是可以設定
先按 Ctrl + A 再按 Z 在選 O

Tagged with:
Dec 07

# vos changeaddr -remove -oldaddr SERVER_NAME

Removed server SERVER_NAME from the VLDB.

Tagged with:
Nov 26

# dsmc q backup -inactive xxx.php
ANS1677W The MAILPROG option is ignored because it is no longer supported.
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
Client Version 5, Release 5, Level 1.0
Client date/time: 11/24/2009 14:13:30
(c) Copyright by IBM Corporation and other(s) 1990, 2008. All Rights Reserved.

Node Name: LIHO.TW
Session established with server BKSRV_AIX: AIX-RS/6000
Server Version 5, Release 4, Level 3.0
Data compression forced on by the server
Server date/time: 11/24/2009 14:13:29 Last access: 11/24/2009 13:54:10

Size Backup Date Mgmt Class A/I File
—- ———– ———- — —-
8,268 B 03/12/2009 13:47:46 DEFAULT I /afs
/home/USERNAME/xxx.php

# dsmc restore -inactive xxx.php
ANS1677W The MAILPROG option is ignored because it is no longer supported.
IBM Tivoli Storage Manager
Command Line Backup/Archive Client Interface
Client Version 5, Release 5, Level 1.0
Client date/time: 11/24/2009 14:14:33
(c) Copyright by IBM Corporation and other(s) 1990, 2008. All Rights Reserved.

Node Name: LIHO.TW
Session established with server BKSRV_AIX: AIX-RS/6000
Server Version 5, Release 4, Level 3.0
Data compression forced on by the server
Server date/time: 11/24/2009 14:14:32 Last access: 11/24/2009 14:13:29

Restore function invoked.

** Interrupted **
ANS1114I Waiting for mount of offline media.
<< Restoring 8,268 /home/USERNAME/xxx.php [Done]

Restore processing finished.

Total number of objects restored: 1
Total number of objects failed: 0
Total number of bytes transferred: 3.35 KB
Data transfer time: 0.00 sec
Network data transfer rate: 152,698.86 KB/sec
Aggregate data transfer rate: 0.04 KB/sec
Elapsed processing time: 00:01:17

Tagged with:
Nov 21

Google Chrome OS 又名 Google OS.

我到 gdgt 下載了 VMware 版本的Chromium OS 玩. 不確定裡面有沒有spyware. 所以我註冊了一個新的 google 帳號就只為了玩 Google OS. 這個版本應該不是 google 的人 build 的. 不知道有多可靠? Chromium OS 開機速度真是驚人. 在我的 VMware 只花10秒鐘就開起來了. 下面是它的畫面 :


Chromium OS 登入畫面. 直接使用 Google 帳號密碼就可以了.


登入中…


這是 Google OS 目前內建的版面.


裡面就是一個 Chrome 瀏覽器

簡單來說 Google OS 就是一個非常陽春的作業系統. 裡面只跑一隻程式, 那叫做 Google Chrome 瀏覽器. 這也是為什麼 Google 努力的在開發他們自己的瀏覽器. 而且提出一些新的觀念. 以往的瀏覽器都是使用同一隻 Process 然後再開很多 Threads . 如果某個tab當機或是吃資源吃太重. 就會導致整個瀏覽器不能運作. Google Chrome 瀏覽器. 就是 fork 出很多 Processes 使得每個頁面都擁有自己的資源. 當某個 Process 當掉的時候不會導致 Google Chrome 瀏覽器當掉. 我在測試 Google OS 的時候, 就嘗試把所有的 tab 關掉. 不管我怎麼關閉. 最後還是跑出一隻 Google Chrome 瀏覽器. 有點像是踩不死的蟑螂. 另外, 在 gdgt 下載的那個版本不太穩定常常當機. Orz.

用來跑 Google OS 的電腦不需要很強的CPU, 也不需要很高的記憶體. 甚至還不需要很大的硬碟. 我認為現今的 Netbook 來跑 Google OS 就很夠用了. 只是螢幕可能需要大一些. Google OS 所有的應用程式都在網路上. 換而言之, 沒有網路那台電腦就廢掉了. 除非 Google 把 Google Gear 寫得非常完善. (Google Gear 是用來處理離線的工具) 雖然我知道這是一個很嶄新的革命. 很顛覆傳統的作法. 但是, 我相信短時間內 Google OS 還是沒辦法普及. 甚至沒辦法取代現在的使用者的習慣. 大家都還是習慣有硬碟的生活. 放照片影片在自己的硬碟內. 來來很有可能 Google 提供非常大的硬碟空間. 或許要付費. 縱使Google解決了網路空間的問題. 但是他們還要面對網路頻寬不夠的問題. 現階段光是處理照片上傳就要很久. 況且未來的照片解析度會越來越高. 所以我看 Google OS 短時間內很難生存得下去.

你可以到 The Chromium Projects 了解更多 Chromium OS的訊息. 也當然可以下載他們的原始碼. 自行建立自己的 Google OS 版本.

這裡可以看到更詳細的解說 :

What is Google Chrome OS?

在3分鐘附近可以看到 Google OS 的真面目. 也能體驗一下到底 Google OS 開機速度有多快.

Chromium OS Fast Boot

另外我不是在唱衰 Google OS. 我只是認為還有一段很長的路要走. 例如 Google Docs 要更完善的功能. 例如預覽列印. 甚至 Google OS 裡面要能調整螢幕解析度. 還有如果 Google OS 裡面能有 iTunes 會更好. 當然如果他能與手機裝置同步也不錯. 甚至 Google OS 裡面還是沒有類似 photoshop 的軟體. 當然我是個重度需要 terminal 工作的使用者. 如果沒有 terminal 我就很難工作了. 所以短時間. Google OS 對我來說還是沒辦法滿足我的需求.

Tagged with:
Nov 10

I’m going to use the Google Mini pdf file as this demonstration. Please download that file to the same directory of your php script in advance. Check it out here. You can see how GOOD Google did the document preview function is. Of course, I’m not as well as Google’s experts. But, I just knew a small trick.

我將使用Google Mini pdf 檔案進行這個範例解說. 請先將這個檔案下載到你的php程式相同目錄. 按這裡. , 你可以先看看 Google 的 document preview 的功能已經相當完善. 當然, 我不像 Google 的專業人士那麼厲害. 但是, 我知道一點小技巧.

Before you start to generate pdf file preview, you need to make sure your system is installed the GhostScript and the ImageMagick.

在開始產生pdf預覽前, 你先在你的系統安裝 GhostScriptImageMagick程式.

Following php script to generate thumbnails pdf files:
下列php程式碼會產生縮圖:

1
exec('/usr/bin/convert "googlemini_datasheet.pdf" -geometry 200 "googlemini_thumbnails.png"');

Output :

file name : googlemini_thumbnails-0.png


file name : googlemini_thumbnails-1.png

Following php script to generate large pdf files:
下列php程式碼會產生大圖:

1
exec('/usr/bin/convert "googlemini_datasheet.p22df" -density 1200x1200 -geometry 1024 -quality 100 "googlemini_large.png"');

Output :

file name : googlemini_large-0.png


file name : googlemini_large-1.png

From above php scripts, you can see the convert command generated two png files. Because, the Google Mini pdf file has two pages. If there are many pages in pdf file, It will be generated some file name with “-0″, “-1″, “-2″, “-3″ and so on.

從上列php程式碼, 你可以了解 convert 指令幫你產生了兩張 png 圖. 因為那個 Google Mini pdf 檔案有兩頁. 如果pdf檔案有很多頁面, 那會產生”-0″, “-1″, “-2″, “-3″…等.

If you would like to generate the first page, you can use following php script:
如果你只想產生第一頁, 你可以使用下列php程式.

1
exec('/usr/bin/convert "googlemini_datasheet.pdf[0]" -geometry 200 "googlemini_page1.png"');

Just add the [0] after the pdf file name. How about the second page? Just change inside number of [ ] from 0 to 1.

只要在pdf檔案後面加入[0]就可以了. 那如果要只輸出第二頁? 只要改變 [ ] 裡面的數子. 從 0 到 1.

References :

Tagged with:
Oct 14

# yum clean metadata
# yum clean all

這好像是萬能的.之前也有遇過這樣類似的問題. :)

Tagged with:
Sep 11

An alternate way to mount an NFS share from another machine is to add a line to the /etc/fstab file. The line must state the hostname of the NFS server, the directory on the server being exported, and the directory on the local machine where the NFS share is to be mounted. You must be root to modify the /etc/fstab file.

The general syntax for the line in /etc/fstab is as follows:

server:/usr/local/pub /pub nfs rsize=8192,wsize=8192,timeo=14,intr

The mount point /pub must exist on the client machine. After adding this line to /etc/fstab on the client system, type the command mount /pub at a shell prompt, and the mount point /pub will be mounted from the server.

Tagged with:
Aug 26

用yum安裝 fuse fuse-ntfs-3g dkms dkms-fuse 指令如下 :
# yum –enablerepo=dag install fuse fuse-ntfs-3g dkms dkms-fuse

Tagged with:
Aug 04

用了linux那麼久了. 今天才知道這個功能. 真是要打屁股!!

先印出 cpuinfo 的資訊這樣看下列範例會比較清楚.
# cat /proc/cpuinfo

processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping : 3
cpu MHz : 2800.000
cache size : 2048 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 3
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc up pni monitor ds_cpl est cid cx16 xtpr
bogomips : 6388.48

假設我要抓 CPU 資訊 model name. 指令為 :
# cat /proc/cpuinfo | grep model\ name

model name : Intel(R) Pentium(R) 4 CPU 3.20GHz

要抓 CPU 資訊及前一行指令為 :
# cat /proc/cpuinfo | grep model\ name -B1

model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz

要抓 CPU 資訊及後一行指令為 :
# cat /proc/cpuinfo | grep model\ name -A1

model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping : 3

要抓 CPU 資訊及前後兩行指令為 :
# cat /proc/cpuinfo | grep model\ name -C2

cpu family : 15
model : 4
model name : Intel(R) Pentium(R) 4 CPU 3.20GHz
stepping : 3
cpu MHz : 2800.000

Tagged with:
Jul 09

我 Linux 學藝不精. 之前, 都以為執行某個程式. 那個 terminal 必須要掛著不能登出(log off). 原來只要加個 nohup 就可以登出了.

# nohup /xxx/xxx/test.exe &
Tagged with: