-
jquery应用:鼠标移动到表格tr变色
/**@param tabID 表格名称*@param oveClass 鼠标进入时的样式*@param outClass 鼠标离开时的样式(为样式名称)*/function altrow(tabID,oveClass,outClass) {var rowObj = $(“#” + tabID).find(“tr”);$.each(rowObj, function (i, obj) {var tr = $(obj);tr.mousemove(function () {tr.addClass(oveClass);});tr.mouseout(function () {tr.removeClass(oveClass);tr.addClass(outClass);});});}网页加载$(document).ready(function(){altrow(传入参数);}); -
Js压缩加密工具 (PHP版)
下载地址:
http://www.codebit.cn/packer/packer.php-1.0.zip -
get_magic_quotes_gpc() get_magic_quotes_runtime()
GPC 过滤Get Post Cookie 而 RUNTIME 是过滤对数据库执行查询时的过滤。作用:检测php.ini中的magic_quotes_runtime的值magic_quotes_gpc 设置是否自动为GPC(get,post,cookie)传来的数据中的\’\”\\加上反斜线。set_magic_quotes_runtime(0) -
Amavisd参数
前言amavisd-new为一新的amavis perl module,它具有高效能、检查信件内容(SpamAssasin)、VirusScanners(可结合28种之多的扫毒程式)。它是由perl所写成的,所以效能有大幅的成长。它可与MTA使用SMTP、LMTP协定来沟通。postfix+amavisd-new的流程:(1)信件由Internet(smtpd)或是由Local(pickup)接收要传送的信件(2)信件传送至cleanup(3)信件传送至qmgr(4)因content_filter的设定,会将信件传送至smtp-amavis(5)amavisd-new执行content file及scanvirus的动作(6)amavisd-new将信件传送至smtpd 10025(127.0.0.1:10025)(7)信件传送至cleanup(8)信件传送至qmgr(9)信件传送至Internet(smtp)或是Local(local)———————————————————————————————————————版本系统为debian/linux 4.0,amavisd-new 2.4.2-5配置文件Amavisd-new的主要配置文档在/etc/amavis/conf.d/目录中;还有些变量需在amavisd-new的可执行脚步中查看,为/usr/sbin/amavisd-new。1./etc/amavis/conf.d/配置文档在/etc/amavis/conf.d/目录中,主要配置文件有:/etc/amavis/conf.d/15-content_filter_mode/etc/amavis/conf.d/20-debian_defaults⑴在15-content_filter_mode中:查杀病毒功能块,把下面代码前的“#”去掉便可。#@bypass_virus_checks_maps = (# \%bypass_virus_checks, \@bypass_virus_checks_acl, \$bypass_virus_checks_re);垃圾邮件功能块:@bypass_spam_checks_maps = ( #让amavisd-new启动spamassassin\%bypass_spam_checks, \@bypass_spam_checks_acl, \$bypass_spam_checks_re);1; # insure a defined return⑵在20-debian_defaults中(此文件相当于其他版本中的amavisd.conf):use strict;#将$QUARANTINEDIR设定为刚刚建立的病毒隔离目录$QUARANTINEDIR = “$MYHOME/virusmails”;$log_recip_templ = undef; # disable by-recipient level-0 log entries$DO_SYSLOG = 1; # log via syslogd (preferred)$syslog_ident = ‘amavis’; # syslog ident tag, prepended to all messages$syslog_facility = ‘mail’; # Syslog facility as a string$syslog_priority = ‘debug’; # switch to info to drop debug output, etc$enable_db = 1; # enable use of BerkeleyDB/libdb (SNMP and nanny)$enable_global_cache = 1; # enable use of libdb-based cache if $enable_db=1$inet_socket_port = 10024; # 默认amavisd-new监听端口t#设定评分规则#变量以$sa开头的均为spamassassin中的,在这进行设置后,在 /etc/spamassassin/local.cf 所#设定的將失去效用$sa_spam_subject_tag = ‘***SPAM*** ‘; # 对垃圾邮件主题添加’***SPAM*** ‘$sa_tag_level_deflt = -10; # 超过这个分数标准者,才视为垃圾邮件打分数。$sa_tag2_level_deflt = 20; # 超过这个分数标准者,才允许在邮件标题加入Spam 信息。加入#X-Spam-Flag:YES 及改写主题$sa_kill_level_deflt = 6.31; # 超过这个分数标准者,就直接將信件备份后删除$sa_dsn_cutoff_level = 10; # 超过这个分数标准者,將不会送出 DSN 信息$sa_mail_body_size_limit = 200*1024; # 超过某个特定大小的邮件就不经过SpamAssassin 的扫#描,此大小不包括附件大小。#让sa可以和外部连线$sa_local_tests_only = 0; # only tests which do not require internet access?$sa_auto_whitelist = 1; # 启用自动学习白名单 White List#启用 SpamAssassin 的 Debug。在正式上线时请记得去掉# Turn on SpamAssassin debugging (output to STDERR, use with ‘amavisd debug’)$sa_debug = 1; # defaults to false# 设定 White List# 注意:在 /etc/spamassassin/local.cf 所设定的將失去效用!@whitelist_sender_maps = ( [“.cc17121.com”] );#添加白名单,对大附件仍然进行解压缩,但不打分#map { $whitelist_sender{lc($_)}=1 } (qw( #同上功能# *@cc17121.com# *@*.edu.tw#));# 或指定为某个档案。注意:这些档案必须存在,否则Amavisd-new 將无法启动!read_hash(\%whitelist_sender, ‘/var/amavis/whitelist’);#指定黑名单read_hash(\%blacklist_sender, ‘/var/amavis/blacklist’);#若收件人名列其中,则不进行垃圾邮件检测read_hash(\%spam_lovers, ‘/var/amavis/spam_lovers’);###以下几个变量在执行脚本/usr/sbin/amavisd-new中均可找到####################### Quota limits to avoid bombs (like 42.zip)$MAXLEVELS = 1; #扫描压缩包时,解压几层$MAXFILES = 150; #最多扫描压缩包内1500个文件$MIN_EXPANSION_QUOTA = 100*1024; # 单位bytes,最小邮件限额,包括附件$MAX_EXPANSION_QUOTA = 200*1024*1024; # bytes , 最大邮件大小,为200K$MIN_EXPANSION_FACTOR = 1; #可扫描邮件大小的最小倍数$MAX_EXPANSION_FACTOR = 500; #可扫描邮件大小的最大倍数##最大扫描压缩包大小为($MAX_EXPANSION_QUOTA)×($MAX_EXPANSION_FACTOR),#当解压缩后的文件达到此值时,系统会结束解压缩进程。###########################################################$undecipherable_subject_tag = ‘ ‘; #取消对未检查的信件主题添加“UNCHECK”,也可以在#执行脚本/usr/sbin/amavisd-new中修改”UNCHECK”# Use D_DISCARD 邮件不传送给发件人及收件人。#Use D_BOUNCE 不传送给收件人。除了定义在 $viruses_that_fake_sender_re 病毒名称# # #外的信件,amavisd-new 皆会传送 DSN 讯息给发件人。# Use D_REJECT 不传送给收件人,发件人会收到拒绝传送的信息。# Use D_PASS 不做任何处理,直接传送给收件人。$final_virus_destiny = D_DISCARD;$final_banned_destiny = D_PASS;$final_spam_destiny = D_DISCARD;$final_bad_header_destiny = D_PASS;$MAX_EXPANSION_FACTOR测试结果:a. 附件为257M,$MAX_EXPANSION_FACTOR为500倍,先添加好附件:点击发送:11:16:00 发送页面完成:11:19:20 耗时:3m 20sBzip进程开始时间:11:23:45 结束时间:11:28:00 耗时:4m 15s (bzip为解压缩进程)发送完成时间:11:30:40 共耗时:14m40sb. 附件为257M,$MAX_EXPANSION_FACTOR为1倍,先添加好附件:点击发送:12:31:30 发送页面完成:12:34:40 耗时:3m 10sBzip进程开始时间:12:39:05 结束时间:12:39:55 耗时:50s (bzip为解压缩进程)发送完成时间:12:42:30 共耗时:11m00s2./usr/sbin/amavisd-new 执行文件$MIN_EXPANSION_FACTOR = 1; # times original mail size$MAX_EXPANSION_FACTOR = 500; # times original mail size$spam_lover #发送垃圾邮箱至# timeout for our processing: 超出设置时间后会断开连接$child_timeout = 8*60; # abort child if it does not complete a task in n sec# $child_timeout的值則須小於/etc/postfix/main.cf裡smtp_data_dome_timeout的值# Net::Server pre-forking settings – defaults, overruled by amavisd.conf$max_servers = 2; # number of pre-forked children$max_requests = 10; # retire a child after that many accepts# serves only as a quick default for other configuration settings$MYHOME = ‘/var/amavis’;$mydomain = ‘!change-mydomain-variable!.example.com’;#intentionally bad default$virus_admin = “administrator\@$mydomain”;$spam_admin = “administrator\@$mydomain”;$mailfrom_notify_admin = “administrator\@$mydomain”;$mailfrom_notify_recip = “administrator\@$mydomain”;$mailfrom_notify_spamadmin = “administrator\@$mydomain”; -
邮件服务器安装完毕,安装反垃圾邮件,和反病毒
apt-get install amavisd-newapt-get install spamassassinapt-get install clamavapt-get install clamav-daemonapt-get install clamtkapt-get install libnet-dns-perlapt-get install libmail-spf-query-perlapt-get install libnet-ph-perlapt-get install libnet-snpp-perlapt-get install libnet-telnet-perlapt-get install pyzor razorapt-get install arjapt-get install bzip2apt-get install cabextractapt-get install cpioapt-get install nomarchapt-get install paxapt-get install unzipapt-get install zipapt-get install zooapt-get install lzopapt-get install arc系统已经有的apt-get install fileapt-get install gzipapt-get install lha安装源里没有的apt-get install zop 没有apt-get install rar 没有apt-get install unrar 没有安装完以后的一些服务testServer:/var/spool# netstat -tapActive Internet connections (servers and established)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program nametcp 0 0 localhost.localdo:10024 *:* LISTEN 28665/amavisd (masttcp 0 0 localhost.localdo:10025 *:* LISTEN 30507/mastertcp 0 0 localhost.localdoma:745 *:* LISTEN 22193/famdtcp 0 0 *:mysql *:* LISTEN 1466/mysqldtcp 0 0 *:11211 *:* LISTEN 2235/memcachedtcp 0 0 localhost.localdo:spamd *:* LISTEN 30522/spamd.pidtcp 0 0 *:sunrpc *:* LISTEN 1622/portmaptcp 0 0 *:ssmtp *:* LISTEN 30507/mastertcp 0 0 *:ftp *:* LISTEN 874/vsftpdtcp 0 0 59.108.38.221:domain *:* LISTEN 8346/namedtcp 0 0 postfixserver.do:domain *:* LISTEN 8346/namedtcp 0 0 localhost.locald:domain *:* LISTEN 8346/namedtcp 0 0 *:ssh *:* LISTEN 25579/sshdtcp 0 0 localhost.localdom:8888 *:* LISTEN 18342/dispatch.fcgitcp 0 0 *:smtp *:* LISTEN 30507/mastertcp 0 0 localhost.localdoma:953 *:* LISTEN 8346/namedtcp 0 248 postfixserver.domai:ssh localhost:nessus ESTABLISHED 19023/sshd: kangjintcp 0 0 localhost.localdo:mysql localhost.localdo:42555 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:mysql localhost.localdo:42584 ESTABLISHED 1466/mysqldtcp 0 0 postfixserver.domai:ssh localhost:msnp ESTABLISHED 23562/sshd: kangjintcp 0 0 localhost.localdo:mysql localhost.localdo:42552 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:42619 localhost.localdo:mysql ESTABLISHED 28487/authdaemondtcp 0 0 localhost.localdo:mysql localhost.localdo:42576 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:42556 localhost.localdo:mysql ESTABLISHED 30528/smtpdtcp 0 0 localhost.localdo:42578 localhost.localdo:mysql ESTABLISHED 30553/virtualtcp 0 0 localhost.localdo:42325 localhost.localdo:spamd TIME_WAIT –tcp 0 0 localhost.localdo:42552 localhost.localdo:mysql ESTABLISHED 28484/authdaemondtcp 0 0 localhost.localdo:42563 localhost.localdo:mysql ESTABLISHED 28482/authdaemondtcp 0 0 localhost.localdo:39194 localhost.localdo:10025 ESTABLISHED 29398/amavisd (ch3-tcp 0 0 localhost.localdo:mysql localhost.localdo:42556 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:mysql localhost.localdo:42563 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:42576 localhost.localdo:mysql ESTABLISHED 30552/trivial-rewritcp 0 0 localhost.localdo:mysql localhost.localdo:42577 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:mysql localhost.localdo:42560 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:42575 localhost.localdo:mysql ESTABLISHED 30552/trivial-rewritcp 0 0 localhost.localdo:42577 localhost.localdo:mysql ESTABLISHED 30533/cleanuptcp 0 0 localhost.localdo:42584 localhost.localdo:mysql ESTABLISHED 28485/authdaemondtcp 0 0 localhost.localdo:10025 localhost.localdo:39194 ESTABLISHED 30561/smtpdtcp 0 0 localhost.localdo:mysql localhost.localdo:42578 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:42560 localhost.localdo:mysql ESTABLISHED 28476/authdaemondtcp 0 0 localhost.localdo:10025 localhost.localdo:39234 TIME_WAIT –tcp 0 0 localhost.localdo:42555 localhost.localdo:mysql ESTABLISHED 30528/smtpdtcp 0 0 localhost.localdo:mysql localhost.localdo:42575 ESTABLISHED 1466/mysqldtcp 0 0 localhost.localdo:mysql localhost.localdo:42619 ESTABLISHED 1466/mysqldtcp6 0 0 [::]:imaps [::]:* LISTEN 28516/couriertcpdtcp6 0 0 [::]:pop3s [::]:* LISTEN 28544/couriertcpdtcp6 0 0 [::]:svn [::]:* LISTEN 9603/svnservetcp6 0 0 [::]:pop3 [::]:* LISTEN 28527/couriertcpdtcp6 0 0 [::]:imap2 [::]:* LISTEN 28499/couriertcpdtcp6 0 0 [::]:www [::]:* LISTEN 28140/apache2tcp6 0 0 [::]:domain [::]:* LISTEN 8346/namedtcp6 0 0 [::]:ssh [::]:* LISTEN 25579/sshdtcp6 0 0 localhost:953 [::]:* LISTEN 8346/namedtcp6 0 0 [::]:https [::]:* LISTEN 28140/apache2 -
vi命令
进入vi的命令
vi filename :打开或新建文件,并将光标置于第一行首
vi +n filename :打开文件,并将光标置于第n行首
vi + filename :打开文件,并将光标置于最后一行首
vi +/pattern filename:打开文件,并将光标置于第一个与pattern匹配的串处
vi -r filename :在上次正用vi编辑时发生系统崩溃,恢复filename
vi filename….filename :打开多个文件,依次进行编辑移动光标类命令
h :光标左移一个字符
l :光标右移一个字符
space:光标右移一个字符
Backspace:光标左移一个字符
k或Ctrl+p:光标上移一行
j或Ctrl+n :光标下移一行
Enter :光标下移一行
w或W :光标右移一个字至字首
b或B :光标左移一个字至字首
e或E :光标右移一个字至字尾
) :光标移至句尾
( :光标移至句首
}:光标移至段落开头
{:光标移至段落结尾
nG:光标移至第n行首
n+:光标下移n行
n-:光标上移n行
n$:光标移至第n行尾
H :光标移至屏幕顶行
M :光标移至屏幕中间行
L :光标移至屏幕最后行
0:(注意是数字零)光标移至当前行首
$:光标移至当前行尾屏幕翻滚类命令
Ctrl+u:向文件首翻半屏
Ctrl+d:向文件尾翻半屏
Ctrl+f:向文件尾翻一屏
Ctrl+b;向文件首翻一屏
nz:将第n行滚至屏幕顶部,不指定n时将当前行滚至屏幕顶部。插入文本类命令
i :在光标前
I :在当前行首
a:光标后
A:在当前行尾
o:在当前行之下新开一行
O:在当前行之上新开一行
r:替换当前字符
R:替换当前字符及其后的字符,直至按ESC键
s:从当前光标位置处开始,以输入的文本替代指定数目的字符
S:删除指定数目的行,并以所输入文本代替之
ncw或nCW:修改指定数目的字
nCC:修改指定数目的行删除命令
ndw或ndW:删除光标处开始及其后的n-1个字
do:删至行首
d$:删至行尾
ndd:删除当前行及其后n-1行
x或X:删除一个字符,x删除光标后的,而X删除光标前的
Ctrl+u:删除输入方式下所输入的文本搜索及替换命令
/pattern:从光标开始处向文件尾搜索pattern
?pattern:从光标开始处向文件首搜索pattern
n:在同一方向重复上一次搜索命令
N:在反方向上重复上一次搜索命令
:s/p1/p2/g:将当前行中所有p1均用p2替代
:n1,n2s/p1/p2/g:将第n1至n2行中所有p1均用p2替代
:g/p1/s//p2/g:将文件中所有p1均用p2替换选项设置
all:列出所有选项设置情况
term:设置终端类型
ignorance:在搜索中忽略大小写
list:显示制表位(Ctrl+I)和行尾标志($)
number:显示行号
report:显示由面向行的命令修改过的数目
terse:显示简短的警告信息
warn:在转到别的文件时若没保存当前文件则显示NO write信息
nomagic:允许在搜索模式中,使用前面不带“\”的特殊字符
nowrapscan:禁止vi在搜索到达文件两端时,又从另一端开始
mesg:允许vi显示其他用户用write写到自己终端上的信息最后行方式命令
:n1,n2 co n3:将n1行到n2行之间的内容拷贝到第n3行下
:n1,n2 m n3:将n1行到n2行之间的内容移至到第n3行下
:n1,n2 d :将n1行到n2行之间的内容删除
:w :保存当前文件
:e filename:打开文件filename进行编辑
:x:保存当前文件并退出
:q:退出vi
:q!:不保存文件并退出vi
:!command:执行shell命令command
:n1,n2 w!command:将文件中n1行至n2行的内容作为command的输入并执行之,若不指定n1,n2,则表示将整个文件内容作为command的输入
:r!command:将命令command的输出结果放到当前行寄存器操作
“?nyy:将当前行及其下n行的内容保存到寄存器?中,其中?为一个字母,n为一个数字
“?nyw:将当前行及其下n个字保存到寄存器?中,其中?为一个字母,n为一个数字
“?nyl:将当前行及其下n个字符保存到寄存器?中,其中?为一个字母,n为一个数字
“?p:取出寄存器?中的内容并将其放到光标位置处。这里?可以是一个字母,也可以是一个数字
ndd:将当前行及其下共n行文本删除,并将所删内容放到1号删除寄存器中删除全部内容
:1,$ 转到最后一行
:1,.d 删除这行以上全部内容