Archive for 十二月, 2007

[转]要Flash做作品也具有”左右时间”的功能

看着中央电视台著名节目主持人杨澜,拍摄的按个左右时间看电视!要我顿然的想法,FLASH能不能也具有这个功能呢?
现在我们要改装一下这个Flash作品.给她也注入记忆功能.
要实现的效果:
刷新或关闭页面的时候记住上次的播放头位置.
下一次打开页面动画接着上一次的位置继续播放.
实现代码如下(发布成AS1/AS2):

  1. var 52ria= SharedObject.getLocal('remember');
  2. if (52ria.data.pos != undefined) {
  3.       gotoAndPlay(52ria.data.pos);
  4. }
  5. this.onEnterFrame = function () {
  6.       52ria.data.pos = _currentframe;
  7. };
  8. 52ria.flush();

评论

[转]以最少的Web服务器达到最大的性能──“互联星空播客”今日上线

  引用
  新浪科技讯 2007年5月17日,新浪与中国电信联合召开新闻发布会,正式宣布双方在播客业务上结为全面合作伙伴关系,新浪播客将以联合品牌“新浪-互联星空播客”的全新形象跟网民见面。今后,网民不仅将体验到速度更流畅、内容更丰富的播客平台,而且无论在新浪网,还是互联星空网站都可使用播客的全部服务。
  http://tech.sina.com.cn/i/2007-05-17/10091512192.shtml
Read the rest of this entry »

评论

[转]SQL Relay的PHP API使用方法

USING
You can use the module by loading it in your PHP script and calling SQL Relay functions.
For example:

dl(“sql_relay.so”);
$con=sqlrcon_alloc(“adasz”,9000,”",”user1″,”password1″,0,1);
$cur=sqlrcur_alloc($con);
sqlrcur_sendQuery($cur,”select table_name from user_tables”);
sqlrcon_endSession($con);
for ($i=0; $i {
printf("%s\n",sqlrcur_getField($cur,$i,"table_name"));
}
sqlrcur_free($cur);
sqlrcon_free($con);
Read the rest of this entry »

评论

[转]php多线程/进程的问题

昨天找到了进程后台运行的方法,今天测试了一下,发现popen的速度很慢,要40-50毫秒,exec更慢!类似的程序调用命令,都要经过系统调用,每次都开启一个php进程想必很慢。
Read the rest of this entry »

评论 (1)

Secure Apache TRACE Vulnerabilities

  1. telnet www.example.com 80

After the response

  1. Trying 12.34.56.78...
  2.  Connected to www.example.com.
  3.  Escape character is '^]'.

enter these commands:

  1. TRACE /index.html HTTP/1.1
  2.  Host: www.example.com
  3.  [CR]
  4.  [CR] = Carriage Return, for a blank line to signify the end of the headers being sent

If your server is “vulnerable” you will get a response back similar to this one (status 200):

  1. HTTP/1.1 200 OK
  2.  Date: Sat, 17 Dec 2005 23:51:29 GMT
  3.  Server: Apache/1.3.33 Sun Cobalt (Unix) mod_ssl/2.8.22 OpenSSL/0.9.6 PHP/4.3.10 mod_auth_pam_external/0.1 mod_perl/1.29
  4.  Connection: close
  5.  Transfer-Encoding: chunked
  6.  Content-Type: message/http
  7.  30
  8.  TRACE /index.html HTTP/1.1
  9.  Host: www.example.com
  10.  0
  11.  Connection closed by foreign host.

This is “bad” because an attacker could get cookie or other information returned by using a carefully crafted request.

To protect your server, you must login as root and add this block of code to every VirtualHost container in /etc/httpd/conf/httpd.conf and /etc/httpd/conf/vhosts/site[1-n]:

  1. # Block TRACE/TRACK XSS vector
  2.  RewriteEngine On
  3.  RewriteCond %{REQUEST_METHOD} ^TRAC(E|K)
  4.  RewriteRule .* - [F]

Then restart Apache

  1. /etc/rc.d/init.d/httpd reload

Once you do that, you can perform the same test and the reply will look different:

  1. HTTP/1.1 403 Forbidden
  2.  Date: Sat, 17 Dec 2005 00:01:06 GMT
  3.  Server: Apache/1.3.33 Sun Cobalt (Unix) mod_ssl/2.8.22 OpenSSL/0.9.6 PHP/4.3.10 mod_auth_pam_external/0.1 mod_perl/1.29
  4.  Last-Modified: Fri, 11 Feb 2005 05:30:57 GMT
  5.  ETag: "601d904-4dd-420c4311"
  6.  Accept-Ranges: bytes
  7.  Content-Length: 1245
  8.  Content-Type: text/html
  9.  
  10.  ... HTML content snipped ...

评论

[转]网站测试技术简介

1 概述

在一个软件项目开发中,系统测试是保证整体项目质量的重要一环,本文将就网站的测试技术及相应的自动测试工具做一个简要的介绍。主要就如下几个方面进行探讨:
功能测试

性能测试

安全性测试

稳定性测试

浏览器兼容性测试

可用性/易用性测试

链接测试

代码合法性测试
Read the rest of this entry »

评论

svn安装

在网上找了很多资料,大部分的SVN都需要跟Apache结合使用。基于对Linux不是太熟悉,不敢重装Apache,只好想其他办法来解决这问题。其实,与Apache结合用户权限管理起来更方便。

安装:
./configure –with-apr=apache源码目录/scrlib/apr –with-apr-util=apache源码目录/scrlib/apr-util
make
make install

使用:

开启服务:
svnserve -d –root=SVN项目保存目录

建立项目命令:
svnadmin create project_name SVN项目保存目录/project_name
建立项目之后,进入文件夹,可以看到一个conf的文件夹。进入文件夹可以看到3个文件(如果没有passwd文件,可以用vi创建),
编辑 svnserve.conf 把anon-access = read ,auth_access = write
还有password-db = passwd 的注释去掉,还有[general]的注释也要去掉。
vi passwd文件,如果是新文件,则输入:
[user]
your_name = your_password
这里设置的your_name是你的用户名,your_password是你的密码,这个是访问SVN必要的通行证。

评论

Jabber资料

找到几个PHP应用Jabber的例子

http://code.blitzaffe.com/pages/phpclasses/files/jabber_client_52-11

http://zeank.in-berlin.de/jsjac/#dl

还有在www.phpclasses.org 也有不少Jabber应用的类。

明天继续研究。

评论