最新发布 第18页
#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.
There is no excerpt because this is a protected post.
There is no excerpt because this is a protected post.
<?php $user = "root"; //数据库用户名 $password = "123";//数据库密码 $db_name = "root";//数据库名 $link = mysql_connect("localhost:3306",$user,$password); mysql_select_db("$db_name",$link); echo "<p>;正在清空数据库..."; $result=mysql_query("SHOW tables",$link); while ($currow=mysql_fetch_array($result)) { mysql_query("drop TABLE IF EXISTS $currow[0]"); echo $currow[0]."<br>;"; } echo "成功</p>;"; ?>;