星期三, 12月 28, 2005

OSX上匯入Windows通訊錄

這個問題找老地方和OKIOS都沒有解答,後來發現OSX的通訊錄支援LDIF,所以在Windows上利用Thunderbird匯入Outlook的通訊錄,再匯出成LDIF檔案;最後匯入OSX的通訊錄。

LDIF真是好格式,不會有語系亂碼的問題。

其實我沒有在用Outlook寫email,但是ActiveSync只能和Outlook同步通訊錄,是用MS版PDA不得已的做法。誰叫我的Palm早掛兩個月,唉~

另外聽說OSX上有要錢的工具可以和蜥蜴同步,但中文還是會亂碼,那一天才會全面使用UTF-8呢?真期待呀!

星期日, 12月 25, 2005

Mac上的RSS Reader

又被Mac嚇到,NetNewsWire這套RSS Reader介面實在是很棒,足以和Sage相比。
在Mac上Firefox有點慢,不只是RAM吃得兇,中文還三不五時掉字,讓我用起來不順手,如果Mac上的瀏覽器有簡繁轉換的功能,我就不要用Firefox了。

OSX的Blog工具

OSX上的Blog工具實在是相當多,尤其讓我驚訝的是Mac的軟體工作者人機介面通常都做得不錯。現在我這篇就是在MarsEdit上做出來,用Mac Mini的這兩星期,讓我覺得夾不死在許多方面都把鈔票之門幹掉。

星期四, 12月 15, 2005

iChatAV不支援USB

今天去弄了一支號稱支援OSX的WebCam,結果居然有找到microphone,沒有影像。
請出Google大神才知道iChat是不支援usb webcam,只支援本家1394的webcam。

再找之後發現另一個產品叫iChatUSBCam,就是不知怎樣修改讓iChat支援usb webcam,但是要$9.95;試用只能用3天。
現在馬上就要推出MacTel,我相信夾不死一定遲早會推出usb webcam,等著瞧吧~

星期日, 11月 13, 2005

Firefox 1.5

Firefox 1.5 真的很快,可惜有不少extension都不能用。
新功能很多人有寫,我倒覺得沒什麼,但速度和多工,真的令我滿意;不相信的話可以同時開啟許多分頁就知道我的意思,不像1.0.x版會被某一分頁將整個AP拖慢,應該是在multithread有下功夫。

今天又發現 blogger 的Editor不能貼上 Rich Text,在Firefox 1.0.7時記得是可以。

星期六, 11月 12, 2005

PocketPC一直當

公司買的 PocketPC似乎不是很穩?
這台HP 6365只要打開 Papago v9連結 Blue Tooth GPS後,就很容易當。

本來以為是CPU太慢,但Dopod 699似乎也有這種情形,
到底是Papago的問題還是PocketPC OS的問題呢?

星期六, 11月 05, 2005

Win32下的Vim編輯器

UltraEdit對UTF-8的中文處理不好,無法搜尋UTF-8的中文,所以去試一下EmEditor,效果不錯。

但我又不想花錢,於是就去找Vim,效果還不錯。
關於自動轉碼
http://wiki.gentoo.org.tw/mediawiki/index.php/Vim
http://wiki.debian.org.tw/index.php?title=Unicode&redirect=no
http://www.longwin.com.tw/~jon/blog/archives/000114.html

所以我將.vimrc設成

" 存取檔案預設編碼,
set fileencoding=utf-8
" 檔案編碼們
set fileencodings=utf-8,big5,gb2312,euc-jp,gbk,euc-kr,utf-bom,iso8859-1
" 檔案格式 unix 或 dos
set ffs=dos,unix
" 預設檔案格式,若有設定,存檔後自動更改為 ff
set ff=unix
" VIM 內部預設編碼
set encoding=utf-8
" 終端機編碼
" for console mode we use big5
if has("gui_running")
set termencoding=utf-8
else
set termencoding=big5
endif

colorscheme murphy

"彩色語法顯示
syntax on

"解決menu 亂碼問題
source $VIMRUNTIME/delmenu.vim
language messages zh_TW.utf-8
開啟UTF-8或是Big5都沒有問題,就算是用Notepad開的也很正常。

只是.... menu會變亂碼,找了一陣子都找不到解。發現是encoding=utf-8和syntax on就是會衝,編輯menu檔也沒用。不管怎麼設定.gvimrc會是menu變亂碼,最後亂試一通,把syntax on放到最後就正常了!
如果訊息變亂碼,就把lang\zh_TW.UTF-8\LC_MESSAGES\vim.mo覆蓋 lang\zh_TW\LC_MESSAGES\vim.mo。


Update :看了這篇才知道menu亂碼的正解。

錯怪Firefox了

最近老覺得Firefox好慢,今天無意中看到一篇MSDN上的文章,
選擇簡中版,發現有些字彙怪怪的,去改新同文堂的設定時,才赫然發現我設成自動轉換。對於所有的UTF-8編碼,新同文堂都會去翻譯,而現在大多的網頁都是UTF-8,就像這個MSN Spaces或Blogger、Gmail等,難怪Firefox變很慢

現在設成手動轉換,呵呵,又再度覺得Firefox很快。

