Tuesday Jul 03, 2007
Project Nevada G11N and its live repositories are online now!
This project is to provide internationalization and localization of
OpenSolaris Nevada release software to enable input and output of
international characters, and also to allow access of cultural
convention data and appropriate display of cultural elements in
OpenSolaris software.
You can find more information about Nevada G11N from:
http://www.opensolaris.org/os/project/nv-g11n/
For the live repositories of project Nevada G11N:
http://www.opensolaris.org/os/project/nv-g11n/documents/repository/
If you'd like to apply the Read/Write account to G11N live repositories,
please check 'Requesting an HG account' page:
http://www.opensolaris.org/os/project/nv-g11n/documents/get_account/
Sunday Jul 01, 2007
This year is the 3rd run of ERI Stars Program, it's my honor to be one of the ERI Stars. There's a special gift for the Stars this year: a 7-inch digital photo frame.


Thursday Jun 14, 2007
As Mercurial is more and more in vogue inside Sun, many workspaces need to be converted from other Source Code Management (SCM) into Mercurial. hgsvn is a good tool to convert SVN based workspaces into Mercurial (HG) based.
- Download latest version of hgsvn (current version is 0.1.3):
http://cheeseshop.python.org/pypi/hgsvn
- Untar hgsvn, then install (setup.py will download setuptools during installation):
$ cd hgsvn-0.1.3
$ su -
{passwd}
# export http_proxy="http://webcache.japan.sun.com:8080/"
# python setup.py install
- Create and pull svn workspace:
$ mkdir g11n-ws
$ hgimportsvn http://agc163.prc.sun.com/svn/cws/g11n-ws/trunk g11n-ws
$ cd g11n-ws
$ hgpullsvn
- voila
References:
Monday Jun 11, 2007
Five years ago when I joined Sun China ERI, Li was the site lead. He set up the site, then left Sun to MSN China. He then left MSN after around a year. He's now head of Mozilla China:
http://blog.mozilla.com/ligong
Maybe it's true that some people like the adventure and excitement of the Startups. Or maybe there's really an un-visible ceiling over there.
Thursday Jun 07, 2007
There are a couple of killing features in the coming NetBeans IDE version 6.0 (will be released in this November according to roadmap).
I especially like the JRuby on Rails Support, and the Swing GUI Builder. You can find the Flash demos from netbeans.org for them.
Sunday Jun 03, 2007
I'm using Ubuntu 7.04 as the desktop. The version of Firefox on Ubuntu is 2.0.0.3 (just updated to 2.0.0.4 yesterday). There is a handy feature introduced in Firefox 2.0.x series: 'Undo Close Tab'. At the beginning, this menu appears when right clicking on the Tab. But it will disappear later.
I thought it was because I installed GreaseMonkey extension. Yup, Grease Monkey is too powerful, and will bring un-expected effects sometimes. I tried to uninstall GreaseMonkey extenion, but I still can't find the 'Undo Close Tab' in the menu. I also created a brand-new profile (mv .mozilla .mozilla.bak, then launch Firefox). I can see 'Undo Close Tab' at first, then I lost it after restart Firefox several times.
When I searching through the settings on Preferences, I found a 'Startup' setting on 'Main' tab. The 3rd option for 'When Firefox starts:' is 'Show my windows and tabs from last time'. I happened to choose it, then 'Undo Close Tab' is back again. And it works pretty well until now.
Thursday May 31, 2007
It's convenient if the email alias (mailing list) is archived and browse-able to new comers. To achieve this, simply add webarchives@Sun.COM into your email alias through http://netadmin . Then you should be able to browse the email archives through: https://onestop.sfbay.sun.com/mailfinder/aliases_archived.shtml.
Thursday May 17, 2007
I'm using both Subversion (SVN) and Mercurial (HG) for source codes management (SCM). There are some differences between them for daily using. I document them in this article and update it when I find new differences.
- commit : push
'svn ci' will commit the server directly
'hg ci' will commit to local history
'hg push' will push the changes to server
- locally : globally
all svn cmds will check current and subdirs only, eg commit, status
but hg cmds will check globally, including the whole workspace
if you want to check current and subdirs only, append '.' to hg cmds
eg, hg status .
- partially checkout : fully checkout
svn can checkout a portion of the workspace (a module or subdir)
hg can't, it will clone the whole workspace
- empty dir
mercurial will ignore empty dirs when invoking 'hg add', more details
if you want to add those dirs into mercurial, add a hidden file under it
$ touch subdir/.hidden
$ hg add subdir
- symbolic link
mercurial 0.9.3 doesn't support symbolic link file type:
[qd139970@agc141 rtc]$ hg --version
Mercurial Distributed SCM (version 0.9.3)
Copyright (C) 2005, 2006 Matt Mackall <mpm@selenic.com>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[qd139970@agc141 rtc]$ hg add RTC_Template_O5U1
RTC_Template_O5U1: unsupported file type (type is symbolic link)
[qd139970@agc141 rtc]$
PS: link1 and link2 mentioned that this feature is supported in trunk.
PS2: Mercurial 0.9.4 supports symbolic links now(Jun 25, 2007).
- account name
Mercurial will look at $HOME/.hgrc to get the account info when 'hg commit',
if there's not 'username' entry in $HOME/.hgrc, Mercurial will use
$USER@$HOSTNAME as the username in log message.
if this is not what you want, please specify your username in $HOME/.hgrc
[ui]
username = [your prefer username]
- multiple heads
it's quite easy to create multiple heads in Mercurial workspace.
you commit new changeset locally, and 'hg pull' from parent workspace
to get new changesets from team members, then two heads created.
'hg heads' will show the heads information.
if multiple heads exist, you need to 'hg up && hg merge && hg commit'
before you can 'hg push' your changeset to parent workspace.
one possible way to avoid the mess is running 'hg pull && hg up' before
you commit any modifications.
if you enable hgext.fetch extension, 'hg fetch' will do this for you:
'hg pull && hg up && hg merge && hg commit'
add following two lines in $HOME/.hgrc can enable hgext.fetch extension
[extensions]
hgext.fetch =
Wednesday May 09, 2007
It's pretty easy to add clustrmaps and page-hits in the theme of Sun Blog.
- register your blog, say http://blogs.sun.com/simford, in ClustrMaps: http://clustrmaps.com/getone.php
- Copy HTML lines from your ClustrMaps login page
- In 'Preferences/Theme' setting page, click 'Custom' button
- In 'Preferences/Templates' setting page, click edit button of 'Weblog' entry
- Paste the HTML lines from ClustrMaps in proper place:
<div>
<a href="http://www2.clustrmaps.com/counter/maps.php?url=http://blogs.sun.com/simford" id="clustrMapsLink"><img src="http://www2.clustrmaps.com/counter/index2.php?url=http://blogs.sun.com/simford" style="border:0px;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onError="this.onError=null; this.src='http://clustrmaps.com/images/clustrmaps-back-soon.jpg'; document.getElementById('clustrMapsLink').href='http://clustrmaps.com'" />
</a>
</div> - Add page hits info in similar place
<div class="rFolderitem">
#set($refs = $model.weblog.getTodaysReferrers())
#showReferrersList($refs 30 20)
</div> - click 'Save' button
Saturday Apr 28, 2007
OS: Solaris Nevada (build 59, sparc)
Mercurial: 0.9.3
Due to the lack of 'diffstat' tool on Solaris, the notification extension (hgext.notify) doesn't work well on Solaris. After several trying, I finally made it work.
Here is the setup steps:
- vi .hg/hgrc
[web]
contact = {your name}
description = Docking Workspace for Solaris WOS, SunSolve (Patch) and JES
style = gitweb
allow_archive = gz zip bz2
[extensions]
hgext.patchbomb =
hgext.notify =
[hooks]
# send one email per change
#incoming.notify = python:hgext.notify.hook
# send one email per group of changes
changegroup.notify = python:hgext.notify.hook
[email]
from = svnroot@agc163.prc.sun.com
method = /usr/sbin/sendmail
[web]
baseurl = http://agc163.prc.sun.com/hg/
[notify]
# multiple sources can be specified as a whitespace separated list
sources = serve push pull bundle
# set this to False when you're ready for mail to start sending
test = false
config =
# repos live in /workspace/scm/hg/hgroot on server, so strip 5 "/" chars
strip = 5
# you can override the changeset template here, if you want.
# If it doesn't start with \n it may confuse the email parser.
# here's an example that makes the changeset template look more like hg log:
template = \ndetails: {baseurl}{webroot}/rev/{node|short}\nchangeset: {rev}:{node|short}\nuser: {author}\ndate: {date|date}\ndescription:\n{desc}\n
[reposubs]
# key is glob pattern, value is comma-separated list of subscriber emails
* = {email address}
- When tried to push back, it failed
[gbuild@agc141 s11]$ hg push
Enter passphrase for key '/export/home/gbuild/.ssh/id_dsa':
pushing to ssh://hgroot@agc163.prc.sun.com/docking
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 76 changes to 76 files
remote: /bin/sh: diffstat: not found
remote: error: changegroup.notify hook raised an exception: [Errno 32] Broken pipe
[gbuild@agc141 s11]$
- After searching on Internet, I found the patch for Solaris
http://www.selenic.com/mercurial/bts/file270/diffstat.patch
diff -r 730cbd26552c -r 79639a44dd23 mercurial/patch.py
--- a/mercurial/patch.py Wed Apr 04 02:28:29 2007 -0300
+++ b/mercurial/patch.py Wed Apr 04 03:09:26 2007 -0300
@@ -635,6 +635,8 @@ def export(repo, revs, template='hg-%h.p
single(rev, seqno+1, fp)
def diffstat(patchlines):
+ if not util.find_in_path('diffstat', os.environ.get('PATH', '')):
+ return
fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
try:
p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name)
- But it still failed when push back
[gbuild@agc141 s10u3]$ hg --traceback push
Enter passphrase for key '/export/home/gbuild/.ssh/id_dsa':
pushing to ssh://hgroot@agc163.prc.sun.com/docking
searching for changes
remote: adding changesets
remote: adding manifests
remote: adding file changes
remote: added 1 changesets with 8 changes to 8 files
remote: # /usr/lib/python2.4/vendor-packages/mercurial/patch.pyc has bad mtime 1177746898 vs 1172046709
remote: error: changegroup.notify hook raised an exception: cannot concatenate 'str' and 'NoneType' objects
[gbuild@agc141 s10u3]$
- After rename /usr/lib/python2.4/vendor-packages/mercurial/patch.pyc, the error still existed.
- I finally found following patch after several trying:
--- /usr/lib/python2.4/vendor-packages/mercurial/patch.py.old Sat Apr 28 19:02:05 2007
+++ /usr/lib/python2.4/vendor-packages/mercurial/patch.py Sat Apr 28 16:29:14 2007
@@ -659,6 +659,8 @@
single(repo.lookup(rev), seqno+1, fp)
def diffstat(patchlines):
+ if not util.find_in_path('diffstat', os.environ.get('PATH', '')):
+ return ""
fd, name = tempfile.mkstemp(prefix="hg-patchbomb-", suffix=".txt")
try:
p = popen2.Popen3('diffstat -p1 -w79 2>/dev/null > ' + name)
Monday Apr 09, 2007
Accessing Mercurial through http/apache is handy, but it requests the workspace is owned by the same user with httpd (webservd:webservd on solaris). So accessing Mercurial over ssh tunnel is a better choice (this is also the way http://www.opensolaris.org/ chose).
Client side:
- $
ssh-keygen -b 1024 -t dsa
[ create id_dsa.pub for server side ]
$ cat <<EOF > $HOME/.hgrc
[ui]
username = User Name <user.name@example.com>
Server side:
- $ cat <<EOF > $HOME/.ssh/authorized_keys
command="cd /workspace/scm/hg/hgroot; /usr/demo/mercurial/hg-ssh g11n",\ no-port-forwarding,no-X11-forwarding,no-agent-forwarding
ssh-[type] [key]
EOF
Client side:
- $ hg clone ssh://agc163.prc.sun.com/g11n
- [play with it]
- $ hg ci
- $ hg push
Monday Apr 09, 2007
Solaris Nevada build 59 shipped with Mercurial 0.9.3:
$ hg --version
Mercurial Distributed SCM (version 0.9.3)
Setup Mercurial server on it is pretty easy.
- $ mkdir -p /workspace/scm/hg/hgroot/g11n
- $ cd /workspace/scm/hg/hgroot/g11n
- $ hg init
- $ cat <<EOF > .hg/hgrc
[web]
contact = Simford Dong
description = G11N Internal CWS
style = gitweb
allow_archive = gz zip bz2
allow_push = *
- $ cp /usr/demo/mercurial/hgwebdir.cgi /workspace/scm/hg/hgroot
- $ chmod a+x /workspace/scm/hg/hgroot/hgwebdir.cgi
- $ cat <<EOF > /workspace/scm/hg/hgroot/hgweb.config
[paths]
g11n = g11n
- Append following lines into /etc/apache2/httpd.conf
ScriptAliasMatch ^/hg(.*) /workspace/scm/hg/hgroot/hgwebdir.cgi$1
<Directory "/workspace/scm/hg/hgroot">
Order allow,deny
Allow from all
AllowOverride All
Options ExecCGI
AddHandler cgi-script .cgi
<Limit POST>
AuthType Basic
AuthName "Mercurial Repository"
AuthUserFile /workspace/scm/hg/auth/hgpasswd
Require valid-user
</Limit>
</Directory>
- # svcadm refresh svc:/network/http:apache2
- # chown -R webservd:webservd /workspace/scm/hg/hgroot/g11n
- Done.
NOTE: following part will enable push back over http, if you don't like this feature, you can skip them.
- 'allow_push = *' part of step 4
- '<Limit POST> ... </Limit>' part of step 8
- step 10
Sunday Apr 08, 2007
Do following as root privilege.
- Download cvs pkg from sunfreeware.com, and install it
http://www.sunfreeware.com/programlistsparc10.html#cvs - # vi /etc/services
append one new line: cvspserver 2401/tcp # CVS pserver daemon - # vi /etc/inetd.conf
append one new line: cvspserver stream tcp nowait root /workspace/scm/cvs/bin/cvs.inetd - # cat <<EOF >/workspace/scm/cvs/bin/cvs.inetdcvs.inetd
> #!/bin/bash
>
> REPOS="--allow-root=/workspace/scm/cvs/cvsroot/test"
>
> /workspace/scm/cvs/bin/cvs -f $REPOS pserver
> EOF
- # chmod a+x /workspace/scm/cvs/bin/cvs.inetdcvs.inetd
- # mkdir -p /workspace/scm/cvs/cvsroot/test
- # cvs -d /workspace/scm/cvs/cvsroot/test init
- # reboot
- Done.
It seems that this is bug that we need to reboot the OS to make cvs server work.
Believe me, I tried many ways to avoid this but failed
- # svcs -p |grep inetd
online Apr_06 svc:/network/inetd:default - # svcs restart svc:/network/inetd:default
- # inetadm | grep cvs
- [no out put, failed #1]
- # init S
- # init 3
- # inetadm | grep cvs
- [no out put, failed #2]
- # reboot
- # inetadm | grep cvs
enabled online svc:/network/cvspserver/tcp:default - [works now :( ]
Thursday Apr 05, 2007
Do following in root privilege.
- # ## install svn pkg from Solaris build 61
- # ## if you're using snv_61 or later, skip this step
- # ## svn version 1.4.0 (r21228)
- # pkgadd -d . SUNWneon SUNWsvn SUNWsvnS
- #
- # cd /etc/apache2
- # cp httpd.conf-example httpd.conf
- # vi httpd.conf
- add two lines in LoadModule session
- LoadModule dav_svn_module libexec/mod_dav_svn.so
LoadModule authz_svn_module libexec/mod_authz_svn.so
- add follow at the end of httpd.conf
- RedirectMatch ^(/svn)$ $1/
<IfModule dav_svn_module>
<Location /svn/>
DAV svn
SVNParentPath /workspace/scm/svn/svnroot
SVNListParentPath on
SVNIndexXSLT "/svnindex.xsl"
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /workspace/scm/svn/auth/svn_passwd
<IfModule authz_svn_module>
AuthzSVNAccessFile /workspace/scm/svn/auth/svn_access.conf
</IFModule>
# For any operations other than these, require an authenticated user.
<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>
</Location>
</IfModule>
- #
- # cp /usr/share/src/subversion/tools/xslt/svnindex.xsl /var/apache2/htdocs/
- # cp /usr/share/src/subversion/tools/xslt/svnindex.css /var/apache2/htdocs/
- # cp /usr/share/src/subversion/www/favicon.ico /var/apache2/htdocs/
- # /usr/apache2/bin/htpasswd -cm /workspace/scm/svn/auth/svn_passwd [username]
New password:
Re-type new password:
Adding password for user [username] - # cat <<EOF > /workspace/scm/svn/auth/svn_access.conf
> [groups]
> g1 = [username]
>
> [/]
> * = r
>
> [test:/]
> @g1 = rw
>
> EOF - #
- # cd /workspace/scm/svn/svnroot
- # svnadmin create test
- #
- # svcs -a |grep apache2
disabled 12:36:52 svc:/network/http:apache2 - # svcadm enable svc:/network/http:apache2
- #
That's it! You should be able to browse the svn tree from:
http://www.example.com/svn/
Or check out source tree by:
$ svn co http://www.example.com/svn/test
- $ ##
- $ ## to create notifications for commit
- $ ## as normal user privilege
- $ ##
- $ cd /workspace/scm/svn/svnroot/test/hooks
- $ cp /usr/share/src/subversion/tools/hook-scripts/commit-email.pl.in commit-email.pl
- $ vi commit-email.pl
replace "@SVN_BINDIR@/svnlook" with "/usr/bin/svnlook" in line 54 - $ cp post-commit.tmpl post-commit
- $ vi post-commit
add full path to commit-email.pl, replace the email address with the real one,
add '-s "test project"' before email address,
comment out line 'log-commit.py ...'
- $
Thursday Mar 29, 2007
My v240 server has 4 disks: 73G x 2, 140G x2. So I decided to create RAID1 to keep my data safer.
I used following partition layout to install Solaris Nevada build 59:
- /c1t0d0s0 / 30G
- /c1t0d0s1 swap 2G
- /c1t0d0s6 100M
- /c1t0d0s7 /export 38G
- /c1t2d0s6 100M
- /c1t2d0s7 /workspace 140G
Steps to create RAID1 for all partitions (as root account):
- prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
- metadb -afc 2 c1t0d0s6 c1t1d0s6
- metainit -f d10 1 1 c1t0d0s0
- metainit -f d20 1 1 c1t1d0s0
- metainit d0 -m d10
- metaroot d0
- metainit -f d11 1 1 c1t0d0s1
- metainit -f d21 1 1 c1t1d0s1
- metainit d1 -m d11
- metainit -f d17 1 1 c1t0d0s7
- metainit -f d27 1 1 c1t1d0s7
- metainit d7 -m d17
- prtvtoc /dev/rdsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t3d0s2
- metadb -afc 2 c1t2d0s6 c1t3d0s6
- metainit -f d18 1 1 c1t2d0s7
- metainit -f d28 1 1 c1t3d0s7
- metainit d8 -m d18
Change /etc/vsftab from:
/dev/dsk/c1t0d0s1 - - swap - no -
/dev/dsk/c1t0d0s0 /dev/rdsk/c1t0d0s0 / ufs 1 no -
/dev/dsk/c1t0d0s7 /dev/rdsk/c1t0d0s7 /export ufs 2 yes -
/dev/dsk/c1t2d0s7 /dev/rdsk/c1t2d0s7 /workspace ufs 2 yes -
to
/dev/md/dsk/d1 - - swap - no -
/dev/md/dsk/d0 /dev/md/rdsk/d0 / ufs 1 no -
/dev/md/dsk/d7 /dev/md/rdsk/d7 /export ufs 2 yes -
/dev/md/dsk/d8 /dev/md/rdsk/d8 /workspace ufs 2 yes -
24. lockfs -fa
25. reboot
After reboot,
- metattach d0 d20
- metattach d1 d21
- metattach d7 d27
- metattach d8 d28
- metastat ## check the status of all mirrors
- installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t1d0s0 ## install bootblk to c1t1d0s0
- ls -l /dev/dsk/c1t0d0s0 ## get the symbol link
- lrwxrwxrwx 1 root root 43 Mar 29 21:32 /dev/dsk/c1t0d0s0 -> ../../devices/pci@1c,600000/scsi@2/sd@0,0:a
- init 0
- ok> devalias ## check device
rootmirror /pci@1c,600000/scsi@2/disk@1,0
rootdisk /pci@1c,600000/scsi@2/disk@0,0
16. ok> boot rootmirror ## test bootblk in mirror partition
If everything is okey, then that's it.
convention data and appropriate display of cultura...
<a href="
WoW Insider Show's look at multiboxing now availab...
[url=
Thanks for the backlink. That is why Google create...
Our web is wholesale jewelry. This is the lar...