Tuesday, January 31, 2006

百度,请把我的博客收入!

很多人都报怨自己的站点不能被BaiDu正常索引,在Google Group上见到有人说“给百度钱的站点才能被正常索引”之类的话,这也言过其实了;但是我的博客至今没有被索引进百度倒是的的却却的真实案例,可能是我内容不够好吧?但是我认为我的博客也不至于被百度评为“垃圾”的级别吧?为什么会这样。不说个人博客,一些网站也招受同样的命运:solidot.org ,据说一样也有类似情况。但是google却能正常索引我的博客,Yahoo!cn ,就是连A9,MSN也可以, 为什么百度不行? 难道因为我的站点编码是UTF-8的原因? 难道我的博客上没有大量的链接或广告? 难道…… 或许可能是这样:

  1. 百度的搜索的确对非GBK等中文编码有所抗拒

  2. 为了加快索引速度,不得不省略掉一些站点,比如象我这样的个人博客,没有给百度带来利益的站点

  3. 技术的发展跟不上数据的增加

  4. 其他不可预测或者不敢说明的原因



希望每个人都写博客,每个人都有站点,如果百度连“自己”的内容也索引不了?那么…… 我也很高兴,因为: 它把美国股民当猪一样玩了一把,所以,不管怎么样,我最后要说的就是 “百度,baidu,我支持你!反正我也很少用百度的搜索了。”

SeaMonkey 1.0 Released

期待已久的 Mozilla Application Suite 革新项目 “SeaMonkey” 昨天正事发布了1.0版本!



The SeaMonkey Council is proud to announce SeaMonkey 1.0, the first end-user release of their internet suite. This open source application, available as a free download from its mozilla.org-hosted website, features a state-of-the-art web browser and powerful email client, as well as a WYSIWYG web page composer and a feature-rich IRC chat client. For web developers, mozilla.org's DOM inspector and JavaScript debugger tools are included as well. SeaMonkey 1.0 is one of the most complete, powerful, and secure internet software packages available today.

Monday, January 23, 2006

Thanks Answers.com

给answers.com发去的邮件本反馈单词发音的问题以为不会被回复,但是ansers.com的员工却用非常礼貌的邮件热情地给予我了帮助, 让我在opera(linux system)上解决了单词发音的问题,我曾经也发过一些反馈给Google, Baidu, hotmail等等,除了Google态度好一些,hotmail用机器敷衍,其他的几乎不会理你,唉,仗着访问多?所以我到现在都不会使用那些网站的服 务,为了证明,我公布这次的两次邮件内容。


Received: from tweety.atomant.net([127.0.0.1]) by xinhua.org(AIMC 3.1.0.0)
with SMTP id jm043d36de2; Sun, 22 Jan 2006 18:37:28 +0800
Received: from tweety.atomant.net([212.143.232.13]) by xinhua.org(AIMC 2.9.5.4)
with SMTP id AISP action; Sun, 22 Jan 2006 18:37:28 +0800
MIME-Version: 1.0
X-MimeOLE: Produced By Microsoft Exchange V6.0.6603.0
Message-ID: <2372B81B7E201444A2DE95EAB0D5AC4402923408@tweety.atomant.net>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
X-AIMC-AUTH: (null)
X-AIMC-MAILFROM: support@answers.com
X-AIMC-Msg-ID: e9KbcAPB
content-class: urn:content-classes:message
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Subject: RE: Your Message to Answers.com
From: "Answers Support"
To: "Fred Chu"
Date: Sun, 22 Jan 2006 12:40:37 +0200
Thread-Topic: Your Message to Answers.com
Thread-Index: AcYdpZkqdMPSu/02Tsy/kMMloloI6QBlMCkw

Dear Fred,

Great! Glad to hear that it worked out for you.

Also, we apcodeciate your suggestion. Your message has been passed onto to our Product Management team for consideration in a further release.

Feel free to contact us if you have any further questions or comments about Answers.com. Don't forget to tell your friends and colleagues about us.

