Chinese fonts in Debian

November 13, 2007

Desired effect: Everything (menu, console, etc.) in default locale (i.e. English). Able to display Chinese web page and emails nicely. Switchable Chinese input for any application. References [1], [2], [3]. and [4] (for scim setup).

1. generate locales

dpkg-reconfigure locales


I use en_US.UTF-8 as my default locale.

2. add deb unstable main/ttf-arphic-newsung to /etc/apt/sources.list. ttf-arphic-newsung appears to be the font edited by firefly.

Install these essential Chinese fonts

apt-get install ttf-arphic-newsung
apt-get install ttf-arphic-ukai ttf-arphic-uming
apt-get install ttf-arphic-gbsn00lp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gkai00mp

Optional English fonts

apt-get install ttf-bitstream-vera ttf-dejavu
apt-get install msttcorefonts

I don’t recommend editing the font.conf and local.conf as suggested in Ref 4, since doing so will render the English fonts ugly. IMHO, the Chinese fonts, with anti-aliasing, look just as good, if not better, without the modification.

3. scim input set up

apt-get install scim scim-pinyin

4. creates ~/.xinput.d/en_US symbolic link to /etc/X11/xinit/xinput.d/scim.

im-switch -z en_US -s scim

It will complain about not finding scim-pinyin configuration, but works correctly after next login.


elog 2.7.0 in Debian

November 12, 2007

Unfortunately Elog did not pass the security scrutiny of Debian yet. Hence it is categorized as unstable. For security reason, instead of apt-get install elog from sid, It’s better to get the latest tarball and build from source.

1. Build and install elog to the default location /usr/local/ with user:group as root:staff.

cd elog-2.7.0 && make && sudo make install

2. Take care of user privilege

useradd -G staff gordon
chmod -R g+w /usr/local/elog

add to the [global] section of /usr/local/elog/elogd.cfg

Usr = gordon
Grp = staff

3. Start elog daemon and view the logbooks @ localhost:8080

sudo elogd -p 8080 -c /usr/local/elog/elogd.cfg -D

Cisco VPN in Debian

November 12, 2007

Connecting to the WUSTL NIL VPN service. A good tutorial can be found here .

apt-get install vpnc
sudo cp /etc/vpnc/example.conf /etc/vpnc/nil.conf

Fill in all the information in the conf file with the help from .pcf file, and comment out the line with “IKE Authmode hybrid” because “vpnc was built without openssl: Can’t do hybrid or cert mode.”

sudo vpnc nil.conf

To disconnect:

sudo vpnc-disconnect

JRE and flash plugin for Mozilla (Firefox/Iceweasel)

November 11, 2007

Currently both JRE5 and JRE6 are viable options. Install either one from the non-free section

apt-get install sun-java5-jre
apt-get install sun-java6-jre

link java plugin library to mozilla plugin directory, e.g., JRE6.

ln -s /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/ ~/.mozilla/plugins/

This works only for i386. On amd64 system

apt-get install java-gcj-compat-plugin

usually gives most people what they want. If it’s necessary to run sun java-plugin on amd64, a chrooted ia32 env is probably the only solution.

to have flash plugin, which is only available from the unstable (sid) branch

apt-get -t sid install flashplugin-nonfree

to use predefined priorities to automatically select one implementation of “flash”
between the multiple installed alternatives (this usually works for most people)

update-alternatives --auto

to manually select one implementation of “flash” between the multiple installed alternatives :

update-alternatives --config

Read/Write ntfs in Debian

November 11, 2007

Seems there are now two packages claiming to provide full read/write support of windows ntfs. One is ntfsprogs from, the other is ntfs-3g from , which is based on FUSE. While the former alleges the latter an obsolete fork, the latter bashes reliablility issue in the former’s 2.0.0 release. Without knowing which one performs superior, I’m sticking with ntfsprogs simply because of its longer track-record and wishing the two will merge someday.

A how-to is only a google away, such as Howto for ntfs-3g

apt-get install ntfs-3g
apt-get install ntfsprogs

mount -t ntfs-3g /dev/hda1 /media/win -o umask=0,nls=utf8
mount -t ntfs /dev/hda1 /media/win -o umask=0,nls=utf8

entry for /etc/fstab

/dev/hda1 /media/win ntfs-3g umask=0,nls=utf8 0 0
/dev/hda1 /media/win ntfs umask=0,nls=utf8 0 0

Simpleshare printer in Debian

November 10, 2007

The Simpleshare NAS (network attached storage) device is a quite interesting device by SimpleTech (Review). Although it’s not as hackable as the Linksys NSLU2 with SlugOS or OpenSlug, it’s probably still one of the best NAS devices on the market. I’ve been through both 160G and 250G models, which unfortunately suffered from a firmware bug affecting the auto spin-down of the harddrive (details in the simpleshare forum at openmss), and finally settled down at a 500G unit.

One of the cool things about Simpleshare is its integrated usb printer server under samba. This memoir is about getting the printer connected to the Simpleshare to work under linux (specifically, Debian Lenny).

1. Having cups and samba packages installed

apt-get install cupsys cupsys-bsd cupsys-client
apt-get install foomatic-db-hpijs gs-esp a2ps
apt-get install samba smbclient

2. Find printer driver at

The age of my printer certainly shows from its driver name: HP-DeskJet_825C-hpijs.ppd.

3. Find printer name from the Simpleshare samba server.

smbclient -L SIMPLESHARE -N

Domain=[MSHOME] OS=[Unix] Server=[Samba 3.0.2]
Sharename Type Comment
--------- ---- -------
config Disk
NetFolder Disk
MyHome Disk
MyShare Disk
IPC$ IPC IPC Service ("SimpleShare")
ADMIN$ IPC IPC Service ("SimpleShare")

4. Add printer to cups.

lpadmin -p DESKJET -v smb://SIMPLESHARE/DESKJET-825C -P /root/HP-DeskJet_825C-hpijs.ppd

5. Configure printer in cups

Start printer, accept jobs, and change settings for the printer (DESKJET) in the cups html configuration page @ http://localhost:631  (root access)

qemu not happy with gcc4

November 4, 2007

Updated 3/23/2008 Thanks to RP for cleaning up the gcc recipies. Now oe builds its own gcc3.4 if qemu is needed to generate binary locales. The following is not needed anymore.

It is a known oe bug 2157 that qemu does not work with gcc 4. To use an older gcc 3 version in debian lenny (which default to gcc 4)

apt-get install gcc-3.4 cpp-3.4 g++-3.4

and manually symbolic link the following:

ln -s /usr/bin/gcc-3.4 /usr/bin/gcc
ln -s /usr/bin/g++-3.4 /usr/bin/g++
ln -s /usr/bin/cpp-3.4 /usr/bin/cpp