<?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>未分类 &#8211; Simon</title>
	<atom:link href="https://www.luisimon.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.luisimon.com</link>
	<description>blog</description>
	<lastBuildDate>Fri, 22 Nov 2024 07:20:46 +0000</lastBuildDate>
	<language>zh-Hans</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>

<image>
	<url>https://www.luisimon.com/wp-content/uploads/2019/09/cbrks-x5t4i-001.ico</url>
	<title>未分类 &#8211; Simon</title>
	<link>https://www.luisimon.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>N型MOSFET电荷泵驱动电路</title>
		<link>https://www.luisimon.com/2024/11/09/923/</link>
		
		<dc:creator><![CDATA[Alan]]></dc:creator>
		<pubDate>Sat, 09 Nov 2024 15:03:14 +0000</pubDate>
				<category><![CDATA[电子电路]]></category>
		<category><![CDATA[MOSFETT]]></category>
		<category><![CDATA[T12]]></category>
		<category><![CDATA[电荷泵]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=923</guid>

					<description><![CDATA[前言：众所周知，MOSFET为“电压驱动”型器件，以N-MOS为例，VGS电压与RDS(on)成反比。即驱动N ... <a title="N型MOSFET电荷泵驱动电路" class="read-more" href="https://www.luisimon.com/2024/11/09/923/" aria-label="继续阅读N型MOSFET电荷泵驱动电路">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong>前言：众所周知，MOSFET为“电压驱动”型器件，以N-MOS为例，V<sub>GS</sub>电压与R<sub>DS(on)</sub>成反比。即驱动N-MOS时<strong>V<sub>GS</sub></strong>尽可能最大。</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="534" height="287" src="https://www.luisimon.com/wp-content/uploads/2024/10/ChargePump.jpg" alt="" class="wp-image-925" srcset="https://www.luisimon.com/wp-content/uploads/2024/10/ChargePump.jpg 534w, https://www.luisimon.com/wp-content/uploads/2024/10/ChargePump-300x161.jpg 300w" sizes="(max-width: 534px) 100vw, 534px" /><figcaption class="wp-element-caption">N-MOSFET &amp; Charge Pump（测试电路，电阻R13不是必须的）</figcaption></figure></div>


<p>首先讲清楚此电路的具体是用于控制T12烙铁，其中P+是接T12烙铁正极。</p>



<p>电荷泵组成器件分别是：D2、D3、C4，此三个器件构成的电荷泵可以使N沟道的MOS作为上管使用。</p>



<p>即是Q2导通，MOS关断时，电源通过D3、C4以及烙铁构成回路并在此时为C4充电至电源电压。在Q2关断时，MOS导通，由于MOS导通后电阻极小（T12烙铁≈8Ω），使得B点电压迅速抬升（接近电源电压），C4在此时发挥作用，由于C4负极在B点，C4电压满足MOS的V<sub>GS</sub>最小要求，向G极提供电流，MOS稳定导通。</p>



<p>解释：D3的作用使防止MOS导通时，C4通过MOS流回B点而放电。D2主要起到钳位作用保护MOS的G极（V<sub>GS</sub>最高耐压20V）。</p>



<p class="has-text-color has-link-color wp-elements-1a88632bc5a1b55ce5a7b6597637164a" style="color:#919ca5"><em>其他：A、B电压约为18V，A对地电压约为 电源电压+18V。</em></p>



<p><a href="https://www.luisimon.com/goto/litp" rel="nofollow" data-type="link" data-id="https://github.com/wagiminator/ATmega-Soldering-Station">T12项目参考自德国网友GitHub</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>购买打印机后的感受想告诉你的注意事项</title>
		<link>https://www.luisimon.com/2024/07/26/857/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Fri, 26 Jul 2024 14:01:46 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=857</guid>

					<description><![CDATA[打印机在大约十年前对于个人（家庭）来说还是个稀罕的东西。大家对打印机还是“办公室” “打印店”的印象。但随着今 ... <a title="购买打印机后的感受想告诉你的注意事项" class="read-more" href="https://www.luisimon.com/2024/07/26/857/" aria-label="继续阅读购买打印机后的感受想告诉你的注意事项">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>打印机在大约十年前对于个人（家庭）来说还是个稀罕的东西。大家对打印机还是“办公室” “打印店”的印象。但随着今年来个人家庭对打印需求的增加和打印机价格的降低，打印机逐渐走进个人家庭。</p>



<p class="has-medium-font-size"><strong>进纸</strong></p>



<p>前进纸纸张需要转一个弯，这意味着纸张会弯曲，某些也比较硬的时候可能会打印，也就是打印机的适用范围变窄了。</p>



<p class="has-medium-font-size"><strong>相片纸压痕</strong></p>



<p>相片纸打印时可能出现送纸机构齿轮的压印（不算特别明显，毕竟不是专业的相片打印机）。这个问题你可能需要在网上向网友咨询一下你的意向机器的情况，这可能跟相纸厚度方面也有关系。我个人的是佳能G3800墨仓打印机。不过其他品牌也可能有类似的问题。</p>



<p class="has-medium-font-size"><strong>无边距</strong></p>



<p>似乎只要支持A4（打印机最大支持尺寸）的无边距，那么这个范围下的其他尺寸理论上也可以支持，不过最好咨询一下客服。</p>



<p class="has-medium-font-size"><strong>耗材价格</strong></p>



<p>关于耗材，主要是说墨水。一般建议购买墨仓式的打印机，后期直接购买一瓶瓶的墨水这样成本比较低。个人还是建议使用原厂墨水。特别是还在保修期内的机器，因为如果你使用了第三方的墨水，厂家是能检测出来的，你的机器将会失去保修。</p>



<p class="has-medium-font-size"><strong>墨水防水性</strong></p>



<p>所谓防水，指的是打印出来的文档不会因为纸张沾了水导致字体化开和渗透到反面。一般来说，防水墨水属于颜料墨水，不防水的属于染料墨水。通常家用的入门机器是只有黑色墨水是防水的（相对价格而言感觉家用也是够的）。</p>



<p class="has-medium-font-size"><strong>打印速度</strong></p>



<p>通常喷墨打印机打印速度不如激光打印机，如果你打印需求不大，大部分机器的速度还是没有问题的。打印<strong>7寸</strong>照片通常需要50-60秒，普通文本因为不是满版所以速度通常1分钟有20张左右的速度。具体机器也有差异。</p>



<p class="has-medium-font-size"><strong>屏幕显示</strong></p>



<p>配备屏幕的机器通常比较贵，屏幕主要是方便直接操作。如果支持APP（手机）操作，那么可以忽视屏幕，省下钱来。</p>



<p class="has-medium-font-size"><strong>喷墨技术（微压电/热发泡）</strong></p>



<p><strong>微压电</strong>技术。这个是爱普生的专利技术，代表厂家有<strong>爱普生</strong>和<strong>兄弟</strong>。利用压电陶瓷的压电效应来挤压墨水</p>



<p><strong>热发泡</strong>技术。佳能公司的专利技术。代表厂家有<strong>佳能</strong>和<strong>惠普</strong>。技术实现，在喷头里设置加热体，浸泡在墨水，瞬间将周围的墨水加热到100°C，水汽膨胀将墨水喷射出去。</p>



<p>微压电，喷头价格相对较高（是热发泡2倍左右），使用寿命较长，爱普生宣称喷头不是耗材，无需更换，打印分辨率相比热发泡稍高。</p>



<p>热发泡，价格相对较低，堵头后维修或者更换方便，寿命相对微压电较短（从佳能保修政策猜测是30000张寿命）。</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>解决MSI微星主板开启WOL远程唤醒无效</title>
		<link>https://www.luisimon.com/2024/07/09/860/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Tue, 09 Jul 2024 04:31:11 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[BIOS]]></category>
		<category><![CDATA[MSI]]></category>
		<category><![CDATA[Wake On Lan]]></category>
		<category><![CDATA[WOL]]></category>
		<category><![CDATA[主板]]></category>
		<category><![CDATA[微星]]></category>
		<category><![CDATA[远程开机]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=860</guid>

					<description><![CDATA[今天升级了电脑的微星主板BIOS后发现在[唤醒事件设置]里启用了[PCIe设备唤醒]依然无效。 我找到原因了， ... <a title="解决MSI微星主板开启WOL远程唤醒无效" class="read-more" href="https://www.luisimon.com/2024/07/09/860/" aria-label="继续阅读解决MSI微星主板开启WOL远程唤醒无效">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>今天升级了电脑的微星主板BIOS后发现在<strong>[唤醒事件设置]</strong>里启用了<strong>[PCIe设备唤醒]</strong>依然无效。</p>



<p>我找到原因了，下面来讲一下。</p>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">关键是在于<strong>开启【PCIE设备唤醒】</strong>和<strong>关闭【ErP Ready】</strong></mark></p>



<ul class="wp-block-list">
<li>开机后一直按<strong>[Del]</strong>键进入BIOS，如下图，找到 <strong>[SETTINGS]</strong> -> <strong>[高级]</strong></li>
</ul>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="768" src="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_00.jpg" alt="" class="wp-image-867" srcset="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_00.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_00-300x225.jpg 300w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_00-768x576.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list">
<li>进入 <strong>[唤醒事件设置]</strong></li>
</ul>



<ol class="wp-block-list"></ol>



<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 decoding="async" width="1024" height="768" data-id="868" src="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_01.jpg" alt="" class="wp-image-868" srcset="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_01.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_01-300x225.jpg 300w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_01-768x576.jpg 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>
</figure>



<ul class="wp-block-list">
<li>选择<strong> [PCIE设备唤醒]</strong> -> <strong>[允许]</strong></li>
</ul>



<p><strong>为什么是PCIE设备呢？</strong>因为WOL远程唤醒是通过板载<strong>以太网卡</strong>来实现的，网卡虽然不是直接插在PCIE插槽上，但实际上线路使用的是PCIE的通道。所以<strong>网卡属于PCIE设备</strong></p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_03.jpg" alt="" class="wp-image-869" srcset="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_03.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_03-300x225.jpg 300w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_03-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list">
<li>返回 <strong>[高级]</strong> 菜单，选择 <strong>[电源管理设置]</strong></li>
</ul>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_04.jpg" alt="" class="wp-image-870" srcset="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_04.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_04-300x225.jpg 300w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_04-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list">
<li>选择 <strong>[ErP Ready] </strong>-> <strong>[禁止]</strong></li>
</ul>



<p>我猜测是禁止了节能模式，网卡在关机后才能正常供电。</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="1024" height="768" src="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_06.jpg" alt="" class="wp-image-871" srcset="https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_06.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_06-300x225.jpg 300w, https://www.luisimon.com/wp-content/uploads/2024/07/MSI_SnapShot_06-768x576.jpg 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list">
<li>最后 <strong>[保存并退出]</strong> 设置，或者直接按 <strong>[F10]</strong> 保存</li>
</ul>



<p><strong>测试远程开机成功！</strong></p>



<p><em>后记</em></p>



<p><em>你的主板界面上有所区别，不过基本就是按照这个菜单模式，可以自己找一找。</em></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>使用Shadowsocks+v2aryPlug+CDN搭建代理服务器，Cloudflare复活梯子</title>
		<link>https://www.luisimon.com/2024/06/30/835/</link>
		
		<dc:creator><![CDATA[Alan]]></dc:creator>
		<pubDate>Sun, 30 Jun 2024 08:34:35 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[cloudflare]]></category>
		<category><![CDATA[ss]]></category>
		<category><![CDATA[v2ary]]></category>
		<category><![CDATA[VPS]]></category>
		<guid isPermaLink="false">https://www.luisimon.com/?p=835</guid>

					<description><![CDATA[前言：翻墙（梯子）VPS被墙复活，隐藏自己的VPS，优化速度慢便宜VPS的线路速度。 前期准备工作： 1、域名 ... <a title="使用Shadowsocks+v2aryPlug+CDN搭建代理服务器，Cloudflare复活梯子" class="read-more" href="https://www.luisimon.com/2024/06/30/835/" aria-label="继续阅读使用Shadowsocks+v2aryPlug+CDN搭建代理服务器，Cloudflare复活梯子">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>前言：翻墙（梯子）VPS被墙复活，隐藏自己的VPS，优化速度慢便宜VPS的线路速度。</p>



<p><strong>前期准备工作：</strong></p>



<p>1、域名、海外虚拟主机（VPS 云主机）<em>注意：两者均需要花钱</em></p>



<p>2、准备账号：Cloudflare+海外vps销售商网站账号(用于购买)+godaddy(个人推荐)</p>



<p><strong>注意事项：</strong></p>



<p>域名：选购域名原则有三个。①不要在境内购买 ②不要选购cn这类需要备案的顶级域名 ③挑顶级域名购买即可。</p>



<p>VPS：对于主机，这里只提供选购建议。首先主要需要是海外的，这些地区访问互联网不受限制，通常建议购买机房在美国（美国对东半球光纤出口主要在洛杉矶），如果其他地区有线路优化，也可以选港、台、日以及新加坡等地区。这里要注意，别购买国内商家（例如：阿里云 腾讯云）的海外机房，相信不言自知。<em><strong>这里直接选美国机房即可。</strong></em></p>



<p><strong>看到这里，如果你有预算，想好了，就可以去把上面的所有东西准备好，再回来部署你的机器了</strong></p>



<p class="has-text-align-center"><strong>回见</strong></p>



<h2 class="wp-block-heading"><strong>域名配置与证书获取</strong></h2>



<p>流程简述：①我们先要登录CloudFlare，添加域名并获取CloudFlare的域名服务器地址 ②到购买的域名服务商那里把你的域名服务器地址改为刚刚从CloudFlare获得的地址 ③到CloudFlare获取SSL证书</p>



<p><strong>添加域名并获取CloudFlare域名服务器地址</strong></p>



<p>我们先登录你的CloudFlare账号，然后添加你刚刚购买的域名。添加成功后，单击你的域名，点选下方图①的“DNS”功能，这时你可以看到你的域名所有解析记录的一个列表，在列表的下方，找到图②的Cloudflare nameservers，把红框中的两个地址复制下来。</p>



<figure class="wp-block-image size-large is-resized"><img loading="lazy" decoding="async" width="1024" height="121" src="https://www.luisimon.com/wp-content/uploads/2020/04/cficon-1024x121.jpg" alt="" class="wp-image-277" style="width:715px;height:84px" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/cficon-1024x121.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2020/04/cficon-300x35.jpg 300w, https://www.luisimon.com/wp-content/uploads/2020/04/cficon-768x91.jpg 768w, https://www.luisimon.com/wp-content/uploads/2020/04/cficon.jpg 1041w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">图① CloudFlare功能列表</figcaption></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="285" src="https://www.luisimon.com/wp-content/uploads/2020/04/ns-1024x285.jpg" alt="" class="wp-image-279" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/ns-1024x285.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2020/04/ns-300x84.jpg 300w, https://www.luisimon.com/wp-content/uploads/2020/04/ns-768x214.jpg 768w, https://www.luisimon.com/wp-content/uploads/2020/04/ns.jpg 1031w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption">图② CloudFlare域名服务器地址</figcaption></figure>



<p><strong>设置新域名服务器地址</strong></p>



<p>到刚刚购买域名的域名商的网站上，找到“DNS管理”，并且设置成上面CloudFlare的域名服务器地址，以使CloudFlare接管域名解析的权限。下面以godaddy为例：单击我们的账户名，点击“我的产品（My Product）”，这时会列出你账户下所有的域名，在你对应域名的后面，如图③，单击“DNS”，这是会看到这个域名的所有解析记录，在其下方即是“ 域名服务器 ”，单击更改，并填入CloudFlare的域名服务器地址保存即可。</p>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="360" height="425" src="https://www.luisimon.com/wp-content/uploads/2020/04/微信截图_20200406222310.jpg" alt="" class="wp-image-280" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/微信截图_20200406222310.jpg 360w, https://www.luisimon.com/wp-content/uploads/2020/04/微信截图_20200406222310-254x300.jpg 254w" sizes="auto, (max-width: 360px) 100vw, 360px" /><figcaption class="wp-element-caption">图③ 设置域名服务器</figcaption></figure></div>


<p><strong>获取CloudFlare的免费证书</strong></p>



<p>在获取证书之前，我们先来完成一下其他设置。先在“DNS”下，把图标点亮，启用对应记录的CDN加速，以及在“SSL/TLS”下设置加密模式为“Full”，如下两张图片</p>


<div class="wp-block-image is-resized">
<figure class="aligncenter"><img loading="lazy" decoding="async" width="302" height="43" src="https://www.luisimon.com/wp-content/uploads/2020/04/无标题.jpg" alt="" class="wp-image-281" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/无标题.jpg 302w, https://www.luisimon.com/wp-content/uploads/2020/04/无标题-300x43.jpg 300w" sizes="auto, (max-width: 302px) 100vw, 302px" /><figcaption class="wp-element-caption">图④ 启用CDN</figcaption></figure></div>

<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="669" src="https://www.luisimon.com/wp-content/uploads/2020/04/20200406222956-1024x669.jpg" alt="" class="wp-image-282" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/20200406222956-1024x669.jpg 1024w, https://www.luisimon.com/wp-content/uploads/2020/04/20200406222956-300x196.jpg 300w, https://www.luisimon.com/wp-content/uploads/2020/04/20200406222956-768x502.jpg 768w, https://www.luisimon.com/wp-content/uploads/2020/04/20200406222956.jpg 1049w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption class="wp-element-caption"> 图⑤ SSL/TLS模式 </figcaption></figure></div>


<p>完成以上，我们正式进行证书的生成，还是在“SSL/TLS”下，点击“Origin Server”，单击蓝色按钮进行证书的生成，在第一步我们只需把底部的有效期改为“1 year”即可（更改是为安全起见，不改亦可），下一步，这时我们可以看到CloudFlare给我生成证书的公钥和私钥了，我们把这“Origin Certificate（公钥）”和“Private Key（私钥）”两个文本框中的文本复制下来，并分别保存成“公钥.txt”和“私钥.txt”两个文件。</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1022" height="434" src="https://www.luisimon.com/wp-content/uploads/2020/04/20200406223031.png" alt="" class="wp-image-287" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/20200406223031.png 1022w, https://www.luisimon.com/wp-content/uploads/2020/04/20200406223031-300x127.png 300w, https://www.luisimon.com/wp-content/uploads/2020/04/20200406223031-768x326.png 768w" sizes="auto, (max-width: 1022px) 100vw, 1022px" /><figcaption class="wp-element-caption">图⑥ 证书生成</figcaption></figure>



<h2 class="wp-block-heading"><strong>VPS部署：</strong></h2>



<pre class="wp-block-verse"><em><strong>首先声明，以下所有创建和下载的文件我们都将存放在 “/root”目录下<br>查看当前所处目录命令：pwd<br>转到root目录命令：cd /root</strong></em></pre>



<p>机器最低硬件要求</p>



<ul class="wp-block-list">
<li>CPU：单核</li>



<li>内存：512 MB</li>



<li>硬盘：20GB</li>



<li>流量：300GB</li>
</ul>



<p>内存是必须保证的，否则你的代理服务容易被系统结束，导致频繁登录主机启动代理服务。</p>



<p>购买VPS时，在选好对应配置后，一般还会让你选择主机将要安装的操作系统以及机房位置（根据不同商家，有些可能在套餐中就指定了机房位置）。这里推荐安装CentOS7及以上版本的Linux，机房则是选择美国即可，优选洛杉矶。</p>



<p>在选购完成后，需要一小段时间等待系统初始化VPS。请在初始化完成后，在VPS管理界面获取root密码以及ip地址。具体如何获取，每个VPS商家的管理界面设计不同，请你细心寻找。</p>



<p><strong>登录VPS</strong></p>



<p>在拿到这些资料后，你需要准备一个SSH远程连接工具（<a rel="noreferrer noopener" aria-label="PuTTY（在新窗口打开）" href="https://www.luisimon.com/goto/1ei1" rel="nofollow" target="_blank">PuTTY</a>），当然如果你是Windows10用户，那你可以使用快捷键（Win+X）单击“Windows PowerShell”，打开后输入命令（注意需要英文字符）：ssh root@[你VPS的IP地址]，然后键入回车，接下来你需要输入“yes”，确认使用来自VPS的公钥。再然后输入刚才从管理界面获得root密码即可， 在Windows PowerShell中，鼠标右键为粘贴文本，注意这里输入密码是不会在显示任何东西出来，但是确实是输入了，输入完成后，键入回车即可，如果你的密码正确，此时就已经登录远程VPS了。<a rel="noreferrer noopener" aria-label="通过PuTTY登录VPS教程（在新窗口打开）" href="https://www.luisimon.com/goto/fi1p" rel="nofollow" target="_blank">通过PuTTY登录VPS教程</a></p>



<pre class="wp-block-code"><code>ssh root@192.168.1.111</code></pre>



<p><strong>检查VPS</strong></p>



<p>登录vps后，分别输入 “wget”，“ vim”，“tar”并回车，如果均没有出现类似“-bash: wget: command not found ”即可直接跳到<strong>服务程序安装</strong>。否则我们就要安装对应的功能。</p>



<p>wget 用于下载web上的文件，安装命令如下：</p>



<pre class="wp-block-code"><code>yum install wget -y</code></pre>



<p>vim 用于编辑文本 ，安装命令如下： </p>



<pre class="wp-block-code"><code>yum install vim -y</code></pre>



<p> tar 用于解压压缩包 ，安装命令如下： </p>



<pre class="wp-block-code"><code>yum install tar -y</code></pre>



<p><strong>下载代理服务程序</strong></p>



<p>shadowsocks：我们通过在GitHub上提供的<a rel="noreferrer noopener" aria-label="（在新窗口打开）" href="https://www.luisimon.com/goto/nf3e" rel="nofollow" target="_blank">一</a><a rel="noreferrer noopener" aria-label="键安装脚本（在新窗口打开）" href="https://www.luisimon.com/goto/85xd" rel="nofollow" target="_blank">键安装脚本</a>进行安装。 <a rel="noreferrer noopener" aria-label="项目地址（在新窗口打开）" href="https://www.luisimon.com/goto/nf3e" rel="nofollow" target="_blank">项目地址</a></p>



<p>v2aryPlug插件：<a rel="noreferrer noopener" aria-label=" 服务端插件（在新窗口打开）" href="https://www.luisimon.com/goto/s4x7" rel="nofollow" target="_blank">服务端插件</a>。 <a rel="noreferrer noopener" href="https://www.luisimon.com/goto/uc6z" rel="nofollow" target="_blank">项目地址</a>  </p>



<p>首先我们在命令行输入<strong><em>pwd</em></strong>命令，查看是否在root目录下。如果是，那在下一行应该显示 /root，否则我们应该输入以下命令：</p>



<pre class="wp-block-code"><code>cd /root/</code></pre>



<p>我们通过<em><strong>wget</strong></em>命令把上面的“一件安装脚本”和“服务端插件”下载到VPS。</p>



<p>下载命令格式：wget [文件网络地址]  </p>



<p>执行权限设置命令格式：chmod a+x [文件路径]</p>



<p>解压文件命令格式：tar -zxvf [文件路径]</p>



<p>直接复制下面两行命令到命令行窗口执行（如果下面地址失效，请到上面项目地址找对应文件）</p>



<pre class="wp-block-code"><code>wget -O shadowsocks-all.sh https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh &amp;&amp; chmod a+x shadowsocks-all.sh</code></pre>



<pre class="wp-block-code"><code>wget https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.0/v2ray-plugin-linux-amd64-v1.3.0.tar.gz &amp;&amp; tar -zxvf v2ray-plugin-linux-amd64-v1.3.0.tar.gz</code></pre>



<p><strong>安装代理服务</strong></p>



<p>执行一下命令进行安装，在安装过程中我们全程敲击回车键即可。（因为在安装前的所有配置都不是我们需要的）</p>



<pre class="wp-block-code"><code>./shadowsocks-all.sh</code></pre>



<p><strong>代理服务运行与维护</strong></p>



<p>前面，我们已经在CloudFlare上生成了证书并且保存了下来。把生成的证书分别复制到VPS中，如果会使用FTP工具，可以直接在本地重命名，再使用FTP工具传到VPS中，但由于每个人电脑环境不同，保存的文件格式不一定能在Linux上正确识别，所以下面我们通过复制文本，并在VPS上创建公私钥文件，请不要担心这会很复杂，下面是文件名称：</p>



<pre class="wp-block-verse">公钥文件名称：full_chain.pem<br>私钥文件名称：private.key</pre>



<div class="wp-block-group"><div class="wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow">
<p>公钥文件创建：先在本地全选复制“公钥.txt”里面的所有文本数据，执行一下命令后，按键盘上的“i”键，在命令行底部会出现“&#8211; INSERT &#8211;”字样，表示当前是插入模式，此时我们把复制好的公钥文本数据粘贴到这里，在按键盘上的“Esc”退出编辑模式，此时命令行下方出现一个“:”，在冒号后面输入“wq”并回车，我们就完成公钥文件的创建了。</p>



<p> 私钥文件创建： 依此，用同样办法创建私钥文件。</p>



<pre class="wp-block-code"><code>vim full_chain.pem
vim private.key</code></pre>
</div></div>



<p>为了方便使用，接下来我们创建启动脚本“runSs.sh”，以及添加脚本到开机执行。</p>



<pre class="wp-block-code"><code>vim runSs.sh</code></pre>



<p>添加下方命令到“runSs.sh”中</p>



<pre class="wp-block-code"><code>#!/bin/bash
nohup ss-server -k &#91;替换为你的密码] -p 443 -m aes-256-gcm --plugin /root/v2ray-plugin_linux_amd64 --plugin-opts "server;tls;host=&#91;替换为你的域名];cert=/root/full_chain.pem;key=/root/private.key;loglevel=none" &gt; /dev/null 2&gt;&amp;1 &amp;</code></pre>



<p>执行下面命令（设置运行脚本权限，添加开机启动，开启防火墙端口(CentOS7)）</p>



<pre class="wp-block-code"><code>chmod a+x runSs.sh
echo ./root/runSs.sh &gt;&gt; /etc/rc.d/rc.local
chmod a+x /etc/rc.d/rc.local
firewall-cmd --zone=public --add-port=443/tcp --permanent
firewall-cmd --reload</code></pre>



<p>至此服务器已经配置完成！</p>



<h2 class="wp-block-heading"><strong>客户端配置</strong></h2>



<p><strong>客户端程序下载</strong></p>



<p>shadowsocks地址：<a rel="noreferrer noopener" aria-label="客户端程序（在新窗口打开）" href="https://www.luisimon.com/goto/nodo" rel="nofollow" target="_blank">客户端程序</a>。<a rel="noreferrer noopener" aria-label="项目地址（在新窗口打开）" href="https://www.luisimon.com/goto/owlu" rel="nofollow" target="_blank">项目地址</a></p>



<p>v2ray插件地址：<a rel="noreferrer noopener" aria-label="插件（在新窗口打开）" href="https://www.luisimon.com/goto/j5it" rel="nofollow" target="_blank">插件</a>。<a href="https://www.luisimon.com/goto/tsog" target="_blank" rel="nofollow noreferrer noopener" aria-label="项目地址（在新窗口打开）">项目地址</a></p>



<p><strong>客户端配置</strong></p>



<p>把v2ray插件解压到Shadowsocks目录下 。</p>



<p>如图⑦，根据在VPS中的“runSs.sh”启动文件配置，填写好客户端的配置。</p>



<ul class="wp-block-list">
<li>服务器地址：填写在CloudFlare开启了CDN的那个完整域名</li>



<li>服务器端口：默认443，使用CDN时候必须是443</li>



<li>密码：查看“runSs.sh”-k 后面的即是需要填写的密码</li>



<li>加密：查看“runSs.sh”-m后面的 即是需要选择的密加密算法</li>



<li>插件程序：复制插件文件名（不包含后缀名）粘贴到这里</li>



<li>插件选项：tls;host=[替换为你的域名]，注意这里的host必须和服务器配置的一致，否则无法通讯</li>
</ul>


<div class="wp-block-image">
<figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="257" height="329" src="https://www.luisimon.com/wp-content/uploads/2020/04/20200407061359.jpg" alt="" class="wp-image-303" srcset="https://www.luisimon.com/wp-content/uploads/2020/04/20200407061359.jpg 257w, https://www.luisimon.com/wp-content/uploads/2020/04/20200407061359-234x300.jpg 234w" sizes="auto, (max-width: 257px) 100vw, 257px" /><figcaption class="wp-element-caption">图⑦ 客户端配置</figcaption></figure></div>


<p>至此客户端也配置完成，最后在任务栏中找到shadowsocks图标，查看是否为灰色，如果是灰色，则右键在“系统代理”一栏中选择“PAC模式”。</p>



<p><strong>火狐浏览器配置</strong></p>



<p>在点击浏览器右上角菜单按钮打开“选项”，在“常规”的最底部的“网络设置”中单击“设置”，选择“使用系统代理设置”。</p>



<p><strong>完成</strong></p>



<p>至此所有工作完成，现在可以自由地连接互联网了。Flower</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Linux磁盘分区格式化挂载（教程）</title>
		<link>https://www.luisimon.com/2022/11/13/620/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sun, 13 Nov 2022 01:30:18 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=620</guid>

					<description><![CDATA[parted /dev/sdb 可以输入p打印磁盘信息，查看分区的情况，找到起始和结束位置。 /dev/sdb ... <a title="Linux磁盘分区格式化挂载（教程）" class="read-more" href="https://www.luisimon.com/2022/11/13/620/" aria-label="继续阅读Linux磁盘分区格式化挂载（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<pre class="wp-block-preformatted"><strong>parted /dev/sdb</strong>
可以输入p打印磁盘信息，查看分区的情况，找到起始和结束位置。
<strong>/dev/sdb</strong>是你的磁盘

<strong>mklabel gpt
</strong>设置分区类型为gpt

<strong>mkpart primary 0% 100%
</strong>primary指分区类型为主分区，0是分区开始位置，100%是分区结束位置。相同的命令为：mkpart primary 0 -1 或者是：mkpart  primary 0  XXX 结束的空间

<strong>print</strong>
打印当前分区,查看分区设置是否正确
　　
<strong>quit</strong>
退出
　　
<strong>mkfs.xfs /dev/sdb1
</strong>格式化成xfs文件系统<strong> </strong>

如果要格式化成ext4则是
<strong>mkfs -t ext4 /dev/sdb1</strong>

<strong>mount /dev/sdb1 /data
</strong>挂载分区
/data是指/dev/sdb1分区要挂载的目录

<strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-luminous-vivid-orange-color">配置开机自动挂载：</mark></strong>

<strong>blkid</strong>
查看磁盘分区的UUID
显示类似的信息

<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-purple-color">/dev/sda1: UUID="8048997a-16c9-447b-a209-82e4d380326e" TYPE="ext4"
/dev/sda5: UUID="0c5f073a-ad3f-414f-85c2-4af83f6a437f" TYPE="swap"
/dev/sdb1: UUID="11263962-9715-473f-9421-0b604e895aaa" TYPE="ext4"
/dev/sr0: LABEL="Join Me" TYPE="iso9660"</mark>

 <strong>vim /etc/fstab</strong>
编辑/etc/fstab，在其中加入

<mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-purple-color">UUID=11263962-9715-473f-9421-0b604e895aaa /data ext4 defaults 0 1</mark>

&lt;fs spec> &lt;fs file> &lt;fs vfstype> &lt;fs mntops> &lt;fs freq> &lt;fs passno>
具体说明，以挂载/dev/sdb1为例：

<strong>&lt;fs spec>：分区定位，可以给UUID或LABEL，例如：UUID=6E9ADAC29ADA85CD或LABEL=software
&lt;fs file>：具体挂载点的位置，例如：/data
&lt;fs vfstype>：挂载磁盘类型，linux分区一般为ext4，windows分区一般为ntfs
&lt;fs mntops>：挂载参数，一般为defaults
&lt;fs freq>：磁盘检查，默认为0
&lt;fs passno>：磁盘检查，默认为0，不需要检查</strong>


修改完/etc/fstab文件后，运行以下命令检查配置是否正确，否则系统无法正常启动
<strong>sudo mount -a</strong></pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Demo</title>
		<link>https://www.luisimon.com/2021/05/21/524/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Fri, 21 May 2021 02:11:12 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=524</guid>

					<description><![CDATA[温馨提示:以下只是案例展示 , 不会派发任何&#8221;中奖&#8221;礼品 环游大西洋可口可乐告白201 ... <a title="Demo" class="read-more" href="https://www.luisimon.com/2021/05/21/524/" aria-label="继续阅读Demo">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong>温馨提示:以下只是案例展示 , 不会派发任何&#8221;中奖&#8221;礼品</strong></p>



<p><a href="https://www.luisimon.com/goto/pebr" target="_blank" rel="nofollow noreferrer noopener">环游大西洋</a><br><a href="https://q.luisimon.com/demo/CocaCola/Views/Index/
"></a><a href="https://www.luisimon.com/goto/sgfd" target="_blank" rel="nofollow noreferrer noopener">可口可乐</a><br><a href="https://www.luisimon.com/goto/sczw" target="_blank" rel="nofollow noreferrer noopener">告白2018<br></a><a href="https://www.luisimon.com/goto/hif0" target="_blank" rel="nofollow noreferrer noopener">廉政公署新年贺卡</a><br><a href="https://www.luisimon.com/goto/d41q" target="_blank" rel="nofollow noreferrer noopener">廉政公署-齐来识别<br></a><a href="https://www.luisimon.com/goto/wzzu" target="_blank" rel="nofollow noreferrer noopener">南航签到领福利</a><br><a href="https://www.luisimon.com/goto/3sp8" target="_blank" rel="nofollow noreferrer noopener">多图读懂港口岸电<br></a><a href="https://www.luisimon.com/goto/o3i1" target="_blank" rel="nofollow noreferrer noopener">猴运送给你</a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>Oreo&#038;Chelsea</title>
		<link>https://www.luisimon.com/2021/02/28/440/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sun, 28 Feb 2021 13:58:42 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[加菲猫]]></category>
		<category><![CDATA[宠物猫]]></category>
		<category><![CDATA[猫猫]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=440</guid>

					<description><![CDATA[]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://www.luisimon.com/wp-content/uploads/2022/12/image-1024x1024.png" alt="" class="wp-image-642" srcset="https://www.luisimon.com/wp-content/uploads/2022/12/image-1024x1024.png 1024w, https://www.luisimon.com/wp-content/uploads/2022/12/image-300x300.png 300w, https://www.luisimon.com/wp-content/uploads/2022/12/image-150x150.png 150w, https://www.luisimon.com/wp-content/uploads/2022/12/image-768x768.png 768w, https://www.luisimon.com/wp-content/uploads/2022/12/image.png 1440w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://www.luisimon.com/wp-content/uploads/2022/12/image-6-1024x1024.png" alt="" class="wp-image-649" srcset="https://www.luisimon.com/wp-content/uploads/2022/12/image-6-1024x1024.png 1024w, https://www.luisimon.com/wp-content/uploads/2022/12/image-6-300x300.png 300w, https://www.luisimon.com/wp-content/uploads/2022/12/image-6-150x150.png 150w, https://www.luisimon.com/wp-content/uploads/2022/12/image-6-768x768.png 768w, https://www.luisimon.com/wp-content/uploads/2022/12/image-6.png 1440w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://www.luisimon.com/wp-content/uploads/2022/12/image-3-1024x1024.png" alt="" class="wp-image-645" srcset="https://www.luisimon.com/wp-content/uploads/2022/12/image-3-1024x1024.png 1024w, https://www.luisimon.com/wp-content/uploads/2022/12/image-3-300x300.png 300w, https://www.luisimon.com/wp-content/uploads/2022/12/image-3-150x150.png 150w, https://www.luisimon.com/wp-content/uploads/2022/12/image-3-768x768.png 768w, https://www.luisimon.com/wp-content/uploads/2022/12/image-3.png 1440w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://www.luisimon.com/wp-content/uploads/2022/12/image-4-1024x1024.png" alt="" class="wp-image-646" srcset="https://www.luisimon.com/wp-content/uploads/2022/12/image-4-1024x1024.png 1024w, https://www.luisimon.com/wp-content/uploads/2022/12/image-4-300x300.png 300w, https://www.luisimon.com/wp-content/uploads/2022/12/image-4-150x150.png 150w, https://www.luisimon.com/wp-content/uploads/2022/12/image-4-768x768.png 768w, https://www.luisimon.com/wp-content/uploads/2022/12/image-4.png 1440w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="1024" src="https://www.luisimon.com/wp-content/uploads/2022/12/image-5-1024x1024.png" alt="" class="wp-image-647" srcset="https://www.luisimon.com/wp-content/uploads/2022/12/image-5-1024x1024.png 1024w, https://www.luisimon.com/wp-content/uploads/2022/12/image-5-300x300.png 300w, https://www.luisimon.com/wp-content/uploads/2022/12/image-5-150x150.png 150w, https://www.luisimon.com/wp-content/uploads/2022/12/image-5-768x768.png 768w, https://www.luisimon.com/wp-content/uploads/2022/12/image-5.png 1440w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CIDR，子网掩码和可用IP地址快速参考指南（备忘单）</title>
		<link>https://www.luisimon.com/2020/12/13/386/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sun, 13 Dec 2020 12:17:42 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=386</guid>

					<description><![CDATA[A quick reference Subnet and CIDR guide. What’s a /28?  ... <a title="CIDR，子网掩码和可用IP地址快速参考指南（备忘单）" class="read-more" href="https://www.luisimon.com/2020/12/13/386/" aria-label="继续阅读CIDR，子网掩码和可用IP地址快速参考指南（备忘单）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p>A quick reference Subnet and CIDR guide.</p>



<p>What’s a /28?  How many IPs do I get to use with a /26?  Well, see the table below!<br>Usable IPs is the Total IPs minus the Network and Broadcast IPs.</p>



<figure class="wp-block-table"><table class=""><thead><tr><td><strong>CIDR</strong></td><td><strong>Subnet Mask</strong></td><td><strong>Total IPs</strong></td><td><strong>Usable IPs</strong></td></tr></thead><tbody><tr><td>/32</td><td>255.255.255.255</td><td>1</td><td>1</td></tr><tr><td>/31</td><td>255.255.255.254</td><td>2</td><td>0</td></tr><tr><td>/30</td><td>255.255.255.252</td><td>4</td><td>2</td></tr><tr><td>/29</td><td>255.255.255.248</td><td>8</td><td>6</td></tr><tr><td>/28</td><td>255.255.255.240</td><td>16</td><td>14</td></tr><tr><td>/27</td><td>255.255.255.224</td><td>32</td><td>30</td></tr><tr><td>/26</td><td>255.255.255.192</td><td>64</td><td>62</td></tr><tr><td>/25</td><td>255.255.255.128</td><td>128</td><td>126</td></tr><tr><td>/24</td><td>255.255.255.0</td><td>256</td><td>254</td></tr><tr><td>/23</td><td>255.255.254.0</td><td>512</td><td>510</td></tr><tr><td>/22</td><td>255.255.252.0</td><td>1024</td><td>1022</td></tr><tr><td>/21</td><td>255.255.248.0</td><td>2048</td><td>2046</td></tr><tr><td>/20</td><td>255.255.240.0</td><td>4096</td><td>4094</td></tr><tr><td>/19</td><td>255.255.224.0</td><td>8192</td><td>8190</td></tr><tr><td>/18</td><td>255.255.192.0</td><td>16,384</td><td>16,382</td></tr><tr><td>/17</td><td>255.255.128.0</td><td>32,768</td><td>32,766</td></tr><tr><td>/16</td><td>255.255.0.0</td><td>65,536</td><td>65,534</td></tr><tr><td>/15</td><td>255.254.0.0</td><td>131,072</td><td>131,070</td></tr><tr><td>/14</td><td>255.252.0.0</td><td>262,144</td><td>262,142</td></tr><tr><td>/13</td><td>255.248.0.0</td><td>524,288</td><td>524,286</td></tr><tr><td>/12</td><td>255.240.0.0</td><td>1,048,576</td><td>1,048,574</td></tr><tr><td>/11</td><td>255.224.0.0</td><td>2,097,152</td><td>2,097,150</td></tr><tr><td>/10</td><td>255.192.0.0</td><td>4,194,304</td><td>4,194,302</td></tr><tr><td>/9</td><td>255.128.0.0</td><td>8,388,608</td><td>8,388,606</td></tr><tr><td>/8</td><td>255.0.0.0</td><td>16,777,216</td><td>16,777,214</td></tr><tr><td>/7</td><td>254.0.0.0</td><td>33,554,432</td><td>33,554,430</td></tr><tr><td>/6</td><td>252.0.0.0</td><td>67,108,864</td><td>67,108,862</td></tr><tr><td>/5</td><td>248.0.0.0</td><td>134,217,728</td><td>134,217,726</td></tr><tr><td>/4</td><td>240.0.0.0</td><td>268,435,456</td><td>268,435,454</td></tr><tr><td>/3</td><td>224.0.0.0</td><td>536,870,912</td><td>536,870,910</td></tr><tr><td>/2</td><td>192.0.0.0</td><td>1,073,741,824</td><td>1,073,741,822</td></tr><tr><td>/1</td><td>128.0.0.0</td><td>2,147,483,648</td><td>2,147,483,646</td></tr><tr><td>/0</td><td>0.0.0.0</td><td>4,294,967,296</td><td>4,294,967,294</td></tr></tbody></table></figure>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>CentOS 7 簡單安裝GitLab（教程）</title>
		<link>https://www.luisimon.com/2020/09/19/347/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Sat, 19 Sep 2020 02:46:01 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[版本管理]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=347</guid>

					<description><![CDATA[安裝GitLab 1.安装并配置必要的依赖关系 在CentOS 7（和RedHat / Oracle / Sc ... <a title="CentOS 7 簡單安裝GitLab（教程）" class="read-more" href="https://www.luisimon.com/2020/09/19/347/" aria-label="继续阅读CentOS 7 簡單安裝GitLab（教程）">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<p><strong><em>安裝GitLab</em></strong></p>



<p><strong>1.安装并配置必要的依赖关系</strong></p>



<p>在CentOS 7（和RedHat / Oracle / Scientific Linux 7）上，以下命令还将在系统防火墙中打开HTTP和SSH访问。</p>



<pre class="wp-block-preformatted">sudo yum install -y curl policycoreutils-python openssh-server
sudo systemctl enable sshd
sudo systemctl start sshd

sudo firewall-cmd --permanent --add-service=http
sudo systemctl reload firewalld
</pre>



<p> 接下来，安装Postfix发送通知邮件。如果您想使用其他解决方案发送电子邮件，请跳过此步骤并在安装GitLab后<a href="https://www.luisimon.com/goto/0s0j" rel="nofollow">配置外部SMTP服务器</a>。（不发邮件的话这步可以跳过） </p>



<p><strong> 2.添加GitLab软件包存储库并安装软件包 </strong></p>



<p>如果想手动安装的可以到以下地址下载，国内比较快奥</p>



<p><a href="https://www.luisimon.com/goto/6fhl" rel="nofollow">https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el7/</a></p>



<p><strong> gitlab 分为gitlab-ce和gitlab-ee，我们要安装ce社区版<br>gitlab-ce是社区版，免费的<br>gitlab-ee是企业版，收费的 </strong></p>



<p>添加GitLab软件包存储库。</p>



<p>curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash</p>



<p><strong>如果要使用国内源</strong></p>



<pre class="wp-block-code"><code>vim /etc/yum.repos.d/gitlab_gitlab-ce.repo</code></pre>



<pre class="wp-block-code"><code>&#91;gitlab-ce]
name=gitlab-ce
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key</code></pre>



<pre class="wp-block-code"><code>vim /etc/yum.repos.d/gitlab_gitlab-ee.repo</code></pre>



<pre class="wp-block-code"><code>&#91;gitlab-ee]
name=gitlab-ee
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ee/yum/el$releasever/
repo_gpgcheck=0
gpgcheck=0
enabled=1
gpgkey=https://packages.gitlab.com/gpg.key</code></pre>



<p>接下来，安装GitLab软件包。将`http://gitlab.example.com`更改为您想要访问您的GitLab实例的URL。安装将自动在该URL处配置并启动GitLab。安装后HTTPS需要<a href="https://www.luisimon.com/goto/fix2" rel="nofollow">额外的配置</a>。</p>



<p>sudo EXTERNAL_URL=&#8221;http://gitlab.example.com&#8221; yum install -y gitlab-ce</p>



<p>第一次访问时，您将被重定向到密码重置屏幕。提供初始管理员帐户的密码，您将被重定向回登录屏幕。使用默认帐户的用户名root登录。 </p>



<p><strong>4.安装过程中问题处理</strong></p>



<p>执行到&nbsp;sudo EXTERNAL_URL=&#8221;http://gitlab.example.com&#8221; yum install -y gitlab-ce 这个步骤的时候，很大可能被卡死。</p>



<p><em>解决方案：</em></p>



<p><em>1、没关系上趟厕所多等一会（10分钟）<br>2、按住CTRL+C强制结束<br>3、运行：sudo systemctl restart gitlab-runsvdir<br>4、再次执行：sudo gitlab-ctl reconfigure</em></p>



<h4 class="wp-block-heading"><strong>如果访问时报，502 错误</strong></h4>



<p>解决方案：<br></p>



<p>可能性一<br>是unicorn服务与tomcat端口冲突，配置下unicorn使用端口应该就可以了<br>vi /etc/gitlab/gitlab.rb<br>unicorn[&#8216;port&#8217;] = 9090<br></p>



<p>再gitlab-ctl reconfigure 重启配置，然后稍等一会，在访问，这样GitLab服务器就可以正常运行了。</p>



<p><strong>安装/启动postfix的时候报错：</strong></p>



<pre class="wp-block-preformatted"> [root@&nbsp;~]#&nbsp;systemctl&nbsp;start&nbsp;postfix&nbsp;&nbsp;
Job&nbsp;for&nbsp;postfix.service&nbsp;failed&nbsp;because&nbsp;the&nbsp;control&nbsp;process&nbsp;exited&nbsp;with&nbsp;error&nbsp;code.&nbsp;See&nbsp;"systemctl&nbsp;status&nbsp;postfix.service"&nbsp;and&nbsp;"journalctl&nbsp;-xe"&nbsp;for&nbsp;details.&nbsp; </pre>



<p>解决方法：</p>



<pre class="wp-block-preformatted">#修改&nbsp;/etc/postfix/main.cf的设置&nbsp;
inet_protocols&nbsp;=&nbsp;ipv4
inet_interfaces&nbsp;=&nbsp;all</pre>



<p><strong>5.GitLab常用命令</strong></p>



<pre class="wp-block-preformatted">sudo gitlab-ctl start                  # 启动所有 gitlab 组件；
sudo gitlab-ctl stop &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 停止所有 gitlab 组件；
sudo gitlab-ctl restart&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# 重启所有 gitlab 组件；
sudo gitlab-ctl status &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;# 查看服务状态；
sudo gitlab-ctl reconfigure &nbsp; &nbsp; &nbsp; &nbsp; # 启动服务；
sudo vim /etc/gitlab/gitlab.rb &nbsp; &nbsp; &nbsp;# 修改默认的配置文件；
gitlab-rake gitlab:check SANITIZE=true --trace &nbsp; &nbsp;# 检查gitlab；
sudo gitlab-ctl tail &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# 查看日志；</pre>



<h4 class="wp-block-heading">完全卸载GitLab</h4>



<p>一、停止gitlab<br> sudo gitlab-ctl stop<br>二、卸载gitlab（这块注意了，看看是gitlab-ce版本还是gitlab-ee版本，别写错误了）<br> sudo rpm -e gitlab-ce<br></p>



<p>三、查看gitlab进程</p>



<p> ps -ef|grep gitlab<br>　 &nbsp; &nbsp;杀掉第一个守护进程(runsvdir -P /opt/gitlab/service log)<br>　 &nbsp; &nbsp;kill -9 4473<br>　 &nbsp; &nbsp;再次查看gitlab进程是否存在<br></p>



<p>四、删除gitlab文件</p>



<p>       <strong> find / -name *gitlab*|xargs rm -rf      # 删除所有包含gitlab的文件及目录</strong></p>



<p>      <strong>  find / -name gitlab |xargs rm -rf </strong><br></p>



<p>删除gitlab-ctl uninstall时自动在root下备份的配置文件（ls /root/gitlab* 看看有没有，有也删除）通过以上几步就可以彻底卸载gitlab </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>正则表达式:&#8221;?&#8221;符号的匹配问题</title>
		<link>https://www.luisimon.com/2020/07/21/344/</link>
		
		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Tue, 21 Jul 2020 01:45:25 +0000</pubDate>
				<category><![CDATA[未分类]]></category>
		<guid isPermaLink="false">https://www.luisimon.xyz/?p=344</guid>

					<description><![CDATA[作为一名不经常使用正则表达式的Programer，想用最简单的语言来描述否定匹配，不过发现确实不是那么好理解。 ... <a title="正则表达式:&#8221;?&#8221;符号的匹配问题" class="read-more" href="https://www.luisimon.com/2020/07/21/344/" aria-label="继续阅读正则表达式:&#8221;?&#8221;符号的匹配问题">阅读更多</a>]]></description>
										<content:encoded><![CDATA[
<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p> 作为一名不经常使用正则表达式的Programer，想用最简单的语言来描述否定匹配，不过发现确实不是那么好理解。还是按照自己知道的来描述吧。 </p><cite> <a href="https://www.luisimon.com/goto/ix8d" rel="nofollow">https://www.jianshu.com/p/041b33ae524e</a> </cite></blockquote>



<p><strong>(?:pattern)</strong></p>



<pre class="wp-block-preformatted"> 非获取匹配，匹配pattern但不获取匹配结果，不进行存储供以后使用。这在使用或字符“(|)”来组合一个模式的各个部分是很有用。例>>如“industr(?:y|ies)”就是一个比“industry|industries”更简略的表达式。</pre>



<p><strong>(?=pattern)</strong></p>



<pre class="wp-block-preformatted"> 非获取匹配，正向肯定预查，在任何匹配pattern的字符串开始处匹配查找字符串，该匹配不需要获取供以后使用。例如，“Windows(?=95|98|NT|2000)”能匹配“Windows2000”中的“Windows”，但不能匹配“Windows3.1”中的“Windows”。预查不消耗字符，也就是说，在一个匹配发生后，在最后一次匹配之后立即开始下一次匹配的搜索，而不是从包含预查的字符之后开始。</pre>



<p><strong>(?!pattern)</strong></p>



<pre class="wp-block-preformatted"> 非获取匹配，正向否定预查，在任何不匹配pattern的字符串开始处匹配查找字符串，该匹配不需要获取供以后使用。例如“Windows(?!95|98|NT|2000)”能匹配“Windows3.1”中的“Windows”，但不能匹配“Windows2000”中的</pre>



<p><strong>(?&lt;=pattern)</strong></p>



<pre class="wp-block-preformatted"> 非获取匹配，反向肯定预查，与正向肯定预查类似，只是方向相反。例如，“(?&lt;=95|98|NT|2000)Windows”能匹配“2000Windows”中的“Windows”，但不能匹配“3.1Windows”中的“Windows”。</pre>



<p><strong>(?&lt;!pattern)</strong></p>



<pre class="wp-block-preformatted"> 非获取匹配，反向否定预查，与正向否定预查类似，只是方向相反。例如“(?&lt;!95|98|NT|2000)Windows”能匹配“3.1Windows”中的“Windows”，但不能匹配“2000Windows”中的“Windows”。这个地方不正确，有问题</pre>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
