This page is not available in 繁體中文, as a result the English (en_US) version is shown instead.
Journey to 64 bit Linux

Some notes on setting up my new computer with 64 bit kernel:

AMD A780G/HD3200

Driver in Ubuntu 8.04 (Hardy Heron) wasn't new enough, had to grab the debs from 8.10. Needed the following: xserver-xorg-video-ati, xserver-xorg-video-mach64, xserver-xorg-video-r128, xserver-xorg-video-radeon. After that it's recognized as a r600 part.

Still no DRI and acceleration. Probably because the in-kernel DRM driver isn't new enough. Tried to upgrade to 8.10's development version, still no dri device. 8.10 was too unstable, reinstalled back to 8.04.

Also no Xv/XVideo, highdef (H.264) video skips frame in mplayer.

SpeedStep/Cool'n Quiet

First of all you need to load kernel module powernow-k8.

Found out that if you added a CPU Frequency Scaling Monitor applet to the panel and do dpkg-reconfigure gnome-applets, it automatically prompts you if you want to setuid the binary. Once I enabled that, I could configure the cpu governor by left clicking it. Too bad I need one applet for each core.

VMWare workstation

Need 32bit userland and the usual vmware-any-any patch. Move away or delete lib/vmware/lib/libgcc_s.so.1/libgcc_s.so.1. Got "Version mismatch with vmmon module: expecting 138.0, got 137.0.", found this, reproducing below:

I think you can also do the following (got this from someone on the vmware forums I think).

cd vmware-server-distrib/lib/modules/source/ tar -xvf vmmon.tar vi vmmon-only/include/compat_kernel.h

change the line that says: static inline syscall1(int, compatexit, int, exitcode); to the following by removing two commas: static inline _syscall1(int compatexit, int exit_code);

sudo tar -cvf vmmon.tar vmmon-only/

VM suspended in old 32bit box couldn't be resumed from 64bit, although I am not sure if I am supposed to be able to do that.

Other remarks

The Phenom 9600 I got is probably a b2 revision that suffers from the TLB errata. Apparently all b3 parts' model numbers end in "50" instead of "00". I didn't find out until after I ordered it, but if you want more peace of mind you may want to get the b3 parts. I haven't hit the problem yet, but I haven't really stressed the box either. Found a kernel patch written by an AMD employee.

Once I enabled the ondemand cpu governor, the cracking noise from the onboard audio on ECS A780GM-A motherboard almost disappeared, even when the cores are in full frequency.

I wrote this after I've set everything up, so it's possible that I missed some stuff.

by khc on Sat Jul 5 16:56:20 2008 Permlink
Tags: computer

git rebase --interactive

is extremely difficult to use. I've used git add --interactive before, but once you throw in tree edit I was just too scared and gave up. Also git add --interactive doesn't seem to let me split a hunk that's contiguous (ie: a new function).

Lots of time wasted with no progress. I think I will just manually edit the patch.

4 days weekend, I may look into building a new computer.

by khc on Mon Jun 30 23:08:36 2008 Permlink
Tags: computer

Tracking 2 branches in git-svn

Update: I've since written a script that automates this, see the follow up Fetching svn branches with git-svn .

The git-svn man page is less than helpful about how to track 2 subversion branches (actually, trunk and another branch). Typically trunk is the development branch and you have another branch for release that you backport fixes to. You can fetch all branches easily, but many times you don't want to and just want a particular branch. After many tries I've found something that works.

After you cloned a git-svn repository, you should have something like this in your .git/config:

[svn-remote "svn"]
    url = svn://svn/mgmt/trunk
    fetch = :refs/remotes/git-svn

Append the branch that you want:

[svn-remote "foo"]
    url = svn://svn/mgmt/branches/foo_branch
    fetch = :refs/remotes/git-foo

Then do:

git svn fetch -R foo -r 31144 # or whatever revision you want to start with
git branch -av # should see a new remote branch
git branch --track foo_branch git-foo

After you do this, you should see your .git/config now has a new entry:

