Archive for 八月, 2011

Typo3 session

Using sessions
Sessions are a mechanism to carry user data (parameters) along the web site visit without having to post them over and over again. The data is available as long as the session is valid, usually until all browser windows are closed.

Since TYPO3 instantiates a session automatically, you can use this existing session to read/write data into it. However, you must first understand that sessions in frontend and backend are handled differently.

The routine on the other hand is always the same.

Recover your data from the session
Add values (possibly into an array that holds all the session data)
Save your data to the session (continue reading…)


MySQL性能优化的最佳21条经验

今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显。关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我们程序员需要去关注的事情。当我们去设计数据库表结构,对操作数据库时(尤其是查表时的SQL语句),我们都需要注意数据操作的性能。这里,我们不会讲过多的SQL语句的优化,而只是针对MySQL这一Web应用最多的数据库。希望下面的这些优化技巧对你有用。 (continue reading…)


fpdf矢量图 EPS / AI

EPS / AI

Informations

Author: Valentin Schmidt
License: Freeware
Version: 1.6
From: http://staff.dasdeck.de/valentin/fpdf/fpdf_eps/ (continue reading…)



SCP(Secure Copy)协议

scp 命令是 SSH 中最方便有用的命令了,试想,在两台服务器之间直接传送文件,仅仅用 scp 一个命令就完全解决了。你可以在一台服务器上以 root 身份运行 #scp servername:/home/ftp/pub/file1 ./ 这样就把另一台服务器上的文件 /home/ftp/pub/file1 直接传到本机器的当前目录下,当然你也可以用 #scp /tmp/file2 servername:/boot 把本机上的文件 /tmp/file2 送到另一台机器的 /boot 目录下。而且整个传送过程仍然是用 SSH 加密的。

scp就是secure copy,是用来进行远程文件拷贝的。数据传输使用 ssh,并且和ssh 使用相同的认证方式,提供相同的安全保证 。 与rcp 不同的是,scp 在需要进行验证时会要求你输入密码或口令。

 


linux下php扩展ssh2的安装

1. 安装OpenSSL
a. # yum install openssl
b. # yum install openssl-devel

2. 安装libssh2:
a.  # cd /usr/src
b.  # wget http://downloads.sourceforge.net/project/libssh2/libssh2/1.0/libssh2-1.0.tar.gz
c.  # tar -zxvf libssh2-1.1.tar.gz
d.  # cd libssh2-1.1
e.  # ./configure
f.  # make all install

3. link libssh & PHP together,using pecl:
a. #  pecl install -f ssh2
b. 确保生成的ssh2.so在php.ini制定的extension目录下
c. 修改php.ini,添加 extension=ssh2.so

4. Compiling libssh2 PHP Extension (代替上面第3步,貌似上面的是不稳定版本)
a.  # wget http://pecl.php.net/get/ssh2-0.11.0.tgz
b.  # tar -zxvf ssh2-0.11.0.tgz
c.  # cd ssh2-0.11.0
d. # phpize && ./configure –with-ssh2 && make « Generates ssh2.so, the compiled PHP extension.
e. # cp ./modules/ssh2.so /usr/lib/php/modules/ssh2.so
f.  修改php.ini,添加 extension=ssh2.so (echo “extension=ssh2.so” > /etc/php.d/ssh2.ini)

5.  重启lighttpd: service lighttpd restart (continue reading…)


linux下VSFTP的搭建及优化

首先安装Linux 企业版第一张光盘中的vsftpd-2.0.1-5.i386.rpm
#rpm –ivh
/media/cdrom/RedHat/RPMS/vsftpd-3.0.1-5.i386.rpm
启动vsftpd服务
#service vsftpd start
刷新防火墙
#iptables -F
这样一个简单linux下的FTP就已经搭建好了!
下面就来慢慢优化我们的FTP服务器: (continue reading…)


js取url参数

function getParameterByName(name){
  name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
  var regexS = "[\\?&]" + name + "=([^&#]*)";
  var regex = new RegExp(regexS);
  var results = regex.exec(window.location.href);
  if(results == null)
    return "";
  else
    return decodeURIComponent(results[1].replace(/\+/g, " "));
}

Copyright © 1996-2010 Add Lives. All rights reserved.
iDream theme by Templates Next | Powered by WordPress