Sincerely yours,
Ricky Fleischer
Answers Customer Support
http://www.answers.com
The Answer Engine


-----Original Message-----
From: Fred Chu [mailto:fredchu@xinhua.org]
Sent: Friday, January 20, 2006 11:34 AM
To: Answers Support
Subject: Re: Your Message to Answers.com


To:

From: "Answers Support"
Subject: RE: Your Message to Answers.com
Date: Fri, 20 Jan 2006 11:02:43 +0200

> Dear Fred,
>
> Thank you for contacting Answers.com.
>
> We have been unable to reproduce your issue, Fred. Opera worked just
> fine for us on a Linux workstation.
>
> For starters, do you hear other sounds clearly? If not, please make sure
> your speakers are plugged in, both to the computer and electricity,
> switched on, with the volume turned up. Make sure you have the speaker
> icon in the System Tray (near the clock). Click it to scale up the
> volume, and make sure the Mute box is not checked.
>
> Have you tried any other browsers? We have found the Firefox works very
> nicely in Linux, with RealPlayer set to play the audio. We recommend
> trying that; we found the sound to work in Firefox once we had installed
> Real Player.
>
> Feel free to contact us if you have any further questions or comments
> about Answers.com.
>
> Sincerely yours,
> Ricky Fleischer
> Answers Customer Support
> http://www.answers.com
> The Answer Engine
>
>
> -----Original Message-----
> From: fredchu@xinhua.org [mailto:fredchu@xinhua.org]
> Sent: Wednesday, January 18, 2006 9:30 AM
> To: Answers Support
> Subject: Your Message to Answers.com
>
>
> Name: Fred Chu, fredchu@xinhua.org
> Sent from Answers
>
> I can't hear the voice, when I get the answer of "Linux", when I click
> the button of the loudspeaker, but I can't hear only voice! Can you help
> me.
> ---------------
> My system:
> Ubuntulinux 5.04
> Opera 8.5
> flash 7.16
> esound driver
> ---------------
>
> Thanks.
>
> HTTP_USER_AGENT:Opera/8.51 (X11; Linux i686; U; zh-cn)
> AB version: null
>

Hi Sir

Thanks your response, I have not installed a real
realplayer, but installed realplayer's plugin for some
media players. I can heard the voice in firefox and
Opera now. But I think use flash to play voice is a good
idea. It can works fine with only system and only
browser. It's only a suggestion.


--
Fred Chu, Chongqing, China (mainland)
URL: http://blogit.3322.org   CQ   CN
fredchu@xinhua.org  PGP key available

Friday, January 13, 2006

从PHP获得更快、更安全的Msyql链接?

今天在 apache 2.2 + PHP5.1.1 + MySQL 5.0.1 的环境上编译了PHP支持 mysqli() 的MySQL的功能,的确不错,链接速度提高了很多;想使用mysqli()需要在 PHP编译配置时加上到 MySQL 的 mysql_config 可执行文件的路径,比如我的就是

#./configure --with-mysqli=/opt/MySQL5/bin/mysql_config --enable-xslt --with-xslt-sablot --with-apxs=/opt/apache/bin/apxs --with-gd --with-zlib --with-pgsql=/opt/pgsql



mysqli() 同时提供 面向对象面向过程 的两种链接方式

< ?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "world");

/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

printf("Host information: %s\n", $mysqli->host_info);

/* close connection */
$mysqli->close();
?>



< ?php
$link = mysqli_connect("localhost", "my_user", "my_password", "world");

/* check connection */
if (!$link) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}

printf("Host information: %s\n", mysqli_get_host_info($link));

/* close connection */
mysqli_close($link);
?>

Wednesday, January 11, 2006

mod_python在apache 2.2上安装问题的解决

昨天在一台机器上安装了 apache 2.2 , php 5.1.1, mysql 5.0, postgresql 8.1 ,都编译成功,可是在编译安装mod_python的时候遇到了问题

