December 2004 Archives

PPPoE 原來可以這樣

user-pic
Vote 0 Votes

IP 跟 Gateway 完全是不同網段

ppp0 Link encap:Point-Point Protocol
inet addr:218.166.248.109 P-t-P:61.228.96.254 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:14794 errors:0 dropped:0 overruns:0 frame:0
TX packets:14745 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1544763 (1.4 MiB) TX bytes:740369 (723.0 KiB)

# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
61.228.96.254 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
10.18.43.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 61.228.96.254 0.0.0.0 UG 0 0 0 ppp0

Netcraft Toolbar

user-pic
Vote 0 Votes

http://toolbar.netcraft.com/

  • Protect your savings from Phishing attacks.
  • See the hosting location of every site you visit.
  • Help defend the Internet community from fraudsters.
    Unfortunately, it support IE only.
    Screen Shot
    Download

  • BASH [ expr ] -a -o

    user-pic
    Vote 0 Votes

    expr1 -a expr2
    True if both expr1 and expr2 are true.
    expr1 -o expr2
    True if either expr1 or expr2 is true.

    -a (AND) operation first, then -o (OR) operation

    e.g.
    there're 3 files, a, c, d
    #!/bin/sh
    [ -f a -o -f b -o -f c -o -f d ] && echo 0
    [ -f a -o -f b -o -f c -a -f d ] && echo 1
    [ -f a -o -f b -a -f c -o -f d ] && echo 2
    [ -f a -o -f b -a -f c -a -f d ] && echo 3
    [ -f a -a -f b -o -f c -o -f d ] && echo 4
    [ -f a -a -f b -o -f c -a -f d ] && echo 5
    [ -f a -a -f b -a -f c -o -f d ] && echo 6
    [ -f a -a -f b -a -f c -a -f d ] && echo 7
    result is...

    Everything2 Dictionary

    user-pic
    Vote 0 Votes

    http://www.everything2.com/
    可以查到一般字典查不到的字、詞
    cosplay, workaround

    Eudora

    user-pic
    Vote 0 Votes

    我開始用 Email 以來, 一直都用 Eudora, 從 2.x (Windows 3.1 時代) 用到現在 6.x

    優點請參考 KiiAli 的中文化說明
    另外有三大缺點(明明是很基本的功能卻沒有)

  • 中文的支援度差
  • 不支援 unicode
  • HTML 處理不好 (如轉寄表格一定亂掉)
    常常在嫌, 還是一直在用, 呵呵
    主要因為用習慣了, 懶得換, 而且已經累積很多郵件資料, 查詢很方便

    感謝好友果糖的 中文相容修正

    在 Linux 用的 Thunderbird
    整體表現比 Eudora 好, 可惜常用的搜尋功能遜於 Eudora

  • Allow auth in Windows XP SP2

    user-pic
    Vote 0 Votes

    連某些服務會頓一下嗎? 可能該服務需要用到 auth (ident)
    例如 ProFTPD
    有這種狀況的話, 把 auth 加到防火牆例外可以加快連線速度
    控制台/防火牆/例外/新增連接埠
    名稱: auth
    連接埠編號: 113
    TCP

    2004年金毒獎

    user-pic
    Vote 0 Votes

    趨勢科技 2004年金毒獎
    最佳男主角 NetSky

    Google Labs Aptitude Test

    user-pic
    Vote 0 Votes

    GLAT Google Labs Aptitude Test

    ref.
    http://cruftbox.com/blog/archives/001031.html

    Tiny aircraft that just eat and go

    user-pic
    Vote 0 Votes

    吃蒼蠅的小飛機
    英國科學家觀察模擬昆蟲、烏兒的動作, 研究如何造出更小的飛行器.
    這台會飛的小飛機使用微生物能源電池,
    具有自主性, 有能力去尋找食物(死蒼蠅、蘋果).

    讓我想起回到未來那台吃垃圾的空浮車, 如果有一天車子也能使用垃圾當作能源,
    那真是太棒了.

    bzImage vs zImage

    user-pic
    Vote 0 Votes

    bzImage 和 zImage 有什麼差別?
    一個是用 bzip2 壓, 另一個是用 gzip 壓?
    很多人都有這種誤解

    基本上, "b" kernel 是載入到 high memory, 一般的 kernel 載入到 low memory.

    ref.
    make bzImage vs make zImage
    Building the Linux Kernel Image

    CleanSoftware

    user-pic
    Vote 0 Votes

    CleanSoftware.org is a resource to help Windows users find the best free daily-use software,
    free from nasties: adware, spyware, harmful/intrusive components,
    and threats to privacy.

    APNIC Zones Info

    user-pic
    Vote 0 Votes

    Time Traveler?

    user-pic
    Vote 0 Votes

    John Titor's Story
    ET Today 追追追報導
    這位自 2000 年冒出的 John Titor, 自稱是 Time Traveler
    他對我們的未來, 做了一些預言
    例如:
    6. Korea, Taiwan, and Japan will all be conquered by China.
    9. In 2015, there will be a global nuclear war between the United States, China, Europe, and Russia. Nearly 3 billion people will die. The entire world will be damaged.

    時光機的問題, 一直是物理界的經典難題.
    時光機會造成有名的「祖父詭論」, 後來科學家又提出了平行宇宙的概念,
    李連杰的救世主的劇本大概就是依這個概念而來的.
    時光機的可能性, 一直是耐人尋味的議題.
    這位 John Titor 是是否為真的 Time Traveler? 時間會證明.

    昨天嘗試要使用 GRUB 來 load Windows CE, 結果失敗

    一般 Windows CE 的檔案如下
    -r-xr--r-- 1 root root 16384 4月 29 2004 bldr*
    drwxr--r-- 2 root root 2048 6月 1 2001 bmp/
    drwxr--r-- 3 root root 2048 3月 30 2005 Documents and Settings/
    -rwxr--r-- 1 root root 72491 3月 9 2004 eboot.bin*
    -r-xr--r-- 1 root root 18805259 10月 28 20:51 nk.bin*
    -r-xr--r-- 1 root root 308316 10月 28 20:55 splash.bin*

    一張可開機的 Windows CE CF 卡使用 dd 的方式 copy 到另一張不同的 CF 卡, 是無法開機的.
    Windows CE 的 boot loader 似乎是讀固定的位置
    改用 GRUB 的話
    使用 load DOS 的方法, 失敗
    使用 load 整個 image 的方法, 失敗

    ref.
    http://www.gnu.org/software/grub/manual/grub.html
    http://syslinux.zytor.com/memdisk.php

    Mozilla Sunbird

    user-pic
    Vote 0 Votes

    The Sunbird Project is a redesign of the Mozilla Calendar component.
    It's a stand alone application.
    (Mozilla Calendar is a plugin)
    Download

    ref. http://wiki.mozilla.org/index.php/Calendar:Lightning

    Paint.NET

    user-pic
    Vote 0 Votes

    Paint.NET is image and photo manipulation software designed to be used on computers that run Windows XP.
    Paint.NET is jointly developed at Washington State University with additional help from Microsoft, and is meant to be a free replacement for the MS Paint software that comes with all Windows operating systems.
    Download

    Change MAC Address under Linux

    user-pic
    Vote 0 Votes

    ifconfig eth0 down
    ifconfig eth0 hw ether 00:11:22:33:44:55
    ifconfig eth0 up

    not really change physicall MAC address,
    after reboot, MAC address still original one

    Hosts Disable Movable Type as Comment Spam Slows Servers
    This article give me a hint.
    MT comment spam bot target mt-comments.cgi to post comment spam,
    Why not rename it!
    1. mv mt-comments.cgi mt-comments_something.cgi
    2. edit mt.cfg, uncomment CommentScript, and fill with mt-comments_something.cgi
    3. rebuild all pages

    After few days test, it works! (see 404 log)
    This way get rid of most comment spam.
    Some bot reference form action=filename, This trick will fail.

    Fresh Ports

    user-pic
    Vote 0 Votes

    http://www.freshports.org/

    Search latest FreeBSD ports

    WEP is not secure now

    user-pic
    Vote 0 Votes

    http://securityfocus.com/infocus/1814
    new generation of WEP cracking tools for 802.11 wireless networks.
    a WEP key can be determined in minutes or even seconds.

    Anti-Spam Software Test

    user-pic
    Vote 0 Votes

    Test Result

    Unfortunately, these test does not include open source software, such as Spam Assassin.

    LightScribe - 燒錄 CD label

    user-pic
    Vote 0 Votes

    將來只要使用有 LightScribe 支援的 CD/DVD, 就可以在 CD label 面燒錄圖樣/文字

    Spread Firefox

    user-pic
    Vote 0 Votes

    I just put a Firefox button on my home page

    More Buttons and Banners

    Show DirectX Info

    user-pic
    Vote 0 Votes

    run dxdiag

    由於微軟的細明體有字型碎裂及字距的問題
    可以改用螢火飛所釋出內嵌點陣字的文鼎新宋字型

    wget http://firefly.idv.tw/apt/firefly-font/fireflysung-1.3.0.tar.gz
    or
    wget http://www.study-area.org/apt/firefly-font/fireflysung-1.3.0.tar.gz
    #下載內嵌點陣字的文鼎新宋字型

    tar zxf fireflysung-1.3.0.tar.gz
    #解壓縮

    ttfm.sh --add fireflysung-1.3.0/fireflysung.ttf
    # 用 ttfm 工具安裝
    fc-cache -f -v (Build font information cache)

    裝完重新啟動 X, 把字型設為 AR PL New Sung

    ref. 螢火飛相關套件安裝

    Thunderbird 1.0 Released

    user-pic
    Vote 0 Votes

    Google Desktop Search Beta
    MSN Toolbar Suite Beta
    2 desktop searching tool to find your files, data easily.
    MSN Toolbar Suite Beta recently released.
    After I tried both of them, I feel MSN Toolbar is better.

    Tiny P2P program

    user-pic
    Vote 0 Votes

    77 IP Info

    user-pic
    Vote 0 Votes

    http://77bbs.com/ip/

    I wrote a small program to show your IP info and location with IP to Country mapping database and my bbs domain_name_query file.

    Bash Parameter Expansion

    user-pic
    Vote 0 Votes

    ${parameter:-word} Use Default Values.
    e.g.
    echo ${A:-1}
    A=2
    echo ${A:-1}
    result is
    1
    2

    ${parameter:=word} Assign Default Values.
    e.g.
    echo ${A:=1}
    echo $A
    A=2
    echo ${A:=1}
    result is
    1
    1
    2

    ${parameter:?word} Display Error if Null or Unset.
    equals [ -z $parameter ] && echo word && exit 1

    ${parameter:+word} Use Alternate Value.
    equals [ -z $parameter ] || parameter=word
    e.g.
    echo ${A:+1}
    A=2
    echo ${A:+1}
    result is

    1

    ${parameter:offset}
    ${parameter:offset:length}
    e.g.
    A=string
    echo ${A:1}
    echo ${A:2:3}
    result is
    tring
    rin

    ${!prefix*} Expands to the names of variables whose names begin with prefix
    e.g.
    A=test1
    A1=test2
    A2=test3
    B=test4
    echo ${!A*}
    result is
    A A1 A2

    ${#parameter} The length in characters of the value of parameter
    e.g.
    A=string
    echo ${#A}
    result is
    6

    ${parameter#word} Head cut
    ${parameter##word}
    e.g.
    A=file.tar.gz
    echo ${A#*.}
    echo ${A##*.}
    result is
    tar.gz
    gz

    ${parameter%word} Tail cut
    ${parameter%%word}
    e.g.
    A=file.tar.gz
    echo ${A%.*}
    echo ${A%%.*}
    result is
    file.tar
    file

    ${parameter/pattern/string} Pattern replacing
    ${parameter//pattern/string}
    e.g.
    A=linux_linux
    echo ${A/linux/freebsd}
    echo ${A//linux/freebsd}
    result is
    freebsd_linux
    freebsd_freebsd

    ref. man bash, / Parameter Expansion

    Get Windows computer name by IP

    user-pic
    Vote 0 Votes

    Linux: nmblookup -A IP
    e.g.
    # nmblookup -A 192.168.1.238
    Looking up status of 192.168.1.238
    WIN2003 <00> - B
    WIN2003 <20> - B
    WORKGROUP <00> - B
    WORKGROUP <1e> - B

    Windows: ping -a IP

    the ip before proxy

    user-pic
    Vote 0 Votes

    echo $HTTP_X_FORWARDED_FOR

    IP to Country mapping

    user-pic
    Vote 0 Votes

    Folding@home

    user-pic
    Vote 0 Votes

    http://folding.stanford.edu/

    Our goal: to understand protein folding, protein aggregation, and related diseases

    What are proteins and why do they "fold"? Proteins are biology's workhorses --
    its "nanomachines." Before proteins can carry out their biochemical function,
    they remarkably assemble themselves, or "fold." The process of protein folding,
    while critical and fundamental to virtually all of biology, remains a mystery.
    Moreover, perhaps not surprisingly, when proteins do not fold correctly (i.e. "misfold"),
    there can be serious effects, including many well known diseases,
    such as Alzheimer's, Mad Cow (BSE), CJD, ALS, Huntington's,
    and Parkinson's disease.

    Your computer's idle time is too precious to waste.
    Download client now!
    put your computer to work advancing scientific knowledge when it's not helping you.

    PS. Video RAM requirement: 16MB

    ref. Google Compute

    GRANT ALL PRIVILEGES ON *.* TO YourUserName@YourPublicIP IDENTIFIED BY "YourPassword";

    YourUserName is the username that you would like to create.
    YourPublicIP is the public IP address of your PC (can be IP range or use % to allow any host).
    ("211.72.20.%" = 211.72.20.0/24, quote IP range if with %)
    YourPassword - You can setup a password for your account.

    Don't forget flush privileges;

    e.g.
    mysql> grant all privileges on *.* to pank@"211.72.20.%" identified by "1111";
    Query OK, 0 rows affected (0.01 sec)

    mysql> flush privileges;
    Query OK, 0 rows affected (0.01 sec)

    De-Spamming The Inbox: The Hard Way
    This article shows that turn off mail server for 2 days will reduce 97.5% spam.

    I think this way is useless, many of the comments also stand opposite opinion.
    Because:
    1. Spammer never use real Email, never recive bounce mail
    2. Spammer don't care Email valid or not
    3. Email list will increase, never decrease

    Gallary and gettex

    user-pic
    Vote 0 Votes

    只要在 make php 時, enable gettex support
    ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs \
    --enable-module=so --with-config-file-path=/usr/local/etc \
    --libexecdir=/usr/local/apache/libexec --with-gd --with-zlib --with-jpeg-dir --with-freetype-dir --with-gettext
    使用 IE 看 Gallery, 相簿的 counter 都變成 1, 怪怪
    用 Firefox 倒是正常

    "ERROR: recv: Connection reset by peer"
    (return value 141)

    This error occured because license problem, maybe expired.

    workaround: change another hostname by -n parameter

    PS. If server is windows 2003, return value 0, no such error message

    mt-bayesian

    user-pic
    Vote 0 Votes

    前幾天裝了 mt-bayesian, 訓練了幾天, 就已經能正確標示 Spam Comment, 讚!
    美中不足的是沒有自動刪除的設定, 需要手動刪除

    scode 在 BBS 上看到有人裝了沒用(有秀出被干擾的數字圖片, 但是不輸入那個數字還是可以 post comment), 所以我就沒試

    Some useful variables in BASH

    user-pic
    Vote 0 Votes

    EUID
    Expands to the effective user ID of the current user, initialized
    at shell startup. This variable is readonly.

    FUNCNAME
    The name of any currently-executing shell function. This variable
    exists only when a shell function is executing. Assignments
    to FUNCNAME have no effect and return an error status. If
    FUNCNAME is unset, it loses its special properties, even if it
    is subsequently reset.

    GROUPS
    An array variable containing the list of groups of which the
    current user is a member. Assignments to GROUPS have no effect
    and return an error status. If GROUPS is unset, it loses its
    special properties, even if it is subsequently reset.

    HOSTNAME
    Automatically set to the name of the current host.

    LINENO
    Each time this parameter is referenced, the shell substitutes a
    decimal number representing the current sequential line number
    (starting with 1) within a script or function. When not in a
    script or function, the value substituted is not guaranteed to
    be meaningful. If LINENO is unset, it loses its special proper-
    ties, even if it is subsequently reset.

    OSTYPE
    Automatically set to a string that describes the operating system on which bash is executing. The
    default is system-dependent.

    PPID
    The process ID of the shell's parent. This variable is read only.

    RANDOM
    Each time this parameter is referenced, a random integer between 0 and 32767 is generated. The
    sequence of random numbers may be initialized by assigning a value to RANDOM. If RANDOM is
    unset, it loses its special properties, even if it is subsequently reset.

    UID
    Expands to the user ID of the current user, initialized at shell
    startup. This variable is readonly.

    SECONDS
    Each time this parameter is referenced, the number of seconds since shell invocation is returned.
    If a value is assigned to SECONDS, the value returned upon subsequent references is the number
    of seconds since the assignment plus the value assigned. If SECONDS is unset, it loses its special
    properties, even if it is subsequently reset.

    LINES
    Used by the select builtin command to determine the column
    length for printing selection lists. Automatically set upon
    receipt of a SIGWINCH.

    COLUMNS
    Used by the select builtin command to determine the terminal
    width when printing selection lists. Automatically set upon
    receipt of a SIGWINCH.

    ref. man bash

    iptables DNAT port mapping test

    user-pic
    Vote 0 Votes

    環境: 內部的一台機器 listen tcp port 135,139 供測試
    測試工具: nmap, 設好 rule 後作多次 port scan 動作, 觀查 open port

    135-139 對 135-139 (一對一 mapping)
    結果: port 135,139 open

    235-239 對 135-139 (一對一 shift mapping)
    結果: 動態 port 對應
    (在 235-239 中動態分配 2 個 port 分別 mapping 到 135,139)

    100-150 對 135-139 (多對少 mapping, --dport 在 listen port 範圍內)
    結果: 動態 port 對應, 135 對 135, 139 對 139 的機率很高

    150-200 對 135-139 (多對少 mapping, --dport 不在 listen port 範圍內)
    結果: 動態 port 對應

    130-140 對 120-150 (少對多 mapping, --dport 在 listen port 範圍內)
    結果: 固定 135,139 open

    140-150 對 120-140 (少對多 mapping, --dport 不在 listen port 範圍內)
    結果: 動態 port 對應
    有掃到 0 個 port, 1 個 port , 2 個 port 均有出現
    因為 10 個 port 無法一一 mapping 到 20 個 port

    結論: 當 port 無法直接 mapping 時, 會動態 mapping

    MSN's Ad Server

    user-pic
    Vote 0 Votes

    rad.msn.com 是 MSN 的存放廣告的 Server

    由 Ethereal 觀察, MSN Messenger 會送出像如下的 URL
    http://rad.msn.com/ADSAdClient31.dll?GetAd?PG=IMSTWN?SC=HF?ID=000201000251651a

    Accoona Search Engine

    user-pic
    Vote 0 Votes

    http://accoona.com/

    Accoona claims better results than Google
    Accoona takes its name from the Swahili phrase, "accoona matata," for "no worries," popularized by Disney's film, "The Lion King."

    ref. Bill Clinton helps launch search engine

    Google Scholar

    user-pic
    Vote 0 Votes

    http://scholar.google.com/
    專找學術類文章
    Stand on the shoulders of giants

    77BBS URL

    user-pic
    Vote 0 Votes

    寫了一個轉址服務 http://url.77bbs.com/
    此服務類似 http://tinyurl.com/
    不同點在於 77BBS URL 使用 sub domain 的方式做處理

  • 注意事項
    77BBS URL 使用兩碼的英數字排列組合循環使用(約有1200組), 此網址有時效性,
    網址的時效為一個循環, 直到下次有使用者佔用同一個名稱為止
    舉個例子, 假設平均每天有 40 個人使用 77BBS URL, 網址的時效性約為一個月

  • MSN Spaces

    user-pic
    Vote 0 Votes

    微軟的網誌(Blog)服務中文版於今日推出
    http://spaces.msn.com/

    快去搶一個好記的 URL 吧

    我還是會繼續使用這邊的 MT Blog, 畢竟用習慣了.
    MSN Spaces 有 10MB 限制, 這邊, 無限 :)

    IMs, blogs, SMS 正逐漸取代 Email 的地位
    有 2/3 的年輕人表示 "不用 Email 或很少用 Email", 他們的觀念認為 "只有老人跟正式的溝通才使用 Email"

    Email's efficiency falls in terms of promptness, convenience and credibility," observed Yoo Hyon-ok, president, SK Communications.

    ref. 朝鮮日報

    rbash - RESTRICTED SHELL

    user-pic
    Vote 0 Votes

    If you want to restrict someone's shell access, use rbash.

    chsh -s /bin/rbash username

    ref. man bash

    About this Archive

    This page is an archive of entries from December 2004 listed from newest to oldest.

    November 2004 is the previous archive.

    January 2005 is the next archive.

    Find recent content on the main index or look in the archives to find all content.

    Monthly Archives