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 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 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:
Jul 03


我想買這台 Drobo FS. 但是台灣不知道哪時候才會進貨. 這台功能看起來很強大. 可以做不同size的 raid(BeyondRAID). 然後可以線上抽換硬碟. 例如我現在插了 5 個 500GB 的硬碟. 我可以卸載某一個.然後換上 2TB 硬碟. 這都不用砍掉重練. 期待這個設備趕快入手.

Tagged with:
Jun 30

已經送出.但暫時被apple rejected. 因為我用到 private API. 還在測試另外一個版本. 請等待.

此版本主要更新 :
1. 讓使用者在 iOS 4 按Home後, 再進入精省錢重新自動取得資料.
2. 加速大約2秒鐘速度解析hami網頁

Jun 27


還真想學會拍這樣的 trailer. 背景音樂.還有那個旁白的聲音.真的超像一般電影.COOL