星期二, 11月 01, 2005

Palm IIIc壞了

這台Palm IIIc跟了我4年,由於體積太大淪為通訊錄同步工具,
早上要用發現電池壞了電充不進去。

今天公司的PDA手機剛好到貨,WinCE功能果然很強,但也很難操作,微軟的工程師真該去Apple學學。

星期二, 10月 25, 2005

周思博趣談軟體

這個網站我在2000年那時候就看過了,當時就覺得Team Work應該如此;今日看起更加堅定我的信念。

中文版 http://chinesetrad.joelonsoftware.com/

英文版 http://www.joelonsoftware.com/

中文版中有幾篇經典的文章,必讀的大概就是下面這篇
約耳測試: 邁向高品質的12個步驟

很可惜的是他英文網站變成Blog,以前看到的幾篇經典文章我找不到,中文版沒有的就不知從何看起。

星期日, 10月 23, 2005

在Cygwin console輸入、顯示中文

在Cygwin console輸入、顯示中文

需要在家目錄($HOME)下新增或編輯兩個檔案:
.inputrc 和 .bash_profile

在.inputrc中要有下面三行
set meta-flag on
set convert-meta off
set output-meta on

在.bash_profile中要有下面三行
export LESSCHARSET=latin1
alias less='/bin/less -r'
alias ls='/bin/ls -F --color=tty --show-control-chars'

請參考Cygwin FAQWhy don't international (Unicode) characters work?

中文字型問題

開放原碼軟體社群討論區
http://www.cosa.org.tw/forum/index.php?action=profile;u=74;sa=showPosts

打造 Unicode 的環境

Debian下Java 1.5中文字體配置

Mono compiler

剛才寫了一個mono的Hello.cs
{
public static void Main()
{
System.Console.WriteLine("Hello World");
}
}

~>mcs hello.cs
~>mono hello.exe
Hello World
後來去Mono站看一下,發現己經支援C# 2.0,但要換compiler
~>gmcs hello.cs
~>mono hello.exe
Hello World

微軟真是過份,居然標準格式就是一個MZ檔,這是那門子的標準,ECMA太好騙了吧。

能夠執行很不錯,有空再來仔細測看看相容性如何

FreeBSD 6 無線網路設定

Wireless Network

剛才去freebsd看6.0何時Release,上面寫很多doc待更新,無意中找到這篇設定方法,是目前最完整的資料。

<sam@FreeBSD.org>

loader

$FreeBSDMall: doc/en_US.ISO8859-1/articles/wireless/article.sgml,v 1.12 2005/09/15 08:57:52 loader Exp $


1 Wireless networking basics

Wireless networks are based on the IEEE 802.11 standards. A basic wireless network consists of multiple stations communicating with radios that broadcast in either the 2.4GHz or 5GHz band (though this varies according to the locale and is also changing to enable communication in the 2.3Ghz and 4.9Ghz ranges).

802.11 networks are organized in two ways: in a BSS one station acts as a master with all the other stations associating to it; this is termed infrastructure mode and the master station is termed an access point (AP). In BSS mode all communication passes through the AP; even when one station wants to communicate with another wireless station messages must go through the AP. In the second form of network there is no master and stations communicate directly. This form of network is termed an IBSS and is commonly know as an adhoc network.

802.11 networks were first created in the 2.4GHz band using protocols defined by the IEEE 802.11b standard. These specifications include the operating frequencies, MAC layer characteristics including framing and transmission rates (communication can be done at various rates). Later the 802.11a standard defined operation in the 5GHz band, including different signalling mechanisms and higher transmission rates. Still later the 802.11g standard was defined to enable use of 802.11a signalling and transmission mechanisms in the 2.4GHz band in such a way as to be backwards compatible with 802.11b networks.

Separate from the underlying transmission techniques 802.11 networks have a variety of security mechanisms. The original 802.11 specifications defined a simple security protocol called WEP. This protocol uses a fixed pre-shared key and the RC4 cryptographic cipher to encode data transmitted on a network. Stations must all agree on the identity of the fixed key in order to communmicate. This scheme was shown to be easily broken and is now rarely used except to discourage transient users from joining networks. Current security practice is given by the IEEE 802.11i specification which defines new cryptographic ciphers and an additional protocol to authenticate stations to an access point and exchange keys for doing data communication. Further, cryptographic keys are periodically refreshed and there are mechanisms for detecting intrusion attempts (and for countering intrusion attempts). Another security protocol specification commonly used in wireless networks is termed WPA. This was a precursor to 802.11i defined by an industry group as an interim measure while waiting for 802.11i to be ratified. WPA specifies a subset of the requirements found in 802.11i and is designed for implementation on legacy hardware. Specifically WPA defines the TKIP protocol that is derived from the original WEP protocol. 802.11i permits use of TKIP but most stations will instead use the AES cipher for encrypting data; a cipher that is too computationally costly to be implemented on legacy hardware.

[no mention of 802.1x]

