preload
Jul 29

# hdparm -t /dev/sdb1

/dev/sdb1:
Timing buffered disk reads: 750 MB in 3.01 seconds = 249.58 MB/sec

Tagged with:
Jul 29

方法一 :
# echo “foo” > bar
# du -h bar

4.0K bar

方法二 :
# tune2fs -l /dev/sda1 | grep ‘Block size’

Block size: 4096

方法三 :
# dumpe2fs -h /dev/sda1 | grep ‘Block size’

dumpe2fs 1.39 (29-May-2006)
Block size: 4096

方法四 :
# blockdev –getbsz /dev/sda1

4096

Tagged with:
Jul 29

# iozone -a -i 0 -i 1 -f /xxx/xxx/iozone.test -q 64k -n 32M -g 1G > iozone.out
# Generate_Graphs iozone.out

Tagged with:
Jul 26

FROM : YAHOO

TAIPEI (AFP) – Apple was threatened Monday with a fine if it did not act on a dispute in which thousands of visitors to its online store tried to buy computers that were wrongly priced at massive discounts.
The Taipei city government said the US giant had mis-priced two models Friday afternoon, with one on sale for a little over 40 percent of what it should have been.
Apple corrected the prices hours later but by that time more than 200,000 units had been ordered, local media said.
The news comes after computer giant Dell was forced to honour the sale of various electronics goods at a third of their price after offering them at a cut price on the Internet in error.
The complaints erupted after the company unilaterally altered the prices of the bargain-hunting orders.
Apple would not say if it would deliver the products on the erroneous prices. And after an initial investigation, the city government’s Law and Regulation Commission issued an ultimatum to the US computer company.
“The city government has tried to reach Apple since Friday afternoon but has not yet received any response from it over the more than 30 consumer complaints,” Yeh Ching-yuan, chief of the commission, said in a statement.
“Apple has to respond to our order before the end of Tuesday or may face a fine of up to 300,000 Taiwan dollars (9,400 US) according to the consumers’ protection law,” he warned.
Apple is required to provide details of the alleged mis-pricing, why it happened, the number and value of orders placed on the mis-price basis, and how the company will act to compensate the customers, he said.
Local media said Apple listed its Mac Mini at 19,999 Taiwan dollars (625 US), about 42 percent of its original price tag of 47,710 Taiwan dollars.
Also, the 8-GB version of Mac Mini Snow Leopard Server was priced lower than the 4-GB version, which costs 34,900 Taiwan dollars.
A court in southern Taiwan last month ordered Dell to deliver 18 laptops and 76 flat-panel monitors to 31 consumers for 490,000 Taiwan dollars, less than a third of the normal price, the Taipei-based Apple Daily said.
The company advertised the unusually low prices on its website in June and July, prompting bargain-hunters to place 200,000 orders.
The consumer rights authorities in Taipei also fined Dell one million Taiwan dollars.

Tagged with:
Jul 23

文章來源 : 自由時報
登山健行,走向戶外,相當有益身體健康。不過,除了常見的蚊蟲叮咬外,「咬人貓」及「咬人狗」是兩種很有名、會造成皮膚傷害的植物。

●咬人狗,俗稱「恆春咬人狗」、「刺暈」,蘭嶼人稱為「ahateng」,意思就是「避開」。

咬人狗喜歡生長在平地至海拔800公尺以下,日光充足、環境稍濕的山區叢林、河邊或海邊。在台灣多處都有它的蹤跡,墾丁社頂公園、高雄柴山、台南烏山獼猴保護區、綠島、蘭嶼等,都是它常出現的地方。

咬人狗常是單棵或數棵樹獨立生長。其葉片呈卵形或橢圓形,長約20到30公分,寬寬大大的,葉柄長約5至10公分(如圖)。其果實的花托呈白色半透明狀,很像「蒟蒻」。

●咬人貓,別名「刺草」、「蕁麻」,分佈在低至中、高海拔的山區,溪頭、杉林溪可見它的蹤跡。

咬人貓常呈群聚生長。其葉片呈寬闊的卵圓形,有點像瘦長的心形,長約6到12公分。葉緣呈大大小小的鋸齒狀(如圖)。葉面有密生的粗毛。

