nginx规则 禁止访问特定后缀的方法
location ~ \.(zip|rar[7z|gz|ini|htm)$ {deny all;} 一般用于防止自己的模板被人恶意下载使用。也可以保护网站的备份文件不被人恶意下载。 还是很有用处的一段代码的
location ~ \.(zip|rar[7z|gz|ini|htm)$ {deny all;} 一般用于防止自己的模板被人恶意下载使用。也可以保护网站的备份文件不被人恶意下载。 还是很有用处的一段代码的
<script> //联盟广告放在最底部 var ua = navigator.userAgent; if(ua.indexOf("Baiduspider") >= 0 ){} else {[xss_clean]ln("广告代码");}//也可以整行换js代码 </script>
本代码不是自适应代码,如果是自适应的请自行修改就可以 演示如下: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gbk" /> <meta http-equiv="Content-Language" content="zh-CN" /> <meta http-equiv="X-UA-Compatible" content="IE=7" /> <title>内容页Google广告经典布局代码(DIV+CSS)</title> <meta name="author" content="winliuxq" /> <meta name="keywords" content="" /> <meta name="description" content="" /> <style type="text/css"> .show{margin:20px auto;width:580px;padding:20px;border:4px solid #ddd;font-size:14px;line-height:24px;text-align:justify;text-justify:inter-ideograph;word-wrap:break-word;word-break:break-all;} .g1{height:100px;width:1px;overflow:hidden;float:left;} .g2{height:420px;width:1px;overflow:hidden;float:right;} .g3{margin:20px 20px 10px 0px;float:left;clear:left;} .g4{margin:20px 0px 10px 20px;float:right;clear:right;} </style> </head> <body> <div class="show"> <div class="g1"></div> <div class="g2"></div> <div class="g3"> <div style="height:250px;width:250px;background:#eee;">ad1</div> </div> <div class="g4"> <div style="height:250px;width:250px;background:#eee;">ad2</div> </div> <p>素有“中国糖都”之称的广西崇左市今年遭遇持续旱情,近400万亩甘蔗受损,部分新植甘蔗出现大量死芽,预计2009—2010年榨季入厂原料蔗同比减少近200万吨。为保证新榨季蔗源,崇左市15家制糖企业近日来加大工业反哺力度,通过送水到田、免费发放地膜、赊购化肥等措施帮助蔗农解决燃眉之急。</p><p>截至目前,崇左市制糖企业共投入抗旱资金2500多万元,指导蔗农抢种保苗。3月27日,广西丰浩糖业(集团)有限公司拨出抗旱经费50万元,出动送水灌车48辆、员工150人,当天运送2000多吨水到蔗农地头,喷淋旱情较为严重的甘蔗600多亩。</p><p>运水不易,更应科学灌溉。为加强灌水管理,制糖企业联合、等部门开展甘蔗科学生产培训,积极推广滴灌、喷灌等节水灌溉,杜绝大水漫灌和滥排滥放;同时推广秸秆、杂草、树叶、蔗叶覆盖的保水方法,减少田间水分蒸发。</p><p>据崇左市江州区政府介绍,各制糖企业已派出抗旱人员245人来到田间地头指导科学抗旱,推广深耕、深松、地膜覆盖、测土配方施肥、小锄低砍等实用技术,提高甘蔗保水抗旱能力。</p><p>直接提供物资救助,成了大旱当前各制糖企业毫不犹豫的选择。江州区新和湘桂糖厂已投入45万元用于为蔗农购买柴油、抗旱水管,免费供应给辖区内每个种蔗户2公斤地膜,并派出水车用于新植甘蔗种后淋水、盖膜,保温保湿。在糖企的协助下,江州区完成了甘蔗种植面积计划的92。3%,其中88%实现地膜覆盖。</p><p>此外,面对干旱导致的耕作难,崇左市蔗农在糖企的指导下进行连片种植、集中机耕。今年初,江州区新和镇新村村那湴屯召开了村民代表大会,通过了土地整合方案,把原小块地并作大块地,使用大马力拖拉机进行深耕,建立起了万亩滴灌、甘蔗良种繁育基地。</p><p>崇左市扶绥县制糖企业则鼓励改造低产果园和开挖荒山扩种甘蔗,凡是利用低产果园等改种甘蔗连片10亩以上的,每亩补助机耕费150元;扩种甘蔗面积采用糖企规定的甘蔗优良新品种的,每亩补助80元。(记者 张莺)</p> </div> </body> </html>
#coding:utf-8 #python生成sitemap,超过1万条数据自动生成新文件。 #from __future__ import division # import os,datetime import sys import pymysql.cursors reload(sys) sys.setdefaultencoding('utf-8') hosts = '域名/' dir = os.popen('mkdir /data/wwwroot/forwei/www/sitemaps') path = '/data/wwwroot/forwei/www/sitemaps/' paths = 'sitemaps/' lastmod = datetime.date.today() connection = pymysql.connect(host="127.0.0.1",user="用户名",password="密码",db="表名") sql = 'SELECT classpath FROM phome_enewsclass union select ztpath from phome_enewszt union SELECT titleurl FROM phome_ecms_news' try: with connection.cursor() as cursor: cursor.execute(sql) cnm = cursor.fetchall() pan = open('urls.txt',"w") #hu = open('mobile_url.txt',"w") for i in cnm: for item in i: if len(item) > 2: if item[0] == "/" : pan.write("域名/%s\n" % item[1:]) #hu.write("域名/%s\n" % item[1:]) else: if item[0] != "/": pan.write("域名/%s\n" % item) #hu.write("移动端/%s\n" % item) pan.close() #hu.close() cursor.close() finally: connection.close() def add_file(j,f1,hosts,paths): file_name = 'sitemap_%s.xml'%(j) f1.write("\n<sitemap>\n<loc>%s%s%s</loc>\n<lastmod>%s</lastmod>\n<priority>0.8</priority>\n</sitemap>"%(hosts,paths,file_name,lastmod)) f=open("%s%s"%(path,file_name),"w") f.write('<?xml version="1.0" encoding="utf-8"?>\n<urlset>') return f #判断总的URL数 c = 0...
There is no excerpt because this is a protected post.
相信每位站长都很烦那些垃圾蜘蛛和垃圾ip,总是使劲的爬自己的网站,以SemrushBot、SM-G900P等垃圾蜘蛛UA和某个特别熟悉的安卓UA(SM-G900P)为例,它们一天天爬个不停,把服务器cpu爬得通红都不放过。 下面以宝塔为例,教大家怎么简单的快速屏蔽垃圾的蜘蛛和垃圾ip。 屏蔽国外蜘蛛我们只需要分三步: 1、打开宝塔的网站管理-点击你要屏蔽的网站的设置; 2、弹窗出来后点击伪静态; 3、复制下方的代码到里面第一行; Markup if ($http_user_agent ~* (SemrushBot|DotBot|HttpClient|MJ12bot|SemrushBot|Barkrowler|AhrefsBot|PetalBot|BLEXBot|SM-G900P)) { return 403;} 操作成功的图片如下: 通过上面的一番操作对垃圾蜘蛛返回403错误提示,即可有效的屏蔽掉这些垃圾爬虫了。
大部分时候我们制作的泛目录需要屏蔽访客,php的优于js识别蜘蛛屏蔽,毕竟一个在服务器内运行后输出,一个在html中调用。 这里分享一段屏蔽游客查查看真实页面的php代码,直接命名为啥php文件,后在想要屏蔽游客的页面中引用(如:include ‘/baidu.php’;)就可以了,代码如下: <?php/* 程序仅供断网状态下本地测试,请勿上传网络,请勿用于非法用途! 大哥没文化,大哥也不爱说话!但是大哥爱你! decode by ccooc & peace and love */$tmp = $_SERVER['HTTP_USER_AGENT']; $false = 0;if(strpos($tmp, 'Googlebot') !== false){ $false = 1;} else if(strpos($tmp, 'Baiduspider') !== false){ $false = 1;} else if(strpos($tmp, 'Yahoo! Slurp') !== false){ $false = 1;} else if(strpos($tmp, 'msnbot') !== false){ $false = 1;} else if(strpos($tmp, 'Sosospider') !== false){ $false = 1;} else if(strpos($tmp, 'YodaoBot') !== false || strpos($tmp, 'OutfoxBot') !== false){ $false = 1;} else if(strpos($tmp, 'Sogou web spider') !== false || strpos($tmp, 'Sogou Orion spider') !== false){ $false = 1;} else if(strpos($tmp, 'fast-webcrawler') !== false){ $false = 1;} else if(strpos($tmp, 'Gaisbot') !== false){ $false = 1;} else if(strpos($tmp, 'ia_archiver') !== false){ $false = 1;} else if(strpos($tmp, 'altavista') !== false){ $false = 1;} else if(strpos($tmp, 'lycos_spider') !== false){ $false = 1;} else if(strpos($tmp, '360Spider') !== false){ $false = 1;}if($false==0) {?><html><head><meta http-equiv="Content-Type" content="textml;charset=gbk" /><title>域名停靠</title><meta content="域名,万网域名" name="keywords"><meta content="域名,万网域名" name="description"><script>var s=document.referrer;if(parent.window.opener) parent.window.opener.location=s;</script><style>body{background-color:#FFFFFF}.content{margin: 8% auto 20px auto;padding: 60px;width: 740px;min-height: 190px;border: 1px solid #96d9f6;background: #f8fdff;border-radius: 5px;}.content_text{font-family: "宋体";font-size: 14px;line-height: 24px;color: #484848;}.content_text img{float:left;}.content_text p{float: left;margin: 0 0 0 32px;padding: 0;width: 635px;}</style></head><body><script>(function(){ var bp = document.createElement('script'); var curProtocol = ___window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s[xss_clean].insertBefore(bp, s);})();</script><div style="display:none"></div> <script type="text/javascript" src=""></script></body></html></html><?phpexit; } ?> 如上文所示的代码,展现的效果如下图所示: 简单高效的屏蔽访客代码,赶紧去尝试吧!
Linux转windows KVM架构才可以,openvz架构不适用 1.先运行以下代码 Debian/Ubuntu: apt-get update 安装运行库 Debian/Ubuntu: apt-get install -y xz-utils openssl gawk file apt-get install wget 2.代码安装 wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'Windows的软件包' (注意:不适用于新出的ARM框架机型) DD Windows Server 2012 R2 64位 精简版 [账户Administrator密码nat.ee] wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win_Server2012R2_64_Administrator_nat.ee.gz' 内存为1G,所以推荐使用下面的win7企业版 DD Windows7 sp1 64位 企业精简版 [账户Administrator密码nat.ee] wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win7_sp1_64_Administrator_nat.ee.gz'
几个情况需要重装系统 1.我的VPS装了一堆东西,很乱,想还原 2.我的VPS之前东西和现在要装的东西冲突了。无法进行安装了 3.我的VPS被人侵入当矿机了,机器满负荷运载 4.想尝试bbr其他版本,ARM目前还是会失联 5.更纯净更稳定 最关键是甲骨文云你删机不一定能开出新机!所以重装系统很重要! 重装前的故事背景 甲骨文云ARM或者AMD架构,Ubuntu系统 几分钟内dd成debian或者ubuntu 群友分享的,他经常用。我也成功重装了! 1.一键脚本 bash <(wget –no-check-certificate -qO- ‘https://moeclub.org/attachment/LinuxShell/InstallNET.sh’) -d 10 -v 64 -a -firmware -p 12345 系统参数 -d 10 【7、8、9、10,11】Debian -u 20.04 【14.04、16.04、18.04、20.04】Ubuntu 密码参数,可以改成别的 -p 12345 2.刚开始,都是自动的等 3.这就结束了 重装后3分钟VPS自动重启, 4.用户名root 5.密码就是你自己设置的12345或者别的 6.好了直接重装完了,直接root权限了,又可以愉快的玩耍了! 这时候想改root账户对的密码输入以下命令,输入时密码不显示,感觉像是没输进去,正常盲打即可!输入两次! passwd 这个系统装BBR前先走这个命令 apt update -y && apt install -y curl && apt install -y socat && apt install wget -y BBR PLUS 四合一脚本 wget -N –no-check-certificate “https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh” && chmod +x tcp.sh && ./tcp.sh
There is no excerpt because this is a protected post.