.museum domain

太帥了,竟然有 .museum 這種 top level domain!

首頁: http://musedoma.museum/
所有 second level 的列表: http://index.museum/

Wikipedia 的 Top level domain list

ip over ptt over wifly

最近 ptt 推出「用 WiFly 免費連上 ptt/ptt2」的服務,詳細內容請見活動網頁

不過如果只能連 ptt 好像很不方便。於是我就想到可以 ip over ptt XD (當然,我用不到所以也不會寫 :p)

首先,除了用 wifly 的電腦,外面也事先要跑隻 daemon 來轉送封包。它們要做的事是連上 ptt,進 chatroom (水球會 lag,又會掉),把對方送來的 packet 往下(e.g. tcp)送。這樣就可以用 wifly 隨意上網了 XD

不只是這樣,因為 daemon 裡面外面(wifly 的裡面外面)透過 chatroom 連在一起,是對等的,所以裡面還可以跑 server 喔。當然前提是外面必須能把 packet 丟到 wifly 發的 ip。

如果上面的 idea 能成真,就可以做出一台 router 來做這些事 XD 真是邪惡…

FTP to SMTP

嘗試在自己的機器上 telnet port 21 (proftpd),然後 PORT xxx,xxx,xxx,xxx,0,25,GET mail_with_smtp.txt。結果 PORT 失敗,看 source 發現他說 PORT 六個參數都不能為零 Q_Q 惡搞失敗 orz

TIME_WAIT state

When I wrote my Computer Network’s homework, I found that binding to the same port will be failed after a client comes in and stop the httpd. I see TIME_WAIT state when execute netstat.

One should wait in TIME_WAIT state for 2 x MSL (/maximum segment lifetime/) after close one connection. The suggestion time interval in RFC 1122 is 120 seconds. But the implementation of Linux follows BSD, which set MSL to 30 seconds. There’s a comment in net/ipv4/tcp_minisocks.c:

* [ BTW Linux. following BSD, violates this requirement waiting
*   only for 60sec, we should wait at least for 240 secs.
*   Well, 240 consumes too much of resources 8)
* ]

I observed the time, and it really about 1 minute Q_Q So I should add a port to the argument :/

BTW, Unix Network Programming is really a great book!

Update:
Use setsockopt to enable SO_REUSEADDR will solve this problem.