[閒聊] 偽基百科

Written on 2:02 下午 by Yu Lai

http://zh.uncyclopedia.info/

PS: 個人覺得內容還蠻腦殘的啦..

[閒聊] 英文的數字單位

Written on 11:29 上午 by Yu Lai

今天剛好有聊到,想說就做個筆記吧。


yotta = 1024
zetta = 1021 十垓
exa = 1018 百京
peta = 1015 千兆
tera = 1012
giga = 109 十億
mega = 106 百萬
kilo = 103

mini = 10-3
micro= 10-6
nano = 10-9

PS: 毫微奈的記憶法可以用"好無奈"來幫助記憶..XD

[技術] 解決samba的charset問題

Written on 11:28 上午 by Yu Lai

就在9/11那天所po的"[技術] 在FreeBSD上掛載smbfs"中,其實有個問題沒有被提到,而是最近才解決的,那就是charset的問題。

在那台Linux上是採用zh_TW.Big5的編碼,其檔案系統也是採用Big5來儲存檔名。而在FreeBSD那台是採用zh_TW.UTF-8,自然的透過mount_smbfs來掛載會出現亂碼的問題,在經過測試,發現mount_smbfs -E的選項可說是無效..XD

所幸,解決的方法是根據samba的The Official Samba-3 HOWTO and Reference Guide中的
Chapter 30. Unicode/Charsets裡提到的:
As of Samba-3, Samba can (and will) talk Unicode over the wire. Internally, Samba knows of three kinds of character sets:

unix charset
This is the charset used internally by your operating system. The default is UTF-8, which is fine for most systems and covers all characters in all languages. The default in previous Samba releases was to save filenames in the encoding of the clients for example, CP850 for Western European countries.

display charset
This is the charset Samba uses to print messages on your screen. It should generally be the same as the unix charset.

dos charset
This is the charset Samba uses when communicating with DOS and Windows 9x/Me clients. It will talk Unicode to all newer clients. The default depends on the charsets you have installed on your system. Run testparm -v | grep "dos charset" to see what the default is on your system.

也就是只要將unix charset和display charset皆設為配合系統設定的Big5的CP950,然後在dos charset設為UTF-8,這樣透過mount_smbfs來掛載時就會自動轉成UTF-8的編碼了。而目前的成果自然就是FreeBSD上的pure-ftp (with utf-8 support)可以多很多東西囉。

[技術] BT備用Tracker列表

Written on 7:27 下午 by Yu Lai

雖然不一定有用,但勉強加入看看吧。

http://tracker.so-ga.net/announce
udp://tracker.bitcomet.net:8080/announce
udp://bt.lanspirit.net:2710/announce
http://btfans.3322.org:6969/announce
http://btfans.3322.org:8080/announce
http://tracker.prq.to/announce.php
http://tracker.prq.to:80/announce.php
http://tracker.prq.to/announce
http://tracker.prq.to:80/announce
http://bt.cnxp.com:8080/announce
http://bt.cnxp.com:6969/announce
http://privatetracker.limitedivx.com:2710/announce.php
http://tracker.torrentz.info:42426/announce
http://tracker.torrentportal.com:6969/announce
http://tracker1.desitorrents.com:6969/announce

[技術] 在FreeBSD上掛載smbfs

Written on 12:36 上午 by Yu Lai

最近,在弄lab的ftp整合計畫。
要將另一台Linux的資料透過samba的方式來掛載到ftp那台FreeBSD上。
以下則是在弄的過程所得到的一些Notes。

首先,我們可以透過以下的指令來察看有提供連線的資料
smbutil view

掛載時則使用
mount_smbfs //[username]@[host]/[service] [mountpoint]

若要加入 /etc/fstab 使開機後自動mount,請先編輯 /etc/nsmb.conf
加入[host:user]的 section,注意! host及section都必須為"大寫",既使平常輸入的是小寫!
然後在該section加入
password=[encrypted_password] (由smbutil crypt算出)

最後,在 /etc/fstab 裡加上:
//[username]@[host]/[service] [mountpoint] smbfs rw,-I=xxx.xxx.xxx.xxx,-N,-u=[uid],-g=[gid] 0 0

要測試是否成功可以用:
mount -a
來觀看結果。

[技術] 解決Blogger下IE顯示問題

Written on 5:40 下午 by Yu Lai

IE在判斷charset時,會先判斷html檔內的文字編碼,
再去判斷Web Server所提供的charset資訊。
一般而言,這樣是不會有什麼大問題。
但問題就出在判斷html檔內的<meta>資訊前,如果先遇到
<title>時會自動去判斷charset而不理會<meta>所設定的charset。

也就是說如果在Blogger下使用UTF-8編碼,IE會因為這樣的Bug而導致畫面一片空白。
遇到這樣的問題,解決的方法進到Blogger裡的範本修改一下囉。
將<head>裡的
<title><$BlogPageTitle$></title>
<$BlogMetaData$>
順序改一下,將<title>往後調,讓IE先讀取<meta>的資訊即可解決。

[技術] 在Linux上掛載FreeBSD的UFS

Written on 6:19 下午 by Yu Lai

Linux從Kernel 2.6.x開始對FreeBSD的UFS有著良好的支援,
對於FreeBSD的Slice也可以對應良好,但在mount時有些參數
仍需注意一下。

以下是在Linux上要mount UFS的一些注意的地方:
首先先用dmesg找到UFS所在的device node,
e.g.
hdc: ST380021A, ATA DISK drivehdc: max request size: 128KiB
hdc: 156312576 sectors (80032 MB) w/2048KiB Cache, CHS=65535/16/63, UDMA(33)
hdc: hdc1
hdc1: <bsd: hdc5 hdc6 hdc7 hdc8 hdc9 >
然後再執行mount指令來掛載ufs,因為要掛載slice,所以要在options中加入ufstype=ufs2。
# mount -t ufs -o ufstype=ufs2,ro /dev/hdc9 /mnt