工作,学习,生活,这里将会有一些记录. 备用域名:http://meisw.wdlinux.cn 注册 | 登陆
浏览模式: 标准 | 列表全部文章

一个比较全面的创建 XMLHttpRequest 的代码:


function getXmlHttpPrefix() {
if (getXmlHttpPrefix.prefix)
return getXmlHttpPrefix.prefix;

var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"];
var o;
for (var i = 0; i < prefixes.length; i++) {
try {
// try to create the objects
o = new ActiveXObject(prefixes[i] + ".XmlHttp");
return getXmlHttpPrefix.prefix = prefixes[i];
}
catch (ex) {};
}

throw new Error("Could not find an installed XML parser");
}

//////////////////////////
// Start the Real stuff //
//////////////////////////


// XmlHttp factory
function XmlHttp() {}

XmlHttp.create = function () {
try {
if (window.XMLHttpRequest) {
var req = new XMLHttpRequest();

// some versions of Moz do not support the readyState property
// and the onreadystate event so we patch it!
if (req.readyState == null) {
req.readyState = 1;
req.addEventListener("load", function () {
req.readyState = 4;
if (typeof req.onreadystatechange == "function")
req.onreadystatechange();
}, false);
}

return req;
}
if (window.ActiveXObject) {
return new ActiveXObject(getXmlHttpPrefix() + ".XmlHttp");
}
}
catch (ex) {}
// fell through
throw new Error("Your browser does not support XmlHttp objects");
}; 

-------------------------------

var xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
var xmlHttp=new ActiveXObject("MSXML.XMLHTTP");
var xmlHttp=new ActiveXObject("MSXML3.XMLHTTP");
这几个代码都有可能, 上面的代码就遍历这些对象选择一个创建成功的出来, 区别就是操作系统带的 MSXML 包的版本不一样, 这些包是 ActiveX 控件, IE 和很多 Windows 应用都可能用到它. 对于 Mozilla, Firefox, 直接用
var xmlHttp = new XMLHttpRequest();
就可以了.

eaccelerator

wget http://x.x.x.47/eaccelerator-0.9.5.3.tar.bz2

export PHP_PREFIX="/opt/php"
$PHP_PREFIX/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=$PHP_PREFIX/bin/php-config
make
make install


[eAccelerator]

extension_dir = "/usr/local/lib/php/extensions"
extension="/no-debug-zts-20060613/eaccelerator.so"
eaccelerator.shm_size="128"
eaccelerator.cache_dir="/tmp/eaccelerator"
eaccelerator.enable="1"
eaccelerator.optimizer="1"
eaccelerator.check_mtime="1"
eaccelerator.debug="0"
;eaccelerator.log_file = "/tmp/eaccelerator/eaccelerator_log
eaccelerator.filter=""
eaccelerator.shm_max="0"
eaccelerator.shm_ttl="0"
eaccelerator.shm_prune_period="0"
eaccelerator.shm_only="0"
eaccelerator.compress="1"
eaccelerator.compress_level="9"


mkdir /tmp/eaccelerator
chmod 0777 /tmp/eaccelerator

 

---------------------------------------------------


Libraries have been installed in:
   /home/eaccelerator-0.9.5.3/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
(It is safe to ignore warnings about tempnam and tmpnam).

qmail

rpm -ivh igenus-daemontools-0.76-5.0.i386.rpm

rpm -ivh igenus-ucspi-tcp-0.88-5.0.i386.rpm

rpm -ivh igenus-vpopmail-5.4.17-5.1.i386.rpm

[root@ctnt-mm i386]# rpm -ivh igenus-vpopmail-5.4.17-5.1.i386.rpm
error: Failed dependencies:
        libmysqlclient.so.14 is needed by igenus-vpopmail-5.4.17-5.1.i386
        mysql >= 3.23.54 is needed by igenus-vpopmail-5.4.17-5.1.i386
    Suggested resolutions:
        mysql-4.1.7-4.RHEL4.1.i386.rpm

其它机上查找
[root@centos ~]# find / -name "libmysqlclient.so.14"
/usr/lib/mysql/libmysqlclient.so.14
确定目录
本机查找,因本机为tar安装,且为5
http://mirror.centos.org/centos-4/4.7/os/i386/CentOS/RPMS/
下载 mysql-4.1.22-2.el4.i386.rpm
需要 安装 perl-DBI-1.40-9.i386.rpm
OK

rpm -ivh igenus-qmail-1.03-5.0.i386.rpm