httpd: Syntax error on line 90 of /usr/local/etc/apache22/httpd.conf:
Cannot load /usr/local/libexec/apache22/mod_python.so into
server: /usr/local/libexec/apache22/mod_python.so: Undefined symbol
"APR_STATUS_IS_SUCCESS"


这是因为 apache 2.2 改写了大量的代码,APR_STATUS_IS_SUCCESS 已经没有在 apache 2.2 中使用了,这时最简单的方法是在源代码 src/filterobject.csrc/connobject.c 中注释掉它,如果你使用的是 mod_python-3.2.5b 也可以使用这个patch:



diff -uNr mod_python-3.2.5b/src/connobject.c mod_python-3.2.5b.new/src/connobject.c
--- mod_python-3.2.5b/src/connobject.c2005-11-12 13:59:35.000000000 -0500
+++ mod_python-3.2.5b.new/src/connobject.c2005-12-03 15:26:27.000000000 -0500
@@ -78,12 +78,6 @@
rc = ap_get_brigade(c->input_filters, bb, mode, APR_BLOCK_READ, bufsize);
Py_END_ALLOW_THREADS;

- if (! APR_STATUS_IS_SUCCESS(rc)) {
- PyErr_SetObject(PyExc_IOError,
- PyString_FromString("Connection read error"));
- return NULL;
- }
-
/*
* loop through the brigade reading buckets into the string
*/
@@ -312,24 +306,17 @@
**
* utility func to make a socket address
*/
-
static PyObject *makesockaddr(struct apr_sockaddr_t *addr)
-{
+{
PyObject *addrobj = makeipaddr(addr);
PyObject *ret = NULL;
if (addrobj) {
- apr_port_t port;
- if(apr_sockaddr_port_get(&port, addr)==APR_SUCCESS) {
- ret = Py_BuildValue("Oi", addrobj, port );
- }
- else {
- PyErr_SetString(PyExc_SystemError,"apr_sockaddr_port_get failure");
- }
+ ret = Py_BuildValue("Oi", addrobj, ntohs(addr->sa.sin.sin_port));
Py_DECREF(addrobj);
}
return ret;
}
-
+
/**
** conn_getattr
**
diff -uNr mod_python-3.2.5b/src/filterobject.c mod_python-3.2.5b.new/src/filterobject.c
--- mod_python-3.2.5b/src/filterobject.c2004-11-25 17:10:52.000000000 -0500
+++ mod_python-3.2.5b.new/src/filterobject.c2005-12-03 14:20:29.000000000 -0500
@@ -178,11 +178,6 @@
APR_BLOCK_READ, self->readbytes);
Py_END_ALLOW_THREADS;

- if (!APR_STATUS_IS_EAGAIN(self->rc) && !APR_STATUS_IS_SUCCESS(self->rc)) {
- PyErr_SetObject(PyExc_IOError,
- PyString_FromString("Input filter read error"));
- return NULL;
- }
}

/*
diff -uNr mod_python-3.2.5b/test/test.py mod_python-3.2.5b.new/test/test.py
--- mod_python-3.2.5b/test/test.py2005-11-14 13:09:49.000000000 -0500
+++ mod_python-3.2.5b.new/test/test.py2005-12-03 14:23:45.000000000 -0500
@@ -242,9 +242,9 @@
PythonOption('PythonOptionTest sample_value'),
DocumentRoot(DOCUMENT_ROOT),
LoadModule("python_module %s" % MOD_PYTHON_SO),
- IfModule("!mod_auth.c",
- LoadModule("auth_module %s" %
- quoteIfSpace(os.path.join(modpath, "mod_auth.so")))))
+ IfModule("!mod_auth_basic.c",
+ LoadModule("auth_basic_module %s" %
+ quoteIfSpace(os.path.join(modpath, "mod_auth_basic.so")))))

f = open(CONFIG, "w")
f.write(str(s))

博客系统升级到 wordpress 2.0

顺利升级,本来以为插件与模板装多的会出问题,没想到非常顺利的就完成了升级,到 www.wordcodess.org 下载2.0包,解包 -> ftp上传覆盖(上个月备份过,所以也就懒的备份什么的了) -> 升级

http://yoursite/wp-admin/upgrade.php

mod_fastcgi的安装注意

今天帮人安装mod_fastcgi,fcgi用来运行 Ruby On Rails

  1. 先下载fgi-2.4.0安装,很容易,使用

    $./configure
    $make
    $sudo make install

    就可以。


  2. 在fastcgi官方网站上下载最新的源代码(目前是 2.4.2 不过也是2003年的更新,确实用不着更新,目前fastcgi被各种apache的mod慢慢取代了,但是它还是可以发挥很大的作用,不过需要注意的是:在 Apache 2.2 版本上 mod_fastcgi 不能正常编译,这是因为apache 2.2 重写了很多代码,看来fast_cgi不得不会再次更新了)

  3. 安装在apache 2.0 版本,阅读 INSTALL.AP2 文档,需要拷贝 Makefile.AP2 到 Makefile

    $cp Makefile.AP2 Makefile


    接下来就是指定Makefile中 top_dir 的正确路径,也就是你的apache2的安装路径,我的是



    #
    # Makefile for Apache2
    #

    builddir = .

    top_dir = /opt/apache

    top_srcdir = ${top_dir}
    top_builddir = ${top_dir}

    include ${top_builddir}/build/special.mk

    [......]


    接下来编译安装就行了

    $make
    $sudo make install


  4. 这时已经把 mod_fastcgi 正确安装了,这时在 你的 apache2 的配置文件 httpd.conf 中加入


    LoadModule fastcgi_module modules/mod_fastcgi.so

    然后让apache2重新启动就可以了

    $sudo apachectl restart

    或者重新加载配置文件

    $sudo /etc/init.d/apache reload

  5. 如果是debian或者ubuntu的用户,直接用apt-get安装就可以了

    $sudo apt-get install libapache2-mod-fcgid

    如果是apache不是apache2那么就是

    $sudo apt-get install libapache-mod-fcgid



Tuesday, January 10, 2006

关于Debian中info软件与texlive的冲突问题

今天系统例行维护自动安全更新之后,info软件包软件包出现了问题

> No `START-INFO-DIR-ENTRY' and no `This file documents'.
> install-info(/usr/share/info/info-stnd.info): unable to determine description
> for `dir' entry - giving up
> dpkg: error processing info (--configure):
> subprocess post-installation script returned error exit status 1
> Errors were encountered while processing:
> info
> E: Sub-process /usr/bin/dpkg returned an error code (1)

发现是因为在info上次更新后安装了 texlive,把texlive中的 install-info 可执行文件链接到了 /usr/bin/install-info ,然而真正的系统 install-info 文件却是在 /usr/sbin/install-info 位置,并且 texlive 把 info 文件也链接到了 /usr/share/info 目录中,删去这些就可以了。
$sudo rm /usr/bin/install-info
$find /usr/share/info/ -type l | sudo xargs rm

Thursday, January 5, 2006

Compile VLC media player on Ubuntulinux Hoary 5.04

VLC is a powerfull and free cross-platform media player, VLC can also be used as a streaming server. You can use it to save streaming media on your local PC. Now I'll show how to complie a VLC media player from source on ubuntulinux.

  1. download source from the VLC offical website

  2. complie it:

    ./configure --enable-real --enable-realrtsp --enable-esd --enable-xosd --enable-loader && make && sudo make install



  3. now you can use VLC media player by command "vlc", and don't forget set the Options -> Audio -> Output modules(advansed) -> EsounD output. enjoy it!



There is a srceenshot of my VLC media player on flickr ;)

Sunday, January 1, 2006

2006 launch!

Today is the 1st day of year 2006, I think this year I will launch. Thanks my friends and my parents in the last year, I will try hard in the new year.