咬人狗及咬人貓都是屬於「蕁麻科」的植物。之所以會「咬人」,主要是它們的葉子上,佈滿了透明刺針般的「焮毛」。「焮毛」是由表皮細胞凸起而成,它的下方是一個囊狀物,內含蟻酸。當皮膚接觸到時,蟻酸會刺激皮膚,產生麻、熱及刺痛感,持續時間約數小時,但有時會超過一天。除了用膠帶將刺入皮膚的焮毛黏出外,可儘速就醫,用藥減輕症狀。

●若在野外被咬人狗或咬人貓「咬」到,無法立刻就醫時,最方便的方法,就是尋找「姑婆芋」(如圖),將其葉片搗碎後敷於皮膚上。

姑婆芋因含「生物鹼」,可中和「蟻酸」,達到消腫的效果。通常有咬人狗及咬人貓的地方,就找得到「姑婆芋」,兩者常相伴而生。天地間相生相剋的道理,真是奇妙!

下次爬山或生態之旅時,若一時想就地「大解」,手邊又沒有衛生紙,記得要分清楚。如果拿到咬人狗的葉子來擦屁股,後果可能會不堪設想喔!

(作者為高雄市林政賢皮膚科診所醫師)

Tagged with:
Jul 22

更新 : 剛剛我在刷一次. 信用卡扣款了. 看來這次是來真的了. 希望蘋果能按照 NT$ 19,900 出貨..
更新2 : 又變NT$ 47,710

Mac mini Snow Leopard Server

2.66GHz Intel Core 2 Duo
8GB 1066MHz DDR3 SDRAM – 2x4GB
Dual 500GB Serial ATA Drives
COUNTRY KIT,K40-TWN
User’s Guide (Traditional Chinese)
+
Mini DisplayPort to DVI Adapter

這樣多少錢呢??!!

NT$ 52,180 含稅

同樣的組態.教育折價多少錢呢??

NT$ 20,900 含稅


二話不說.馬上刷卡刷下去!!!!!!


檢查訂單看看有沒有眼花.沒有眼花.這時候我爽到不行.感覺好像中樂透!!


後來再檢查一次..更!!!!!機車壘..原來是個謊子. 只好退貨了!! 理由”不喜歡這個價格”!!


空歡喜一場…我目前的電腦.記憶體常常不足.很想買蘋果電腦.但是又夭壽貴.算了!!!!

Tagged with:
Jul 20

由於 NoMachine免費版本只能支援 2 個使用者. 在家用當然是足夠. 但是要給多人用就沒辦法了. 只好自己架設免費的 FreeNX server.

在安裝 FreeNX Server 前. 請記得安裝 expect.
# yum install expect

Loaded plugins: kernel-module
sl-base | 1.1 kB 00:00
sl-security | 1.9 kB 00:00
sl-security/primary_db | 1.8 MB 00:02
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
–> Running transaction check
—> Package expect.i386 0:5.43.0-5.1 set to be updated
—> Package expect.x86_64 0:5.43.0-5.1 set to be updated
–> Finished Dependency Resolution
Beginning Kernel Module Plugin
Finished Kernel Module Plugin

Dependencies Resolved

================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
expect i386 5.43.0-5.1 sl-base 158 k
expect x86_64 5.43.0-5.1 sl-base 160 k

Transaction Summary
================================================================================
Install 2 Package(s)
Update 0 Package(s)
Remove 0 Package(s)

Total download size: 318 k
Is this ok [y/N]: y
Downloading Packages:
(1/2): expect-5.43.0-5.1.i386.rpm | 158 kB 00:01
(2/2): expect-5.43.0-5.1.x86_64.rpm | 160 kB 00:00
——————————————————————————–
Total 153 kB/s | 318 kB 00:02
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : expect 1/2
Installing : expect 2/2

Installed:
expect.i386 0:5.43.0-5.1 expect.x86_64 0:5.43.0-5.1

Complete!

之後就去下載 FreeNX 和 NoMachine Client 的套件(freenx-0.7.3-4.el5.centos.x86_64.rpm, nx-3.4.0-4.el5.centos.x86_64.rpm and nxclient-3.4.0-7.x86_64.rpm)然後安裝 :
# rpm -ivh freenx-0.7.3-4.el5.centos.x86_64.rpm nx-3.4.0-4.el5.centos.x86_64.rpm nxclient-3.4.0-7.x86_64.rpm