[branch "foo_branch"]
    remote = .
    merge = refs/remotes/git-foo

git svn rebase your new branch:

git checkout foo_branch
git svn rebase

Now you can cherry-pick revisions from foo_branch, and dcommit as usual.

by khc on Wed Mar 11 00:13:39 2009 Permlink
Tags: computer work

華文細黑

由於Linux下沒有甚麽好的中文字體,我一直都是用OS X下的華文細黑體,STHeiti。要fontconfig用STHeiti並不難,只要把~/.fonts.conf改成這樣就可以了:

<fontconfig>
  <alias>
    <family>serif</family>
    <prefer>
      <family>Bitstream Vera Serif</family>
      <family>STHeiti</family>
    </prefer>
  </alias>
</fontconfig>

sans-serif和monospace都差不多,就不在這裏重複了。

最近發現有些網頁用了其他字體,一直也找不到原因。前兩天發現在中文Wikipedia時選擇簡體的話沒有問題,選擇香港或者是台灣的話都會使用另外的字體,選不轉換也沒有問題。靈機一觸:

$ fc-match :lang=zh-cn
华文细黑.ttf: "STHeiti" "Light"
$ fc-match :lang=zh
华文细黑.ttf: "STHeiti" "Light"
$ fc-match :lang=zh-tw
ShanHeiSun-Light.ttf: "AR PL Mingti2L Big5" "Reguler"
$ fc-match :lang=zh-hk
DFSongSd.ttf: "DFSongStd" "Regular"

細看之下:

$ fc-match STHeiTi -v | grep lang | tail -n 1
        lang: aa|af|ar|ast|ava|ay|az-ir|be|bg|bi|bo|br|bs|ca|ce|ch|co|cs|cy|da|de|dz|el|en|eo|es|et|eu|fa|fi|fj|fo|fr|fur|fy|gd|gl|gv|ho|hr|hu|ia|id|ie|ik|io|is|it|ki|kl|ku-ir|kum|la|lb|lez|lt|lv|mg|mh|mn|mt|nb|nds|nl|nn|no|ny|oc|om|os|pl|ps-af|ps-pk|pt|rm|ru|se|sel|sh|sk|sl|sma|smj|smn|so|sq|sr|sv|sw|tn|tr|ts|ug|uk|ur|vo|vot|wa|wen|wo|xh|yap|zh-cn|zh-sg|zu(s)

雖然華文細黑能夠顯示繁體中文,它自己卻說不可以。花了不少時間改~/.fonts.conf,第一個成功的方法是:

<match>
  <test name="lang" compare="eq"><string>zh-tw</string></test>
  <edit name="lang"><string>zh</string></edit>
</match>

但感覺上這不太好,所以最後用了:

<match>
  <test name="lang" compare="eq"><string>zh-tw</string></test>
  <edit name="family" mode="append" binding="strong">
    <string>STHeiti</string>
  </edit>
</match>
<match>
  <test name="lang" compare="eq"><string>zh-hk</string></test>
  <edit name="family" mode="append" binding="strong">
    <string>STHeiti</string>
  </edit>
</match>

不知道為甚麽,直接match STHeiTi再append zh-tw和zh-hk去lang不成功。用fc-match -v見到改了,但依然用不了。

by khc on Tue Mar 4 23:33:19 2008 Permlink

Web Applications

With my set of tabs that Firefox start every time:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
11982 webbrows  15   0  243m  86m  25m R 16.0  8.6   0:16.25 firefox-bin

Take Gmail out from the list:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
12038 webbrows  15   0  196m  63m  22m S 19.9  6.3   0:09.86 firefox-bin

Take Google Portfolio out too:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
12080 webbrows  15   0  173m  58m  21m S  4.3  5.7   0:09.86 firefox-bin

Welcome to Web 2.0!

Now I use Gmail Notifier instead of leaving the tab open all the time, since I rarely get new emails from my Gmail account anyway.

by khc on Mon Feb 11 20:39:30 2008 Permlink
Tags: computer
Older Posts