2010年10月19日 星期二

Get OpenBSD/NetBSD Latest Install ISO/sets via Rsync

The performance, maybe not a good way to get iso.

OpenBSD
One big install iso




rsync -avz --progress rsync://ftp.estpak.ee/openbsd/snapshots/amd64/install48.iso .

install48.iso
240121856 100% 206.91kB/s 0:18:53 (xfer#1, to-check=0/1)

Number of files: 1
Number of files transferred: 1
Total file size: 240121856 bytes
Total transferred file size: 240121856 bytes
Literal data: 139474432 bytes
Matched data: 100647424 bytes
File list size: 47
File list generation time: 2.846 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 108569
Total bytes received: 139521735

sent 108569 bytes received 139521735 bytes 115159.01 bytes/sec
total size is 240121856 speedup is 1.72



NetBSD
boot iso and install sets




VER=`rsync rsync://nyftp.netbsd.org/NetBSD-daily/HEAD/|tail -n1|cut -d ‘:’ -f 3|cut -d ‘ ‘ -f 2`
rsync -avz --progress rsync://nyftp.netbsd.org/NetBSD-daily/HEAD/$VER/amd64/binary/sets/ ./sets/
rsync -avz --progress rsync://nyftp.netbsd.org/NetBSD-daily/HEAD/$VER/amd64/installation/cdrom/boot.iso .

Number of files: 20
Number of files transferred: 5
Total file size: 223682054 bytes
Total transferred file size: 69074290 bytes
Literal data: 67497874 bytes
Matched data: 1576416 bytes
File list size: 730
File list generation time: 30.022 seconds
File list transfer time: 0.000 seconds
Total bytes sent: 96373
Total bytes received: 67522725

sent 96373 bytes received 67522725 bytes 162741.51 bytes/sec
total size is 223682054 speedup is 3.31


The performance is not so good if you want to keep in sync often.
Possible reason see http://svana.org/kleptog/rgzip.html
http://samba.anu.edu.au/rsync/rsync-and-debian/rsync-and-debian.html

2010年10月15日 星期五

2010年10月10日 星期日

Synology NFS Server

Synology CS407e

Samba is too slow, AFP does not reconnect after network error.

Using NFS, tcp or udp, while playing HD contents on the server, and try to access the nfs volume, it blocks for a while.

Solution, create more nfsd daemon.

/usr/syno/etc/rc.d/S83nfsd.sh

#To create 16 nfs servers
/usr/sbin/nfsd 16

To see server loading

/proc/net/rpc/nfsd

th 16 261 2.256 2.056 3.144 1.404 3.564 3.820 1.556 2.408 1.696 14.924

16 threads, used the last thread 261 times.
2.256 seconds uses 10% of the 16 threads
2.056 seconds uses 20% of the 16 threads
...

2010年10月8日 星期五

Yahoo 斷章取義 API

原文

哥哥安唷 我叫小樂 目前讀大二
民國78年次 身高165cm 47kg 34c
最近家里經濟不好 出來做兼職
希望好心ㄉ哥哥可以援助
見面滿意約 ,ㄅ滿意可以ㄅ約* 愛愛 伴游 聊天 逛街 鐘點情人
ㄞㄞ 3000 2h全套服務 現金交易 ㄅ轉賬刷卡
ㄞㄞㄉ時候要帶套套ㄛ 單純交易.各取所需
有需要ㄉ哥哥加我MSN: @hotmail.com
我ㄉ相簿http://www.wretch.cc/album/
可以在我相簿留電話給我, 我會第一時間聯絡妳ㄉ
期待哥哥約

關鍵字擷取

鐘點##人 203.61894582528
哥哥 124.68604562448
滿意 98.457096577591
聊天 96.000808858899
小樂 94.645411353588
兼職 87.775598642351
希望 86.83604180972
援助 86.090431693226
愛愛 81.748683909361
單純 72.878584750222

鐘點情人的情不知道為什麼變成##,其他都還蠻準的。

另外有一個問題是,如果整篇文章只是把上面關鍵字擷取出來的再傳回去,一樣會傳回這些關鍵字。

希望 185.71838296432
聊天 170.81425651791
小樂 169.63149462119
兼職 162.70161315737
援助 161.0193089944
滿意 148.33799007289
單純 147.81485462203
哥哥 124.63040966573
鐘點 118.08395440453
愛愛 81.748683909361

有些順序變了,但是沒有變的像是”愛愛”分數還是一樣,鐘點情人因為##不見了。
所以說,只要有這些零散的字,就算沒有意圖也一樣會被判斷是怪怪的文章。

再另外,yahoo會刪掉符號,☎之類的,應該是跟標點符號一起一開始被處理掉的,但是,如果在關鍵字裡面加入中文,例如援乂交。☎兼☎職這樣符號太多的也不會被抓出來,阿...就插入一堆電話就可以通過了。

需要python範例程式請留言。
sourceforge上面有java api可以用,提供中研院斷詞跟yahoo斷詞,但是沒有關鍵字這一項。

2010年9月14日 星期二

NetBSD 新的防火牆NPF

http://mail-index.netbsd.org/netbsd-announce/2010/09/13/msg000110.html

The NetBSD Foundation is pleased to announce NPF, a new packet filter
by Mindaugas Rasiukevicius. NPF is designed for high performance on
multiprocessor machines, and for easy extensibility.

Highlights of NPF features include

* MP-safety and locklessness for scalable MP performance: no longer is
the packet filter the bottleneck in your multicore router

* Fast hash-table and red-black tree lookups

* Stateful packet filtering, Network Address Port Translation (NAPT),
and Application-Level Gateways (ALGs) for, e.g., traceroute

* The N-Code processor, a packet-inspection engine inspired by BPF:
the N-Code processor is programmed to match packets using generic,
RISC-like instructions and a few CISC-like instructions for common
patterns such as IPv4 addresses

* Familiar configuration syntax and utilities

* Modularity and extensibility: users extend NPF by loading a kernel
module. NPF provides developers with an extensions API. NPF rules
can embed a hook that invokes an extension

By the end of January, NPF should have all of the capabilities that
NetBSD users have come to expect by using the other filters in the
kernel:

* IPv4 reassembly support
* Bi-directional NAT and port forwarding (re-direction)
* FTP proxy support
* IP header flags cleansing
* ICMP packets and TCP RST packet blocking
* Save/restore state
* Packet logging, configurable using filter rules

Rasiukevicius will also write documentation and configuration examples.

Beyond that, NPF needs code for IPv6 support. Rasiukevicius agrees to
provide technical support to developers who will add IPv6 support to
NPF. An outline of the steps to IPv6 support will be forthcoming.

NPF is the third packet filter in NetBSD, after IP Filter and PF. NPF
is unique for using a bytecode interpreter in its packet-inspection
engine, and for answering the question, "What does a packet filter
designed from the bottom up for multiprocessor systems look like?"

NPF development is sponsored by the NetBSD Foundation.

2010年9月2日 星期四

蘋果產品發表會 串流

http://events.apple.com.edgesuite.net/1009qpeijrfn/event

這個網址。

要怎麼同時讓全世界這麼多人收看呢?
看一下它的ip位址。

mac:~ adolf$ nslookup events.apple.com.edgesuite.net
Server: 127.0.0.1
Address: 127.0.0.1#53

Non-authoritative answer:
events.apple.com.edgesuite.net canonical name = a314.g.akamai.net.
Name: a314.g.akamai.net
Address: 139.175.236.72
Name: a314.g.akamai.net
Address: 139.175.236.74

哇,太巧了,正好是seednet的ip,蘋果也用seednet嗎?

mac:~ adolf$ nslookup events.apple.com.edgesuite.net 168.95.1.1
Server: 168.95.1.1
Address: 168.95.1.1#53

Non-authoritative answer:
events.apple.com.edgesuite.net canonical name = a314.g.akamai.net.
Name: a314.g.akamai.net
Address: 203.69.113.8
Name: a314.g.akamai.net
Address: 203.69.113.48

單位不明的ip,不過用hinet的traceroute只有四個節點。



每個不同的isp會被導向到apple請akamai搞apple(後面是Akamai的技術)跟isp搞的伺服器去。
連giga和信超媒體也有。


新的ipod touch更接近iphone了。
新的apple tv很便宜,三千塊,可是在台灣.....應該不會有人要租0.99的影片,可不可以跟thepiratebay的東西sync也還不清楚。

2010年8月24日 星期二

免螢幕 免鍵盤 免網路線? 一條電線設定好Mac Mini Server

如果你的無線網路環境是沒有密碼的話,也許可以免網路線。

不過反正我有網路線。

環境
分享器一台,或是可以配發dhcp的東西,用macbook的網路分享也可以。
另外一台mac系統,安裝server admin tools用。(server光碟第二片)
網路線一條,接上去。


  1. 打開mini server

  2. 去分享器的地方看,目前的dhcp client,看一下mini server盒子上面的ethernet mac address,找到對應的ip是192.168.200.142

    • Voila_Capture54-2010-08-24-23-00.png



  3. 安裝server admin tools,打開server assistant。

    • Voila_Capture60-2010-08-24-23-00.png



  4. 加入一台新的server,密碼,盒子上面的serial前八位數字。

  5. 連線成功,開始之後的設定。

    • Voila_Capture61-2010-08-24-23-00.png