Other than the above protocol standards the other important standard to be aware of is 802.11e. This defines protocols for deploying multi-media applications such as streaming video and voice over IP (VoIP) in an 802.11 network. Like 802.11i, 802.11e also has a precursor specification termed WME (and now WMM) that has been defined by an industry group as a subset of 802.11e that can be implemented now to enable multi-media applications while waiting for the final ratification of 802.11e. The most important thing to understand about 802.11e and WME/WMM is that it enables prioritized traffic use of a wireless network through Quality of Service (QoS) protocols and enhanced media access protocols. Proper implementation of these protocols enable high speed bursting of data and prioritized traffic flow.

FreeBSD 6.0 supports networks that operate using 802.11a, 80.211b, and 802.11g. The WPA and 802.11i security protocols are likewise supported (in conjunction with any of 11a, 11b, and 11g) and QoS and traffic prioritization required by the WME/WMM protocols are supported for a limited set of wireless devices.


2 Basic setup

2.1 Kernel config

To use wireless networking you need a wireless networking card and to configure the kernel with the appropriate wireless networking support. The latter is separated into multiple modules so that you need only configure the software you are actually going to use.

The first thing you need is a wireless device. The most commonly used devices are those that use parts made by Atheros. These devices are supported by the ath driver and require the following modules:

device ath               # Atheros IEEE 802.11 wireless network driver
device ath_hal # Atheros Hardware Access Layer
device ath_rate_sample # John Bicket's SampleRate control algorithm.

The Atheros driver is split up into three separate pieces: the driver proper (ath), the hardware support layer that handles chip-specific functions (ath_hal), and an algorithm for selecting which of several possible rates for transmitting frames (ath_rate_sample here). If instead of an Atheros device you had another device you would select the module for that device; e.g.

device wi

for devices based on the Intersil Prism parts.

With a device driver configured you need to also bring in the 802.11 networking support required by the driver. For the ath driver this is at least the wlan module:

device wlan              # 802.11 support (Required)

Past this you will need the modules that implement cryptographic suport for the security protocols you intend to use. These are intended to be dynanmically loaded on demand by the wlan module but for now they must be statically configured. The following modules are available:

device wlan_wep          # WEP crypto support for 802.11 devices
device wlan_ccmp # AES-CCMP crypto support for 802.11 devices
device wlan_tkip # TKIP and Michael crypto support for 802.11 devices

wlan_ccmp and wlan_tkip are only needed if you intend to use the WPA and/or 802.11i security protocols. If your network is to run totally open (i.e. with no encryption) then you don't even need the wlan_wep support.

Aside from the above modules there are two other modules that are needed only if you intend to operate an access point (AP) and plan to enable WPA/802.11i/802.1x. The wlan_xauth module is used to construct an authenticator based on the hostapd program; it delegates authentication requests for stations associating to an access point to an external agent (hostapd in this case). The wlan_acl module implements an access control mechanism whereby an AP can restrict the stations that associate based on their MAC address. Like WEP this is provided to discourage casual users from joining a network; in practice it provides little true security to a wireless network. In summary you might add one or both of the following to your configuration if you plan to build an access point:

device wlan_xauth        # External authenticator support for 802.11 devices
device wlan_acl # MAC-based ACL support for 802.11 devices

With this information in the kernel configuration file, recompile the kernel and reboot your FreeBSD box (or load the modules using kldload in which case there is no need to reboot).


2.2 Load the wireless crypto support modules

# vi /boot/loader.conf 
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
wlan_xauth_load="YES"
wlan_acl_load="YES"

Note: You may the choose the crypto services support you need: either to compile them in the kernel or to load the .ko modules. Please note that you need to configure those modules manually as the kernel is not yet able to dynamically load them on-demand.

When the system is up, we could find some information about the device in the boot message, like this:

ath0:  mem 0xff9f0000-0xff9fffff irq 17 at device 2.0 on pci2
ath0: Ethernet address: 00:11:95:d5:43:62
ath0: mac 7.9 phy 4.5 radio 5.6

2.3 Project 'EVIL'

----- Add something about the ndis(4)? -----


3 Infrastructure Mode

3.1 FreeBSD Clients

3.1.1 How to find the access points

--------Add some words about 'scan & list scan' ? --------

# ifconfig ath0 up scan
dlinkap 00:13:46:49:41:76 6 54M 29:0 100 EPS WPA WME
freebsdap 00:11:95:c3:0d:ac 1 54M 22:0 100 EPS WPA

Initiate a scan of neighboring stations, wait for it to complete, and display all stations found. Only the super-user can initiate a scan. Depending on the capabilities of the APs, the following flags can be included in the output:

E

Extended Service Set (ESS). Indicates that the station is part of an infrastructure network (in contrast to an IBSS/ad-hoc network).

I

IBSS/ad-hoc network. Indicates that the station is part of an ad-hoc network (in contrast to an ESS network).

P

Privacy. Data confidentiality is required for all data frames exchanged within the BSS. This means that this BSS requires the station to use cryptographic means such as WEP, TKIP or AES-CCMP to encrypt/decrypt data frames being exchanged with others.

S

Short Preamble. Indicates that the network is using short preambles (defined in 802.11b High Rate/DSSS PHY, short pre- amble utilizes a 56 bit sync field in contrast to a 128 bit field used in long preamble mode).

s

Short slot time. Indicates that the network is using a short slot time.

