jstl fn endsWith 的一个bug 无法匹配“.”
<c:set var="str">pc.shouye.fdwz.</c:set>
${fn:endsWith(str,'.')}
这样会返回false
可以用下面的方式替换
<c:set var="str">pc.shouye.fdwz.</c:set>
${fn:substring(str, fn:length(str)-1, fn:length(str)) != '.'}
<c:set var="str">pc.shouye.fdwz.</c:set>
${fn:endsWith(str,'.')}
这样会返回false
可以用下面的方式替换
<c:set var="str">pc.shouye.fdwz.</c:set>
${fn:substring(str, fn:length(str)-1, fn:length(str)) != '.'}
之前还有个js触发flash来解决的方案,但新版flash更新以后,增加了安全性,js触发的flash事件无效,必须是真实的用户鼠标触发的flash事件才能调用flash的拷贝剪贴板功能。
这个是as2版本,as3的要稍微复杂些。
首先新建一个按钮原件,然后在按钮原件上加如下代码即可
on(release){
if (txt.length)
{
System.setClipboard(txt);
}
}
效果参考
猛烈点击看效果
------------------------------------华丽分割线-----------------------------------
如果传递的参数里面带有&,通常flash会当作不同的参数,如果要获取完整的参数,则需要先对参数进行编码
encodeURIComponent("http://ivy.pconline.com.cn/adpuba/click?adid=149623&id=pc.sy.banner.tl4yc.&")
然后在flash里面替换字符,但flash里面没有replace函数,所以要先定义一个
String.prototype.replace = function(oldStr:String, newStr:String) {
return this.split(oldStr).join(newStr);
}
然后在flash里面对传递的参数进行替换
on(release){
if (txt.length)
{
str = txt.replace("&","&");
System.setClipboard(str);
flash.external.ExternalInterface.call("message","复制成功!");//这个是当拷贝成功后调用js里面的message函数,用来提示用户已经拷贝成功。
}else{
flash.external.ExternalInterface.call("message","复制失败!");
}
}
[\u4E00-\u9FA5]+
貌似是简体和繁体中文字体编码的范围。
比如我要取acount.pclady.com.cn/wzcount/artbrowse.php?groupname=女性网&subgroupname=&id=603065&title=&response=1里面的id=603065
Pattern p = Pattern.compile("artbrowse.php\\?[\\w&=%\\u4E00-\\u9FA5]*(id=\\d+)");
Matcher m = p.matcher(html);
ArrayList artcnts = new ArrayList();
while(m.find()){
artcnts.add(m.group(1));
}
转自:开源ISPCP社区 http://www.ispcpcn.com/article/13/
CentOS5.3的php版本默认为5.1.6,然后在5.2.9版本之前的的php都存在一个漏洞,但是目前网上很多地方都无法使用yum update php*升级到5.2.9,比较常见的是升级到5.2.6版本的,经过搜索国外资料,现在终于找到一种升级CentOS的php到5.2.9的方法。
注意,此方法只能在官方的php版本上升级,如果你使用网上的升级到5.2.6版本的升级方法已经升级了,将无法使用本方法升级php。
运行下面命令:
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/5/remi/i386/remi-release-5-7.el5.remi.noarch.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
然后编辑/etc/yum.repos.d/remi.repo
#vi /etc/yum.repos.d/remi.repo
在这个文件的最后增加一行:
priority=1
保存退出。
/etc/yum.repos.d/epel.repo和/etc/yum.repos.d/epel-testing.repo这两个文件也按照上面的方法进行编辑!
使用下面的命令进行升级,但是经过测试,如果单独升级php将提示失败,只有联通mysql一起升级才可以,所以我们必须执行以下命令才能升级php到5.2.9版本:
yum –-enablerepo=remi update php* mysql*
1. yum -y install vsftpd (yum 自动安装);
2. 修改vsftpd的配置:
在/etc/vsftpd/vsftpd.conf 文件,修改默认配置,包括监听地址和端口,是否打开 tcp、psav模式等等
3.启动vsftpd服务:
运行service vsftpd start即可,或者运行/etc/init.d/vsftpd start
说明:
创建匿名用户根目录: anon_root=/var/ftp/
匿名用户上传文件:
write_enable=YES
anon_world_readable_only=NO
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
然后创建供匿名用户上传文件的目录,并设定权限:
# mkdir /var/ftp/incoming
# chmod o+w /var/ftp/incoming
file_open_mode=0777 ##如果希望上传的文件可以执行,设此值为0777。默认值为0666。
限制用户在自家目录
1、限制所有的本地用户在自家目录
chroot_local_user=YES
2、限制部分本地用户在自家目录
chroot_local_user=NO
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
在/etc/vsftpd.chroot_list文件中加入要限制的本地用户名。注意一个用户名一行。
日志设置:
xferlog_enable=YES|NO
xferlog_file=
这个选项设定记录传输日志的文件名。默认值为/var/log/vsftpd.log。
用setup 可以把它选择为开机自动运行
关于windows用户访问服务器时候出现乱码的问题
windows访问vsftp出现乱码因为windows默认编码是GB2312,linux用的是UTF-8编码,所以上传文件会有乱 码,这时可以更改修改 /etc/sysconfig/i18n文件,将第二行改成这样:LANG = "zh_CN.GB2312"就可以了
vsFTP(二)让虚拟账户使用不同的主目录,并且又完全权限
(转自http://blog.chinaunix.net/u1/42928/showart_334305.html)
virtual_user的主目录: /home/ftp
vsftpd.conf中加入
guest_username=virtual_user
user_config_dir=/etc/vsftpd_user_config
user_sub_token=$USER
/etc/vsftpd_user_config目录下为每个用户建一个配置文件,文件名与用户名相同,内容中必须有
local_root=/home/ftp/$USER
让虚拟账户使用不同的主目录,并且又完全权限, 在vsftpd.conf中输入下面代码:anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
anon_mkdir_write_enable=YES
anon_other_write_enable=YES
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
pam_service_name=vsftpd
userlist_enable=YES
one_process_model=NO
anon_world_readable_only=NO
guest_enable=YES
guest_username=nihao
listen=YES
tcp_wrappers=YES
user_config_dir=/etc/vsftpd_user_config
user_sub_token=$USER
=====================================
创建数据库文件
db_load -T -t hash -f /etc/vsftpd/logins.txt /etc/vsftpd/vsftpd_login.db
且设置权限
chmod 600 /etc/vsftpd/vsftpd_login.db
创建数据库的PAM文件
vi vsftpd.pam 内容如下:
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login
并复制到/etc/pam.d下
cp vsftpd.pam /etc/pam.d
设置虚拟用户的根目录
useradd -d /home/ftp vftp
限制个人用户目录:
user_config_dir=/etc/vsftpd/vsftpd_user_conf
在该目录下建立与特定虚拟用户同名的文件
在用户文件里加入:
local_root=/home/test
就可设置用户的目录
并按实际需要开启相关的权限
anon_world_readable_only=NO
write_enable=YES
anon_upload_enable=YES
anon_other_write_enable=YES
anon_umask=
匿名用户新增文件的umask 数值。默认值为077。
vi vsftpd.conf
anonymous_enable=NO
local_enable=YES
local_umask=022
anon_umask=022
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=vftp
listen=YES
pam_service_name=vsftpd.pam
user_config_dir=/www/servers/vsftpdv/user
pasv_enable=YES
pasv_min_port=10240
pasv_max_port=10250
userlist_enable=YES
userlist_deny=YES
userlist_file=/etc/vsftpd.denyuser
1. 更新系统内核到最新.
[root@linuxfei ~]#yum -y update
系统更新后,如果yum安装时提示错误信息,请执行以下命令修复.
[root@linuxfei ~]#rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY*
2. 安装Apahce, PHP, Mysql, 以及php连接mysql库组件
y[root@linuxfei ~]#um -y install httpd php mysql mysql-server php-mysql
//安装mysql扩展
[root@linuxfei ~]#yum -y install mysql-connector-odbc mysql-devel libdbi-dbd-mysql
//安装php的扩展
[root@linuxfei ~]# yum -y install php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc
//安装apache扩展
[root@linuxfei ~]#yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
一次性粘贴安装:
[root@linuxfei ~]# yum -y install httpd php mysql mysql-server php-mysql httpd-manual mod_ssl mod_perl mod_auth_mysql php-mcrypt php-gd php-xml php-mbstring php-ldap php-pear php-xmlrpc mysql-connector-odbc mysql-devel libdbi-dbd-mysql
3. 启动服务配置
[root@linuxfei ~]# /sbin/chkconfig httpd on [设置apache为自启动]
[root@linuxfei ~]# /sbin/chkconfig –-add mysqld [mysql服务]
[root@linuxfei ~]# /sbin/chkconfig mysqld on [mysqld服务]
[root@linuxfei ~]# /sbin/service httpd start [自启动 httpd 服务]
[root@linuxfei ~]# /sbin/service mysqld start [自启动mysqld服务]
4.设置mysql数据库root帐号密码。
[root@linuxfei ~]# mysqladmin -u root password 'linuxfei' [引号内填密码]
之前有这类广告效果,直接写
body {cursor:url("http://hitn.bdimg.com/cade007/tnfile/item/a333bffd6c56d51608244d7c.cur")}
发现只有ie下可用,其他浏览器不兼容。今天无意中发现一个网站上的鼠标光标在其他浏览器也可以兼容,看了下样式,原来要加个default就可以了。
如下:
body {cursor:url("http://hitn.bdimg.com/cade007/tnfile/item/a333bffd6c56d51608244d7c.cur"), default;}
一,下载
cd /usr/local/src wget http://downloads.zend.com/optimizer/3.3.3/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz tar -xzvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz ./ZendOptimizer-3.3.3-linux-glibc23-i386/install.sh
执行这个脚本后会自动图形界面下提示安装。
php.ini配置文件目录是:/etc
由于想对女性网SNS的站内广告入口做一些来源统计,就需要用到document.referrer来获取点击来源,有些入口有可能是flash 的,不知道flash里的链接来源不知道能否获得,所以做了个例子测试了一下。
flash里面的链接代码为:
on(release)
{getURL("[http://www1.pclady.com.cn/test/20100226/flashtest.html","_blank");}
点击广告可跳转到这个页面,这个页面是把document.referrer输出,代码如下
<script>
document.write('referrer:'+document.referrer);
</script>
测试结果
ie6:referrer为空。
firefox3.6:referrer:http://www1.pclady.com.cn/test/20100226/previewAd.html 正确的输出了flash所在页面的url
chrome:referrer:http://imgad1.3conline.com/ivy/image/20102/26/1267166875222.swf;得到的结果是flash文件的路径。