<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title><![CDATA[傅令江的光影色彩世界]]></title> 
<description><![CDATA[留住记忆的点滴]]></description>
<link>https://www.fulingjiang.cn/</link>
<language>zh-cn</language>
<generator>www.emlog.net</generator>
<item>
	<title>浪淘沙</title>
	<link>https://www.fulingjiang.cn/shicijianshang/292.html</link>
	<description><![CDATA[&nbsp;帘外雨潺潺,春意阑珊。 罗衾不耐五更寒。 梦里不知身是客,一晌贪欢。 独自莫凭栏,无限江山,别时容易见时难。 流水落花春去也,天上人间。]]></description>
	<pubDate>Fri, 06 Mar 2026 07:34:28 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/shicijianshang/292.html</guid>

</item>
<item>
	<title>世事一场大梦，人生几度秋凉</title>
	<link>https://www.fulingjiang.cn/qinggan/291.html</link>
	<description><![CDATA[世事一场大梦，人生几度秋凉，愿未来越来越好！]]></description>
	<pubDate>Fri, 28 Nov 2025 00:49:28 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/qinggan/291.html</guid>

</item>
<item>
	<title>兄弟二周年祭</title>
	<link>https://www.fulingjiang.cn/yuanchuang/290.html</link>
	<description><![CDATA[不知不觉高中最好的朋友已经离开我们两年了，曾几何时梦见，一切还是少年时模样，一句淡淡，抢救过来了，没事了，真希望一切是梦，永远不醒。]]></description>
	<pubDate>Thu, 24 Oct 2024 13:34:48 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/yuanchuang/290.html</guid>

</item>
<item>
	<title>openai给的ionCube 解密代码，应该是老版本可以这样</title>
	<link>https://www.fulingjiang.cn/php/289.html</link>
	<description><![CDATA[<pre class="prettyprint lang-php linenums">&lt;?php
// 加载 ionCube Loader 扩展
if (!extension_loaded('ionCube Loader')) {
    die('ionCube Loader 扩展未加载');
}

// 解密加密的 PHP 代码
$encrypted_code = file_get_contents('encrypted.php');
$decrypted_code = ioncube_loader_decrypt($encrypted_code);
eval($decrypted_code);
?&gt;</pre>]]></description>
	<pubDate>Mon, 20 Feb 2023 03:40:46 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/php/289.html</guid>