rpm -ivh igenus-courier-authlib-4.1.3-5.0.i386.rpm
[root@ctnt-mm i386]# rpm -ivh igenus-courier-authlib-0.59.3-5.0.i386.rpm
error: Failed dependencies:
        /usr/bin/expect is needed by igenus-courier-authlib-0.59.3-5.0.i386
    Suggested resolutions:
        expect-5.42.1-1.i386.rpm

rpm -ivh expect-5.42.1-1.i386.rpm


rpm -ivh igenus-maildrop-2.0.4-5.0.i386.rpm

rpm -ivh igenus-courier-imap-4.1.3-5.0.i386.rpm

rpm -ivh igenus-clamav-0.94-5.0.i386.rpm

rpm -ivh igenus-spamassassin-3.1.8-5.0.i386.rpm
error: Failed dependencies:
        perl(Digest::SHA1) is needed by igenus-spamassassin-3.1.8-5.0.i386
    Suggested resolutions:
        perl-Digest-SHA1-2.07-5.i386.rpm
rpm -ivh perl-Digest-SHA1-2.07-5.i386.rpm


rpm -ivh igenus-ripmime-1.4.0.6-5.0.i386.rpm

rpm -ivh igenus-simscan-1.4.0-5.1.i386.rpm

rpm -ivh igenus-autorespond-2.0.5-5.0.i386.rpm

rpm -ivh igenus-ezmlm-idx-0.40-5.0.i386.rpm


rpm安装完毕


perl(HTTP::Date)
perl(LWP::UserAgent)
http://mirror.centos.org/centos-5/5.2/os/x86_64/CentOS/perl-libwww-perl-5.805-1.1.1.noarch.rpm

1、依赖关系的解决,安装Spamassassin需要很多perl模块的支持,以下是所需模块列表及安装方法,各软件包都可从CPAN取得;

必须的软件包:
Digest::SHA1
HTML::Parser >=3.43
Net::DNS >= 0.34
LWP (aka libwww-perl)
HTTP::Date
IO::Zlib >= 1.04
Archive::Tar  >=1.23

export LC_ALL=C


config
vpopmail
vchkpw

grant select,insert,update,delete,create,alter,drop on vpopmail.* to vpopmail@localhost identified by '';
create database vpopmail

/home/vpopmail/bin/vadddomain domain

 

Privilege separation user sshd does not exist

启动sshd提示:

Privilege separation user sshd does not exist

google了一下,找到了解决方法。

方法一(推荐):
修改/etc/passwd文件,在其中加入
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
或者
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
我加入的是:
sshd:x:109:65534::/var/run/sshd:/usr/sbin/nologin
参考
http://www.unixguide.net/comments/sun/ssh_installation.shtml/37.shtml
http://www.gipsky.com/modules/newbb/viewtopic.php?topic_id=966

方法二(不推荐):
修改/etc/ssh/sshd_config文件
将其中
UsePrivilegeSeparation yes
修改为
UsePrivilegeSeparation no
虽然能解决问题,但是降低了ssh的安全级别。

解开RPM包

rpm2cpio a.rpm | cpio --extract --make-directories

 

2009.07.03

rpm -ivh kchmviewer-3.1-1.el5.5.x86_64.rpm --prefix=/home/chc/rpms/tmp

因为rpm实际上使用cpio格式打包的,因此可以先转成cpio然后解压,如下所示:
rpm2cpio kchmviewer-3.1-1.el5.5.x86_64.rpm | cpio -div

dede code

preg_replace("/(<a(.*)[ \t\r\n]{1,}href=[\"']{0,}http:\/\/[^\/]([^>]*)>)|(<\/a>)/isU","",$)

mysql processlist

mysqladmin -uroot -p proc

mysql -e "show processlist"

rhel5

Installing PEAR environment:      /www/servers/php/lib/php/
/home/r00t/php-5.2.6/sapi/cli/php: error while loading shared libraries: /usr/local/gd/lib/libgd.so.2: cannot rest
ore segment prot after reloc: Permission denied
make[1]: *** [install-pear-installer] Error 127
make: *** [install-pear] Error 2


Nov 14 16:54:45 localhost setroubleshoot:      SELinux is preventing /home/r00t/php-5.2.6/conftest from loading /u
sr/local/gd/lib/libgd.so.2.0.0 which requires text relocation.      For complete SELinux messages. run sealert -l7f26cea9-91e8-4b3a-93e0-6298e6c4e265


failed to connect to server


chcon -t textrel_shlib_t /usr/local/gd/lib/libgd.so.2

 

###
checking for MySQL UNIX socket location... /tmp/mysql.sock
checking for mysql_close in -lmysqlclient_r... no
checking for mysql_error in -lmysqlclient_r... no
configure: error: mysql configure failed. Please check config.log for more information.

没找到解决办法,把PHP换为4的就可以了