August 31, 2004

Time Server List

First 7 servers are Taiwan server

stdtime.sinica.edu.tw
ns1.nctu.edu.tw
ns2.nctu.edu.tw
time.nsysu.edu.tw
time.ncnu.edu.tw
time.stdtime.gov.tw
clock.hinet.net
stdtime.gov.hk *
clepsydra.dec.com
clock.psu.edu *
fartein.ifi.uio.no
harbor.ecn.purdue.edu
kuhub.cc.ukans.edu
louie.udel.edu
molecule.ecn.purdue.edu
ntp0.cornell.edu *
ntp-0.cso.uiuc.edu
ntp-1.cso.uiuc.edu
ntp1.strath.ac.uk
ntp-2.cso.uiuc.edu
ntp2.strath.ac.uk
ntp3.strath.ac.uk
ntp.adelaide.edu.au
ntp.univ-lyon1.fr
salmon.maths.tcd.ie *
tick.cs.unlv.edu
timeserver.cs.umb.edu
time.smu.edu
tock.cs.unlv.edu
vtserf.cc.vt.edu

end with * support rdate (TCP port 37), else support ntpdate (UDP port 123) only

Posted by pank at 03:48 PM | Comments (0)

August 30, 2004

準系統

上週六幫表弟裝了一台 浩鑫SS56G-V2
這台在多媒體方面有加強, 支援 5.1 聲道, 有左右, 後左右, 中置, 重低音的接頭,
也有數位音訊的接頭, 整體感覺不錯

Spec
基座
尺寸 (L)300*(W)200*(H)185 2.85Kg (N.W.) 4.65Kg (G.W.)
前面板 USB * 2,&" MIC * 1, Line in * 1, 1394 * 1, Earphone * 1
後面板 PS/2 Keyboard & Mouse * 1, Serial Port * 2, LAN Port * 1, USB * 2, 1394 * 2, SPDIF * 1, VGA * 1
擴充空間 5.25" * 1, 3.5" * 2
主機板
Form Factor Shuttle Form Factor
中央處理器 Socket 478 Pentium 4 & Celeron 400/533/800MHz FSB
晶片組 North bridge:SiS661FX South bridge:SIS 963L
記憶體 DDR 266/333/400 * 2
顯示卡 SiS Real 256E core
音效卡 Realtek ALC 650 6 channel audio
擴充槽 PCI * 1 8XAGP * 1
IDE 界面 ATA-133
電源 200W (PFC)

