Friday, March 23, 2007

MySQL error connections

连接MySQL得到这样的错误提示
Warning: mysql_pconnect(): Host '67.19.xx.xxx' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts' in C:\Websites\ratedesi\include\connectdb.php on line 9 Host '67.19.xx.xxx' is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts'
在MySQL手册中找到这样的说明

A.2.5 `Host 'HOST_NAME' is blocked'
------------------------------------
If you get the following error, it means that `mysqld' has received
many connect requests from the host `'HOST_NAME that have
been interrupted in the middle:

Host 'HOST_NAME' is blocked because of many connection errors.
Unblock with 'mysqladmin flush-hosts'

The number of interrupted connect requests allowed is determined by
the value of the `max_connect_errors' system variable. After
`max_connect_errors' failed requests, `mysqld' assumes that
something is wrong (for example, that someone is trying to break
in), and blocks the host from further connections until you execute
a `mysqladmin flush-hosts' command or issue a `FLUSH HOSTS'
statement. See *Note server-system-variables::.

By default, `mysqld' blocks a host after 10 connection errors. You
can adjust the value by starting the server like this:

shell> mysqld_safe --max_connect_errors=10000 &
If you get this error message for a given host, you should first
verify that there isn't anything wrong with TCP/IP connections from
that host. If you are having network problems, it does you no good
to increase the value of the `max_connect_errors' variable.



这可能是比如PHP的未注销连接引起,查看MySQL的进程可以查看一下
mysqladmin -u -p processlist

Tuesday, March 20, 2007

XML输出问题

用AJAX抓取读取远程动态脚本生成的XML时(比如:xml.php),如果XML包括了
encodeing="gb2312"
这样的XML属性,那么AJAX(我的OPERA9至少是这样)就不能读出来,解决的办法是,在xml.php加入

Sunday, March 18, 2007

一个错误,PHP

在使用cakephp的时候把项目转移到目的机器上,结果一直 start_session() 的错误,始终找不到原因,今天看看本地机器的 phpinfo() 结果发现少了 php.ini 加载。

加上之后, work fine.

Ubuntu Audacity 问题的解决

在使用 audacity 软件包的时候,可能会遇到 I/O 错误提示,今天编译了 audacity 1.3.2 beta 也不能正常回放声音(因为audacity 1.3.2 使用 GTK2 ,所以支持中文很好,于是我就升级了)

不过在 ubuntuforums.org 上找到了解决方法,使用下面的脚本转换 esd 的加载顺序

#!/bin/bash
killall esd
sleep 3 # To give the codevious command time to fully complete
/usr/bin/audacity
esd


现在就可以正常使用 audacity 啦 ;)

Wednesday, March 14, 2007

在一个HTML页面弹出窗口

有时候需要在装载一个HTML页面的时候弹出一个简单的HTML页面窗口,但有不想去新建立一个HTML,可以使用JAVASCRIPT在现有的HTML页面中实现







这样就实现了 ;)

Friday, March 9, 2007

让 viewvc 默认显示GB2312编码

默认的viewvc是显示UTF-8,不过可能有时候你的项目都是GB2312编码或者BIG5编码,需要改变其实很简单,在viewvc的安装目录下找到这个文件
$VIEWVC_INSTALL_DIR/lib/sapi.py
只需要把 UTF-8 替换成 GB2312 就可以了,一共有三个地方,使用 vim 来就是这样
:%s/=UTF-8/=GB2312/g
或者你可以改一下原代码,更为方便的改动和使用。

注意我使用的 viewvc 版本为dev-1.1,关于viewvc的安装请参考这篇日志,关于svn的安装请参考这篇日志