Preparing… ########################################### [100%]
1:nx ########################################### [ 33%]
2:freenx ########################################### [ 67%]
Stopping sshd: [ OK ]
Starting sshd: [ OK ]
Starting freenx-server: [ OK ]

3:nxclient ########################################### [100%]
Showing file: /usr/NX/share/documents/client/cups-info

CUPS Printing Backend

The NX Client set-up procedure detected that your “IPP CUPS” printing
backend doesn’t allow printing from the NX session. In order to have
printing support in your NX system, you need to set proper permissions
on the IPP backend. Please execute:

chmod 755 /usr/lib/cups/backend/ipp

設定 NX server :
# nxsetup –install –setup-nomachine-key

Setting up /etc/nxserver …done
Setting up /var/lib/nxserver/db …done
Setting up /var/log/nxserver.log …done
Adding user “nx” to group “utmp” …done
Setting up known_hosts and authorized_keys2 …done
Setting up permissions …done
Setting up cups nxipp backend …done

—-> Testing your nxserver configuration …
(omit)
<---- done

----> Testing your nxserver connection …
HELLO NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
<--- done

Ok, nxserver is ready.

PAM authentication enabled:
All users will be able to login with their normal passwords.

PAM authentication will be done through SSH.
Please ensure that SSHD on localhost accepts password authentication.

You can change this behaviour in the /etc/nxserver/node.conf file.
Have Fun!

複製 node.conf.sample 範本檔案到 node.conf :
# cp /etc/nxserver/node.conf.sample /etc/nxserver/node.conf

檢查 FreeNX Server 是否有執行 :
# nxserver –status

NX> 100 NXSERVER – Version 3.2.0-73 OS (GPL, using backend: not detected)
NX> 110 NX Server is running
NX> 999 Bye

將 /usr/bin/nxserver –start 指令放在 /etc/rc.local 內 機器每次開機都執行 FreeNX sever

Tagged with:
Jul 18

金星, 火星, 土星三連星. 昨天看這三顆行星超清楚.剛好西邊沒有什麼雲. 但是昨天忘記拍攝. 今天拍就沒有辦法拍攝得很好.


金星, 火星, 土星三連星…看得出來是哪三個吧?!


幫大家標示一下


這三個行星剛好在獅子座與處女座交界.


獅子座長這樣


處女座長這樣

Tagged with:
Jul 14

轉貼來源 : 民視新聞

暌違近一年後,古巴前領導人卡斯楚,12日又出現在古巴電視台上,儘管4年前生過重病,83歲的卡斯楚看起來精神奕奕,他在預錄訪談中,對國際情勢侃侃而談,而且還罕見地提到了台灣,表示台灣有權加入聯合國。

古巴國營電視台12日晚間播出對卡斯楚的預錄訪談,卡斯楚先就南北韓衝突和中東情勢,發表了看法,接著他話鋒一轉,提到了台灣。

這是卡斯楚暌違11個月後,首次在電視節目中現身,83歲的他留著招牌落腮鬍,穿著格紋襯衫和藍色夾克,雖然講話速度緩慢,但相當健談,似乎已經恢復了健康。

卡斯楚自從4年前因為消化道出血生病開刀,而將國家大權移交給弟弟拉烏之後,就很少公開露面,他的照片最近出現在古巴媒體上是上周末,當時他正在接見哈瓦那一個智庫團體的員工。(民視新聞綜合報導)

Tagged with:
Jul 12

差幾天 function

1
2
3
4
5
6
7
8
function dateDiff($startDate, $endDate) {
    $startArry = getdate(strtotime($startDate));
    $endArry = getdate(strtotime($endDate));
    $start_date = gregoriantojd($startArry["mon"], $startArry["mday"], $startArry["year"]);
    $end_date = gregoriantojd($endArry["mon"], $endArry["mday"], $endArry["year"]);
 
    return round(($end_date - $start_date), 0);
}

差幾分鐘 function

1
2
3
4
5
6
function minDiff($startTime, $endTime) {
    $start = strtotime($startTime);
    $end = strtotime($endTime);
    $timeDiff = $end - $start;
    return floor($timeDiff / 60);
}

差幾天也可以這樣寫 :

1
2
3
4
5
6
function dateDiff($startTime, $endTime) {
    $start = strtotime($startTime);
    $end = strtotime($endTime);
    $timeDiff = $end - $start;
    return floor($timeDiff / (60 * 60 * 24));
}
Tagged with: