野路子博客https://yeelz.com/老司机,路子野,随时跑偏使用 robots.txt 阻止 AI 爬虫,给服务器“减负”https://yeelz.com/post/578.html<p><img src="https://yeelz.com/zb_users/upload/2025/11/202511071762476090352900.jpg" alt="阻止ai爬虫.jpg"/></p><p>最近辣鸡轻量服务器资源频频飙红,开始还以为流量暴涨,自己要发了。</p><p>结果一看日志——原来是每天被各种AI爬虫轮番“光顾”,资源被薅到见底……</p><p>如何礼貌地拒绝这些不请自来的“访客”呢?</p><p>这时, robots.txt 文件就可以派上用场了。</p><h3>什么是 robots.txt?</h3><p>robots.txt 是放置在网站根目录下的一个文本文件,用于向网络爬虫和机器人传达抓取规则。通过它,你可以指定哪些内容允许被抓取,哪些应被禁止访问。</p><p>需要注意的是,尽管大多数正规机器人会遵守 robots.txt 中的规则,但某些恶意爬虫可能会无视这些限制,仍需结合其他防护手段。</p><h3>如何阻止特定爬虫?</h3><p>你可以在 robots.txt 中使用如下指令:</p><pre class="brush:bash;toolbar:false">User-agent:&nbsp;[爬虫名称] Disallow:&nbsp;/</pre><h3>针对常见AI机器人的屏蔽清单</h3><p>以下是一份实用的 robots.txt 示例,可用于限制部分AI爬虫访问:</p><pre class="brush:bash;toolbar:false">User-agent:&nbsp;AddSearchBot User-agent:&nbsp;AI2Bot User-agent:&nbsp;Ai2Bot-Dolma User-agent:&nbsp;aiHitBot User-agent:&nbsp;AmazonBuyForMe User-agent:&nbsp;atlassian-bot User-agent:&nbsp;amazon-kendra- User-agent:&nbsp;Amazonbot User-agent:&nbsp;Andibot User-agent:&nbsp;Anomura User-agent:&nbsp;anthropic-ai User-agent:&nbsp;Applebot User-agent:&nbsp;Applebot-Extended User-agent:&nbsp;Awario User-agent:&nbsp;bedrockbot User-agent:&nbsp;bigsur.ai User-agent:&nbsp;Bravebot User-agent:&nbsp;Brightbot&nbsp;1.0 User-agent:&nbsp;BuddyBot User-agent:&nbsp;Bytespider User-agent:&nbsp;CCBot User-agent:&nbsp;ChatGPT&nbsp;Agent User-agent:&nbsp;ChatGPT-User User-agent:&nbsp;Claude-SearchBot User-agent:&nbsp;Claude-User User-agent:&nbsp;Claude-Web User-agent:&nbsp;ClaudeBot User-agent:&nbsp;Cloudflare-AutoRAG User-agent:&nbsp;CloudVertexBot User-agent:&nbsp;cohere-ai User-agent:&nbsp;cohere-training-data-crawler User-agent:&nbsp;Cotoyogi User-agent:&nbsp;Crawlspace User-agent:&nbsp;Datenbank&nbsp;Crawler User-agent:&nbsp;DeepSeekBot User-agent:&nbsp;Devin User-agent:&nbsp;Diffbot User-agent:&nbsp;DuckAssistBot User-agent:&nbsp;Echobot&nbsp;Bot User-agent:&nbsp;EchoboxBot User-agent:&nbsp;FacebookBot User-agent:&nbsp;facebookexternalhit User-agent:&nbsp;Factset_spyderbot User-agent:&nbsp;FirecrawlAgent User-agent:&nbsp;FriendlyCrawler User-agent:&nbsp;Gemini-Deep-Research User-agent:&nbsp;Google-CloudVertexBot User-agent:&nbsp;Google-Extended User-agent:&nbsp;Google-Firebase User-agent:&nbsp;Google-NotebookLM User-agent:&nbsp;GoogleAgent-Mariner User-agent:&nbsp;GoogleOther User-agent:&nbsp;GoogleOther-Image User-agent:&nbsp;GoogleOther-Video User-agent:&nbsp;GPTBot User-agent:&nbsp;iaskspider/2.0 User-agent:&nbsp;IbouBot User-agent:&nbsp;ICC-Crawler User-agent:&nbsp;ImagesiftBot User-agent:&nbsp;img2dataset User-agent:&nbsp;ISSCyberRiskCrawler User-agent:&nbsp;Kangaroo&nbsp;Bot User-agent:&nbsp;LinerBot User-agent:&nbsp;Linguee&nbsp;Bot User-agent:&nbsp;meta-externalagent User-agent:&nbsp;Meta-ExternalAgent User-agent:&nbsp;meta-externalfetcher User-agent:&nbsp;Meta-ExternalFetcher User-agent:&nbsp;meta-webindexer User-agent:&nbsp;MistralAI-User User-agent:&nbsp;MistralAI-User/1.0 User-agent:&nbsp;MyCentralAIScraperBot User-agent:&nbsp;netEstate&nbsp;Imprint&nbsp;Crawler User-agent:&nbsp;NovaAct User-agent:&nbsp;OAI-SearchBot User-agent:&nbsp;omgili User-agent:&nbsp;omgilibot User-agent:&nbsp;OpenAI User-agent:&nbsp;Operator User-agent:&nbsp;PanguBot User-agent:&nbsp;Panscient User-agent:&nbsp;panscient.com User-agent:&nbsp;Perplexity-User User-agent:&nbsp;PerplexityBot User-agent:&nbsp;PetalBot User-agent:&nbsp;PhindBot User-agent:&nbsp;Poseidon&nbsp;Research&nbsp;Crawler User-agent:&nbsp;QualifiedBot User-agent:&nbsp;QuillBot User-agent:&nbsp;quillbot.com User-agent:&nbsp;SBIntuitionsBot User-agent:&nbsp;Scrapy User-agent:&nbsp;SemrushBot-OCOB User-agent:&nbsp;SemrushBot-SWA User-agent:&nbsp;ShapBot User-agent:&nbsp;Sidetrade&nbsp;indexer&nbsp;bot User-agent:&nbsp;TerraCotta User-agent:&nbsp;Thinkbot User-agent:&nbsp;TikTokSpider User-agent:&nbsp;Timpibot User-agent:&nbsp;VelenPublicWebCrawler User-agent:&nbsp;WARDBot User-agent:&nbsp;Webzio-Extended User-agent:&nbsp;wpbot User-agent:&nbsp;YaK User-agent:&nbsp;YandexAdditional User-agent:&nbsp;YandexAdditionalBot User-agent:&nbsp;YouBot Disallow:&nbsp;/</pre><h3>使用方法</h3><p>将上述内容保存为 robots.txt 文件,上传至你的网站根目录即可生效。</p><p><br/></p>Fri, 07 Nov 2025 08:26:27 +0800关闭宝塔面板默认的 404 页面https://yeelz.com/post/577.html<p>本文又名:404 页面拯救计划,那个丑哭的报错页面真不是我的锅</p><p><img src="https://yeelz.com/zb_users/upload/2025/04/202504161744765227682455.jpg" alt="404.jpg"/></p><p>这已经是我第 N+99 次被问同一个问题了:&quot;老李!我花 8888 买的主题配套 404 页面呢?怎么显示个这么丑的页面?!&quot;</p><p>朋友们,这锅真不背啊!这就好比你在米其林餐厅点了牛排,结果服务员直接从后厨冰柜掏出生肉片!!你猜怎么着?问题出在点单系统(服务器)压根没把订单传给厨师(主题)!</p><h3>发生了什么?</h3><p>用户访问了个寂寞网址</p><p>服务器(nginx):&quot;404 是吧?我这儿有现成的!&quot;</p><p>主题:&quot;等等!我准备了会跳钢管舞的 404 页...&quot;</p><p>服务器(已掏出上默认 404 页面):&quot;下次赶早&quot;</p><p><img src="https://yeelz.com/zb_users/upload/2025/04/202504161744765171405564.jpg" alt="4041.jpg"/></p><h3>根治服务器抢戏(宝塔版)</h3><p>网站 → 选中你站点 → 设置。戳进&quot;配置文件&quot;</p><p>Ctrl+F 搜索&quot;error_page 404 /404.html&quot;</p><p>把下面这行代码变成注释:</p><h3>原版&nbsp;</h3><pre class="brush:bash;toolbar:false">error_page&nbsp;404&nbsp;/404.html; error_page&nbsp;502&nbsp;/502.html;</pre><h3>修改版(加个#号封印)</h3><pre class="brush:bash;toolbar:false">#error_page&nbsp;404&nbsp;/404.html; #error_page&nbsp;502&nbsp;/502.html;</pre><p><br/></p><p>最后重启nginx,优雅!</p><p><img src="https://yeelz.com/zb_users/upload/2025/04/202504161744765186608768.jpg" alt="4042.jpg"/></p><h3>防呆指南</h3><p>务必先备份</p><p>Apache 用户请移步 .htaccess 玩同样操作</p><h3>总结:</h3><p>下次再看到那个丑绝人寰的 404 页面,别急着找我,先给你的服务器做个去 SPA 吧!</p><p><br/></p>Wed, 16 Apr 2025 08:52:27 +0800把 ZBLOG 文章图片自动上传到自建 EasyImages 图床https://yeelz.com/post/576.html<p>4年前曾经写过一篇<a href="https://yeelz.com/post/508.html" target="_blank">把 ZBLOG 文章图片自动上传到自建 Chevereto 图床</a>的文章,后来因为换服务器,图床程序又换成了简单图床(EasyImages),所以当时文末说要提供的插件一直都没提供。</p><p>春节假期闲来无事,把简单图床支持插件重构了一下上传到了 zblog 应用中心,再水一篇文章吧。</p><p>简单图床是一款环境要求极低,适用于单一场景(游客上传)和个人使用,不适于多用户复杂场景的图床程序,支持 API 上传和图片域名和主程序分离。这也是我选择他的主要原因。</p><h3>EasyImage 安装过程</h3><p>去 GitHub 下载 EasyImage2.0 简单图床发行版</p><p>https://github.com/icret/EasyImages2.0/releases/tag/2.8.5</p><p>1.上传安装</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553064227456.png" alt="QQ20250203-102928.png" style=""/></p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553100278682.png" alt="QQ20250203-102948.png" style=""/></p><p>2.安装完成后登录,进入设置界面</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553278511304.jpg" alt="QQ20250203-103039.jpg"/></p><p>3.网站设置中为图片域名设置不同的域名</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553309838874.jpg" alt="QQ20250203-103302.jpg"/></p><p>4.注意把图片域名绑定到图床站目录下的i目录</p><p>5.隐藏/i/目录</p><p>6.图床安全中打开 API 上传</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553352232369.jpg" alt="QQ20250203-103814.jpg"/></p><p>7.API设置中获取 API Token</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553458248020.jpg" alt="QQ20250203-113006.jpg"/></p><p>图床安装设置完成。</p><p>注:上面的3-5是为了图片和图床程序分离,并非必须选项</p><h3>zblog 端设置</h3><p>从 zblog 应用中心中安装简单图床(EasyImages)支持插件</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553558652677.jpg" alt="QQ20250203-104357.jpg"/></p><p>启用插件,进入插件设置,设置相关内容并保存</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553577464837.jpg" alt="QQ20250203-104505.jpg"/></p><p>大功告成!!</p><p>发篇文章测试一下,发现前台图片地址已经变成了我们的图床图片。</p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553604891034.jpg" alt="QQ20250203-105821.jpg" style=""/></p><p><img src="https://yeelz.com/zb_users/upload/2025/02/202502031738553626219403.jpg" alt="QQ20250203-105909.jpg" style=""/></p><p><br/></p>Wed, 05 Feb 2025 15:07:52 +0800jQuery Ripples 隔壁老李同款水波纹涟漪特效https://yeelz.com/post/574.html<p><img src="https://yeelz.com/zb_users/upload/2024/10/202410261729908069858796.jpg" alt="水波纹.jpg"/></p><p>常有人问 gebilaoli.com 首页的水波纹特效是如何实现的,老李通常会让他们去搜 jQuery Ripples。</p><p>但是很多人搜到了也不知道怎么用,甚至还有人不会搜...</p><p>于是还是水一篇文章分享一下吧。</p><p>jQuery Ripples 是一款非常好玩的 jQuery 特效插件,可以为网页元素添加水波涟漪效果。它利用 WebGL 技术,实现了流畅的水波动画,并且支持鼠标互动,用户可以通过鼠标的移动和点击与水波进行互动。这种效果不仅能提升页面的视觉吸引力,还能带来更好的用户体验。如果你有兴趣,可以在你的项目中尝试使用这个插件,给你的网页增添一些动态元素!</p><p>需要注意的是,该插件必须使用同源的图片,或者是图片允许跨域才能正常工作。</p><h3>使用方法</h3><p>引入 jQuery 和 jquery.ripples.js 文件</p><pre class="brush:html;toolbar:false">&lt;script&nbsp;src=&quot;jquery.min.js&quot;&nbsp;type=&quot;text/javascript&quot;&gt;&lt;/script&gt; &lt;script&nbsp;type=&quot;text/javascript&quot;&nbsp;src=&quot;jquery.ripples.js&quot;&gt;&lt;/script&gt;</pre><h3>调用插件</h3><p>页面面初始化完成后使用下面的方法调用,注意要调用水波纹效果的元素上要有一张 CSS 背景图片</p><pre class="brush:js;toolbar:false">//在&lt;body&gt;元素上调用该插件 $(&#39;body&#39;).ripples({&nbsp; &nbsp;&nbsp;resolution:&nbsp;512, &nbsp;&nbsp;dropRadius:&nbsp;20, &nbsp;&nbsp;perturbance:&nbsp;0.04, });</pre><p>暂停和播放水波涟漪效果</p><pre class="brush:js;toolbar:false">$(&#39;body&#39;).ripples(&#39;pause&#39;); $(&#39;body&#39;).ripples(&#39;play&#39;);</pre><p>添加水滴效果</p><pre class="brush:js;toolbar:false">$(&#39;body&#39;).ripples(&quot;drop&quot;,&nbsp;x,&nbsp;y,&nbsp;radius,&nbsp;strength);</pre><p>比如水滴自动落下</p><pre class="brush:js;toolbar:false">setInterval(function()&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;$el&nbsp;=&nbsp;$(&#39;body&#39;); &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;x&nbsp;=&nbsp;Math.random()&nbsp;*&nbsp;$el.outerWidth(); &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;y&nbsp;=&nbsp;Math.random()&nbsp;*&nbsp;$el.outerHeight(); &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;dropRadius&nbsp;=&nbsp;20; &nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;strength&nbsp;=&nbsp;0.04&nbsp;+&nbsp;Math.random()&nbsp;*&nbsp;0.04; &nbsp;&nbsp;&nbsp;&nbsp;$el.ripples(&#39;drop&#39;,&nbsp;x,&nbsp;y,&nbsp;dropRadius,&nbsp;strength); },&nbsp;400);</pre><h3>配置参数</h3><pre class="brush:html;toolbar:false">resolution:分辨率。默认值:256。 dropRadius:水波涟漪的半径。默认值:20。 perturbance:干扰效果。默认值:0.03。 interactive:是否可以用鼠标进行互动。默认值:false。</pre>Sat, 26 Oct 2024 10:00:27 +0800摸鱼神器,在 Visual Studio Code、命令行上进行微信聊天https://yeelz.com/post/573.html<p>爱因斯坦在瑞士专利局工作,一边审查专利文件,一边摸鱼搞相对论。</p><p>刘慈欣在山西娘子关发电厂工作,一边做工程师,一边摸鱼写《三体》等科幻小说。</p><p>毛泽东在北大图书馆工作,一边整理图书清扫房间登记来馆读报的人名,一边摸鱼博览群书了解天下大事。</p><p>报告显示,超过6成的95后员工每天至少摸鱼1小时,一年合计摸鱼30个工作日。</p><p>不摸鱼的工作是不完美的!</p><p>如何更优雅地摸鱼,这有一款在vscode、命令行上进行微信聊天的项目!</p><h3>克隆项目</h3><pre class="brush:bash;toolbar:false">git&nbsp;clone&nbsp;https://github.com/chenbb0128/moyu-chat.git</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156584567482.jpg" alt="QQ20240924-104829.jpg"/></p><h3>进入项目目录,安装依赖</h3><pre class="brush:bash;toolbar:false">#&nbsp;进入项目目录 cd&nbsp;moyu-chat #&nbsp;安装依赖 pnpm&nbsp;i</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156599395901.jpg" alt="QQ20240924-104920.jpg"/></p><h3>运行服务<br/></h3><pre class="brush:bash;toolbar:false">pnpm&nbsp;dev</pre><h3>扫描二维码登录</h3><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156704537097.jpg" alt="QQ20240924-105300.jpg"/></p><h3>好了,现在可以在命令行中微信聊天了</h3><pre class="brush:bash;toolbar:false">#&nbsp;根据好友昵称发送消息 curl&nbsp;&quot;http://127.0.0.1:3000/0?name=好友名称&amp;content=测试消息&quot; #&nbsp;根据好友备注发送消息,需要设置好友备注名 curl&nbsp;&quot;http://127.0.0.1:3000/0?alias=好友备注&amp;content=测试消息&quot; #&nbsp;发送群消息 curl&nbsp;&quot;http://127.0.0.1:3000/1?name=群名称&amp;content=测试消息&quot;</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156762612416.jpg" alt="QQ20240924-110849.jpg"/></p><h2>在vscode中使用<br/></h2><h3>新建终端<br/></h3><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156823691126.jpg" alt="QQ20240924-115521.jpg"/></p><h3>运行服务</h3><pre class="brush:bash;toolbar:false">#&nbsp;进入项目目录 cd&nbsp;D:\moyu-chat #&nbsp;运行服务 pnpm&nbsp;dev</pre><h3>拆分一个终端</h3><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156960114535.jpg" alt="QQ20240924-115712.jpg"/></p><h3>开始在vscode中摸鱼吧</h3><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727156981120553.jpg" alt="QQ20240924-115246.jpg"/></p><h2>常见问题:</h2><h3>Windows系统中出现禁止运行脚本错误</h3><p>以管理员身份打开PowerShell<br/></p><p>运行以下命令将当前策略更改为 RemoteSigned<br/></p><pre class="brush:bash;toolbar:false">Set-ExecutionPolicy&nbsp;-ExecutionPolicy&nbsp;RemoteSigned&nbsp;-Scope&nbsp;CurrentUser</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727157089797823.jpg" alt="QQ20240924-135120.jpg"/></p><h3>Windows系统中提示发送成功但未收到消息或乱码</h3><p>找到D:\moyu-chat\src\index.ts</p><p>搜索</p><pre class="brush:bash;toolbar:false">const&nbsp;content&nbsp;=&nbsp;string2utf8(req.query.content?.toString()) const&nbsp;name&nbsp;=&nbsp;string2utf8(req.query.name?.toString()) const&nbsp;alias&nbsp;=&nbsp;string2utf8(req.query.alias?.toString())</pre><p>改为</p><pre class="brush:bash;toolbar:false">const&nbsp;content&nbsp;=&nbsp;req.query.content?.toString() const&nbsp;name&nbsp;=&nbsp;req.query.name?.toString() const&nbsp;alias&nbsp;=&nbsp;req.query.alias?.toString()</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727157140771002.jpg" alt="QQ20240924-115339.jpg"/></p><p>搜索</p><pre class="brush:bash;toolbar:false">const&nbsp;content&nbsp;=&nbsp;string2utf8(req.query.content?.toString()) const&nbsp;name&nbsp;=&nbsp;string2utf8(req.query.name?.toString())</pre><p>改为</p><pre class="brush:bash;toolbar:false">const&nbsp;content&nbsp;=&nbsp;req.query.content?.toString() const&nbsp;name&nbsp;=&nbsp;req.query.name?.toString()</pre><p><img src="https://yeelz.com/zb_users/upload/2024/09/202409241727157149287675.jpg" alt="QQ20240924-115401.jpg"/></p>Tue, 24 Sep 2024 13:40:24 +0800zblog 实现评论的邮箱地址为必填项的方法https://yeelz.com/post/572.html<p>今天群里有朋友问 zblog 如何让评论区域的邮箱,变成必填项。</p><p>本来大家都认为给表单项加个 required 就可以,结果发现不行。</p><p>还是挂接口解决吧。</p><p>修改你正在用的主题(或者正在用的随便一个插件,又或者新建一个插件)的 include.php 文件。</p><p>在 function ActivePlugin_xxx() 函数内添加:</p><pre class="prism-highlight prism-language-php">Add_Filter_Plugin(&#39;Filter_Plugin_PostComment_Core&#39;,&#39;xxx_PostComment_Core&#39;);</pre><p>在函数外添加:</p><pre class="prism-highlight prism-language-php">function&nbsp;xxx_PostComment_Core(&amp;$cmt)&nbsp;{ global&nbsp;$zbp; $email=GetVars(&quot;email&quot;,&quot;POST&quot;); if(!$email){ $cmt-&gt;IsThrow&nbsp;=&nbsp;true; $zbp-&gt;lang[&#39;error&#39;][14]&nbsp;=&nbsp;&#39;邮件必填&#39;; $zbp-&gt;ShowError(14,&nbsp;__FILE__,&nbsp;__LINE__); } }</pre><p>xxx 是当前应用的 ID。</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409201726801103827672.jpg" title="QQ20240920-105757.jpg" alt="QQ20240920-105757.jpg"/></p><p>问题解决!</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409201726800982670665.jpg" title="QQ20240920-105458.jpg" alt="QQ20240920-105458.jpg"/></p>Fri, 20 Sep 2024 10:52:57 +0800CSS 终于有了元素垂直居中的属性https://yeelz.com/post/571.html<p>2024 年了,CSS 原生属性中终于有了垂直居中的功能,他就是之前 Flex 布局和 Grid 布局中使用的 align-content: center。<br/></p><p>之前要实现垂直居中,通常都是要使用 flexbox 或 grid 布局。</p><p>align-content 在默认的流式布局中是不起作用的。</p><h3>比如这样:</h3><pre class="prism-highlight prism-language-markup">&lt;style&gt; .flex&nbsp;{ &nbsp;&nbsp;height:&nbsp;150px; &nbsp;&nbsp;border:&nbsp;solid; &nbsp;&nbsp;display:&nbsp;flex; &nbsp;&nbsp;flex-wrap:&nbsp;wrap; &nbsp;&nbsp;align-content:&nbsp;center; } &lt;/style&gt; &lt;div&nbsp;class=&quot;flex&quot;&gt; &nbsp;&nbsp;&lt;div&gt;flex垂直居中&lt;/div&gt; &lt;/div&gt;</pre><h3>又比如这样:</h3><pre class="prism-highlight prism-language-markup">&lt;style&gt; .grid&nbsp;{ &nbsp;&nbsp;height:&nbsp;150px; &nbsp;&nbsp;border:&nbsp;solid; &nbsp;&nbsp;display:&nbsp;grid; &nbsp;&nbsp;align-content:&nbsp;center; } &lt;/style&gt; &lt;div&nbsp;class=&quot;grid&quot;&gt; &nbsp;&nbsp;&lt;div&gt;grid垂直居中&lt;/div&gt; &lt;/div&gt;</pre><p>现在,你不需要再使用 flexbox 或 grid 布局就可以轻松实现元素垂直居中。</p><h3>只需要直接这样:</h3><pre class="prism-highlight prism-language-markup">&lt;style&gt; div&nbsp;{ &nbsp;&nbsp;height:&nbsp;150px; &nbsp;&nbsp;border:&nbsp;solid; &nbsp;&nbsp;align-content:&nbsp;center; } &lt;/style&gt; &lt;div&gt; &nbsp;&nbsp;包含&nbsp;&lt;em&gt;多个&lt;/em&gt;&nbsp;节点的内容。 &lt;/div&gt;</pre><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409201726793350892715.jpg" title="垂直居中.jpg" alt="垂直居中.jpg"/></p><h3>兼容性如下:</h3><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409201726793337549883.png" title="css兼容.png" alt="css兼容.png"/></p>Fri, 20 Sep 2024 08:47:40 +0800Z-Blog Bing IndexNow 插件https://yeelz.com/post/570.html<p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409191726727689458559.jpg" title="4x3_搜索引擎_SEO-(1).jpg" alt="4x3_搜索引擎_SEO-(1).jpg"/></p><p>bing站长工具一直提醒未使用IndexNow,看了一下bing也没提供zblog的插件(猪猪仍需努力),于是做了这个插件</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409191726727902664843.jpg" style="" title="now.jpg"/></p><h3>使用教程:</h3><ol class=" list-paddingleft-2" style="list-style-type: decimal;"><li><p>进入https://www.bing.com/indexnow/getstarted,拖到下面,复制API Key</p></li><li><p>下载你刚才获取的Key.txt</p></li><li><p>将TXT文件上传到网站根目录</p></li><li><p>启用插件,填写API Key</p></li><li><p>发布文章,勾选Bing IndexNow 提交</p></li><li><p>去https://www.bing.com/webmasters/indexnow查看是否提交</p></li></ol><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/09/202409191726727908913061.jpg" style="" title="bing index.jpg"/></p>Thu, 19 Sep 2024 14:34:23 +0800解决宝塔面板启用 ssl 后 https://ip 可以打开网站的问题https://yeelz.com/post/569.html<p>群里有人问,为什么用宝塔面板网站搭建好后 https://ip&nbsp; 也能打开他的网站?</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790617367694.png" title="微信截图_20240724105511.png" alt="微信截图_20240724105511.png"/></p><p>按照宝塔官方说法:在未指定默认站点时,未开启 SSL 的站点使用 HTTPS 会直接访问到已开启 SSL 的站点。<br/></p><p>这也就是大家常说的的https窜站!<br/></p><p>新版宝塔已经没有这个问题了,网站列表管理中直接打开 HTTPS 防窜站就好。<br/></p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790640212894.png" title="微信截图_20240724110435.png" alt="微信截图_20240724110435.png"/></p><p>但是有很多人还是用旧版宝塔的,毕竟新版的宝塔一言难尽,于是就水一篇吧~~</p><p>这问题具体有什么影响就不多说了,直接说解决方案。<br/></p><h3>宝塔面板中添加站点</h3><p>域名为a.com(可以随便填),提交。<br/></p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790687235177.png" title="微信截图_20240724105929.png" alt="微信截图_20240724105929.png"/></p><h3>给 a.com 配置 SSL 证书<br/></h3><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790706489956.png" title="微信截图_20240724110128.png" alt="微信截图_20240724110128.png"/></p><h3>密钥和证书填写如下</h3><p>密钥(KEY)<br/></p><pre class="prism-highlight prism-language-bash">-----BEGIN&nbsp;PRIVATE&nbsp;KEY----- MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDPPPynNLmSGfC8 CXODplocOVy/Re9lEhpGtxm0hBoEh3dO61yr2oo8K7Z761o6pkP4Wll+8PaWGGgY IYORsI1DxgTJ0hCdeLy+tJbTZYmbcpboqGD62T68pf4Opsb6ntwWScjFiN1nrqW5 9ctyiOlQmeX48mEv7VxTdHPCdhTwVsbEeFlMbTQfrh88Ph/TmgIJ5gbwRblBEv2T 6oqNQP3u5IFeMI3ACs7ryxSQixfkpktVo72XO8VemgreCvjH8co4fd0788HcYbdV 031o5gqSvmBM1Pz+Lkb+XRP0rpLul/ArEUQ9MAySIr7GskULZD9sue0YQfAHeNrZ 43Zdbe9xAgMBAAECggEBAK3n680UvbUQ96eT9s+/RVbx/Ba2xVH3gv1cocGOKZcr Zr9fWwEL/3zG4ffTZIBbDibXCssvwn3qNVAqr5IOqjz5awNBuJesvhb6zKbRSkyc OG88/UUEEVWVpkD9S3T84owBlu3NEJ71PDV1Qij3I3Nz8jyaiVwCv7t4ubuyA5g6 dy+Y6PnDQ9do8spQDJLQbisAGiyUSuV7pYil5OZAAG7ngMflQYT+0rn4/ChX20sA /WRQ1PmYU/xEQnAYvM5CAjgaZCw92Cn83JN3mgAXU4gdPbxGQOIqTL99Rn8HI4yH x5RLNJ5hS7g2qlLmroZBVis/0Q+8lWc0cb9qqeicghECgYEA6RkNDZI16AOwwPvR Nkcb1uxt6hMT6qC0PFW86u0XQDne49RwG68DYMgI0XaPEfzGzGKSJVY0IpxF5tAg 2xB4RsVRxPiXF9EeM9Xq9RSYKTCP1jGnnqaI4PVSq7eMrRgsAhJdPapLKRhlia6W OnJ4hubQGakKYns2bEg66w/HnPsCgYEA45mBtghS5xE5VNosHxqXrDA6JDcwnjBT FcFuE8FIc2bR91yNejFZ13K0/r41bcVVHRkGC2xVMolQhBxiv3NesvnJ5OEr+OYF FswZQMafOx0Zhy0DySRfJvGp6VhiQOhDIley4rlMGwK2QCDWYQsiN9wAOUkO06H/ nt5jN6rw4YMCgYBOIJVdbRogT8xYgo6W0LKmEMyuXgKY65A9gMc3PoxCfKMWXcfN n5VURPefrUs6ziybqJYvaXtD9nj/adb5VcXagpxrlp6d3vtuiE6eIm71r08mjbIO 3OaX7+HrqDPAeI+XiiwyVPeoKIMv6JJ1uJRpMsehMiVG6OFO3c7RppJTLQKBgA2L SQjIHgbaI4tFIHMJZhU9GXimQCJpxcf5ps9OJT2Y1M3fmBu5bBtCHDs8nnlV0ObW YmGzpK5JNZ1nAwlZmD0WWElijPdW2N6ubqJIL5mY9bfxmdQScgcjQnU8aTxrlfMp PN/5HupMkwPl8Fv+CZ9BXFIMYvF9JnURzt21Mnh5AoGAX7VG378PtgZeZM66vERq mquF5B78plvga3okZG0n/qFRhy1MVFursjHwccPVjdgiSw5co8D06wnqfCO7pQ84 IrszGROKzv8HgoYgYfh/PhNCZN4RsASWAmVNIFm3V5YgrE5yaaUFiUFq3FC1yCJT 499ofkwdWuWyhpw1FP/v7gA= -----END&nbsp;PRIVATE&nbsp;KEY-----</pre><p>证书(PEM格式)</p><pre class="prism-highlight prism-language-bash">-----BEGIN&nbsp;CERTIFICATE----- MIIDOzCCAiOgAwIBAgIUVCECiiqIa/rBlvNeP+6QiKwJTTEwDQYJKoZIhvcNAQEF BQAwODEVMBMGA1UEAwwM6ZqU5aOB6ICB5p2OMRIwEAYDVQQKDAlnZWJpbGFvbGkx CzAJBgNVBAYTAkNOMCAXDTI0MDcyNDAyNDQwMFoYDzI5OTkxMjMxMTU1NTAwWjBW MQswCQYDVQQGEwJDTjEPMA0GA1UECAwG5YyX5LqsMQ8wDQYDVQQHDAbljJfkuqwx FTATBgNVBAoMDOmalOWjgeiAgeadjjEOMAwGA1UEAwwFYS5jb20wggEiMA0GCSqG SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPPPynNLmSGfC8CXODplocOVy/Re9lEhpG txm0hBoEh3dO61yr2oo8K7Z761o6pkP4Wll+8PaWGGgYIYORsI1DxgTJ0hCdeLy+ tJbTZYmbcpboqGD62T68pf4Opsb6ntwWScjFiN1nrqW59ctyiOlQmeX48mEv7VxT dHPCdhTwVsbEeFlMbTQfrh88Ph/TmgIJ5gbwRblBEv2T6oqNQP3u5IFeMI3ACs7r yxSQixfkpktVo72XO8VemgreCvjH8co4fd0788HcYbdV031o5gqSvmBM1Pz+Lkb+ XRP0rpLul/ArEUQ9MAySIr7GskULZD9sue0YQfAHeNrZ43Zdbe9xAgMBAAGjHTAb MAsGA1UdEQQEMAKCADAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBBQUAA4IBAQBX 3m6nkKou9T5GSPpD51KsC7ctjSrA3GtOEdr+N52r8SDkJapW/cCNFU5vAm6eWDVW g7qtTn/xX+taveLCLHumxpQO/4oFMmA/ULnsSRgJro1Jq5l/8cBSFw6ckictFDTp /hUI+RBJm+wP6vzN5nq5AZRb5reaolbYzn3g4pR1on1MofIi9GTGcXqmdErKuGm8 lLb7hXIvGjjJ+5ojtMxqXEsqWVMccAnc1nm4wXEFWhMVvZjDXXXPnOIYgLsFgcHe PdeD6B7bzevC5XKPPT9IYaEaBeqNvJpiiUS8hMFRRAyEAmViQJXQOD8QlHp5rt12 KUiWMQH12iQgN2jCoOxR -----END&nbsp;CERTIFICATE-----</pre><h3>设置默认站点为 a.com</h3><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790775288353.png" style="" title="微信截图_20240724110307.png"/></p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790784629321.png" style="" title="微信截图_20240724110314.png"/></p><p>如有必要,可以去a.com文件夹内删掉404.html和index.html。</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407241721790829285713.png" title="微信截图_20240724111329.png" alt="微信截图_20240724111329.png"/></p><p>搞定!</p><p>其实说白了就是新建一个虚假域名的默认站点,添加一个自签的证书。</p><p>有需要的可以参考。</p>Wed, 24 Jul 2024 11:09:31 +0800Polyfill.io、BootCDN、Bootcss 和 Staticfile CDN 可能已被投毒https://yeelz.com/post/568.html<p>最近有一个引用了Staticfile公共库的网站突然相关资源加载不了,排查了一下发现是uBlockOrigin屏蔽了Staticfile相关的域名。</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407091720487955471487.png" title="微信截图_20240709085901.png" alt="微信截图_20240709085901.png"/></p><p>于是就去Staticfile的git提Issues,结果发现有人反馈引用Staticfile的js文件跳恶意广告。</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407091720487977617988.png" title="微信截图_20240709085933.png" alt="微信截图_20240709085933.png"/></p><p>从回复里看到V2EX也有人发帖olyfill.io、BootCDN、Bootcss 、Staticfile都可能已被投毒。</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407091720487989504521.png" title="微信截图_20240709090122.png" alt="微信截图_20240709090122.png"/></p><p>结合前段时间我的某个站点移动端莫名其妙的跳转到一些app下载广告(当时还以为是运营商劫持),被投毒的说法可信度比较高。</p><p>于是连夜把所有Staticfile CDN的引用都换成本地,要是有使用相关公共库的站长建议赶紧更换!</p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407091720488003341794.png" style="" title="微信截图_20240709090206.png"/></p><p><img class="ue-image" src="https://yeelz.com/zb_users/upload/2024/07/202407091720488007840168.png" style="" title="微信截图_20240709091836.png"/></p>Tue, 09 Jul 2024 09:18:48 +0800