</item>
<item>
	<title>WordPress – 5秒盾防CC（PHP通用代码）</title>
	<link>https://www.fulingjiang.cn/php/288.html</link>
	<description><![CDATA[<div class="article-header theme-box clearfix relative" style="box-sizing:border-box;margin-bottom:20px;position:relative;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	<h1 class="article-title" id="wznav_0" style="box-sizing:border-box;font-size:22px;margin:15px 0px 20px;font-family:inherit;line-height:1.4;color:var(--key-color);outline:0px !important;">
		<span style="box-sizing:border-box;outline:0px !important;font-size:20px;color:var(--main-color);">简介</span>
	</h1>
</div>
<div class="article-content" style="box-sizing:border-box;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;outline:0px !important;">
		这是个类似Cloudflare的防cc功能，利用的是五秒盾的原理，经过检测得到cookie的浏览器才能正常的访问你的网站了，当然了，面对数以万计的肉鸡，这代码还是无能为力的，所以说做人就要低调，别到处装逼，到时候被打了惨的还是自己，下面分享给需要的同学。
	</p>
</div>
<h2 id="wznav_1" style="box-sizing:border-box;font-family:华文新魏;line-height:1.1;color:#4E5358;margin:20px 0px;font-size:18px;position:relative;padding-bottom:8px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	使用教程新建文件
</h2>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	首先建个PHP文件cc.php代码如下：
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	<br />
</p>
<pre class="prettyprint lang-php linenums">&lt;?php
define('SYSTEM_ROOT', dirname(preg_replace('@\\(.*\\(.*$@', '', preg_replace('@\\(.*\\(.*$@', '', __FILE__))) . '/');
session_start();
date_default_timezone_set('Asia/Shanghai');
header('Content-Type: text/html; charset=UTF-8');
function getspider($useragent=''){
  if(CC_Defender==2)return false;
  if(!$useragent){$useragent = $_SERVER['HTTP_USER_AGENT'];}
$useragent=strtolower($useragent);
  if (strpos($useragent, 'baiduspider') !== false){return 'baiduspider';}
  if (strpos($useragent, 'googlebot') !== false){return 'googlebot';}
  if (strpos($useragent, 'soso') !== false){return 'soso';}
  if (strpos($useragent, 'bing') !== false){return 'bing';}
  if (strpos($useragent, 'yahoo') !== false){return 'yahoo';}
  if (strpos($useragent, 'sohu-search') !== false){return 'Sohubot';}
  if (strpos($useragent, 'sogou') !== false){return 'sogou';}
  if (strpos($useragent, 'youdaobot') !== false){return 'YoudaoBot';}
  if (strpos($useragent, 'yodaobot') !== false){return 'YodaoBot';}
  if (strpos($useragent, 'robozilla') !== false){return 'Robozilla';}
  if (strpos($useragent, 'msnbot') !== false){return 'msnbot';}
  if (strpos($useragent, 'lycos') !== false){return 'Lycos';}
  if (strpos($useragent, 'ia_archiver') !== false || strpos($useragent, 'iaarchiver') !== false){return 'alexa';}
  if (strpos($useragent, 'archive.org_bot') !== false){return 'Archive';} 
  if (strpos($useragent, 'robozilla') !== false){return 'Robozilla';} 
  if (strpos($useragent, 'sitebot') !== false){return 'SiteBot';} 
  if (strpos($useragent, 'mj12bot') !== false){return 'MJ12bot';} 
  if (strpos($useragent, 'gosospider') !== false){return 'gosospider';} 
  if (strpos($useragent, 'gigabot') !== false){return 'Gigabot';} 
  if (strpos($useragent, 'yrspider') !== false){return 'YRSpider';} 
  if (strpos($useragent, 'gigabot') !== false){return 'Gigabot';} 
  if (strpos($useragent, 'jikespider') !== false){return 'jikespider';} 
  if (strpos($useragent, 'addsugarspiderbot') !== false){return 'AddSugarSpiderBot';/*非常少*/} 
  if (strpos($useragent, 'testspider') !== false){return 'TestSpider';} 
  if (strpos($useragent, 'etaospider') !== false){return 'EtaoSpider';} 
  if (strpos($useragent, 'wangidspider') !== false){return 'WangIDSpider';} 
  if (strpos($useragent, 'foxspider') !== false){return 'FoxSpider';} 
  if (strpos($useragent, 'docomo') !== false){return 'DoCoMo';} 
  if (strpos($useragent, 'yandexbot') !== false){return 'YandexBot';} 
  if (strpos($useragent, 'ezooms') !== false){return 'Ezooms';/*个人*/} 
  if (strpos($useragent, 'sinaweibobot') !== false){return 'SinaWeiboBot';} 
  if (strpos($useragent, 'catchbot') !== false){return 'CatchBot';} 
  if (strpos($useragent, 'surveybot') !== false){return 'SurveyBot';} 
  if (strpos($useragent, 'dotbot') !== false){return 'DotBot';} 
  if (strpos($useragent, 'purebot') !== false){return 'Purebot';} 
  if (strpos($useragent, 'ccbot') !== false){return 'CCBot';} 
  if (strpos($useragent, 'mlbot') !== false){return 'MLBot';} 
  if (strpos($useragent, 'adsbot-google') !== false){return 'AdsBot-Google';}
  if (strpos($useragent, 'ahrefsbot') !== false){return 'AhrefsBot';}
  if (strpos($useragent, 'spbot') !== false){return 'spbot';}
  if (strpos($useragent, 'augustbot') !== false){return 'AugustBot';}
  return false;
}

if($_GET['rand'] &amp;&amp; $_SESSION['rand_session']!=$_GET['rand']){
  @header('Content-Type: text/html; charset=UTF-8');
exit('&lt;b&gt;浏览器不支持COOKIE或者不正常访问！&lt;/b&gt;');
}
if(!$_SESSION['rand_session'] &amp;&amp; $nosecu!=true){
  if(!getspider()){
    $rand_session=md5(uniqid().rand(1,1000));
  $_SESSION['rand_session']=$rand_session;
    exit("&lt;!DOCTYPE HTML&gt;
    &lt;html&gt;
    &lt;head&gt;
    &lt;meta charset=\"UTF-8\"/&gt;
    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1, maximum-scale=1\" /&gt;

    &lt;title&gt;In inspection...&lt;/title&gt;
   &lt;script&gt; var i = 5; 
  var intervalid; 
  intervalid = setInterval(\"fun()\", 1000); 
function fun() { 
if (i == 0) { 
window.location.href = \"?{$_SERVER['QUERY_STRING']}&amp;rand={$rand_session}\"; 
clearInterval(intervalid); 
} 
document.getElementById(\"mes\").innerHTML = i; 
i--; 
} 
&lt;/script&gt; 
&lt;style&gt;
  html, body {width: 100%; height: 100%; margin: 0; padding: 0;}
    body {background-color: #ffffff; font-family: Helvetica, Arial, sans-serif; font-size: 100%;}
    h1 {font-size: 1.5em; color: #404040; text-align: center;}
    p {font-size: 1em; color: #404040; text-align: center; margin: 10px 0 0 0;}
    #spinner {margin: 0 auto 30px auto; display: block;}
    .attribution {margin-top: 20px;}
  &lt;/style&gt;
  &lt;/head&gt;
&lt;body&gt;
  &lt;table width=\"100%\" height=\"100%\" cellpadding=\"20\"&gt;
    &lt;tr&gt;
      &lt;td align=\"center\" valign=\"middle\"&gt;
    &lt;noscript&gt;&lt;h2&gt;请打开浏览器的javascript，然后刷新浏览器&lt;/h2&gt;&lt;/noscript&gt;
  &lt;h1&gt;&lt;span data-translate=\"checking_browser\"&gt;浏览器安全检查中...&lt;/span&gt;&lt;/h1&gt;
    &lt;p data-translate=\"process_is_automatic\"&gt;&lt;/p&gt;
    &lt;p data-translate=\"allow_5_secs\"&gt;还剩 &lt;span id=\"mes\"&gt;5&lt;/span&gt; 秒&lt;/p&gt;
  &lt;/div&gt;
&lt;/div&gt;
  &lt;/td&gt;
    &lt;/tr&gt;
&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;");}}</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums">
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	<span style="box-sizing:border-box;cursor:pointer;transition:color 0.2s ease 0s, background 0.3s ease 0s, opacity 0.3s ease 0s, box-shadow 0.3s ease 0s, transform 0.3s ease 0s;outline-color:initial !important;outline-style:initial !important;">W</span><span style="box-sizing:border-box;cursor:pointer;transition:color 0.2s ease 0s, background 0.3s ease 0s, opacity 0.3s ease 0s, box-shadow 0.3s ease 0s, transform 0.3s ease 0s;outline-color:initial !important;outline-style:initial !important;">ordPress</span>&nbsp;上传到主题/template/cc.php ;
</p>

<h3 id="wznav_2" style="box-sizing:border-box;font-family:华文新魏;line-height:1.1;color:#4E5358;margin:20px 0px;font-size:16px;position:relative;padding-bottom:8px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	调用代码
</h3>

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	PHP通用调用，在头部或主要文件内文件加入：
</p>

<pre class="prettyprint lang-php linenums">&lt;?php include 'cc.php'; ?&gt;</pre>
<br />
</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums"><span style="color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;">WordPress调用，主题/header.php第一行添加代码：</span></pre>
<pre class="prettyprint lang-php linenums">
</pre>
<pre class="prettyprint lang-php linenums">
<pre class="prettyprint lang-php linenums">&lt;?php get_template_part( 'template/cc' ); ?&gt;</pre>
<h3 id="wznav_3" style="box-sizing:border-box;font-family:华文新魏;line-height:1.1;color:#4E5358;margin:20px 0px;font-size:16px;position:relative;padding-bottom:8px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	建议
</h3>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	可以把代码调用至404错误页，对于单IP刷新CC不存在页面有很好的防御效果！
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	首次访问网站检测浏览器cookie通过才能正常的访问你的网站，搜索引擎蜘蛛已经过滤，不影响收录，还有未加上的可以自己补充。平时没攻击的时候建议不要开启，影响网站体验，配合<a href="https://www.97s.org/?golink=aHR0cHM6Ly93d3cueXVubG9jLmNvbS8xNjcuaHRtbA==" target="_blank" rel="noopener noreferrer" style="box-sizing:border-box;background-color:transparent;text-decoration-line:none;cursor:pointer;transition:color 0.2s ease 0s, background 0.3s ease 0s, opacity 0.3s ease 0s, box-shadow 0.3s ease 0s, transform 0.3s ease 0s;outline:0px !important;">《Nginx lua waf 简单防御CC攻击》</a>效果更佳。
</p>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	补充
</p>
<h3 id="wznav_4" style="box-sizing:border-box;font-family:华文新魏;line-height:1.1;color:#4E5358;margin:20px 0px;font-size:16px;position:relative;padding-bottom:8px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	使用方法
</h3>
<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	2019/07/02 新增脚本运用，根据系统负载来开启/关闭<span style="box-sizing:border-box;cursor:pointer;transition:color 0.2s ease 0s, background 0.3s ease 0s, opacity 0.3s ease 0s, box-shadow 0.3s ease 0s, transform 0.3s ease 0s;outline-color:initial !important;outline-style:initial !important;">5秒</span><span style="box-sizing:border-box;cursor:pointer;transition:color 0.2s ease 0s, background 0.3s ease 0s, opacity 0.3s ease 0s, box-shadow 0.3s ease 0s, transform 0.3s ease 0s;outline-color:initial !important;outline-style:initial !important;">盾</span>，新建check_5.sh：
</p>
<pre class="prettyprint lang-php linenums">
<pre class="prettyprint lang-bsh linenums">#!/bin/bash
# author: yunloc
# website: https://yunloc.com
 
if [ ! -f "status.txt" ];then
echo "" &gt; status.txt
else
status=$(cat status.txt)
fi
now=$(date +%s)
time=$(date +%s -r status.txt)
load=$(cat /proc/loadavg | colrm 5)
echo "当前负载:$load"
newtime=`expr $now - $time`
if [[ $load &lt;1.2 ]] &amp;&amp; [[ $status -eq 1 ]] &amp;&amp; [[ $newtime &gt;600 ]]  
then
cResult=$(/bin/cp /home/wwwroot/yunloc.com/wp-content/themes/begin/header_5_on.php /home/wwwroot/yunloc.com/wp-content/themes/begin/header.php)
echo $cResult
echo "负载低于 1.2，当前已开盾超过 10 分钟($newtime 秒)，尝试关盾"
echo 0 &gt; status.txt
elif [[ $load &lt;1.2 ]]
then
echo "负载低于 1.2，不做任何改变,$newtime 秒"
exit
else
cResult=$(/bin/cp /home/wwwroot/yunloc.com/wp-content/themes/begin/header_5_off.php /home/wwwroot/yunloc.com/wp-content/themes/begin/header.php)
echo $cResult
echo "负载高于 1.2，开启防御规则"
echo 1 &gt; status.txt
fi</pre>
<br />
</pre>
<br />
</pre>
<pre class="prettyprint lang-php linenums">
<p style="box-sizing:border-box;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	设置定时任务，每1分钟检查一次:
</p>

<p style="box-sizing:border-box;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	
<pre class="prettyprint lang-js linenums">*/1 * * * * /root/check_5.sh</pre>
</p>
<div style="box-sizing:border-box;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
</div>
<p>
	<p>
		<p>
			<p style="box-sizing:border-box;outline:0px !important;">
				新建两个文件：
			</p>
			<p style="box-sizing:border-box;outline:0px !important;">
				<span style="font-family:&quot;font-size:12px;color:var(--quote-color);"></span>/home/wwwroot/yunloc.com/wp-content/themes/begin/pheader_5_off.php
			</p>
			<p style="box-sizing:border-box;outline:0px !important;">
				<span style="background-color:#FFFFFF;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;">
				<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
					（首行加入WordPress调用代码）开启防御后把文件写入header.php
				</p>
				<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
					/home/wwwroot/yunloc.com/wp-content/themes/begin/header_5_on.php
				</p>
				<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
					<h3 id="wznav_5" style="box-sizing:border-box;font-family:华文新魏;line-height:1.1;color:#4E5358;margin:20px 0px;font-size:16px;position:relative;padding-bottom:8px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
						原理
					</h3>
					<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
						当系统负载达到1.2后自动开启，小于1.2后600秒关闭。
					</p>
					<p style="box-sizing:border-box;margin-top:0px;margin-bottom:20px;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
						关于负载一般可以简单的设置为你的核心数*1.2 比如你CPU是双核的,可以设置为2.4。
					</p>
				</p>
</span>
			</p>
			<p style="box-sizing:border-box;outline:0px !important;">
				<br />
<span style="font-family:&quot;font-size:12px;color:var(--quote-color);">
				<div class="quote_q quote-mce " mce-contenteditable="false" style="box-sizing:border-box;padding:1.2em;margin:10px 0px 20px;position:relative;--quote-color:var(--main-color);color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
					<div mce-contenteditable="true" style="box-sizing:border-box;outline:0px !important;margin:0px;padding-left:2em;opacity:0.6;position:relative;">
						<div>
							<br />
						</div>
					</div>
				</div>
</span>
			</p>
			<p style="box-sizing:border-box;outline:0px !important;">
				<span style="font-family:&quot;font-size:12px;color:var(--quote-color);"><br />
</span>
			</p>
		</p>
	</p>
</p>
<div class="article-content" style="box-sizing:border-box;color:#4E5358;font-family:华文新魏;font-size:16px;white-space:normal;background-color:#FFFFFF;outline:0px !important;">
	<div class="theme-box wp-posts-content" data-nav="posts" style="box-sizing:border-box;margin-bottom:20px;line-height:2;min-height:90px;outline:0px !important;">
		<div class="quote_q quote-mce " mce-contenteditable="false" style="box-sizing:border-box;outline:0px !important;padding:1.2em;margin:10px 0px 20px;position:relative;--quote-color:var(--main-color);color:var(--quote-color);">
			<div mce-contenteditable="true" style="box-sizing:border-box;outline:0px !important;margin:0px;padding-left:2em;opacity:0.6;position:relative;">
			</div>
		</div>
	</div>
</div>
</pre>
<pre class="prettyprint lang-php linenums">
</pre>
<p>
	<br />
</p>]]></description>
	<pubDate>Tue, 08 Nov 2022 02:54:52 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/php/288.html</guid>

</item>
<item>
	<title>我高中最好的朋友今天猝死了-伤心得不行</title>
	<link>https://www.fulingjiang.cn/qinggan/287.html</link>
	<description><![CDATA[听闻噩耗，心情总难以平复，早已泪如雨下，一切的美好不过十几年前的事情,往事一幕幕，如过眼云烟。虽不常联系，但依旧是那个年代的兄弟。]]></description>
	<pubDate>Mon, 24 Oct 2022 15:16:22 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/qinggan/287.html</guid>

</item>
<item>
	<title>Linux系统中 systemd-journaldCPU占用异常的解决方法</title>
	<link>https://www.fulingjiang.cn/linux/286.html</link>
	<description><![CDATA[解决办法<br />
因为要解决这个问题，我在网上找了很多，其中大概都是如下的解决方法：<br />
<br />
https://www.jianshu.com/p/8b3fba13fcad<br />
<br />
https://github.com/systemd/systemd/issues/9141<br />
<br />
https://blog.kylemanna.com/linux/systemd-journalctl-memory-hog/<br />
<br />
https://github.com/systemd/systemd/issues/11502<br />
<br />
其中的内容我捡主要的写在下面：<br />
<br />
1、通过修改systemd-journald的配置信息，从根源上关闭日志打印<br />
<br />
（1）进入Linux命令窗口输入：vim /etc/systemd/journald.conf<br />
<br />
（2）进入Vim后，把Storage对应的值改为none，修改完保存退出<br />
<br />
（3）更新配置信息：systemctl restart systemd-journald<br />
<br />
&nbsp;<br />
<br />
2、禁用日志<br />
<br />
# systemctl mask systemd-journald<br />
Created symlink /etc/systemd/system/systemd-journald.service → /dev/null.<br />
<br />
&nbsp;<br />
<br />
我是两种方法都使用过的，但是执行完第一个方法之后，命令框给我报了Job for systemd-journald.service failed because a timeout was exceeded.，而且日志打印也还在一直执行。<br />
<br />
所以第一种方法似乎并不能解决我的问题，于是我采用了第二种方法<br />
<br />
第二种方法引自：https://github.com/systemd/systemd/issues/9141<br />]]></description>
	<pubDate>Mon, 24 Oct 2022 02:08:34 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/linux/286.html</guid>

</item>
<item>
	<title>网站来路域名nginx拦截的几种方法</title>
	<link>https://www.fulingjiang.cn/linux/282.html</link>
	<description><![CDATA[<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">以下教程主要是通过nginx，禁止指定来源网站的链接访问自己的网站，</span><br style="box-sizing:border-box;color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;" />
<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">因为经常在统计中看到广告站来路，很影响获取真实的统计信息，所以就想着屏蔽那些广告域名的来路。</span><br style="box-sizing:border-box;color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;" />
<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">1.对于来路为*.xxxx.com，全部返回404，代码如下，</span><br style="box-sizing:border-box;color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;" />
<p>
	<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">代码如下：</span>
</p>
<p>
	<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">if ($http_referer ~* .*.xxxx.com){<br />
&nbsp; &nbsp; return 404;<br />
&nbsp; &nbsp; }<br />
<br />
</span>
</p>
<p>
	<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">
	<p style="box-sizing:border-box;word-break:break-word;margin-top:0px;margin-bottom:0px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);font-size:15px;position:relative;color:rgba(0, 0, 0, 0.84);line-height:2.2;font-family:nexzhu;text-align:justify;white-space:normal;background-color:#FFFFFF;">
		2.对于来路为xxxx.com的链接来路，通过路径转发全部返回到其首页
	</p>
	<p style="box-sizing:border-box;word-break:break-word;margin-top:0px;margin-bottom:0px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);font-size:15px;position:relative;color:rgba(0, 0, 0, 0.84);line-height:2.2;font-family:nexzhu;text-align:justify;white-space:normal;background-color:#FFFFFF;">
		&nbsp;if ($http_referer ~* xxxx.com) {<br />
&nbsp; &nbsp; rewrite ^/ http://xxxx.com/;<br />
&nbsp; &nbsp; }<br />
		<p style="box-sizing:border-box;word-break:break-word;margin-top:0px;margin-bottom:0px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);font-size:15px;position:relative;color:rgba(0, 0, 0, 0.84);line-height:2.2;font-family:nexzhu;text-align:justify;white-space:normal;background-color:#FFFFFF;">
			以上代码可以将它们丢到location ~ 1.php(/|$) {}中，案例如下：
		</p>
<pre style="box-sizing:border-box;overflow:auto;font-family:Menlo, Monaco, Consolas, &quot;font-size:14px;line-height:1.8;margin-top:5px;margin-bottom:5px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);white-space:pre-wrap;overflow-wrap:break-word;position:relative;color:#2C2E3B;text-align:justify;background-color:#FFFFFF;"><code class="language-php hljs" style="box-sizing:border-box;font-family:Menlo, Monaco, Consolas, &quot;line-height:1.8;display:block;overflow-x:auto;background:#000000;color:#FFFFFF;padding:0.5em;border-radius:3px;margin:0px;">
		<ol style="box-sizing:border-box;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);list-style-position:initial;list-style-image:initial;margin:0px 0px 0px 40px !important;">
			
		</ol>
</code></pre>
&nbsp; &nbsp; location ~ [^/].php(/|$) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; if ($http_referer ~* .*.xxxx.com){<br />
&nbsp; &nbsp; &nbsp; &nbsp; return 404;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
	</p>
	<p style="box-sizing:border-box;word-break:break-word;margin-top:0px;margin-bottom:0px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);font-size:15px;position:relative;color:rgba(0, 0, 0, 0.84);line-height:2.2;font-family:nexzhu;text-align:justify;white-space:normal;background-color:#FFFFFF;">
		<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">添加代码后只要重启nginx，就可以生效。</span><br style="box-sizing:border-box;color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;" />
<span style="color:rgba(0, 0, 0, 0.84);font-family:nexzhu;font-size:15px;text-align:justify;white-space:normal;background-color:#FFFFFF;">可以F12添加超链接模拟来路测试</span>
	</p>
<pre style="box-sizing:border-box;overflow:auto;font-family:Menlo, Monaco, Consolas, &quot;font-size:14px;line-height:1.8;margin-top:5px;margin-bottom:5px;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);white-space:pre-wrap;overflow-wrap:break-word;position:relative;color:#2C2E3B;text-align:justify;background-color:#FFFFFF;"><code class="language-php hljs" style="box-sizing:border-box;font-family:Menlo, Monaco, Consolas, &quot;line-height:1.8;display:block;overflow-x:auto;background:#000000;color:#FFFFFF;padding:0.5em;border-radius:3px;margin:0px;">
	<ol style="box-sizing:border-box;padding:0px;-webkit-tap-highlight-color:rgba(0, 0, 0, 0);list-style-position:initial;list-style-image:initial;margin:0px 0px 0px 40px !important;">
		
	</ol>
</code></pre>
<br />
</span>
</p>]]></description>
	<pubDate>Mon, 17 Oct 2022 12:57:04 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/linux/282.html</guid>

</item>
<item>
	<title>浪淘沙令·帘外雨潺潺</title>
	<link>https://www.fulingjiang.cn/shicijianshang/281.html</link>
	<description><![CDATA[李煜 〔五代〕

帘外雨潺潺，春意阑珊。罗衾不耐五更寒。梦里不知身是客，一晌贪欢。
独自莫凭栏，无限江山。别时容易见时难。流水落花春去也，天上人间。]]></description>
	<pubDate>Sat, 15 Oct 2022 02:38:53 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/shicijianshang/281.html</guid>

</item>
<item>
	<title>PHP读本地文件指定某行内容</title>
	<link>https://www.fulingjiang.cn/php/280.html</link>
	<description><![CDATA[&lt;?php<br />
$a = file('xiaohana.txt'); //读取同目录xiaohana.txt文本<br />
echo $a[5];//输入本文档的第6行内容<br />
<p>
	?&gt;
</p>
<p>
	<br />
</p>
<p>
	如果文件较大，内容较多用以下代码<br />
	<div>
		<br />
	</div>
&lt;?php<br />
$c = getLine('./a.txt', 10); // 读取a.txt文件第11行内容<br />
echo $c;<br />
/**<br />
&nbsp;* 获取指定行内容<br />
&nbsp;*<br />
&nbsp;* @param $file 文件路径<br />
&nbsp;* @param $line 行数<br />
&nbsp;* @param $length 指定行返回内容长度<br />
&nbsp;*/<br />
function getLine($file, $line, $length = 4096)<br />
{<br />
&nbsp; &nbsp; $returnTxt = null; // 初始化返回<br />
&nbsp; &nbsp; $i = 1; // 行数<br />
<br />
&nbsp; &nbsp; $handle = @fopen($file, "r");<br />
&nbsp; &nbsp; if ($handle) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; while (!feof($handle)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $buffer = fgets($handle, $length);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ($line == $i) $returnTxt = $buffer;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $i++;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; fclose($handle);<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; return $returnTxt;<br />
}<br />
?&gt;<br />
</p>]]></description>
	<pubDate>Fri, 14 Oct 2022 15:01:27 +0000</pubDate>
	<author>傅令江</author>
	<guid>https://www.fulingjiang.cn/php/280.html</guid>

</item></channel>
</rss>