list scan: Display the access points and/or ad-hoc neighbors located in the vicinity. This information may be updated automatically by the adaptor and/or with a ``scan'' request. ``list ap'' is another


3.1.2 Basic Settings

This is just an simple example showing how to make the wireless network adapter work in FreeBSD. We strongly recommand using WPA to setup your wireless network.


3.1.2.1 DHCP

simply edit /etc/rc.conf and add:

ifconfig_ath0="DHCP"

If there are multiple access points, you must set an ssid to locate one by name.

ifconfig_ath0="ssid your_ssid_here DHCP"

Bring up the interface after the system is up:

# /etc/rc.d/netif start 

3.1.2.2 Static IP Address

try to set an IP address, if there's more than one wireless network, we need to specify the ssid

# ifconfig ath0 inet 192.168.1.100 netmask 255.255.255.0 ssid your_ssid_here 

Now, run ifconfig again to see the status of the interface ath0

# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
status: associated
ssid dlinkap channel 6 bssid 00:13:46:49:41:76
authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

3.1.3 WPA

WPA (Wi-Fi Protected Access) is basically TKIP + 802.1X. TKIP (Temporary Key Integrity Protocol) the part of 802.11i standard which is designed to fix the weakness of WEP and it can be used with the old 802.11 standard.

RSN (WPA2) uses CCMP (Counter Mode with CBC-MAC Protocol) instead of TKIP.


3.1.3.1 WPA-PSK

A pre-shared key (PSK) will be generated from a given password and will be used as the master key in the wireless network.

Please use good passwords that are sufficiently long and made from a rich alphabet so they won't be guessed and/or attacked.

# vi /etc/wpa_supplicant.conf

network={
ssid="freebsdap"
psk="freebsdmall"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...

Then, let's bring up the interface:

# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 5
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.1
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
protmode CTS roaming MANUAL bintval 100

Or you can try to config it manually:

Using the same /etc/wpa_supplicant.conf above, and run:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=TKIP GTK=TKIP]

And run the dhclient command:

# dhclient ath0
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.254 -- renewal in 300 seconds.

# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/48Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
protmode CTS roaming MANUAL bintval 100

Note: If the /etc/rc.conf is setup with:

ifconfig_ath0="DHCP"
then it's no need to run the dhclient command manually, dhclient will be launched after wpa_supplicant plumbs the keys.

----- Should I remove the following section? -----

And also, you can set an static IP address:

# ifconfig ath0 inet 192.168.0.100 netmask 255.255.255.0

# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.100 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit txpowmax 36
protmode CTS roaming MANUAL bintval 100

# route add default your_default_routeer

# echo "nameserver your_DNS_server" >> /etc/resolv.conf

3.1.3.2 EAP-TLS
# vi /etc/wpa_supplicant.conf

