<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>linux - 十步回眸一笑 - 个人技术笔记</title>
	<atom:link href="https://www.hishd.top/archives/tag/linux/feed" rel="self" type="application/rss+xml" />
	<link>https://www.hishd.top</link>
	<description></description>
	<lastBuildDate>Thu, 12 Mar 2026 16:12:55 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Alpine安装Bash</title>
		<link>https://www.hishd.top/archives/358</link>
					<comments>https://www.hishd.top/archives/358#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Thu, 12 Mar 2026 16:12:54 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=358</guid>

					<description><![CDATA[Alpine 默认安装的是 busybox，有很多人包括我自己都是习惯使用Bash的，甚至有很多脚本和命令默认 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Alpine 默认安装的是 busybox，有很多人包括我自己都是习惯使用Bash的，甚至有很多脚本和命令默认都是Bash，在Alpine中就无法使用或者需要自行修改代码甚是麻烦<br></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>安装 libuser</p>



<pre class="wp-block-code"><code>apk add bash libuser</code></pre>



<p>设置Shell</p>



<pre class="wp-block-code"><code>touch /etc/login.defs
mkdir /etc/default
touch /etc/default/useradd
lchsh root
## Changing shell for root.
Password: (输入root密码)
New Shell &#91;/bin/ash]: /bin/bash
## Shell changed.</code></pre>



<figure class="wp-block-image size-full is-resized"><img fetchpriority="high" decoding="async" width="578" height="280" src="https://photo.hishd.top/2026/03/20260312161203836.png" alt="" class="wp-image-359" style="width:336px;height:auto"/></figure>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/358/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debian 设置、添加、挂载新分区</title>
		<link>https://www.hishd.top/archives/341</link>
					<comments>https://www.hishd.top/archives/341#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Sun, 01 Jun 2025 08:50:36 +0000</pubDate>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=341</guid>

					<description><![CDATA[假如我们的vps需要添加一个硬盘来存放数据，我们该如何使用命令的方式添加和挂载新的硬盘呢？ 首先，我们先查看系 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>假如我们的vps需要添加一个硬盘来存放数据，我们该如何使用命令的方式添加和挂载新的硬盘呢？</p>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<p>首先，我们先查看系统的硬盘是否已经识别</p>



<pre class="wp-block-code"><code>fdisk -l</code></pre>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="488" height="276" src="https://photo.hishd.top/2025/06/20250601080958663.png" alt="" class="wp-image-343" style="width:532px;height:auto"/></figure>



<p>从上图可以看到，系统目前识别到了两块硬盘。一块是1TB的，一块是100GB的</p>



<pre class="wp-block-code"><code>lsblk </code></pre>



<figure class="wp-block-image size-full is-resized"><img decoding="async" width="328" height="92" src="https://photo.hishd.top/2025/06/20250601081353871.png" alt="" class="wp-image-344" style="width:456px;height:auto"/></figure>



<p>可以看到有 ”sdb“ 就是那1TB硬盘的<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">磁盘名称</mark></p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<p>接下来我们就要拿起刀来切分区了</p>



<pre class="wp-block-code"><code>fdisk /dev/sdb  #这里的"sdb"需要根据个人实际的磁盘名称设置，别搞错了哟！</code></pre>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="649" height="428" src="https://photo.hishd.top/2025/06/20250601081528218.png" alt="" class="wp-image-345" style="width:688px;height:auto"/></figure>



<p>我们通过指令 <kbd>n</kbd> 来新建分区，如果无需其他具体的分区划分的话这里一路回车默认就可以了。</p>



<p>最后输入 <kbd>w</kbd> 来写入分区改动即可，最后输入 <kbd>q</kbd> 就可以退出 fdisk</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<p>设置新分区</p>



<p>在划分好分区后，我们需要对分区进行格式化和挂载才可以使用。</p>



<pre class="wp-block-code"><code>mkfs -t ext4 /dev/sdb1 </code></pre>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="614" height="219" src="https://photo.hishd.top/2025/06/20250601082320579.png" alt="" class="wp-image-346" style="width:670px;height:auto"/></figure>



<p>格式化时如果不知道具体的分区名称可以通过 <kbd>lsblk</kbd> 来查看，千万别格式化错了哟！</p>
</div>
</div>



<div class="wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex">
<div class="wp-block-column is-layout-flow wp-block-column-is-layout-flow" style="flex-basis:100%">
<p>挂载分区、设置开机自动挂载</p>



<p>对于Linux来说，挂载相当于给分区设置一个盘号（例如： C盘、D盘这种）。我们要先确定这个挂载的目录，我这1T的数据盘主要作用就是用来存放数据的，所以我给起名为”<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">data</mark>“，文件夹目录就放在根目录下。</p>



<pre class="wp-block-code"><code>cd /  #进入Linux根目录
mkdir data  #创建 data 文件夹
mount /dev/sdb1 /data  #将sdb1分区挂载为data文件夹</code></pre>



<p>如此便可以使用了，可以通过 <kbd>lsblk</kbd> 查看一下</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="329" height="126" src="https://photo.hishd.top/2025/06/20250601083540445.png" alt="" class="wp-image-347" style="width:400px;height:auto"/></figure>



<p>到这还没结束，由于目前的挂载只是临时挂载。我们需要把挂载写入到启动 <kbd>/etc/fstab</kbd> 中，这样子就可以实现自动了。</p>



<pre class="wp-block-code"><code>vi /etc/fstab  #编辑文件</code></pre>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="738" height="267" src="https://photo.hishd.top/2025/06/20250601084057966.png" alt="" class="wp-image-349" style="width:791px;height:auto"/></figure>



<p>在文件末尾添加一行类似于以下内容的挂载信息：<kbd>/dev/sdb1 /www ext4 defaults 0 0</kbd></p>



<p>第一列为磁盘分区路径，第二列为挂载目录，第三列为文件系统类型</p>



<p>后两列分别表示dump备份标志和fsck检查顺序，一般设置为0即可。</p>



<p>最后保存文件，重启系统</p>
</div>
</div>



<p>如此下来，每次系统启动都可以自动挂载磁盘分区了。</p>



<p>END</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/341/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Debian 无损扩展根目录</title>
		<link>https://www.hishd.top/archives/328</link>
					<comments>https://www.hishd.top/archives/328#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Thu, 29 May 2025 17:03:12 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=328</guid>

					<description><![CDATA[前几天，vps突发磁盘空间不足导致瘫痪，在购买了空间后发现需要自己手动增加系统空间所以就有了这篇文章。 LVM [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>前几天，vps突发磁盘空间不足导致瘫痪，在购买了空间后发现需要自己手动增加系统空间所以就有了这篇文章。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>LVM（Logical Volume Manager）是Linux下一种用于管理存储设备，它提供了对存储设备进行灵活管理的能力。LVM的主要原理和结构如下：</p>



<ol class="wp-block-list">
<li><strong>物理卷（Physical Volumes）</strong> ：物理卷是LVM中的最底层，它可以是硬盘驱动器的整个物理设备，也可以是分区。LVM会将这些物理卷抽象为逻辑卷组。</li>



<li><strong>逻辑卷组（Volume Group）</strong> ：逻辑卷组是由一个或多个物理卷组成的逻辑单元，它为逻辑卷的创建提供了基础。逻辑卷组内的物理卷可以是同一硬盘上的不同分区，也可以是不同硬盘上的分区。逻辑卷组可以动态地扩展和收缩。</li>



<li><strong>逻辑卷（Logical Volume）</strong> ：逻辑卷是在逻辑卷组上创建的，它相当于传统分区的替代品。逻辑卷可以像物理分区一样被格式化并挂载到文件系统上使用。逻辑卷的大小可以根据需要进行动态调整，而无需重新分区或格式化磁盘。</li>
</ol>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="820" height="703" src="https://photo.hishd.top/2025/05/20250529163343215.png" alt="" class="wp-image-329" style="width:490px;height:auto"/></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<pre class="wp-block-code"><code>lsblk</code></pre>



<p>输入命令获取系统磁盘分区情况，大致如下图。可以看到 /sdb 增加了5G空间并未使用</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="457" height="201" src="https://photo.hishd.top/2025/05/20250529163444306.png" alt="" class="wp-image-330"/></figure>



<ul class="wp-block-list">
<li>接下来进入根分区进行扩容</li>
</ul>



<pre class="wp-block-code"><code>fdisk /dev/sdb  #我这里扩容的是sdb，看清楚你需要扩容是哪个磁盘
</code></pre>



<ul class="wp-block-list">
<li>输入 “p” 打印sdb分区信息</li>
</ul>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="455" height="200" src="https://photo.hishd.top/2025/05/20250529164824794.png" alt="" class="wp-image-332" style="width:455px;height:auto"/></figure>



<ul class="wp-block-list">
<li>输入 “n” 创建新分区</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="667" height="171" src="https://photo.hishd.top/2025/05/20250529164918268.png" alt="" class="wp-image-333"/></figure>



<ul class="wp-block-list">
<li>输入 “t” 设置分区号和分区类型</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="387" height="95" src="https://photo.hishd.top/2025/05/20250529165105394.png" alt="" class="wp-image-334"/></figure>



<ul class="wp-block-list">
<li>最后输入 “w” 保存修改</li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="302" height="62" src="https://photo.hishd.top/2025/05/20250529165147432.png" alt="" class="wp-image-335"/></figure>



<p>接着输入 “q” 退出即可</p>



<ul class="wp-block-list">
<li>接着合并lvm分区</li>
</ul>



<pre class="wp-block-code"><code>pvcreate /dev/sdb2  #创建物理卷(确认你自己的盘号，如果重启过可能盘号会变)
vgextend debian-vg /dev/sdb2  #加入卷组(需使用vgdisplay查看VG Name)
lvextend -l +100%FREE /dev/debian-vg/root  #将空间全部划分到根分区
resize2fs /dev/debian-vg/root  #刷新文件系统</code></pre>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="394" height="39" src="https://photo.hishd.top/2025/05/20250529165718919.png" alt="" class="wp-image-336" style="width:495px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="833" height="80" src="https://photo.hishd.top/2025/05/20250529165747921.png" alt="" class="wp-image-337" style="width:840px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="588" height="93" src="https://photo.hishd.top/2025/05/20250529165806707.png" alt="" class="wp-image-338" style="width:620px;height:auto"/></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>至此lvm分区已经扩容合并一起了</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="460" height="232" src="https://photo.hishd.top/2025/05/20250529165854384.png" alt="" class="wp-image-339"/></figure>



<p>其中从操作中可以看出，我们并没有对原分区进行操作，仅仅是对多出来的空间划分一个新的分区再合并到lvm中，这种操作极具灵活性</p>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/328/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>BBR V3的安装和效果测试</title>
		<link>https://www.hishd.top/archives/279</link>
					<comments>https://www.hishd.top/archives/279#comments</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Wed, 10 Jan 2024 21:38:02 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[VPS测试]]></category>
		<category><![CDATA[BBR]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=279</guid>

					<description><![CDATA[前言：半年前偶然发现BBR出来V3的版本，经过了这一段时间的使用后突然想起来并没用做测试和记录。这次趁着新小鸡 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>前言：半年前偶然发现BBR出来V3的版本，经过了这一段时间的使用后突然想起来并没用做测试和记录。这次趁着新小鸡下水就重新测试了一下。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>目前能安装V3版本的内核貌似并不算多，一般都可能是用XanMod这个发行内核相较于其他版本内核的优缺点网上也是一大堆，我就贴一下<a href="https://xanmod.org/" data-type="link" data-id="https://xanmod.org/" target="_blank" rel="noreferrer noopener">XanMod官网</a>的介绍</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1075" height="998" src="https://photo.hishd.top/2024/01/20240110185324199.png" alt="" class="wp-image-280" style="width:745px;height:auto"/></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>下面是官方给的方法，当然你也可以使用其他人的一键脚本来安装</p>



<p>注册gpg密钥，添加存储库：</p>



<pre class="wp-block-code"><code>wget -qO - https://dl.xanmod.org/archive.key | sudo gpg --dearmor -o /usr/share/keyrings/xanmod-archive-keyring.gpg
echo 'deb &#91;signed-by=/usr/share/keyrings/xanmod-archive-keyring.gpg] http://deb.xanmod.org releases main' | sudo tee /etc/apt/sources.list.d/xanmod-release.list</code></pre>



<p>下载测试脚本：</p>



<pre class="wp-block-code"><code>sudo wget https://dl.xanmod.org/check_x86-64_psabi.sh
chmod +x check_x86-64_psabi.sh
./check_x86-64_psabi.sh</code></pre>



<p>根据提示的版本来安装对应的内核：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="284" height="35" src="https://photo.hishd.top/2024/01/20240110195950263.png" alt="" class="wp-image-285"/></figure>



<p>如我这vps的CPU是支持x86-64V3版本的</p>



<pre class="wp-block-code"><code>sudo apt update &amp;&amp; sudo apt install linux-xanmod-x64v3</code></pre>



<p>下面是官方提供的内核版本选择提示，最好还是根据脚本的结果来安装。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="993" height="435" src="https://photo.hishd.top/2024/01/20240110200239504.png" alt="" class="wp-image-286"/></figure>



<p>开启BBR：</p>



<pre class="wp-block-code"><code>cat > /etc/sysctl.conf &lt;&lt; EOF

net.core.default_qdisc=fq_pie

net.ipv4.tcp_congestion_control=bbr

EOF

sysctl -p</code></pre>



<p>最后重启vps</p>



<p>输入  modinfo tcp_bbr  来检查版本</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="654" height="458" src="https://photo.hishd.top/2024/01/20240110200640217.png" alt="" class="wp-image-288" style="width:512px;height:auto"/></figure>



<p>如何在运行 modinfo tcp_bbr 时看到 "modinfo: ERROR: Module tcp_bbr not found" 错误，这可能是因为 BBR 不再作为一个单独的内核模块存在，而是直接编译进内核了。无法单独查看信息。但已经是BBRv3了</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="307" height="51" src="https://photo.hishd.top/2024/01/20240110201246355.png" alt="" class="wp-image-289"/></figure>



<p>至此，BBRv3已经安装并启用了。下面是一些测试</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>由于我这VPS广州电信绕日本NTT了所以延迟高达200+，广州移动反而是直的。这恰好就当测试一下高延迟绕路和直的来做对比。</p>



<p>去程路由：</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="846" height="310" src="https://photo.hishd.top/2024/01/20240110201648361.png" alt="" class="wp-image-290" style="width:633px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1860" height="1152" src="https://photo.hishd.top/2024/01/20240110201917250.png" alt="" class="wp-image-291" style="width:595px;height:auto" srcset="https://photo.hishd.top/2024/01/20240110201917250.png 1860w, https://photo.hishd.top/2024/01/20240110201917250-1536x951.png 1536w" sizes="auto, (max-width: 1860px) 100vw, 1860px" /></figure>



<p>未开始BBR时的SS速度测试：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="444" height="48" src="https://photo.hishd.top/2024/01/20240110202242401.png" alt="" class="wp-image-297"/></figure>



<p>电信</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1238" height="331" src="https://photo.hishd.top/2024/01/20240110202039570.png" alt="" class="wp-image-292" style="width:699px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="628" height="400" src="https://photo.hishd.top/2024/01/20240110202046184.png" alt="" class="wp-image-293" style="width:539px;height:auto"/></figure>



<p>移动</p>



<figure class="wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex">
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="2496" height="718" data-id="294" src="https://photo.hishd.top/2024/01/20240110202135157.png" alt="" class="wp-image-294" srcset="https://photo.hishd.top/2024/01/20240110202135157.png 2496w, https://photo.hishd.top/2024/01/20240110202135157-1536x442.png 1536w, https://photo.hishd.top/2024/01/20240110202135157-2048x589.png 2048w" sizes="auto, (max-width: 2496px) 100vw, 2496px" /></figure>
</figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1268" height="838" src="https://photo.hishd.top/2024/01/20240110202147811.png" alt="" class="wp-image-296" style="width:521px;height:auto"/></figure>



<p>开启普通BBR时的SS速度测试</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="454" height="52" src="https://photo.hishd.top/2024/01/20240110202248621.png" alt="" class="wp-image-298"/></figure>



<p>电信</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1250" height="344" src="https://photo.hishd.top/2024/01/20240110202302705.png" alt="" class="wp-image-299" style="width:624px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="623" height="406" src="https://photo.hishd.top/2024/01/20240110202305786.png" alt="" class="wp-image-300" style="width:543px;height:auto"/></figure>



<p>移动</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="2484" height="706" src="https://photo.hishd.top/2024/01/20240110202319300.png" alt="" class="wp-image-301" style="width:599px;height:auto" srcset="https://photo.hishd.top/2024/01/20240110202319300.png 2484w, https://photo.hishd.top/2024/01/20240110202319300-1536x437.png 1536w, https://photo.hishd.top/2024/01/20240110202319300-2048x582.png 2048w" sizes="auto, (max-width: 2484px) 100vw, 2484px" /></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1278" height="832" src="https://photo.hishd.top/2024/01/20240110202322974.png" alt="" class="wp-image-302" style="width:584px;height:auto"/></figure>



<p>接着是安装了V3后的速度测试</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="440" height="53" src="https://photo.hishd.top/2024/01/20240110202355550.png" alt="" class="wp-image-303"/></figure>



<p>电信</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1236" height="325" src="https://photo.hishd.top/2024/01/20240110202408783.png" alt="" class="wp-image-304" style="width:606px;height:auto"/></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="621" height="393" src="https://photo.hishd.top/2024/01/20240110202414348.png" alt="" class="wp-image-305" style="width:560px;height:auto"/></figure>



<p>移动</p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="2476" height="688" src="https://photo.hishd.top/2024/01/20240110202425803.png" alt="" class="wp-image-306" style="width:569px;height:auto" srcset="https://photo.hishd.top/2024/01/20240110202425803.png 2476w, https://photo.hishd.top/2024/01/20240110202425803-1536x427.png 1536w, https://photo.hishd.top/2024/01/20240110202425803-2048x569.png 2048w" sizes="auto, (max-width: 2476px) 100vw, 2476px" /></figure>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" width="1292" height="838" src="https://photo.hishd.top/2024/01/20240110202430910.png" alt="" class="wp-image-307" style="width:518px;height:auto"/></figure>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/279/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu安装 云崽v3.0（Yunzai-Bot v3）</title>
		<link>https://www.hishd.top/archives/192</link>
					<comments>https://www.hishd.top/archives/192#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 22:57:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=192</guid>

					<description><![CDATA[云崽是一个原神qq群机器人，通过米游社接口，查询原神游戏信息并快速生成图片。 项目地址：GitHub / Gi [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>云崽是一个原神qq群机器人，通过米游社接口，查询原神游戏信息并快速生成图片。</p>



<p>项目地址：<a rel="noreferrer noopener" href="https://github.com/Le-niao/Yunzai-Bot" data-type="URL" data-id="https://github.com/Le-niao/Yunzai-Bot" target="_blank">GitHub</a> / <a rel="noreferrer noopener" href="https://gitee.com/Le-niao/Yunzai-Bot" data-type="URL" data-id="https://gitee.com/Le-niao/Yunzai-Bot" target="_blank">Gitee</a></p>



<p>前言：这个项目目前可以使用手机、windows以及linux搭建，这些搭建的服务器使用的是Ubuntu系统。Centos系统环境可以通过其他命令安装。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>环境准备： Windows or Linux，Node.js（<a href="http://nodejs.cn/download/" target="_blank" rel="noreferrer noopener">版本至少v16以上</a>），<a href="https://redis.io/docs/getting-started/installation/" target="_blank" rel="noreferrer noopener">Redis</a></p>
<cite>（以上引用自项目）</cite></blockquote>



<p>运行环境准备：</p>



<p>Node.js环境安装可以参考这里 <a href="https://www.hishd.top/archives/2023/196" data-type="URL" data-id="https://www.hishd.top/archives/2023/196" target="_blank" rel="noreferrer noopener">Ubuntu安装Node</a></p>



<p>安装Redis：</p>



<p>将存储库添加到apt索引，更新，然后安装：</p>



<pre class="wp-block-code"><code>curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb &#91;signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis</code></pre>



<p>接下里克隆项目：</p>



<p>国外机子使用GitHub</p>



<pre class="wp-block-code"><code>git clone --depth=1 -b main https://github.com/Le-niao/Yunzai-Bot.git
cd Yunzai-Bot #进入Yunzai目录</code></pre>



<p>国内机子使用Gitee</p>



<pre class="wp-block-code"><code>git clone --depth=1 -b main https://gitee.com/Le-niao/Yunzai-Bot.git
cd Yunzai-Bot #进入Yunzai目录</code></pre>



<p>安装pnpm（已安装的可以跳过）</p>



<pre class="wp-block-code"><code>npm install pnpm -g
</code></pre>



<p>通过pnpm安装依赖</p>



<pre class="wp-block-code"><code>pnpm install -P
</code></pre>



<p>运行（首次运行按提示输入登录）</p>



<pre class="wp-block-code"><code>node app
</code></pre>



<p></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/192/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu安装Node.js</title>
		<link>https://www.hishd.top/archives/196</link>
					<comments>https://www.hishd.top/archives/196#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Mon, 30 Jan 2023 21:52:35 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=196</guid>

					<description><![CDATA[Node.js 是一个跨平台的 JavaScript 运行环境，它构建在为了在服务器端运行 JavaScrip [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>Node.js 是一个跨平台的 JavaScript 运行环境，它构建在为了在服务器端运行 JavaScript 代码而设计的 Chrome JavaScript 上。它通常被用来构建后端应用，但是它也是非常流行的全栈和前端解决方案。npm 是 Node.js 的默认包管理工具，也是世界上最大的软件仓库。<br>这里将介绍，在 Ubuntu 上安装 Node.js 和 npm 三种不同的方式。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>第一种：从 Ubuntu 软件源安装 Node.js 和 npm</p>



<pre class="wp-block-code"><code>sudo apt update
sudo apt install nodejs npm</code></pre>



<p>上面的命令将会安装一系列包，包括编译和安装从 npm 来的本地扩展。<br>安装完成后运行下面的命令，验证安装</p>



<pre class="wp-block-code"><code>nodejs --version</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>第二种：从 NodeSource 中安装 Node.js 和 npm</strong></p>



<p>NodeSource 是一个公司，聚焦于提供企业级的 Node 支持。它维护了一个 APT 软件源，其中包含了很多 Node.js 版本。如果你的应用需要指定版本的Node.js 版本，使用这个软件源。</p>



<p><strong>项目地址</strong>：<a href="https://github.com/nodesource/distributions" data-type="URL" data-id="https://github.com/nodesource/distributions" target="_blank" rel="noreferrer noopener">GitHub</a></p>



<p><strong>使用Ubuntu</strong></p>



<pre class="wp-block-code"><code>curl -fsSL https://deb.nodesource.com/setup_<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">19</mark></strong>.x | sudo -E bash - &amp;&amp;\
sudo apt-get install -y nodejs</code></pre>



<p>如果需要安装其他版本的话，可以自行更换代码中红色的数字。如 setup_18.x  setup_16.x 等</p>



<p>nodejs 软件包同时包含node和npm二进制包。</p>



<p>可选：安装构建工具</p>



<p>要从 npm 编译和安装本机插件，您可能还需要安装构建工具：</p>



<p>在 Ubuntu 上使用sudo运行</p>



<pre class="wp-block-code"><code>apt-get install -y build-essential</code></pre>



<p><strong>验证安装：</strong></p>



<pre class="wp-block-code"><code>node --version
npm --version</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>第三种从 NVM 安装 Node.js 和 npm</strong></p>



<p>NVM (Node Version Manager) 是一个 Bash 脚本，它允许你为每一个用户管理多个 Node.js 版本。使用 NVM，你可以随时安装或者卸载任何你想要使用或者测试的 Node.js版本。</p>



<p><strong>项目地址：<a href="https://github.com/nvm-sh/nvm" data-type="URL" data-id="https://github.com/nvm-sh/nvm" target="_blank" rel="noreferrer noopener">GitHub</a></strong></p>



<p><strong>这里直接使用官方给出的脚本来安装</strong></p>



<pre class="wp-block-code"><code>curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash</code></pre>



<p>或</p>



<pre class="wp-block-code"><code>wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash</code></pre>



<p><strong>安装后关闭当前终端或者按提示复制配置直接运行，如下图所示</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="721" height="446" src="https://photo.hishd.top/2023/01/20230130213058632.png" alt="" class="wp-image-198"/></figure>



<p><strong>验证：</strong></p>



<pre class="wp-block-code"><code>nvm --version</code></pre>



<p><strong>列出当前可用的版本（如需要选择版本，安装最新版本的话可以跳过列出）</strong></p>



<pre class="wp-block-code"><code>nvm list-remote</code></pre>



<p><strong>安装最新可用的 Node.js</strong></p>



<pre class="wp-block-code"><code>nvm install node</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="972" height="199" src="https://photo.hishd.top/2023/01/20230130214351301.png" alt="" class="wp-image-199"/></figure>



<p><strong>验证当前安装的版本：</strong></p>



<pre class="wp-block-code"><code>node --version</code></pre>



<p>或者可以<strong>列出当前nvm的版本</strong></p>



<pre class="wp-block-code"><code>nvm ls</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>以上的三种方法各有各的优势和优点，可以自行选择不同的方式来安装node和npm。不过国内的机器访问GitHub可能会有点慢或者无法访问</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/196/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>国内服务器通过V2ray加速Github</title>
		<link>https://www.hishd.top/archives/75</link>
					<comments>https://www.hishd.top/archives/75#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Fri, 16 Dec 2022 19:13:24 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=75</guid>

					<description><![CDATA[最近遇到很尴尬的一个问题，国内的服务器在访问GitHub拉项目的时候经常等待连接等很久很久，而且速度只有可怜的 [&#8230;]]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>最近遇到很尴尬的一个问题，国内的服务器在访问GitHub拉项目的时候经常等待连接等很久很久，而且速度只有可怜的几十KB/s，既然v2ray有Linux客户端，那就用来做代理加速吧！</p>
</blockquote>



<ul class="wp-block-list">
<li>前提，你首先需要有”梯子“！</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>首先，把V2Ray的Linux客户端文件下载到服务器上</p>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained">
<pre class="wp-block-code"><code>wget https://github.com/v2fly/v2ray-core/releases/download/v5.1.0/v2ray-linux-64.zip #Linux-x86-64-v5.1.0
wget https://github.com/v2fly/v2ray-core/releases/download/v5.1.0/v2ray-linux-32.zip #Linux-x86-32-v5.1.0</code></pre>
</div></div>
</div></div>
</div></div>



<p>创建文件夹并使用unzip解压：</p>



<pre class="wp-block-code"><code>mkdir v2ray &amp; unzip -d v2ray v2ray-linux-64.zip #32位自行替换文件名</code></pre>



<p>获取v2ray的json配置文件</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="657" height="799" src="https://photo.hishd.top/2022/12/20221216182102579.png" alt="" class="wp-image-92"/></figure>



<p>把json配置文件上传到服务器上</p>



<p>测试配置文件是否有错误</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="531" height="108" src="https://photo.hishd.top/2022/12/20221216182430663.png" alt="" class="wp-image-93"/></figure>



<p>显示“Configuration OK”表示测试没有问题，接下来就运行v2ray</p>



<pre class="wp-block-code"><code>./v2ray run -c 配置文件名</code></pre>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="530" height="119" src="https://photo.hishd.top/2022/12/20221216183003849.png" alt="" class="wp-image-94"/></figure>



<p>没有提示报错的话，v2ray就已经在终端前台运行。如果终端连接断开的话，v2ray也会断开。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>设置代理：（只在当前终端生效）</p>



<pre class="wp-block-code"><code>export http_proxy="socks5://127.0.0.1:自定端口" #设置http通过socks5代理
export https_proxy="socks5://127.0.0.1:自定端口" #设置https通过socks5代理
export no_proxy="内网IP段" #设置本地地址不走代理</code></pre>



<p>除了可以使用socks5代理外，还可以使用http或http2来代理</p>



<p>通过curl命令来测试连通性</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1113" height="465" src="https://photo.hishd.top/2022/12/20221216190358236.png" alt="" class="wp-image-99"/></figure>



<p>查看当前代理：</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="281" height="65" src="https://photo.hishd.top/2022/12/20221216190637858.png" alt="" class="wp-image-100"/></figure>



<p> 取消当前代理：</p>



<pre class="wp-block-code"><code>unset http_proxy
unset https_proxy</code></pre>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">注意！！！</mark> 发现有一些脚本在使用代理后会提示“当前连接无法通过代理”，建议尝试使用其他连接方式</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/75/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Centos Yum提示No URLs in mirrorlist错误</title>
		<link>https://www.hishd.top/archives/48</link>
					<comments>https://www.hishd.top/archives/48#respond</comments>
		
		<dc:creator><![CDATA[DB.Russell]]></dc:creator>
		<pubDate>Wed, 16 Nov 2022 20:24:25 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[yum]]></category>
		<guid isPermaLink="false">https://www.hishd.top/?p=48</guid>

					<description><![CDATA[当yum时提示 “Failed to download metadata for repo 'appstrea [&#8230;]]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list">
<li>CentOS环境为 8.9 64bit</li>
</ul>



<p>当yum时提示 “Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist”</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://photo.hishd.top/20221117033416.png" alt=""/></figure>



<p>解决办法如下：</p>



<pre class="wp-block-code"><code>sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-Linux-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://www.hishd.top/archives/48/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
