近日用 www.inblogs.net 也不能访问 blogspot 了,难道也被 GFW 给 block 了?
2007-07-07
ssh 相关的几个环境变量
SSH_CLIENT='192.168.3.102 1051 10022'
SSH_CONNECTION='192.168.3.102 1051 192.168.3.38 10022'
SSH_TTY=/dev/pts/0
其中 SSH_TTY 只有在 interactive shell 中才会被设置.
Posted by
Display Name
-
5:08 PM
0
comments
Labels: Network/Security, Shell/Scripting
Google Code: Failed to checkout svn repository
svn { ls | cat | info } http://xxx.googlecode.com/svn 等命令都 work,就是不能 checkout:
$ svn co http://xxx.googlecode.com/svn
svn: REPORT request failed on '/svn/!svn/vcc/default'
svn: REPORT of '/svn/!svn/vcc/default': 400 Bad Request (http://huan.googlecode.com)
$
但是用 https 的话就能 checkout,不知何故,有人说是跟 firewall 上的设置有关。
(回家用俺的 ADSL 试了一下,没有问题,看来是公司的 firewall 把 http 的 svn checkout 给 block 了)
Posted by
Display Name
-
2:51 PM
0
comments
Labels: Google, Version Control
Upload your svn repository to Google Code
今日听 jiahuan 说可以在 Google Code 上创建自己的 svn repository,好是激动了一番,俺早就想找个地方安置俺的 svn 目录了。
申请步骤很简单,到 http://code.google.com/hosting/ 创建一个 new project 就成了。每个 project 空间好像是 100M,一般来说足够用了。project 创建之后就可以用 svn client 往里面添加内容了;另外 google code 也允许把一个已经存在的 svn repository 用 svnsync 给 upload 上去,着实方便。唯一一点不足之处是,project 里面的的所有东西都是 open 的,任何人都能够 svn checkout,不爽,一点隐私都没有!看来目前俺还不能充分利用 Google Code 的这个 service。:-(
Posted by
Display Name
-
2:29 PM
0
comments
Labels: Google, Version Control
svnsync
From: http://svn.collab.net/repos/svn/trunk/notes/svnsync.txt
==== What Is It? ====
svnsync is a tool for creating and maintaining read-only mirrors of
subversion repositories. It works by replaying commits that occurred
in one repository and committing it into another.
==== Basic Setup ====
First, you need to create your destination repository:
$ svnadmin create dest
Because svnsync uses revprops to keep track of bookkeeping information
(and because it copies revprops from the source to the destination)
it needs to be able to change revprops on your destination repository.
To do this you'll need to set up a pre-revprop-change hook script that
lets the user you'll run svnsync as make arbitrary propchanges.
$ cat <<'EOF' > dest/hooks/pre-revprop-change
#!/bin/sh
USER="$3"
if [ "$USER" = "svnsync" ]; then exit 0; fi
echo "Only the svnsync user can change revprops" >&2
exit 1
EOF
$ chmod +x dest/hooks/pre-revprop-change
$ svnsync init --username svnsync file://`pwd`/dest \
http://svn.example.org/source/repos
Copied properties for revision 0
$
Note that the arguments to 'svnsync init' are two arbitrary repository
URLs. The first is the destination, which must be empty, and the second
is the source.
Now you can just run the 'svnsync sync' command to synchronize pending
revisions. This will copy any revisions that exist in the source repos
but don't exist in the destination repos.
$ svnsync sync file://`pwd`/dest
Committed revision 1.
Copied properties for revision 1.
Committed revision 2.
Copied properties for revision 2.
Committed revision 3.
Copied properties for revision 3.
...
==== Locks ====
If you kill a sync while it's occurring there's a chance that it might
leave the repository "locked". svnsync ensures that only one svnsync
process is copying data into a given destination repository at a time
by creating a svn:sync-lock revprop on revision zero of the destination
repository. If that property is there, but you're sure no svnsync is
actually running, you can unlock the repository by deleting that revprop.
$ svn pdel --revprop -r 0 svn:sync-lock file://`pwd`/dest
==== FAQ ====
Q: So what can I do with this thing anyway?
A: Well, anything that's read-only. As long as you don't commit changes
to the destination repository you're all set. This means destination
repositories are good for providing offsite mirrors, read-only mirrors,
etc.
Q: What if I want to check out from a mirror, but commit to the master?
A: That's possible, but requires some gymnastics. You see, each repository
has its own UUID, which is stored in the working copy, so if you check
out from the mirror, and then do a 'svn switch --relocate' to point to
the master it'll error out. To make this work you need to make sure that
the mirrors have the same UUID as the master. You can set a repository
UUID via the following technique:
$ cat - <
Posted by
Display Name
-
2:19 PM
0
comments
Labels: Version Control
vim 中编辑不同编码的文件时需要注意的一些地方 - ChinaUnix
vim编码方面的基础知识:
- 存在3个变量:
fileencoding—-该选项是vim写入文件时采用的编码类型。
termencoding—-该选项代表输出到客户终端(Term)采用的编码类型。
- 此3个变量的默认值:
fileencoding—-vim打开文件时自动辨认其编码,fileencoding就为辨认的值。为空则保存文件时采用encoding的编码,如果没有修改encoding,那值就是系统当前locale了。
termencoding—-默认空值,也就是输出到终端不进行编码转换。
由此可见,编辑不同编码文件需要注意的地方不仅仅是这3个变量,还有系统当前locale和文件本身编码以及自动编码识别、客户运行vim的终端所使用的编码类型3个关键点,这3个关键点影响着3个变量的设定。
如果有人问:为什么我用vim打开中文文档的时候出现乱码?
答案是不确定的,原因上面已经讲了,不搞清楚这3个关键点和这3个变量的设定值,出现乱码是正常的,倒是不出现乱码那反倒是凑巧的。
再来看一下常见情况下这三个关键点的值以及在这种情况下这3个变量的值:
- locale—-目前大部分Linux系统已经将utf-8作为默认locale了,不过也有可能不是,例如有些系统使用中文locale zh_CN.GB18030。在locale为utf-8的情况下,启动vim后encoding将会设置为utf-8,这是兼容性最好的方式,因为内部 处理使用utf-8的话,无论外部存储编码为何都可以进行无缺损转换。locale决定了vim内部处理数据的编码,也就是encoding。
- 文件的编码以及自动编码识别—-这方面牵扯到各种编码的规则,就不一一细讲了。但需要明白的是,文件编码类型并不是保存在文件内的,也就是说没有任何 描述性的字段来记录文档是何种编码类型的。因此我们在编辑文档的时候,要么必须知道这文档保存时是以什么编码保存的,要么通过另外的一些手段来断定编码类 型,这另外的手段,就是通过某些编码的码表特征来断定,例如每个字符占用的字节数,每个字符的ascii值是否都大于某个字段来断定这个文件属于何种编 码。这种方式vim也使用了,这就是vim的自动编码识别机制了。但这种机制由于编码各式各样,不可能每种编码都有显著的特征来辨别,所以是不可能 100%准确的。对于我们GB2312编码,由于其中文是使用了2个acsii值高于127的字符组成汉字字符的,因此不可能把gb2312编码的文件与 latin1编码区分开来,因此自动识别编码的机制对于gb2312是不成功的,它只会将文件辨识为latin1编码。此问题同样出现在gbk,big5 上等。因此我们在编辑此类文档时,需要手工设定encoding和fileencoding。如果文档编码为utf-8时,一般vim都能自动识别正确的 编码。
- 客户运行vim的终端所使用的编码类型—-同第二条一样,这也是一个比较难以断定的关键点。第二个关键点决定着从文件读取内容和写入内容到文件时使用 的编码,而此关键点则决定vim输出内容到终端时使用的编码,如果此编码类型和终端认为它收到的数据的编码类型不同,则又会产生乱码问题。在linux本 地X环境下,一般终端都认为其接收的数据的编码类型和系统locale类型相符,因此不需关心此方面是否存在问题。但如果牵涉到远程终端,例如ssh登录 服务器,则问题就有可能出现了。例如从1台locale为GB2310的系统(称作客户机)ssh到locale为utf-8的系统(称作服务器)并开启 vim编辑文档,在不加任何改动的情况下,服务器返回的数据为utf-8的,但客户机认为服务器返回的数据是gb2312的,按照gb2312来解释数 据,则肯定就是乱码了,这时就需要设置termencoding为gb2312来解决这个问题。此问题更多出现在我们的windows desktop机远程ssh登录服务器的情况下,这里牵扯到不同系统的编码转换问题。所以又与windows本身以及ssh客户端有很大相关性。在 windows下存在两种编码类型的软件,一种是本身就为unicode编码方式编写的软件,一种是ansi软件,也就是程序处理数据直接采用字节流,不 关心编码。前一种程序可以在任何语言的windows上正确显示多国语言,而后一种则编写在何种语言的系统上则只能在何种语言的系统上显示正确的文字。对 于这两种类型的程序,我们需要区别对待。以ssh客户端为例,我们使用的putty是unicode软件,而secure CRT则是ansi 软件。对于前者,我们要正确处理中文,只要保证vim输出到终端的编码为utf-8即可,就是termencoding=utf-8。但对于后者,一方面 我们要确认我们的windows系统默认代码页为cp936(中文windows默认值),另一方面要确认vim设置的termencoding= cp936。
最后来看看处理中文文档最典型的几种情况和设置方式:
- 系统locale是utf-8(很多linux系统默认的locale形式),编辑的文档是GB2312或GBK形式的(Windows记事本默认保 存形式,大部分编辑器也默认保存为这个形式,所以最常见),终端类型utf-8(也就是假定客户端是putty类的unicode软件)则vim打开文档后,encoding=utf-8(locale决定的),fileencoding=latin1(自动编码判断机制不准导致的),termencoding=空(默认无需转换term编码),显示文件为乱码。
- 解决方案 1
首先要修正fileencoding为cp936或者euc-cn(二者一样的,只不过叫法不同),注意修正的方法不是:set fileencoding=cp936,这只是将文件保存为cp936,正确的方法是重新以cp936的编码方式加载文件为:edit ++enc=cp936,可以简写为:e ++enc=cp936。
- 解决方案2
临时改变vim运行的locale环境,方法是以LANG=zh_CN vim abc.txt的方式来启动vim,则此时encoding=euc-cn(locale决定的),fileencoding=空(此locale下文件 编码自动判别功能不启用,所以fileencoding为文件本身编码方式不变,也就是euc-cn),termencoding=空(默认值,为空则等 于encoding)此时还是乱码的,因为我们的ssh终端认为接受的数据为utf-8,但vim发送数据为euc-cn,所以还是不对。此时再用命令: set termencoding=utf-8将终端数据输出为utf-8,则显示正常。
- 情况与前面基本相同,只是使用的ssh软件为secure CRT类ansi类软件。
vim打开文档后,encoding=utf-8(locale决定的),fileencoding=latin1(自动编码判断机制不准导致的),termencoding=空(默认无需转换term编码),显示文件为乱码。
- 解决方案 1
- 解决方案 2
与上面方案2类似,不过最后一步修改termencoding省略即可,在此情况下需要的修改最少,只要以locale为zh_CN开启 vim,则encoding=euc-cn,fileencoding和termencoding都为空即为encoding的值,是最理想的一种情况。
可见理解这3个关键点和3个参数的意义,对于编码问题有很大助力,以后就可以随心所欲的处理文档了,同时不仅仅是应用于vim,在其他需要编码转换的环境里,都可以应用类似的思路来处理问题解决问题。
最后推荐一款功能强大的windows下的ssh客户端—-xshell,它具有类似secure CRT一样的多tab 的ssh窗口的能力,但最为方便的是这款工具还有改变Term编码的功能,这样我们就可以不用频繁调整termencoding,只需在ssh软件里切换 编码即可,这是我用过的最为方便的ssh工具。它是商业软件,但非注册用户使用没有任何限制,只是30天试用期超出后会每次启动都提示注册,对于功能没有 丝毫影响。
Posted by
Display Name
-
11:41 AM
0
comments
Labels: Vim
Controlling your locale with environment variables
Controlling your locale with environment variables
By Bill Poser on May 01, 2006 (8:00:00 AM)You choose your locale by setting environment variables. Different variables control different things. LC_MESSAGES determines the language and encoding of messages as well as of labels in GUI components if they use GNU gettext or one of its relatives to obtain translations. A few programs obtain translations in other ways and may not be affected by LC_MESSAGES.
LC_CTYPE defines character classes, which are named sets of characters used by a variety of programs, especially regular expression matchers. In programs such as grep that use character classes like [:alnum:], class membership varies with locale. If the writing system distinguishes upper- and lower-case letters, LC_CTYPE specifies the relationship between the two.
Sort order is controlled by LC_COLLATE. Sort orders can differ within the same writing system. In ASCII order, the upper-case letters as a group precede the lower-case letters: A B C ... a b c.... In French, upper-case letters immediately follow their lower-case counterparts: a A b B c C.... In some other locales upper-case letters immediately precede their lower-case counterparts: A a B b C c....
Sort order affects not only sorting but character ranges in regular expressions. In ASCII order, the range expression [A-Z] stands for the 26 upper-case letters. That is because the expression stands for the characters starting with A and ending with Z. In ASCII, the upper-case letters form a contiguous block of 26 running from A to Z. However, in the French locale the letters starting with A and ending with Z consist of all of the letters except for lower-case a.
The format of times and dates is controlled by LC_TIME. In American English, the date command produces results like this:
Fri Apr 14 20:33:28 PDT 2006
In Catalan, the language is different but the format is the same:
dv abr 14 20:33:49 PDT 2006
But in Japanese the year comes first, then the month, then the day, then the day of the week, and finally the time:
2006年 4月 14日 金曜日 20:34:42 PDT
The format of numbers is determined by LC_NUMERIC. In American English, a period serves as decimal point and commas break the integers into groups of three:
652,314,159.278
In German, the grouping is the same but the roles of period and comma are reversed:
652.314.159,278
In Hindi the period and comma play the same roles as in American English, but the integers are broken into groups of two, except for the hundreds downward, which form a group of three:
65,23,14,159.278
The format of amounts of money is controlled by LC_MONETARY. In addition to the formatting of the numbers, this environment variable specifies the symbol for the unit of currency and things like how negative values are written.
Additional variables include:
- LC_PAPER: paper size
- LC_NAME: personal name format
- LC_ADDRESS: address format
- LC_TELEPHONE: telephone number format
- LC_MEASUREMENT: measurement units
The environment variable hierarchy
Most of the time you'll want to set all of these variables to the same value, but occasionally it makes sense to use different values. For example, if you want your interface language to be English but are sorting French data, you could set LC_MESSAGES to en_US but LC_COLLATE to fr_FR.
When you don't want to use different values, it isn't necessary to set all of the variables individually. Instead, you can set LC_ALL or LANG. When a program looks at the environment variables to determine what locale to use, it follows the following procedure:
- If the LC_ALL environment variable is defined and is not null, its value is used.
- If the appropriate component-specific environment variable -- e.g. LC_COLLATE -- is set and non-null, its value is used.
- If the LANG environment variable is defined and is not null, its value is used.
- If the LANG environment variable is not set or is null, an implementation-dependent default locale is used.
Notice that this means that if you want to use different locales for different purposes you should unset LC_ALL.
There is one further environment variable, LANGUAGE, which is used only by GNU gettext, the system that provides translations of messages for many programs. Unlike the others, this variable can be assigned multiple locales separated by colons. The locales are tried in order until a message catalog is found. For example, the specification sv_SE:nn_NO:de_DE indicates that the user prefers Swedish, to use Norwegian if Swedish is not available, and to use German if Norwegian is not available. If defined, LANGUAGE takes precedence over LC_ALL, LC_MESSAGES, and LANG.
Locale names
Locale names take the form:
language(_territory)(.encoding)(@modifier) The only obligatory part is the language code, such as en for English. The same language may be used in different ways in different countries, so locale names commonly include a territory code as second component. Thus, fr_FR is the locale for French in France, fr_CA for French in Canada, and en_CA the locale for English in Canada. An encoding may also be specified. English will by default be encoded in ASCII, but en_US.UTF-8 specifies American English in the UTF-8 Unicode encoding. Language codes are usually taken from the list of two-letter codes defined in ISO-639-1, country codes from the two-letter codes defined in ISO-3166-1.
The modifier you are most likely to see is euro, which is used for locales using the euro currency where the original locale definition was created before the introduction of the euro in the European Union. For example, es_ES@euro is the current Spanish locale, while es_ES is the pre-euro locale.
A few special locales do not follow these naming conventions. The POSIX locale, also known as the C locale, sets up a traditional Unix environment, with the ASCII encoding, POSIX character classes, and American English time, date, number, and monetary formats. If things seem off when you use programs such as sort and grep, the problem may be that you are using a locale that defines a different sort order or character classes from what you are used to. Setting your locale to POSIX may set things right.
To find out what your current locale is, use the locale command with no arguments. It will print the values of all of the relevant environment variables except for LANGUAGE. locale charmap prints the name of the current encoding. To find out what locales are available, type locale -a. To find out what encodings are available, type locale -m.
Installing locales
You may find that the locale you need is not installed on your machine. If so, you may be able to install it yourself. Locale definitions are stored in plain ASCII files that follow a special format described in the locale(5) man page. How to write your own locale definitions would be fodder for a whole other article, but you can find quite a few locale definitions in localedata/locales in the glibc distribution directory, in files whose names are the same as the locale name, e.g. zu_ZA for Zulu in South Africa.
To install a locale file, use localedef. This command installs Zulu:
localedef -i zu_ZA -f ../charmaps/UTF-8 zu_ZA
The last argument here is the locale name. The argument to the -i flag is the locale definition file. The argument to the -f flag is the appropriate character set definition file, most frequently UTF-8.
Many languages do not have a two-letter code, so three-letter codes from ISO-639-2 are increasingly seeing use. Similarly, three-letter country codes defined in ISO-3166-2 are on the horizon.
Another development is the Common Locale Data Repository project sponsored by the Unicode Consortium. Recognizing that it is inefficient for different operating systems and developers to compile localization information and store it in different formats, the CLDR project is developing a new, XML-based, cross-platform system for storing locale information which is already in use by Java and some other programs.
Posted by
Display Name
-
11:19 AM
0
comments
Labels: *nix, Shell/Scripting
2007-07-05
[gcc] -rdynamic
> BTW, why is it that the -soname option and the -rdynamic
> option are not in the man page for gcc?
Essentially because they are really linker options, passed by gcc down to
ld. This is strictly true for -soname: the comma-separated list
following -Wl option of gcc is passed directly to the linker, after
replacing the commas with spaces (you can see this if you gcc -v). No
other processing is done on it by the compiler proper.
The -rdynamic option is slightly different. It seems to have been
introduced as a high-level interface to the linker, to (a) force the
allocation of a global symbol table in the final executable, even if it's
not strictly needed, and (b) cause the inclusion of the global symbols in
that symbol table.
- Under linux, gcc interprets it by setting the "-export-dynamic" option for ld, which has that effect, according to the linux ld manpage.
- Under IRIX it's ignored, and the program's happy as a clam.
- Under SunOS-4.1, gcc interprets it by setting the -dc -dp options for ld, which again forces the allocation of the symbol table in the code produced (see ld(1) on a Sun).
Wonder if we should mailbomb gcc-bug@gnu.org until they fix their man/info
pages ;-)
-- From http://www.cim.mcgill.ca/~franco/OpSys-304-427/messages/node59.html
Posted by
Display Name
-
3:10 PM
0
comments
Hacking HelloWorld
HackingHelloWorld (PDF)
- From Jim Huang (黃敬群 / jserv)
[Keywords: hello world]
Posted by
Display Name
-
1:52 PM
0
comments
修改常量字符串导致的 segmentation fault
昨天一同事遇到的问题, 帮他解决了一下, 备忘 :-)
$ cat foo.c
#include
int main(int argc, char *argv[])
{
char *s = "foo;bar;car";
strtok(s, ";");
return 0;
}
$ gcc foo.c
$ ./a.out
Segmentation fault
$ gcc -S foo.c
$ cat foo.s
.file "foo.c"
.section .rodata ; read only data (?)
.LC0:
.string "foo;bar;car"
.LC1:
.string ";"
.text
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $24, %esp
andl $-16, %esp
movl $0, %eax
addl $15, %eax
addl $15, %eax
shrl $4, %eax
sall $4, %eax
subl %eax, %esp
movl $.LC0, -4(%ebp)
movl $.LC1, 4(%esp)
movl -4(%ebp), %eax
movl %eax, (%esp)
call strtok
movl $0, %eax
leave
ret
.size main, .-main
.ident "GCC: (GNU) 4.0.3 (Ubuntu 4.0.3-1ubuntu5)"
.section .note.GNU-stack,"",@progbits
$
Posted by
Display Name
-
9:42 AM
0
comments
svn: Not authorised to open root of edit operation
如果启用了 svn 的 path-based access control, svnserve.conf 中的 anon-access 要设成 none 才行:
$ cat svnserve.conf
[general]
anon-access = none
auth-access = write
password-db = passwd
authz-db = authz
realm = My Realm
$ cat authz
[/]
admin = rw
[/project1]
guest = r
$
Posted by
Display Name
-
9:24 AM
0
comments
Labels: Version Control
2007-07-04
crypt(): DES or MD5
DES 算法的 crypt() 函数最多只支持 8 个字符的 password, 超过 8 个字符的部分被忽略掉了; 而 MD5 算法的 crypt() 则没有这个限制. 因此现在的 passwd 命令一般用 MD5 加密方式.
From crypt's man page:
=====================
The glibc2 version of this function has the following additional features. If salt is a character string starting with the three characters "$1$" followed by at most eight characters, and optionally terminated by "$", then instead of using the DES machine, the glibc crypt function uses an MD5-based algorithm, and outputs up to 34 bytes, namely "$1$
Posted by
Display Name
-
10:46 AM
0
comments
MacPorts: Installed ports
autoconf
automake
bash
cmake
colordiff
expect
findutils
gawk
gnutar
gsed
lftp
libtool
subversion
tcl
vim
watch
wget
wireshark
Posted by
Display Name
-
10:12 AM
0
comments
Labels: Apple, Tcl/Expect
Bash: COLUMNS and LINES not set on startup
Mac OS X (10.4) 上默认安装的 bash 还是经典的 2.05b 版, 不如 3.x 强大. 自己下载编译了 3.2.17 编译安装, 一切顺利. 但是启动 bash 3.2.17 后发现 COLUMNS 和 LINES 这两个变量没有定义, 不过在改变终端窗口大小后就有定义了, 有些麻烦, 只好在 bashrc 里面给 bash 发一个 SIGWINCH 信号:
Posted by
Display Name
-
9:54 AM
0
comments
Labels: Apple, Shell/Scripting
2007-07-01
MacPorts: The port command
- port selfupdate
- port search subversion
- port install bash
- port variants vim
- port install vim +perl +cscope subversion +no_bdb
- port cat vim
- port deactivate vim @7.1.002_0
- port upgrade vim
- port upgrade installed
- port info bash
- port deps subversion
- port dependents readline
- port outdated
- ... ...
Posted by
Display Name
-
1:18 PM
0
comments
2007-06-29
三峡珍惜植物园根归何处
院士上书总理批示难奈悲凉命运
三峡珍稀植物园根归何处
□本报记者 曹筠武 发自重庆万州
■在这个1200亩的园子里,聚集了176种、上万株珍稀植物,它是“三峡珍稀植物避难所”。
■尽管包括3位两院院士在内的一批中国顶级植物学家奔走呼吁,尽管国务院总理温家宝在2005年即专门对此作出批示,但也未能使这个“避难所”起死回生———2007年6月9日,植物园“停止了生产活动”。
最后两名工人也撤离了。创办人向秀发,成为重庆三峡珍稀植物园惟一的留守者。陪伴这个44岁男人的,只有一个跟随他多年的聋哑孩子——他是他的亲戚。在 这个1200多亩的园子里,他们孤独地守候着176种、上万株珍稀植物。每天早晨,向秀发打着手势给“哑巴”吩咐任务,寂静的山林里,只有风穿过树叶的声 音。
植物园是在2007年6月9日“关张”的。此前5年,三峡地区珍稀植物大都被抢救性移栽培育在这里,它们来自库区淹没带。
库区蓄水完成后,这些在地球上延续了百万年的珍稀植物,将在它们原来的栖息地彻底消失。
所以在植物学家看来,这个园子是“三峡珍稀植物避难所”、“中国植物物种基因库”。
但这抢救性的5年,是惨淡经营的5年。尽管向秀发耗尽家财,尽管包括3位两院院士在内的一批中国顶级植物学家奔走呼吁,尽管总理温家宝在2005年即专门对此作出批示,也未能使这个“避难所”起死回生。
- 从水产商到植物狂人
2003年6月,三峡库区开始蓄水。当陆地渐渐沉入水底时,人可以迁移,动物可以逃避,“只有植物,既没有嘴喊救命,也没有腿跑。”中科院植物所首席科学家李振宇说,“我们必须帮助它们逃生。”
疏花水柏枝、荷叶铁线蕨、中华蚊母树、川鄂新樟……由于逃脱了远古时代冰川的袭击,50余种三峡地区特有珍稀植物由此保存下来。按照《中国植物红皮书 ——稀有濒危植物》名录统计:在8种国家一级保护珍稀濒危植物中,三峡库区占3种;二级珍稀濒危保护植物159种,三峡库区有22种;三级222种,库区 有24种。此外,库区还生长着大量百年以上古树名木,被称为“中国植物资源战略基地”。
而在蓄水后,需抢救保护的珍稀濒危植物将近300种。
“迁地保护,是挽救三峡珍稀植物的惟一办法。”李振宇说。早在1998年,他就和国家林业局生态环境监测总站高级工程师李建文,联合发出了迁地保护建议书。
当建议书被业内人士传阅时,当时还是水产商人的向秀发偶然路过重庆巫山县。他看见施工队伍沿江清库,人们开着推土机、带着砍刀和锄头,逐一铲平树丛。
当时,向秀发承包着一个数百亩的大水库养鱼,每年收入至少三十万。1998年10月,他跑生意路过北京,想到在巫山县看到的情境,这个平时喜欢搞点盆景根雕的人突发奇想跑到了中科院植物所。
向秀发第一次见到首席科学家李振宇。想象中的“大专家”没有架子,而对一个商人关心植物表示出极大的兴趣。李振宇带着向秀发去了北京植物园,他走在前 面,用带福建口音的普通话“像背书一样”,滔滔不绝地讲解着路过的植物;向秀发则跟在后面,“完全被李老师的讲解震住了,完全被那些奇特植物吸引了”。
两个生活轨迹本无交叉点的人,最终谈到了三峡植物保护。李振宇从第四纪冰川讲起,一直讲到疏花水柏枝最后的栖息地。
李振宇语气沉重,向秀发似懂非懂。他问:搞个园子,把珍稀植物都保护起来怎么样?李振宇不禁哑然失笑,“一个植物园一年投入要上千万,公益性项目只花钱不赚钱,你怎么搞?”
“回到家后,他一个星期没下楼。”妻子吴石英回忆,“也不见任何人。”
向秀发此后只向一位密友谈起过,那时他在做这辈子最艰难的选择。“他对我说,一个人活一辈子,要做出点事才能留名。”这位密友回忆。
最终,向秀发给李振宇打了电话:“我要搞个植物园,把三峡的珍稀植物全部救了!”
谁也劝不住向秀发。他又经人介绍认识了中科院植物所客座教授、重庆药物种植研究所研究员刘正宇,以及中科院武汉植物所研究员金义欣。他拜他们为师,学习 植物知识。从2000年开始,向秀发跑遍北京、上海、武汉、深圳,考察了各地植物园。在深圳仙湖植物园,成片的苏铁开出金黄色的花,向秀发至今也难忘那种 “陶醉”。
这个军事经济学院路桥专业毕业的工农兵大学生,开始一本一本的啃专业植物书籍。亲友都觉得他疯了——他们不知道,这只是开始。
- 与蓄水上演“生死时速”
2002年,植物园选址确定在万州五桥。“一年多时间,我们被他拉着跑遍了库区,”年过古稀的中科院武汉植物所研究员金义欣回忆,“五桥地处库区核心地带,自然生态良好,气候地貌符合三峡植物生长要求。”
在专家们的影响和向秀发的运作下,2002年8月,当时的重庆市计委支持植物园立项。国家林业局专项拨款313万元,作为植物园初期建设经费。“这是当时惟一专门抢救移栽三峡珍稀植物的园子。”李振宇说。
珍稀植物园由重庆金园珍稀植物培植有限公司担任项目法人,这个公司的法定代表人为向秀发。
和植物园基础设施建设同步进行的,是抢救性移栽三峡珍稀植物。2003年,一期蓄水就要启动,他们在和蓄水线赛跑。
疏花水柏枝———生长在江边沙夹石地,将被全部淹没。2002年,从巫山段江心岛移栽。这种从喜马拉雅山脉辗转千年才栖息于三峡地区的奇特植物,最终落脚于珍稀植物园。
荷叶铁线蕨———铁线蕨科最原始的类型,在亚洲大陆仅见于三峡,却与大西洋亚速尔群岛产肾叶铁线蕨、非洲中南部细辛铁线蕨同属一个种群。对研究该种的亲缘关系以及植物区系、地理分布均有重大的价值。2002年从万州武陵移栽。
崖柏———1892年法国植物学家从三峡首次采集到标本,此后再未发现,被联合国教科文组织宣布灭绝,成为我国植物研究的空白。2003年,采集于城口大巴山并栽培成活。
还有被称为植物活化石的桫椤,高达20米的紫薇,世界已知胸径最大的黄连木古树,极为罕见的巨型十大功劳木……众多珍稀植物或古树名木,从绝壁或深沟被 移栽。“在2003年一期蓄水前,我们就抢着迁移了现在园里大部分植物,”向秀发说起来无比自豪,“我比蓄水线跑得快!”
但他们也并不总是跑赢,在据国外文献记载有“丰都车前”的一个江心岛上,向秀发和专家们4年间前往寻找三十多次,但最终没能找到。当江心岛最终被淹没,向秀发只能黯然喟叹。
2002年,在迁移绝壁上的十大功劳木时,向秀发被滑脱的树干打断两根胸肋;2003年,他在巴东被竹叶青蛇咬伤,虽经当地医生及时救治抢回性命,但一根食指残废;2004年,向秀发又在野外考察时跌落山崖,昏迷数日后救回性命,一根小指残废。
“老向是在以狂热的态度抢救植物,”一位长期采访向秀发的记者分析,“在对待自己认定的事业上,他是个偏执狂。”
2002年底,由中科院、国家林业局等单位举办的第五届全国生物多样性保护与持续利用研讨会上,主办方以“作出卓越贡献的民间保护人士”邀请向秀发参会并发言。
植物狂人的声誉到达顶峰,但植物园的命运渐入低谷。
- 总理批示
花钱如流水。这是运作植物园期间,向秀发最大的感受。
国家林业局313万专款很快用于园区基础建设,“每一分钱的用途国家都作了详细规定”。植物抢救同期进行,向秀发只能自掏腰包。
野外作业、植物的迁移和栽培、员工工资,每一项都是个无底洞。2002年,他把经营了3年的水库鱼塘转卖。次年起,他开始变卖在老家置下的商铺和住房。
2004年,一直被蒙在鼓里的妻子吴石英回了趟老家,突然发现自家的房子大半到了别人名下……
2004年6月,中国工程院院士、国家环保总局前副局长金鉴明等中外专家专程参观了珍稀植物园。“金院士很高兴,但发现了问题———和珍稀植物抢救移栽 的成效相比,植物园的建设太缓慢了。”李振宇说,“园里大部分员工只会挖坑栽树,技术人员才一两个。”原因很简单,向秀发请不起人搞研究。
从五桥镇到植物园,金鉴明爬了一个小时山路。植物园不通公路,每次采回植物,只能手拉肩扛到园内。2003年,为了一棵二十多米高的飞蛾槭,向秀发们足足扛了4天。他把这些苦情都倒给了金鉴明。
2005年4月,中国工程院院士金鉴明,中科院院士洪德元、王文采,中国高等植物志主编傅立国,中国兰科植物泰斗陈心启等顶尖植物学家联名向温家宝总理 写信,请求“加大抢救保护三峡珍稀植物力度,设立三峡珍稀植物迁地保护专项经费……建设三峡珍稀植物园,是三峡库区文明建设的国际形象工程……体现人与自 然和谐相处的精神”。
专家们尤其急迫地指出,在三峡珍稀植物即将遭遇灭顶之灾的关口,国家投入甚少。“自三峡工程建设以来,实施中央财政投入的项目仅两个,一个是三峡办支持的‘疏花水柏枝、荷叶铁线蕨、川明参保护抢救科研课题’;二就是国家林业局投入313万元的三峡珍稀植物园。”
4月21日,信件得到温家宝总理批示。据向秀发称,总理在外出返京的第二天即做出批示。
温家宝总理批示后,重庆市政府决定由市林业局牵头,编制植物园总体规划,并报市政府和国家有关部门审定。同时,由万州区林业局代市政府起草向国务院三峡办的报告,争取专项资金支持。
一个半月后,国家林业局和三峡办召开专家座谈会;7月19日,重庆市副市长余远牧根据当时重庆市委书记黄镇东批示,赴万州召开现场办公会。
“余市长那天确定了三件事:立即修通进园公路;由重庆市林业局尽快编制植物园总体规划并上报国家有关部门申请经费;解决植物园编制问题。”向秀发说。
向秀发兴奋异常,他觉得事情应该能够顺利进行了,却没想一切如故。
- 体制内外
时至今日,从五桥镇到植物园,仍然需要爬一个小时山路;植物园总体规划和编制挂靠,还停留在文件上。
照向秀发的说法,植物园就像个尴尬的黑孩子,“给了准生证,但至今还没上户口”。没有编制,不可能吸引高级科技人员加入;没有规划,就无从向国家申请经费。
老家的商铺和住房已经卖光了,向秀发欠外债30多万。
由于缺乏人手护理,荒草逐渐包围已经十分脆弱的珍稀植物。“我找到林业部门诉苦,现在摆个半截摊子,再不做规划,国家前期投的几百万不是浪费了?”他回忆说,“但有工作人员很不理解:你不是都拿到一笔钱了么,够了嘛!”
2006年重庆大旱,植物园内的蓄水池干了,就从山下买水,水价一度涨到20块一担。向秀发最发愁的就是拿着水瓢不知道该浇向哪株植物,“它们都像是自己的亲儿子”。
最后出再高的价也买不到水了。向秀发只能看着,这些他拿命换回来的植物一株株枯萎凋亡。崖柏枯死了,20米高的紫薇枯死了,黄连木枯死了,四照花也枯死了……这些百年古树支撑不住,更不用说那些本应生活在潮湿环境中的桫椤、疏花水柏枝和兰科植物。
向秀发跑到林业部门求助,却得到回答:现在到处都旱,我们也帮不了你。
上千株植物死了!在它们曾经的避难所三峡———200万年前,地球经历新生代第四季大冰川期,由于特殊的地理地貌,三峡地区逃过冰川直接凌虐,不仅使众多第三纪和更早的植物得以保存,更成为第四纪后植物异质分化的策源地。
“他还是把事情看得简单了。”一位采访向秀发多年的记者评价,“不熟悉机关单位的规则,以为拿了国家和市领导的批示就是尚方宝剑,其实县官不如现管。”
曾有有关部门工作人员来参观后,挖了一截石斛想带走,向秀发居然追到车里把石斛拿了回来。有人劝他,难道这个关系抵不上一截草苗?向秀发生气地回答:都是我拿命换回来的!
也曾采访过向秀发的一位记者说,老向是真的守着金碗挨饿,园子里的珍稀植物价值不菲,曾有韩国商人以单价200美元收购兜兰,园里培育了上千株,但他一 兜也不肯卖。2005年,重庆林业系统一名官员到植物园调研,向秀发谈及经费问题,官员沉吟半响后委婉指点:你可以搞点市场化运作嘛。向秀发当即一脸乌青 的顶了回去:要卖植物我早就卖了,等不到现在!
向秀发曾反复要求首先把植物园总体规划编制起来,重庆市林业局建议由万州区林业局牵头;向秀发找到万州区林业局,有人跟他说了实话:“万州的财政状况你也知道,就算我们愿意来牵头,把你的编制也挂靠过来,我们又哪来钱给你办事?”
植物狂人也曾试图融入体制内,但他的做法令人哭笑不得。他把向各部门递送的请求函,都“搞成红头文件的样子”。但这种表面文章,不可能让人对他改变态度。
- 5年盼来两台灭火机
6月7日,三峡珍稀植物园向重庆市林业局发出《关于暂停生产活动的报告》,称“从市计委批复至今,该项目的规划及项目投资均未落实,项目建设仍未实施,导致前期按计划抢救到园内的大批三峡珍稀植物无法实施保护,陷入毁灭状态”,并“请林业局回复并作妥善安排”。
两周后,重庆市林业局向万州区林业局发出《关于做好重庆三峡珍稀植物园保护工作的函》,其中提出:你局按照属地管理原则,加强对三峡珍稀植物园的保护和 管理工作;根据行政管理和公文管理规定,我局只接受各区县林业主管部门上报文件,不接受区县林业部门管理的单位上报文件。请将我局意见转告三峡珍稀植物 园。
向秀发看到复函后感叹,“植物园的事情不归他们管。”
而在接受南方周末记者采访时,万州区林业局副局长吴鸣飞称:“说实话,我们现在也搞不懂该哪个部门管。”目前,区林业局已经向万州区政府打了紧急报告,区政府目前正在研究之中,“我们也只能尽到这个责任了”。
从2007年开始,工人们就没领过工资,逐渐有人离去。年三十上午,工人们围在植物园里向秀发的住处外,等着结算去年的工资,其中还有他的两个亲兄弟。
6月初,向秀发向有关部门寄了一封信,说明“植物园已成荒山,防盗防虫防火都很危急”。市林业局官员下来调查了一回,“要不给你拨两台灭火机?”
“这是总理批示两年后,植物园落实的第一件事情。”向秀发说。他说现在他算有了些新的领悟,“毕竟总理不可能亲自来帮我栽树”。
入夏后,接连下了几场雨。去年干死的一棵紫薇,居然冒出了一点新芽。向秀发的心情明显好了很多———他的自豪总是来源于“自己的”植物,它们活得那么艰难,却又那么坚强。

向秀发守在枯死的植物旁 曹筠武/图
这些都是重庆三峡珍稀植物园挽救的物种,大多相当于动物界的大熊猫
崖柏
紫薇
中华蚊母树
桫椤
荷叶铁线蕨
疏花水柏枝
Posted by
Display Name
-
12:15 PM
0
comments
Labels: Misc
[vim] How to use mouse in an xterm terminal
:help 'mouse'
Posted by
Display Name
-
10:36 AM
0
comments
Labels: Vim
2007-06-28
Searching RFCs
RFCs@FAQs.org
IETF.org (Google Custom Search)
Posted by
Display Name
-
7:10 PM
0
comments
Labels: Google, Network/Security
Google Docs 改版了

昨天下午的时候发现 google docs 改版了, 原来的 label 变成了 directory, 方便了许多.
Posted by
Display Name
-
10:51 AM
0
comments
Labels: Google