network={
ssid="freebsdap"
proto=RSN
key_mgmt=WPA-EAP
eap=TLS
identity="loader"
ca_cert="/etc/certs/cacert.pem"
client_cert="/etc/certs/clientcert.pem"
private_key="/etc/certs/clientkey.pem"
private_key_passwd="freebsdmallclient"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

----- Should I remove the following section? -----

We also can bring up the interface manually:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.3.3 EAP-TTLS
# vi /etc/wpa_supplicant.conf

network={
ssid="freebsdap"
proto=RSN
key_mgmt=WPA-EAP
eap=TTLS
identity="test"
password="test"
ca_cert="/etc/certs/cacert.pem"
phase2="auth=MD5"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

----- Should I remove the following section? -----

We also can bring up the interface manually:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.3.4 EAP-PEAP
# vi /etc/wpa_supplicant.conf

network={
ssid="freebsdap"
proto=RSN
key_mgmt=WPA-EAP
eap=PEAP
identity="test"
password="test"
ca_cert="/etc/certs/cacert.pem"
phase1="peaplabel=0"
phase2="auth=MSCHAPV2"
}
# vi /etc/rc.conf

... ... ...

ifconfig_ath0="WPA DHCP"

... ... ...
# /etc/rc.d/netif start
Starting wpa_supplicant.
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPREQUEST on ath0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.20
bound to 192.168.0.254 -- renewal in 300 seconds.
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.254 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

----- Should I remove the following section? -----

We also can bring up the interface manually:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:11:95:c3:0d:ac (SSID='freebsdap' freq=2412 MHz)
Associated with 00:11:95:c3:0d:ac
EAP-MSCHAPV2: Authentication succeeded
EAP-TLV: TLV Result - Success - EAP-TLV/Phase2 Completed
WPA: Key negotiation completed with 00:11:95:c3:0d:ac [PTK=CCMP GTK=TKIP]
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy ON deftxkey UNDEF TKIP 2:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.1.4 WEP

WEP (Wired Equivalent Privacy) is part of the original 802.11 standard. There is no authentication mechanism, only a weak form of access control, and it's easily to be cracked.

First, please make sure 「device wlan_wep」 is compiled in the kernel or module 「wlan_wep.ko」 is loaded

# ifconfig ath0 inet 192.168.1.100 netmask 255.255.255.0 ssid dlinkap       wepmode on weptxkey 3 wepkey 3:0x3456789012 
# ifconfig
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.1.100 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
status: associated
ssid dlinkap channel 6 bssid 00:13:46:49:41:76
authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
protmode CTS bintval 100
  • The 「weptxkey」 means which WEP key will be used in the transmission. Here we used the third key.

  • The 「wepkey」 means setting the selected WEP key. It should in the index:key format, If the index is not give, key 1 is set. That is to say we need to set the index if we use other keys rather than the first key.

And wpa_supplicant also can be used to locate and configure access points which configured with WEP.

Set it working like the example above:

# vi /etc/wpa_supplicant.conf

network={
ssid="dlinkap"
key_mgmt=NONE
wep_key2=3456789012
wep_tx_keyidx=2
}
# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:13:46:49:41:76 (SSID='dlinkap' freq=2437 MHz)
Associated with 00:13:46:49:41:76

3.2 FreeBSD Host Access Points

FreeBSD also can function as an Access Point, and now it supports WPA with the hostapd.


3.2.1 host-based access point:

----- Should I remove this section? -----

The host side:

# ifconfig ath0 inet 192.168.0.120 netmask 255.255.255.0 ssid freebsdap mode 11g mediaopt hostap 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet 192.168.0.120 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4
ether 00:11:95:c3:0d:ac
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode OPEN privacy OFF txpowmax 36 protmode CTS dtimperiod 1
bintval 100

The client side:

# ifconfig ath0 up scan
SSID BSSID CHAN RATE S:N INT CAPS
freebsdap 00:11:95:c3:0d:ac 1 54M 19:0 100 ES
dlinkap 00:13:46:49:41:76 6 54M 30:0 100 EPS WPA WME
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 ssid freebsdap 
# ifconfig -v ath0
ath0: flags=8843 mtu 1500
inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

3.2.2 WEP:

The host side:

# ifconfig ath0 inet 192.168.0.120  netmask 255.255.255.0 ssid freebsdap     wepmode on weptxkey 3 wepkey 3:0x3456789012 mode 11g mediaopt hostap 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet 192.168.0.120 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4
ether 00:11:95:c3:0d:ac
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
protmode CTS dtimperiod 1 bintval 100

The client side:

# ifconfig ath0 up scan
SSID BSSID CHAN RATE S:N INT CAPS
freebsdap 00:11:95:c3:0d:ac 1 54M 20:0 100 EPS
dlinkap 00:13:46:49:41:76 6 54M 30:0 100 EPS WPA WME
# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 ssid freebsdap     wepmode on weptxkey 3 wepkey 1:0x3456789012 
# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.130 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/54Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode OPEN privacy ON deftxkey 3 wepkey 3:40-bit txpowmax 36
protmode CTS roaming DEVICE bintval 100

3.2.3 WPA-PSK

The host side:

# vi /etc/hostapd.conf

interface=ath0
driver=bsd
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=freebsdap
wpa=1
wpa_passphrase=freebsdmall
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP

And run:

# /usr/sbin/hostapd /etc/hostapd.conf 
# ifconfig ath0 mediaopt hostap 

The client side:

# ifconfig ath0 up scan
dlinkap 00:13:46:49:41:76 6 54M 29:0 100 EPS WPA WME
freebsdap 00:11:95:c3:0d:ac 1 54M 22:0 100 EPS WPA
# vi /etc/wpa_supplicant

network={
ssid="freebsdap"
psk="freebsdmall"
}

And run:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf

# ifconfig ath0 inet 192.168.0.130 netmask 255.255.255.0 
# ifconfig -v ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.1.130 netmask 0xffffff00 broadcast 192.168.1.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (DS/11Mbps)
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA privacy ON deftxkey UNDEF TKIP 2:128-bit TKIP 3:128-bit
txpowmax 36 protmode CTS roaming MANUAL bintval 100

3.2.4 EAP-TLS:

------ Should I add a section about generating the SSL keys/certificates? -----

# vi /etc/hostapd.conf

interface=ath0
driver=bsd
logger_syslog=-1
logger_syslog_level=0
logger_stdout=-1
logger_stdout_level=0
debug=4
dump_file=/tmp/hostapd.dump
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=freebsdap
ieee8021x=1
own_ip_addr=127.0.0.1
auth_server_addr=127.0.0.1
auth_server_port=1812
auth_server_shared_secret=freebsdmallradius
wpa=2
wpa_key_mgmt=WPA-EAP
wpa_pairwise=CCMP TKIP

I installed net/freeradius and it's running on the same host.

# vi /usr/local/etc/raddb/clients.conf

client 127.0.0.1 {
secret= freebsdmallradius
shortname= localhost
}
# vi /usr/local/etc/raddb/users

"loader" Auth-Type := EAP
# vi /usr/local/etc/raddb/eap.conf

eap {
default_eap_type = tls
timer_expire = 60
ignore_unknown_eap_types = no
cisco_accounting_username_bug = no
md5 {
}
leap {
}
gtc {
auth_type = PAP
}
tls {
private_key_password = freebsdmallserver
private_key_file = /home/loader/radius/serverkey.pem
certificate_file = /home/loader/radius/servercert.pem
CA_file = /home/loader/radius/CA_nlab/cacert.pem
dh_file = ${raddbdir}/certs/dh
random_file = /dev/urandom
fragment_size = 1024
}
mschapv2 {
}
}
# /usr/local/etc/rc.d/radiusd.sh start 
# hostapd /etc/hostapd-eap-tls.conf

# ifconfig ath0 mediaopt hostap 
# ifconfig ath0
ath0: flags=8843 mtu 2290
inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:c3:0d:ac
media: IEEE 802.11 Wireless Ethernet autoselect <:hostap> (autoselect )
status: associated
ssid freebsdap channel 1 bssid 00:11:95:c3:0d:ac
authmode WPA2/802.11i privacy MIXED deftxkey 2 TKIP 2:128-bit
TKIP 3:128-bit txpowmax 0 protmode CTS dtimperiod 1 bintval 100

On the client side:

# wpa_supplicant -d -K -i ath0 -c /etc/wpa_supplicant.conf


3.2.5 EAP-TTLS

Using the same /etc/hostapd.conf in the EPA-TLS section.

# vi /usr/local/etc/raddb/eap.conf

eap {
default_eap_type = ttls
timer_expire = 60
ignore_unknown_eap_types = no
cisco_accounting_username_bug = no
md5 {
}
leap {
}
gtc {
auth_type = PAP
}
tls {
private_key_password = freebsdmallserver
private_key_file = /home/loader/radius/serverkey.pem
certificate_file = /home/loader/radius/servercert.pem
CA_file = /home/loader/radius/CA_nlab/cacert.pem
dh_file = ${raddbdir}/certs/dh
random_file = /dev/urandom
fragment_size = 1024
}
ttls {
default_eap_type = md5

}
mschapv2 {
}
}
# vi /usr/local/etc/raddb/users

"test" User-Password == "test"
# hostapd /etc/hostapd.conf 

The client side:

# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf 

3.2.6 EAP-PEAP

The host side:

Using the same /etc/hostapd.conf in the EPA-TLS section.

# vi /usr/local/etc/raddb/eap.conf

eap {
default_eap_type = peap
timer_expire = 60
ignore_unknown_eap_types = no
cisco_accounting_username_bug = no
md5 {
}
leap {
}
gtc {
auth_type = PAP
}
tls {
private_key_password = freebsdmallserver
private_key_file = /home/loader/radius/serverkey.pem
certificate_file = /home/loader/radius/servercert.pem
CA_file = /home/loader/radius/CA_nlab/cacert.pem
dh_file = ${raddbdir}/certs/dh
random_file = /dev/urandom
fragment_size = 1024
}

peap {
default_eap_type = mschapv2
}
mschapv2 {
}
}

/usr/local/etc/raddb/users:

# vi /usr/local/etc/raddb/users

"test" User-Password == "test"
# hostapd /etc/hostapd.conf 

The client side:

# wpa_supplicant -d -i ath0 -c /etc/wpa_supplicant.conf


4 Ad-hoc mode

On the box A:

# ifconfig ath0 inet 192.168.0.1 netmask 255.255.255.0 ssid freebsdap mediaopt adhoc

# ifconfig ath0
ath0: flags=8843 mtu 1500
inet 192.168.0.1 netmask 0xffffff00 broadcast 192.168.0.255
inet6 fe80::211:95ff:fec3:dac%ath0 prefixlen 64 scopeid 0x4
ether 00:11:95:c3:0d:ac
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect )
status: associated
ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac
authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

On the box B:

# ifconfig ath0 up scan
SSID BSSID CHAN RATE S:N INT CAPS
dlinkap 00:13:46:49:41:76 6 54M 30:0 100 EPS WME
freebsdap 02:11:95:c3:0d:ac 2 54M 19:0 100 IS
# ifconfig ath0 inet 192.168.0.2 netmask 255.255.255.0 ssid freebsdap mediaopt adhoc

# ifconfig ath0
ath0: flags=8843 mtu 1500
inet6 fe80::211:95ff:fed5:4362%ath0 prefixlen 64 scopeid 0x1
inet 192.168.0.2 netmask 0xffffff00 broadcast 192.168.0.255
ether 00:11:95:d5:43:62
media: IEEE 802.11 Wireless Ethernet autoselect (autoselect )
status: associated
ssid freebsdap channel 2 bssid 02:11:95:c3:0d:ac
authmode OPEN privacy OFF txpowmax 36 protmode CTS bintval 100

5 Monitor mode

This is a place holder.


6 Troubleshooting

----- This part should be imporved. ------

  • running wpa_supplicant and/or hostapd with 「-dd」 option.

  • running 80211debug/80211stats tools in /usr/src/tools/tools/ath, like this:

    # ./80211debug +state +auth +debug +assoc +xrate +power +scan +wme
    net.wlan.0.debug: 0xc80000 => 0x44ec0400
  • Send all the debug information to sam@?(Is this okay?)


This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <
doc@FreeBSD.org>.

網站分級標章

網站分級是好事,問題是在下面這個下載頁
http://www.ticrf.org.tw/chinese/html/06-rating-5.htm




上面這個圖就夠大了,這個下載圖也未免太大了吧...
台灣的公務員是怎麼想的,唉呀~

我不要幫你修電腦

無意中看到這篇
No, I won’t fix your computer
居然有 ,實在是太經典。
前天幫女友的同學修電腦到快凌晨一點,特別有感觸~
No, I will not fix your computer

我才不要幫你修電腦 (Sosumi!)


記憶體沒插牢,你自己去插牢
主機板嗶嗶叫,就讓他繼續叫
就算是螢幕燒掉還是被雷打到
我才不要幫你修電腦

管你不能上網,是如何的煎熬
管你不能列印,工作都亂糟糟
出了什麼問題我統統都不知道
我才不要幫你修電腦

我不要,我才不要,我才不要沒事幫你修電腦
我不要,我才不要,我憑什麼非要幫你修到好?
我不要,我就是不要,我又不是為了你才學電腦
電腦修到好,你也不會對我比較好

我不要,我才不要,我才不要沒事幫你修電腦
我不要,我才不要,我憑什麼非要幫你修到好?
我不要,我就是不要,我又不是為了你才學電腦
電腦修得好,只會要飯要到老

No, I won’t fix your computer
我才不要幫你修電腦 No!No!No!No!
No, I won’t fix your computer
我才不要幫你修電腦

星期六, 10月 22, 2005

Blogger比較好用

MSN Spaces比起來,Blogger確實比較快,使用者介面也簡單很多,
連html編輯器都比較快,難怪Google會買下來。

星期三, 4月 06, 2005

mkv字幕分離與重製

mkv字幕分離與重製要用到軟體mkvtoolnix
到這裡下載選擇windows 的安裝程式,因為它用wxWindow,用rar版會缺dll
http://www.bunkus.org/videotools/mkvtoolnix/

主要是以命令列為主
mkvinfo 觀看mkv的資訊
mkvextract分離
mmg圖形介面
mkvmerge產生mkv檔,也可以看mkv影片檔資訊

用mkvinfo或者mkvmerge都可以看到你要分離的字幕在第幾個tracks

mkvinfo的情況 ,似乎code page不同,新版的mkvinfo在中文console下有些問題,所以改用gui
K:\mkv>mkvinfo -g 鋼1.mkv
...(略)
(MKVInfo) | + A track at 397
(MKVInfo) | + Track number: 3 at 400
(MKVInfo) | + Track UID: 1051997168 at 403
(MKVInfo) | + Track type: subtitles at 410
(MKVInfo) | + Codec ID: S_TEXT/ASS at 413
(MKVInfo) | + CodecPrivate, length 1254 at 425
(MKVInfo) | + Language: chi at 1683
(MKVInfo) | + Lacing flag: 0 at 1690
(MKVInfo) | + A track at 1693
(MKVInfo) | + Track number: 4 at 1696
(MKVInfo) | + Track UID: 449712430 at 1699
(MKVInfo) | + Track type: subtitles at 1706
(MKVInfo) | + Codec ID: S_TEXT/ASS at 1709
(MKVInfo) | + CodecPrivate, length 1254 at 1721
(MKVInfo) | + Default flag: 0 at 2979
(MKVInfo) | + Language: tai at 2982
(MKVInfo) | + Lacing flag: 0 at 2989

mkvmerge的情形

C>mkvmerge -i 鋼1.mkv
File '鋼1.mkv': container: Matroska
Track ID 1: video (V_MS/VFW/FOURCC, XVID)
Track ID 2: audio (A_MPEG/L3)
Track ID 3: subtitles (S_TEXT/SSA)
Track ID 4: subtitles (S_TEXT/SSA)

完整顯示出該影片資訊,知道我們要的是chi字幕,另一種國別寫法是zho,也是中文

分離字幕的指令
C>mkvextract tracks 鋼1.mkv -c UTF-8 3:1.ssa
Extracting track ID 3 to a SSA/ASS file '1.ssa'.
progress: 100%

在utf-8後面的3是track後面是你自己命名的字幕檔名
因為不加utf-8這個參數分離出來的字幕檔會變亂碼
在這裏有兩個字幕,4是泰文,可利用mmg看一下

完整的分離影片應為mkvextract tracks 鋼1.mkv -c UTF-8 3:1.ssa 1:1.avi 2:1.mp3

接下來可用notepad等編輯,注意為utf-8格式
若是純文字檔請存成.srt
若為簡體中文,可利用ConvertZ這套軟體去轉換為繁體,可批次處理,很快。
由於用ssa字幕大小格式還要調整,最好用Sub Station Alpha這套軟體編輯,手動編輯怪
怪的,後來我直接轉成srt檔,字幕反而比較清楚。
python ssa2srt.py 1.ssa > 1.srt
字幕也有可能是idx等等,請自行找到對應的程式處理

最後用mmg製成mkv檔,將1.avi、1.mp3和1.srt加入即可,請注意以下兩點
1. 字幕的語系請選zho或是chi,為中文
2. Subtitle Charset用此方式編碼為UTF-8,但經過ConvertZ轉換,則為Big5或是CP950,請多加注意。
即可用media player classic播放
若使用命令列格式,可批次處理,由於個案不同,請參考mmg產生的command line
本例子為
C>mkvmerge -o 鋼1.mkv --default-track 0 -d 0 -A -S 1.avi --default-track 0 -a 0 -D -S 1.mp3 --sub-charset 0:UTF-8 --language 0:zho --default-track 0 -s 0 -D -A 1.srt --track-order 0:0,1:0,2:0

其實步驟不多,只有3~4步,可寫成批次檔。請多推廣正體中文。

星期六, 2月 19, 2005

FreeBSD的桌面

關於FreeBSD中文化的問題,大都在 FreeBSD Chinese HowTo 裡可以找到。
這裡只寫那篇HowTo沒寫的東西。
由於兩年沒用FreeBSD的X,特別感謝Yahoo的Dustin Liu的提供的設定方法。

1. Locale的問題,在Xorg裡,似乎對Big5的支援度比較差,因此許多人直接使用zh_TW.UTF-8。這樣在桌面的顯示會正常,但是在Terminal會不正常,因此可以使用Screen,再設定 .screenrc
defencoding big5

但是中文檔名有問題,實在是有些麻煩

2. 中文字型顯示不好看,必須利用Firefly的patch,在/etc/make.conf請加入
WITH_CJK=yes
分別編譯安裝ports:
print/freetyp2;
x11- fonts/fontconfig;
x11-toolkits/pango;
x11-fonts/libXft;
libXft必須在port:print/freetyp2及port:x11-fonts/fontconfig之後 ,
以前的XFS已經不見了,安裝libXft就有這個功能。

字型設定的細節可參考 FontConfig
(新)細明體在 11, 12, 13, 15, 16, 20 點的大小有特別做內嵌的點陣字,換句話說,由於中文字的 hinting 不易,有時點陣字會比較有效。又因為新細明體使用了 bytecode 來組合筆劃, 沒有編進 bytecode interpreter 的 freetype 版本在 render 的時候,就會碎掉。請確定您系統上 freetype2 的 source 之中, include/freetype/config/ftoption.h 裡面的 #defineTT_CONFIG_OPTION_BYTECODE_INTERPRETER 是不是有打開。也不可以使用內建的 autohinter. 由於是上述幾個特定的大小是內建點陣字型,所以沒有被 bytecode interpreter 影響。
設定讓新細明體在這些大小時顯示內建的點陣字而不要用 anti-aliased, 可以在 ~/.fonts.conf 加入:


PMingLiU
true
true
false


PMingLiU
12
false
true

因為 MingLiU 宣稱自己是 monospaced 字型,但實際上它有兩種寬度:中文的全形以及英文的半形。於是 freetype 就被騙了; 同樣的事情也發生在其他華康的一些字型上。Freetype 有個 globaladvance 的 flag:


MingLiU
false


萬一因為不明的原因, 這樣做沒有用, 那麼還可以改 spacing:


MingLiU
0

雖然細明體比較好看,但是破碎字的問題還是偶爾會出現,而且還是有版權的東東,不太建議安裝,用Firefly New Sung比較保險,嫌醜就打開antialias吧。

Gtk2 可以使用兩組特殊的 alias: Sans 和 Serif. Sans 是無襯線的意思,也就是如 Arial, Verdana 等等邊緣是方的字。Serif 則是有襯線的字,如 Times. 由於 fontconfig 有字型取代的機制, 可以修改 /etc/fonts/fonts.conf 裡面的這一段:

Bitstream Vera Sans
Helvetica
Arial
Verdana
Nimbus Sans L
Luxi Sans
Kochi Gothic
PMingLiU
AR PL KaitiM GB
AR PL KaitiM Big5
Baekmuk Dotum
SimSun
sans-serif


與這一段:


sans-serif

Bitstream Vera Sans
Verdana
Nimbus Sans L
Luxi Sans
Arial
Helvetica
Kochi Gothic
PMingLiU
AR PL KaitiM GB
AR PL KaitiM Big5
Baekmuk Dotum
SimSun



3. 輸入法:Dustin建議我用SCIM,實際使用上比XCIN好用。


有時候中文輸入會不正常,重新登入又可以,應該是SCIM的問題吧
不過用Windows XP的msn有時候也會無法輸入中文,不要對X要求過高,給它一點時間改進.

4. Browser:當然就是Firefox囉,裝完後記得裝 /usr/ports/java/jdk1.4和 /usr/ports/www/linuxpluginwrapper 設定請參考 http://freebsd.kde.org/howtos/konqueror-flash.php
就可以看Java applet和flash
目前測試的結果,jdk 1.4中文沒問題,jdk 1.5會變成方塊,而且jdk 1.5的設定方法己經改變沒辦法用Firefly的方法修改。

5. IDE:我是用Eclipse,2005/10開始有Eclipse 3.1,使用上完全正常,字型用細明體或Firefly 新宋體都可以.NetBeans 4.1我也裝了,大致上都是用笨人裝法.只是要新增plugin時會沒有權限,所以記得打開檔案權限 chown .或是xhost +,sudo eclipse或sudo netbeans來安裝plugin,之後再用自己的帳號使用。




希望以後能夠一次裝到底,沒有這些怪問題