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
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...
0
1
2
3
4
5
6
http://www.everything2.com/
可以查到一般字典查不到的字、詞
如 cosplay, workaround
我開始用 Email 以來, 一直都用 Eudora, 從 2.x (Windows 3.1 時代) 用到現在 6.x
優點請參考 KiiAli 的中文化說明
另外有三大缺點(明明是很基本的功能卻沒有)
感謝好友果糖的 中文相容修正
在 Linux 用的 Thunderbird
整體表現比 Eudora 好, 可惜常用的搜尋功能遜於 Eudora
連某些服務會頓一下嗎? 可能該服務需要用到 auth (ident)
例如 ProFTPD
有這種狀況的話, 把 auth 加到防火牆例外可以加快連線速度
控制台/防火牆/例外/新增連接埠
名稱: auth
連接埠編號: 113
TCP
GLAT Google Labs Aptitude Test
ref.
http://cruftbox.com/blog/archives/001031.html
吃蒼蠅的小飛機
英國科學家觀察模擬昆蟲、烏兒的動作, 研究如何造出更小的飛行器.
這台會飛的小飛機使用微生物能源電池,
具有自主性, 有能力去尋找食物(死蒼蠅、蘋果).
讓我想起回到未來那台吃垃圾的空浮車, 如果有一天車子也能使用垃圾當作能源,
那真是太棒了.
bzImage 和 zImage 有什麼差別?
一個是用 bzip2 壓, 另一個是用 gzip 壓? 錯
很多人都有這種誤解
基本上, "b" kernel 是載入到 high memory, 一般的 kernel 載入到 low memory.
ref.
make bzImage vs make zImage
Building the Linux Kernel Image
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.
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
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 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
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.
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.
Unfortunately, these test does not include open source software, such as Spam Assassin.
將來只要使用有 LightScribe 支援的 CD/DVD, 就可以在 CD label 面燒錄圖樣/文字
I just put a Firefox button on my home page
More Buttons and Banners
由於微軟的細明體有字型碎裂及字距的問題
可以改用螢火飛所釋出內嵌點陣字的文鼎新宋字型
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. 螢火飛相關套件安裝
http://www.mozilla.org/products/thunderbird/
1.0 中文版 (win32)
Other Systems and Languages
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.
15 line P2P program written in Python
9 line MoleSter written in Perl
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.
${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
${parameter:-word}
Use Default Values. If parameter is unset or null, the expan-
sion of word is substituted. Otherwise, the value of parameter
is substituted.
${parameter:=word}
Assign Default Values. If parameter is unset or null, the
expansion of word is assigned to parameter. The value of param-
eter is then substituted. Positional parameters and special
parameters may not be assigned to in this way.
${parameter:?word}
Display Error if Null or Unset. If parameter is null or unset,
the expansion of word (or a message to that effect if word is
not present) is written to the standard error and the shell, if
it is not interactive, exits. Otherwise, the value of parameter
is substituted.
${parameter:+word}
Use Alternate Value. If parameter is null or unset, nothing is
substituted, otherwise the expansion of word is substituted.
${parameter:offset}
${parameter:offset:length}
Substring Expansion. Expands to up to length characters of
parameter starting at the character specified by offset. If
length is omitted, expands to the substring of parameter start-
ing at the character specified by offset. length and offset are
arithmetic expressions (see ARITHMETIC EVALUATION below).
length must evaluate to a number greater than or equal to zero.
If offset evaluates to a number less than zero, the value is
used as an offset from the end of the value of parameter. If
parameter is @, the result is length positional parameters
beginning at offset. If parameter is an array name indexed by @
or *, the result is the length members of the array beginning
with ${parameter[offset]}. Substring indexing is zero-based
unless the positional parameters are used, in which case the
indexing starts at 1.
${!prefix*}
Expands to the names of variables whose names begin with prefix,
separated by the first character of the IFS special variable.
${#parameter}
The length in characters of the value of parameter is substi-
tuted. If parameter is * or @, the value substituted is the
number of positional parameters. If parameter is an array name
subscripted by * or @, the value substituted is the number of
elements in the array.
${parameter#word}
${parameter##word}
The word is expanded to produce a pattern just as in pathname
expansion. If the pattern matches the beginning of the value of
parameter, then the result of the expansion is the expanded
value of parameter with the shortest matching pattern (the ``#''
case) or the longest matching pattern (the ``##'' case) deleted.
If parameter is @ or *, the pattern removal operation is applied
to each positional parameter in turn, and the expansion is the
resultant list. If parameter is an array variable subscripted
with @ or *, the pattern removal operation is applied to each
member of the array in turn, and the expansion is the resultant
list.
${parameter%word}
${parameter%%word}
The word is expanded to produce a pattern just as in pathname
expansion. If the pattern matches a trailing portion of the
expanded value of parameter, then the result of the expansion is
the expanded value of parameter with the shortest matching pat-
tern (the ``%'' case) or the longest matching pattern (the
``%%'' case) deleted. If parameter is @ or *, the pattern
removal operation is applied to each positional parameter in
turn, and the expansion is the resultant list. If parameter is
an array variable subscripted with @ or *, the pattern removal
operation is applied to each member of the array in turn, and
the expansion is the resultant list.
${parameter/pattern/string}
${parameter//pattern/string}
The pattern is expanded to produce a pattern just as in pathname
expansion. Parameter is expanded and the longest match of pat-
tern against its value is replaced with string. In the first
form, only the first match is replaced. The second form causes
all matches of pattern to be replaced with string. If pattern
begins with #, it must match at the beginning of the expanded
value of parameter. If pattern begins with %, it must match at
the end of the expanded value of parameter. If string is null,
matches of pattern are deleted and the / following pattern may
be omitted. If parameter is @ or *, the substitution operation
is applied to each positional parameter in turn, and the expan-
sion is the resultant list. If parameter is an array variable
subscripted with @ or *, the substitution operation is applied
to each member of the array in turn, and the expansion is the
resultant list.
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> -
WORKGROUP <1e> -
Windows: ping -a IP
http://ip-to-country.webhosting.info/node/view/36
http://www.komar.org/cgi-bin/ip_to_country.pl
Download IP to Country database
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
只要在 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, 訓練了幾天, 就已經能正確標示 Spam Comment, 讚!
美中不足的是沒有自動刪除的設定, 需要手動刪除
scode 在 BBS 上看到有人裝了沒用(有秀出被干擾的數字圖片, 但是不輸入那個數字還是可以 post comment), 所以我就沒試
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
環境: 內部的一台機器 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
rad.msn.com 是 MSN 的存放廣告的 Server
由 Ethereal 觀察, MSN Messenger 會送出像如下的 URL
http://rad.msn.com/ADSAdClient31.dll?GetAd?PG=IMSTWN?SC=HF?ID=000201000251651a
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
http://scholar.google.com/
專找學術類文章
Stand on the shoulders of giants
Just install Microsoft Windows Journal Viewer
寫了一個轉址服務 http://url.77bbs.com/
此服務類似 http://tinyurl.com/
不同點在於 77BBS URL 使用 sub domain 的方式做處理
微軟的網誌(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. 朝鮮日報
If you want to restrict someone's shell access, use rbash.
chsh -s /bin/rbash username
ref. man bash
RESTRICTED SHELL
If bash is started with the name rbash, or the -r option is supplied at
invocation, the shell becomes restricted. A restricted shell is used
to set up an environment more controlled than the standard shell. It
behaves identically to bash with the exception that the following are
disallowed or not performed:
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (see COM-
MAND EXECUTION above), rbash turns off any restrictions in the shell
spawned to execute the script.