準系統的優點

  • 體機小, 外型也不賴
  • 比較安靜, 由於準系統多半有自己的散熱系統(浩鑫的是採用具備I.C.E 整合型熱導管散熱引擎), 比 CPU 原廠風扇安靜許多

    準系統的缺點

  • 缺乏擴充性, 沒空間讓你讓多台 CD-ROM/DVD/燒錄機, 多台 HD

    我推測準系統未來應該滿有前景

    美中不足的是這台和 Windows XP SP2 似乎有相容性問題, 灌了 SP2 會卡在開機畫面
    已發信詢問浩鑫 Support 有無解決之道

    -- 20040919 add --
    後來微軟出了這個 patch, 應該是針對這個問題
    Critical Update for Windows XP (KB885626)
    發佈日期: 2004/9/14
    Download
    This non-security critical update helps resolve an issue where a limited
    number of systems running a BIOS without production support for Intel Pentium
    4 and Intel Celeron D processors based on Prescott C-0 stepping can
    potentially hang on Windows XP Service Pack 2 installation. After you install
    this update, you may have to restart your computer.

    Posted by pank at 09:52 AM | Comments (0)
  • August 27, 2004

    TCL/TK required rpm

    in mdk
    tcl-8.3.3-21mdk
    tk-8.3.3-21mdk
    itcl-8.3.3-21mdk
    itcl is incr tcl that includes many useful widgets

    Posted by pank at 04:56 PM | Comments (0)

    Flying Car

    空浮車、時光機、瞬間移動裝置一直是我的三大夢想

    飛行車在未來十年內即將實現!
    http://www.businessweek.com/technology/content/aug2004/tc20040825_4462_tc119.htm

    不過我理想的飛行車是具備反重力系統的空浮車

    Posted by pank at 11:31 AM | Comments (0)

    [postfix] add footer or header to every outgoing and incoming message

    edit master.cf

    smtp inet n n n - - smtpd
    -o content_filter=filter:
    filter unix - n n - - pipe
    flags=Rq user=filter argv=/path/mailfilter.sh ${sender} ${recipient}

    edit /path/mailfilter
    # file mailfilter.sh
    # this sample script add http://pank.org at the bottom of message
    TEMP=/tmp/temp-$$.eml
    cat > $TEMP
    RCPT=`echo $@ | cut -d' ' -f2-`
    {
    cat $TEMP
    echo -e "\n--\nhttp://pank.org\n"
    } | $SENDMAIL -i $RCPT
    rm $TEMP

    Posted by pank at 11:02 AM | Comments (0)

    August 26, 2004

    DOS box under Windows 2K/XP

    http://dosbox.sourceforge.net/

    用 dosbox 可以在 2K/XP 模擬舊 dos 環境, 玩 dos game 比較順

    ref. Get DOS games working in XP!

    Posted by pank at 10:09 PM | Comments (0)

    August 24, 2004

    Joe 3.1

    Joe 是我習慣用的編輯器, 最近出了 3.x 版

    http://sourceforge.net/projects/joe-editor/
    Download

    好用新功能
    3.0 部分

    - Syntax highlighting
    這個功能對寫程式很好用
    - Auto detect CR-LF (MS-DOS) files
    若是 DOS format file, 不會看到最後的^M, 編輯後的格式仍是 DOS format, 可以用 ^T, Z 關掉
    - File selection window is now 4 lines instead of 1
    ^KE, 選擇編輯檔案新增為4行(3.1版是多行)

    3.1 部分
    - Use ^T E to set character set of file (hit at the
    prompt for a list of available character sets).
    可以設文件的 charset
    - TAB completion is now more "bash"-like
    選擇編輯檔時按 tab 表現
    - Added -icase option for case insensitive search by default.
    忽略大小寫的搜尋參數
    - Added status line sequence %x: shows current context (function
    name if you're editing C).
    第一行狀態列顯示目前在那個 function (寫程式好用)
    - Added tab completion at search prompts and ESC-Enter for tab
    completion within text windows.
    在搜尋時, 按 tab 自動補齊可能 keyword
    在內文打字時, 參照內文自動補齊, 例如在編輯程式時, 打了 inc 再按 ESC-Enter 會自自補齊變成 include
    - Added Ctrl-space block selection method
    按 Ctrl-space 選取區塊, 可惜這功能鍵在 Windows 下和切換輸入法衝突, 無法在 Winodws 下使用
    - ^K E asks if you want to load original version of the file
    再編輯同一個檔尚未存檔時會問要不要載入原檔

    其他新增功能
    ^@ insert 這功能名為 insert, 但是試的結果和 Ctrl-space 差不多, 可用來選取區塊
    ^K, ^K. 左右平移一次動2格
    I-SEARCH ^[R Backwards ^[S Forwards 立即落點至搜尋字串

    Posted by pank at 01:36 AM | Comments (0)

    August 23, 2004

    Test ACPI and APM under Linux

    ACPI
    1. S1: echo 1 > /proc/acpi/sleep Standby, 按 power key 後繼續動作
    2. S2: 未使用
    3. S3: echo 3 > /proc/acpi/sleep 沒反應
    4. S4: echo 4 > /proc/acpi/sleep 沒反應
    5. S5: echo 5 > /proc/acpi/sleep 直接關機, 未 sync
    http://www.commoner.com/~lsimon/AsusM3N.html

    Get pmtools
    Usage: pmtest [OPTION] [TYPE] [ID]

    where OPTION is one of:
    -l list devices (default)
    -d0 resume device (ACPI D0)
    -d1, -d2, -d3 suspend device (ACPI D1-D3)

    and TYPE is one of:
    unknown PCI USB SCSI ISA system

    and ID is one of:
    keyboard serial irda floppy vga pcmcia
    or a specific device number from /usr/include/linux/pm.h.

    Examples:
    pmtest -l PCI list all registered PCI devices
    pmtest -d0 VGA resume (unblank) the console
    pmtest -d3 PCI 0x1234 suspend a PCI device

    ref. http://www.columbia.edu/~ariel/acpi/acpi_howto.txt

    APM
    apm -s, --suspend
    Put the machine into suspend mode if possible.
    apm -S, --standby
    Put the machine into standby mode if possible.
    ref. man apm

    ACPI S1~S5 說明

    S0 => 正常模式
    S1 => Standby CPU 有供電, 停止指令運作, 許多週邊停止運作
    S2 => 根據規格, 未使用
    S3 => Suspend to RAM 即是把 windows 現在存在記憶體中的所有資料保存不動,然後進入「假關機」。此時除了記憶體需要電源來保持資料以外,其它的設備、裝置全部停止供電。
    S4 => Suspend to Disk 即是把 windows 記憶體中的資料完整的存在硬碟中。
    等開機時就直接從存這些資料的地方直接完整的讀到記憶體, 不需要跑一堆應用程式。
    使用這種模式的話, 硬碟一定要騰出一個完整的連續空間。
    WinME/2000/XP 本身就有休眠功能, Linux 2.4.x kernel 不支援
    S5 => Soft Off, 立即關機

    ref. http://ftp.sun.ac.za/ftp/mirrorsites/linux-extra/docs/acpi/sleep.html

    Posted by pank at 11:47 AM | Comments (0)

    August 21, 2004

    一張網卡 bind 兩個不同網段的 IP

    環境: 兩條對外網路, 兩個 ATU-R 均接到 Hub, 電腦接 Hub

    IP1 100.100.100.100/24 Gateway 100.100.100.254
    IP2 200.200.200.200/24 Gateway 200.200.200.254

    ifconfig eth0 100.100.100.100 netmask 255.255.255.0
    ifconfig eth0:0 200.200.200.200 netmask 255.255.255.0

    由於 default gateway 只能設一個, 所以會有其中一個 IP 不通

    必需用 ip route2 來解決這個問題
    kernel option 中的 IP: policy routing 必需勾選(CONFIG_IP_MULTIPLE_TABLES)
    否則在使用 ip rule 時會出現如下錯誤訊息
    # ip rule list
    RTNETLINK error: Invalid argument
    dump terminated

    先在 /etc/iproute2/rt_tables 下建兩個 table
    echo "100 line1" >> /etc/iproute2/rt_tables
    echo "200 line2" >> /etc/iproute2/rt_tables

    # 設定 line1 的 gateway
    ip route add default via 100.100.100.254 table line1
    # 設定 line2 的 gateway
    ip route add default via 200.200.200.254 table line2
    # 指定從 100.100.100.100 進來的連線走 rule line1
    ip rule add from 100.100.100.100 table line1
    # 指定從 200.200.200.200 進來的連線走 rule line1
    ip rule add from 200.200.200.200 table line2

    設完後, 從外面連兩個 IP 都可以通

    連外負載平衡
    kernel option 中的 IP: equal cost multipath 必需勾選(CONFIG_IP_ROUTE_MULTIPATH)
    指定 multipath
    ip route add default scope global nexthop via 100.100.100.254 dev eth0 weight 1 \
    nexthop via 200.200.200.254 dev eth0 weight 1
    設完後就達成 line1 line2 路由平衡, 可以調整 weight 參數來決定 line1 或 line2 的比重
    ip route list 會看到 default 如下
    default
    nexthop via 100.100.100.254 dev eth0 weight 1
    nexthop via 200.200.200.254 dev eth0 weight 1

    ref. http://lartc.org/

    Posted by pank at 03:09 PM | Comments (0)

    August 20, 2004

    Apache mod_limitipconn

    http://dominia.org/djao/limitipconn.html

    這個 mod 可以用來檔 flashget, net transport, netants 之類的多線程下載程式,
    開太多線, 對 server 造成負擔, 又不會比較快

    FreeBSD
    cd /usr/ports/www/mod_limitipconn && make install

    編輯 httpd.conf
    LoadModule limitipconn_module libexec/apache/mod_limitipconn.so
    AddModule mod_limitipconn.c
    ExtendedStatus On

    新增
    <IfModule mod_limitipconn.c>
    <Location />
    MaxConnPerIP 2
    </Location>
    <Location /cgi-bin>
    MaxConnPerIP 2
    </Location>
    </IfModule>

    若有 VirtualHost, 請加到對應的 block

    apachectl restart 後, 測試一下
    log 裡面會發現 503, 就是被限制的線程
    220.130.142.100 - - [20/Aug/2004:01:32:43 +0800] "GET /test.rar HTTP/1.1" 503 395
    220.130.142.100 - - [20/Aug/2004:01:32:49 +0800] "GET /test.rar HTTP/1.1" 503 395
    220.130.142.100 - - [20/Aug/2004:01:32:55 +0800] "GET /test.rar HTTP/1.1" 503 395
    220.130.142.100 - - [20/Aug/2004:01:33:02 +0800] "GET /test.rar HTTP/1.1" 503 395
    220.130.142.100 - - [20/Aug/2004:01:33:08 +0800] "GET /test.rar HTTP/1.1" 503 395
    220.130.142.100 - - [20/Aug/2004:01:33:14 +0800] "GET /test.rar HTTP/1.1" 503 395

    Posted by pank at 01:49 AM | Comments (0)

    August 19, 2004

    August 18, 2004

    Taiwan FreeBSD FTP Server

    ftp.tw.freebsd.org is an alias for freebsd.csie.nctu.edu.tw.
    ftp1.tw.freebsd.org is an alias for freebsd.ntcu.net.
    ftp2.tw.freebsd.org is an alias for freebsd.nsysu.edu.tw.
    ftp3.tw.freebsd.org is an alias for ccuftp.ccu.edu.tw.
    ftp4.tw.freebsd.org is an alias for ftp.ee.ncku.edu.tw.
    ftp5.tw.freebsd.org is an alias for freebsd.ntcu.net.
    ftp6.tw.freebsd.org is an alias for bsd.cc.ntu.edu.tw.
    ftp7.tw.freebsd.org is an alias for ftp.NHCTC.edu.tw.
    ftp8.tw.freebsd.org is an alias for ftp.tku.edu.tw.
    ftp9.tw.freebsd.org is an alias for ftp.chu.edu.tw.
    ftp10.tw.freebsd.org is an alias for freebsd.ntcu.net.
    ftp11.tw.freebsd.org is an alias for mirror.csie.ntu.edu.tw.
    ftp12.tw.freebsd.org is an alias for freebsd.ndhu.edu.tw.
    ftp13.tw.freebsd.org is an alias for freebsd.cis.nctu.edu.tw.
    ftp14.tw.freebsd.org is an alias for FreeBSD.nccu.edu.tw.
    ftp15.tw.freebsd.org is an alias for freebsd.giga.net.tw.

    for make.conf

    MASTER_SITE_OVERRIDE?= \
    ftp://freebsd.csie.nctu.edu.tw/pub/distfiles/${DIST_SUBDIR} \
    ftp://ftp1.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR} \
    ftp://ftp2.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} \
    ftp://ftp3.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR} \
    ftp://ftp6.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR} \
    ftp://ftp7.tw.freebsd.org/pub/distfiles/${DIST_SUBDIR} \
    ftp://ftp8.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} \
    ftp://ftp9.tw.freebsd.org/FreeBSD/distfiles/${DIST_SUBDIR} \
    ftp://ftp11.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} \
    ftp://ftp13.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} \
    ftp://ftp14.tw.freebsd.org/distfiles/${DIST_SUBDIR} \
    ftp://ftp15.tw.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR} \
    # 1,5,10 same, ftp4 down, ftp12 no distfiles

    Posted by pank at 11:44 AM | Comments (0)

    Microsoft File System Limitations

    FAT16
    最大分割區: 4G, 作業系統限制: DOS, Windows 9x 為 2G
    最大檔案: 4G, 作業系統限制: DOS, Windows 9x 為 2G

    FAT32
    最大分割區: 127G, 作業系統限制: 32G
    最大檔案: 4G

    NTFS
    最大分割區: 約 2^64, 作業系統限制: 約 256T
    最大檔案: 約 2^64, 作業系統限制: 約 16T

    ref.
    Size Limitations in NTFS and FAT File Systems
    File Systems
    Maximum Partition Size Using FAT16 File System
    Limitations of FAT32 File System
    NTFS.com: NTFS vs FAT

    Posted by pank at 12:26 AM | Comments (0)

    August 17, 2004

    Install Java plugin to Mozilla

    http://plugindoc.mozdev.org/linux.html#Java

    Java Runtime Environment

    Version: 1.4.2_05 and later

    Install Step
    1. Install Java Runtime Environment.
    2. Make a symbolic linkto libjavaplugin_oji.so in your Mozilla Plugins
    directory.

    Important notes: Do not copy the plugin to your plugs directory.
    If you do, Mozilla will crash any time you attempt to view a page containing a
    Java applet.

    Posted by pank at 06:29 PM | Comments (0)

    Movie player on Linux

    XINE
    MPlayer
    Totem Moive Player

    Posted by pank at 11:14 AM | Comments (0)

    August 16, 2004

    idesk

    http://idesk.sourceforge.net/
    可以把 icon 放到 root desktop 上(eg. IceWM's desktop)

    原始網站上的 0.3.5 版的檔案壞了(已發信通知作者)
    正確檔案可到這裡下載

    要 make idesk, 需要下面的 rpm
    freetype2-devel
    libtiff3-devel
    libungif4-devel
    libimlib1-devel

    作如下 link
    ln -fs /usr/include/freetype2/freetype /usr/include

    make 的時候, /usr/include/pngconf.h
    __png.h__ already includes setjmp.h;
    __dont__ include it again.;
    這兩行會出現錯誤, 不曉得為什麼, mark 掉即可 make, make 出的來檔案也正常

    idesk 需要 /etc/fonts/fonts.conf
    這個檔是給 Xlib 看的
    The X-specific library 'Xft' uses fontconfig along with freetype to specify and rasterize fonts.
    若沒這個檔, 會出現如下錯誤
    FontConfig error: Cannot load default config file

    idesk 需要 /usr/X11R6/lib/modules/extensions/libextmod.a
    若沒這個檔, idesk 可以跑, 但是有 mouse 動作時會出現如下錯誤, 而且 icon 透明的部分會變成黑色
    Xlib: extension "SHAPE" missing on display ":0.0".

    設定檔 $HOME/.ideskrc
    範例

    table Config
    FontName: tahoma
    FontSize: 8
    FontColor: #ffffff
    PaddingX: 35
    PaddingY: 25
    Locked: false
    HighContrast: false
    Transparency: 150
    Shadow: true
    ShadowColor: #000000
    ShadowX: 1
    ShadowY: 2
    Bold: false
    end

    PaddingX, PaddingY: 這個參數在 README 並沒有提到, 在新版(0.5x)也被刪除, 意義不明
    Locked: 是否鎖定 icon 位置
    HighContrast:是否在 text 外框用反色描繪
    Transparency: 透明度, 0=不透明, 255=完全透明, 指 mouse not hover 時的狀況
    Shadow: 是否描繪影子
    UseDoubleClick: 是否使用 double click 啟動程式
    Bold: 是否 text 粗體

    設定目錄 $HOME/.idesktop (內存 icon link file)
    範例:

    table Icon
    Caption: mozilla
    Command: /usr/bin/mozilla
    Icon: /usr/share/icons/mozilla.png
    X: 60
    Y: 200
    end

    Posted by pank at 06:18 PM | Comments (1)

    August 15, 2004

    Windows XP SP2 4226 fix

    In XP SP2 there is a limit of 10 Concurrent TCP Connections
    Patch Download

    ref.
    http://www.lvllord.de/4226fix/4226fix.htm
    http://www.neowin.net/forum/index.php?showtopic=200828

    Posted by pank at 02:45 AM | Comments (0)

    August 14, 2004

    Cmdow

    http://www.commandline.co.uk/cmdow/index.html
    Download

    Cmdow is a Win32 commandline utility for NT4/2000/XP/2003 that allows windows to be listed, moved, resized, renamed, hidden/unhidden, disabled/enabled, minimized, maximized, restored, activated/inactivated, closed, killed and more.

    eg.
    Run a program hidden: cmdow /run /hid myprog.exe

    Posted by pank at 10:48 PM | Comments (0)

    WinRAR self-extraction installation tip

    WinRAR 可以在註解加入 icon 建立參數來製作簡易的安裝程式

    Delete 解壓縮前先刪除檔案
    License 顯示程式的使用授權協定
    Overwrite 選擇檔案的覆寫模式
    Path 設定預設目標路徑
    Presetup 指定解壓縮前執行的程式
    SavePath 儲存目的地路徑(儲存路徑在 registry, 當下次再執行自解檔時會自動帶入, Path 參數存在時才有效)
    Setup 指定解壓縮後執行的程式
    Shortcut 建立解壓縮檔案的捷徑
    Silent 跳過開始時的對話方塊
    TempMode 解壓縮檔案到暫存資料夾
    Text 加入純文字到自解檔對話方塊純文字視窗
    Title 設定自解檔對話方塊標題

    範例

    Title=MSN Messenger 7.0.0225
    Path=%temp%
    Setup=msnnoad.exe /i
    Overwrite=1
    Silent=1
    簡單的自解範例, 解完執行 msnnoad.exe
    Title=MSN Messenger 7.0.0332 中文化
    Overwrite=1
    Path=MSN Messenger
    Silent=1
    TempMode=安裝前請先結束 MSN Messenger\n進行安裝?@MSN Messenger 7.0.0332 中文化
    Setup=msnmsgr
    解壓前秀一對話視窗, @後面接標題

    Title=Maxthon 繁體中文版
    Text
    {-
    網際暢遊(Maxthon)是一個完全免費的綠色軟體,無需註冊,
    不附加任何廣告,無需安裝,解壓到資料夾後可以直接使用,
    並且容許以任何形式傳播該軟體。
    }
    Path=Maxthon
    SavePath
    Overwrite=1
    Shortcut=D, Maxthon.exe,,, "Maxthon"
    Shortcut=P, Maxthon.exe, Maxthon,, "Maxthon"
    Shortcut=P, MaxthonUINST.exe, Maxthon,, "Uninstall"
    Setup=Maxthon.exe
    Shortcut=D 建立桌面 icon
    Shortcut=P 建立程式集 icon

    Setup 程式有加參數時需留一空白

    參數說明: (資料來自 WinRAR 說明檔)

    Delete=<檔案名稱>

    在解壓縮到目標資料夾之前刪除指定的檔案,允許數個 Delete 命令。
    如果在此指定的檔案被鎖定而無法刪除,自解檔模組在解壓縮前會試著將它臨時重新命名,並在 Windows 重新啟動時刪除它,這能不能成功則取決於 Windows 版本的差異。
    範例:

    Delete=winrar95.exe

    Delete=rarlng.dll

    License=<使用授權協議對話方塊標題>

    {-
    使用授權協定純文字 1
    使用授權協定純文字 2

    }

    當開始自解檔時,顯示軟體的使用授權協定,使用者可以接受,並繼續解壓縮,或拒絕並離開。
    License 可以是 HTML 格式或純文字格式。後者自解檔模組會配合對話方塊將指定純文字字串結合和重新格式成最佳狀態,因此如果您希望開始新段落的話,您必須在之前加入一個空字串。
    使用 HTML 可以控制顯示的字形、顏色及格式。關於 HTML 的語法在一般網際網路都找得到,或者您也可以用 HTML 編輯程式製作。
    範例:

    License=最終使用者使用授權協議書

    {-
    所有版權於 RAR 均屬於作者所專有。

    此程式是共享軟體,任何人在測試期限內均可以使用此軟體。
    在測試期限過後,您必須註冊。
    }

    Overwrite=[n]

    如果 [n] 為 0,在覆寫檔案之前使用者將先被詢問。這是 覆寫 命令的預設動作,可以不需要指定。如果 [n] 不存在或是等於 1,檔案將在沒有確認的狀況下全部覆寫。如果 [n] 等於 2,所有已存在的檔案將不會被覆寫。
    範例:
    Overwrite=1

    Path=<路徑>

    設定預設的目標路徑。路徑的絕對使用起始點在預設下為 <磁碟機號>:,如果 <路徑> 只包含名稱,它將會被附加到 Program Files 資料夾下,如果您不希望這麼做,請從 '.\' 字元開始定義起始 <路徑>。
    範例:
    設定 [Calc 3.05 beta] 為資料夾名,位置在 [Program Files] 下,當成預設路徑:

    Path=Calc 3.05 beta

    設定 [C:\Calc] 當作預設路徑:

    Path=C:\Calc

    設定 [Calc] 在根目錄下當作預設路徑:

    Path=.\Calc

    Presetup=<程式>

    自解檔在解壓縮之前將試著執行 <程式>,在執行 <程式> 之前必須先指定目標資料夾。您可以使用此命令,比如說,當安裝新版本於舊版本上面時,用以移除先前的程式版本。
    範例:
    Presetup=uninstall.exe /clean

    Setup=<程式>

    在成功解壓縮之後自解檔將會試著執行 <程式>。在執行 <程式> 之前,包含已解壓縮檔的資料夾將會設為目前資料夾
    範例:
    Setup=setup.exe

    注意

    1) 如果您在使用自解檔執行 InstallShield setup.exe 有問題的話,請試著執行 [setup.exe /SMS] 來代替簡潔的 [setup.exe]。此選項允許自解檔檢測安裝程式的離開。
    2) 全部在自解檔命令列所指定的選項都會從 Setup=<程式> 命令提交給程式,自解檔它自己則只認得 -s 選項,也就是強制背景安裝模式而不顯示開始對話方塊。
    3) 自解檔模組在安裝之前先設定 sfxname 環境變數。這個變數包含自解檔名稱,所以安裝程式可以預先讀取這類的資訊。


    shortcut=<目標類型>,<來源名稱>,<目標資料夾>,<敘述>,<捷徑名稱>

    為解壓的檔案建立一個捷徑。

    目標類型 是目標區域種類,可以有下列值:

    D 在桌面建立捷徑
    S 在 [開始] 功能表建立捷徑
    P 在 [開始] 功能表/[程式集] 中建立捷徑
    T 在 [啟動] 功能表中建立捷徑
    來源名稱 是壓縮檔名稱。

    目標資料夾 是建立捷徑的資料夾,如果它不存在,將被自我解壓縮檔建立。
    敘述 是敘述捷徑的字串。
    捷徑名稱 是由自解檔建立的 .lnk (捷徑) 檔案的檔案名稱。
    所有選項用逗號分隔。如果您需要在選項內加入逗號字元,就把整個選項加上引號。如果您要顯示引號,則必須打兩次引號。只有目標類型和來源名稱是必需的,其他選項選用。
    範例
    在桌面建立在 WinRAR 資料夾中連接到 winrar.exe 的捷徑,帶有 [WinRAR 執行檔] 的敘述和 [WinRAR 壓縮軟體] 的名稱:

    Shortcut=D, winrar.exe, WinRAR, "WinRAR 執行檔", "WinRAR 壓縮軟體"

    Silent[=選項]

    開始解壓縮時不顯示開始對話方塊。
    選項 可以是 1 或 2。如果 選項 是 1,開始解壓縮對話方塊會完全隱藏,包含進度顯示和檔案名稱。如果 選項 是 2,則跳過開始解壓縮的確認,但使用者仍然可以看到壓縮檔案的解壓縮進程。
    範例:
    Silent=2

    TempMode=[問題?述][@視窗標題純文字]

    此命令強制自解檔建立一個臨時目錄,將全部檔案解壓縮至此,然後開始執行 Setup 命令所指定的程式,並在完成 Setup 程式之後將臨時目錄中的內容全部清除。當執行這些操作時,自解檔會自動設定為 安靜模式。如果 TempMode 命令存在的話,?述中將有 Setup 命令且不得使用 path 命令。
    TempMode 命令可以有字串選項的選項,在解壓縮之前可用以定義問題和問題的標題。這樣的範例,僅在當使用者選擇 [是] 按鈕時才會開始解壓縮。
    範例:

    a) TempMode
    b) TempMode=您希望繼續安裝 Calculator 3.05 嗎?@Calculator 安裝程式

    Text=<字串>

    b)

    Text

    {-
    字串 1
    字串 2

    }

    加入指定純文字或 HTML 字串到自解檔模組的文字輸出視窗。當自解檔模組第一次遇到 Text 命令時,它會重置此視窗在加入 <字串> 之前的預設內容,後續命令則附加 <字串> 到已存在的純文字後。
    這種命令語法可以一次加入單行字串或數行字串。
    如果使用純文字語法時,自解檔模組會配合對話方塊將指定純文字字串結合和重新格式成最佳狀態,因此如果您希望開始新段落的話,您必須在之前加入一個空字串。
    使用 HTML 可以控制顯示的字形、顏色及格式。關於 HTML 的語法在一般網際網路都找得到,或者您也可以用 HTML 編輯程式製作。

    範例:

    a) 加入單一字串到對話方塊視窗
    Text=這是我的新程式

    b) 加入指定純文字到對話方塊視窗 [Text

    {-
    此程式最有趣的特性是:
    - 支援 Windows 剪貼簿;
    - 每一個處理的檔案大小最大為 10KB;
    }

    Title=<標題>

    設定自解檔的視窗標題。
    範例:
    Title==Calculator,版本 3.05


    Posted by pank at 09:02 PM | Comments (1)

    pstools for NT/2K/XP

    http://www.sysinternals.com/ntw2k/freeware/pstools.shtml

    Download

    includes many tools

    PsExec - execute processes remotely
    PsFile - shows files opened remotely
    PsGetSid - display the SID of a computer or a user
    PsKill - kill processes by name or process ID
    PsInfo - list information about a system
    PsList - list detailed information about processes
    PsLoggedOn - see who's logged on locally and via resource sharing (full source is included)
    PsLogList - dump event log records
    PsPasswd - changes account passwords
    PsService - view and control services
    PsShutdown - shuts down and optionally reboots a computer
    PsSuspend - suspends processes
    PsUptime - shows you how long a system has been running since its last reboot (PsUptime's functionality has been incorporated into PsInfo)

    Posted by pank at 08:40 PM | Comments (1)

    August 13, 2004

    Windows XP SP2

    http://www.microsoft.com/technet/prodtechnol/winxppro/maintain/winxpsp2.mspx
    主要是針對安全作強化(控制台多了防火牆、資訊安全中文)
    我裝了幾台, 還不錯








    Posted by pank at 10:07 AM | Comments (0)

    August 12, 2004

    Windows XP Unattended Installation

    Step 0: SP2 整合
    將 Windwos XP CD 解開到 x:\xpcd, 然後 xpsp2.exe/integrate:x:\xpcd
    (xpsp2.exe 是完裝的 SP2 升級檔)

    Step 1: 準備 winnt.sif (在 i386 目錄內), 設定好參數. winnt.sif 參數說明
    範例:

    [Data]
    AutoPartition=0
    MsDosInitiated="0"
    UnattendedInstall="Yes"

    [Unattended]
    UnattendMode=FullUnattended
    OemSkipEula=Yes
    OemPreinstall=No
    TargetPath=\WINDOWS
    Repartition=No
    UnattendSwitch="Yes"
    WaitForReboot="No"
    DriverSigningPolicy=Ignore
    CrashDumpSetting=0
    NtUpgrade=No

    [GuiUnattended]
    AdminPassword=*
    EncryptedAdminPassword=NO
    OEMSkipRegional=1
    TimeZone=220
    OemSkipWelcome=1

    [SystemFileProtection]
    SFCQuota=0

    [UserData]
    ProductID=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
    FullName="Windows XP"
    OrgName="Microsoft"
    ComputerName=*

    [RegionalSettings]
    LanguageGroup=7,9,10

    [Identification]
    JoinWorkgroup=WORKGROUP

    [Networking]
    InstallDefaultComponents=Yes

    [Branding]
    BrandIEUsingUnattended=Yes

    [Display]
    BitsPerPel=32
    Xresolution=800
    YResolution=600
    Vrefresh=75

    [Components]
    msmsgs=off

    [URL]
    Home_Page=www.google.com.tw

    Step 2: 建立 $OEM$ 相關目錄
    md $OEM$
    cd $OEM$
    md $1 $$ $Docs $Progs install
    如下(用不到的目錄可以省略)

    $1 下的所有檔案及目錄, 會複製到 %SystemDrive%
    $$ 下的所有檔案及目錄, 會複製到 %SystemRoot%
    install 是用來放 OEM 軟體的地方

    Step 3: 在 $OEM$ 目錄下建立 cmdlines.txt, 寫入預定執行的指令
    範例:

    [COMMANDS]
    install.bat

    Step 4: 編輯 cmdlines.txt 內的批次檔, 軟體安裝需採用 quiet 或 silient 安裝模式, 才能自動安裝, 並不是所有軟體都支援這種參數, 參考應用程序的全自動安裝
    範例:

    @ECHO OFF
    ECHO.
    ECHO 系統優化
    regedit /s tweak.reg
    ECHO.
    ECHO 安裝 MSN Messenger 6.2
    start/wait install\msn.msi /qn
    install\msn6xnoad.exe /s

    Step 5: 使用 WinISO 將異動的檔案, 塞到 Windows XP 的 ISO 檔

    Step 6: 完成, 可以使用 Virtual PC 或 VMWare 測試一下, 最後可燒成 CD

    ref.
    Windows XP Unattended Installation, Part II
    MSFN's Unattended Windows
    無人值守Windows XP安裝光盤

    Posted by pank at 11:31 PM | Comments (0)

    cramfs file size limit

    cramfs default maximum file size is 16M (16777215)
    if file size > 16M, you'll get this message when mkcramfs
    warning: file sizes truncated to 16MB (minus 1 byte).

    it's possible to make limit larger!

    modify to value CRAMFS_SIZE_WIDTH in kernel source
    include/linux/cramfs_fs.h
    (default #define CRAMFS_SIZE_WIDTH 24)

    after I tested, maximum value is 28, in other word,
    file size limit 268435455 (256MB)

    don't forget to modify mkcramfs, get cramfs tools and
    change the value as above (modify /usr/include/linux/cramfs_fs.h and rebuid mkcramfs), use modified mkcramfs to make cram files.

    note. CRAMFS_SIZE_WIDTH in kernel and mkcramfs must be the same,
    or cramfs will not work.

    Posted by pank at 04:50 PM | Comments (3)

    August 11, 2004

    Some regex example

    Check Email format
    ^[a-z]+[0-9a-z._-]*@[0-9a-z.]+[a-z]$
    will match pank@test.com, henry.pan@test.com, a_pank@test.com
    but not 1pank@test.com, pank#@test.com, %pank@test.com

    Check unix userid
    ^[a-z][a-z_-]*
    will match pank, pan_, pank-
    but not 1pank, pank#, pank!

    Posted by pank at 06:15 PM | Comments (0)

    檔案權限問題

    pank 是一般 user, home 在 /home/pank
    先以 root 權限做下列動作
    cd /home/pank
    touch file1 file2
    chmod 644 file1
    chmod 0 file2
    mkdir dir1 dir2 dir3 dir4
    chmod 755 dir1
    chmod 0 dir2
    chmod 777 dir3
    chmod 1777 dir4
    cp file1 file2 dir3
    cp file1 file2 dir4

    然後再以 pank 權限執行下列指令, 請說明會有什麼反應及動作
    1. cat file1
    2. cat file2
    3. ls dir1
    4. ls dir2
    5. rm file1
    6. rm file2
    7. rd dir1
    8. rd dir2
    9. rm dir3/file1
    10. rm dir3/file2
    11. rm dir4/file1
    12. rm dir4/file2

    解答如下

    1. cat file1 可以 cat
    2. cat file2 Permission denied
    3. ls dir1 可以 ls
    4. ls dir2 Permission denied
    5. rm file1 可以 rm
    6. rm file2 可以 rm
    7. rd dir1 可以 rd
    8. rd dir2 可以 rd
    9. rm dir3/file1 可以 rm
    10. rm dir3/file2 可以 rm
    11. rm dir4/file1 Operation not permitted
    12. rm dir4/file2 Operation not permitted

    您答對了幾題呢?

    Posted by pank at 02:45 PM | Comments (0)

    August 10, 2004

    兩台 Notebook 試用

    最近試用了兩台新的 Notebook (一台同學的, 一台公司的)

    ASUS M5200N
    拿到第一個感覺是比想像中還輕巧, 含有 DVD + CDRW combo, 才 1.55Kg
    12"螢幕, 1.5G Pentium M, 256MB RAM, 40GHD, 3個USB2.0 port
    keyboard 小了一點, 打字需要一些時間適應,
    可能是只配備 256MB RAM 的關係, 軟體執行感覺不是很流暢,
    12"螢幕對於看習慣13"的我來說, 也覺得略小
    這台適合常帶 NB 跑的人

    Joybook 5000-T10
    這台拿到第一個感覺是外塑膠感很重, 沒什麼質感,
    15.1"螢幕, 1.5G Pentium M, 512MB RAM, 40GHD, 3個USB2.0 port
    keyboard 配置不好, 如 pg up/dn 的位置, windows 鍵在 space 旁邊(一般是在 ctrl, alt 之間), keyboard 尺寸大是其優點
    和上面那台一樣, 也有 DVD + CDRW combo
    軟體執行起來滿流暢的
    15.1"的大螢幕看起很舒服
    這台適合放在桌上使用, 取代桌上型電腦

    Posted by pank at 05:52 PM | Comments (0)

    MSN Web Messenger

    MSN Web Messenger
    類似 ICQ2Go 可以從網頁登入

    Posted by pank at 05:39 PM | Comments (0)

    NOKIA 螢幕測試程式

    Download

    可觀查您的 LCD 有無壞/亮點

    Posted by pank at 09:39 AM | Comments (0)

    August 09, 2004

    Windows XP FAT32 to NTFS

    convert d: /fs:ntfs

    若為系統碟, 會在下次開機後進行轉換

    Posted by pank at 01:05 PM | Comments (0)

    Get pbase photo script

    # 範例: 周大拍的2004台北電腦應用展
    URL="http://www.pbase.com/albertjou/show16&page=all"
    for i in `lynx -dump $URL | awk -F'[] ]' '/http.*image/ {print $NF}'`
    do
        wget `lynx -source $i | awk -F\" '/IMG.*upload.*jpg/ {print $6}'`
    done
    
    Posted by pank at 03:32 AM | Comments (0)

    August 07, 2004

    數位電視盒

    昨天去買了個數位電視盒, 真是讚
    天線不像類比訊號要架很高, 在室內就可以收到訊號, 不過還是放室外高較佳
    數位電視的特點就是超清晰, 若收訊不良會呈停格或格狀畫面(就像 VCD 撥放不順的畫面)
    目前可收 12 台
    1 CTV 中視
    2 CTV NEWS 中視新聞
    3 MY LIFE 中視生活台
    4 FTV 民視
    5 FMTV 交通電視台
    6 FTVN 民視新聞
    7 TTV-1 台視
    8 TTV-2 台視家庭台
    9 HAKKA 客家電視台
    10 CTS 華視
    11 CTS_Edu 華視教學台
    12 CTS_UNEWS華視優新聞
    ps. 我買的是大通 PX DTV-1000, $3999 全國電子價, 送室外天線

    2005-10-06 Update: 現在可以共收到 14 台, 多了公視、公視Dimo

    Posted by pank at 01:50 AM | Comments (4)

    August 05, 2004

    August 04, 2004

    NetSupport School Pro

    這套軟體應用在教室, 超強, 可以廣播畫面, 看 client 端的畫面, 支援音效,
    比 VNC 還快
    download
    http://www.netsupport-inc.com/

    Posted by pank at 11:38 PM | Comments (0)

    Linux QoS requirements

    for kernel 2.4.x

    CONFIG_NET_SCHED=y
    CONFIG_NETLINK=y
    CONFIG_NET_SCH_INGRESS=y
    CONFIG_NET_QOS=y
    CONFIG_NET_CLS=y
    CONFIG_NET_CLS_FW=y
    CONFIG_NET_CLS_POLICE=y
    CONFIG_IP_NF_IPTABLES=y
    CONFIG_IP_NF_MANGLE=y
    CONFIG_IP_NF_TARGET_MARK=y

    Posted by pank at 11:13 AM | Comments (0)

    August 02, 2004

    diablo2oo2's Universal Patcher

    diablo2oo2's Universal Patcher - [dUP]
    this is cool stuff to making crack patch

    there's many crackme challenge in author's page

    Posted by pank at 11:44 PM | Comments (1)

    DVD 的倍數

    DVD燒錄機1秒寫入1350KB的資料為"等倍速",也就是說,2倍速驅動器寫入資料的速度
    為2700KB/秒、4倍速為5400KB/秒。等倍速到4倍速,縮短的時間與速度成正比,也就是說以
    4.7GB用等倍數需60分鐘,2倍數需30分鐘,4倍數需15分鐘。而8倍數速理論上是7.5分鐘,
    12倍數是5分鐘,16倍數是3.75分鐘,但事實上8倍數為10分鐘,12倍數為8分鐘,16倍數靈
    6分鐘,其不能實現的主要是產品規格所描述的是寫入速度的最大速度,是在部分外圈以這
    個速度進行燒錄,內圈則是低速燒錄,而非用這個速度來燒錄所有這個光碟。原因是燒錄機
    燒錄的原理透過旋轉碟片,而旋轉的次數超過每分鐘一萬轉時,會遇上碟片旋轉的物理上限
    ,此時碟片會出現異常,所以光碟機必須控制碟片的旋轉次數,以防止碟片的爆片。DVD碟
    片一般是從內圈向外圈寫入資料,當4倍速以下的碟片其旋轉次數不到一萬轉,所以能以最
    大速度寫入,而8倍速或更高倍速的碟機,內圈每分鐘會超過一萬轉,故必須控制內圈維持
    在4-6倍速,每分鐘不到一萬轉的部分則以8倍數或更高倍數來寫入,當速度來到16倍速時,
    最外圈的轉速接近每分鐘1萬轉時,就已經面臨物理上的極限了,所以16倍速為極限倍數,
    工研院光電所則認為,透過更精密的控制,可到達更高的極限,來到20倍數。

    Posted by pank at 11:26 PM | Comments (1)

    August 01, 2004

    jaPBe

    just another PureBasic editor
    這個開發工具比 PureBasic 原本提供的好用許多

    ref.
    http://www.robsite.de/php/pureboard/viewtopic.php?t=1632
    http://www.purebasic.com/

    Posted by pank at 01:59 AM | Comments (0)