<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title>meisw's blog</title>
		<link>http://meisw.wdlinux.cn//</link>
		<description>工作,学习,生活,这里将会有一些记录.     备用域名:http://meisw.wdlinux.cn</description>
		<copyright>Copyright (C) 2004 Security Angel Team [S4T] All Rights Reserved.</copyright>
		<generator>SaBlog-X Version 1.6 Build 20080806</generator>
		<lastBuildDate>Sat, 30 May 2026 02:12:12 +0000</lastBuildDate>
		<ttl>30</ttl>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1091-1.html</guid>
			<title>tmux常用命令</title>
			<author>admin</author>
			<description><![CDATA[<p>Window:</p>
<p>ctrl+b, C创建一个新的窗口（下方会出来）</p>
<p>ctrl+b, 0/1/2切换</p>
<p>ctrl+b, P上一个/N下一个</p>
<p>ctrl+b, &amp; kill</p>
<p>Pane:</p>
<p>ctrl+b, %, 左右分割窗口</p>
<p>Ctrl+b,&quot; 上写分割窗口</p>
<p>Ctrl+b, 上下左右 切换这些窗口</p>
<p>Ctrl+b, X退出小串口</p>
<p>Ctrl+b, Z放大小窗口，再来一次恢复</p>
<p>ctrl+b, W可以监控所有窗口</p>
<p>&nbsp;</p>
<p>这是 tmux 自带的滚动方案，无需任何配置，所有环境都能直接使用：</p>
<p>&nbsp;</p>
<p>按 Prefix + [ 进入复制 / 滚动模式（此时终端底部会出现行号提示）</p>
<p>滚动操作：</p>
<p>逐行滚动：方向键 &uarr;/&darr;</p>
<p>整页翻页：PageUp/PageDown</p>
<p>Vi 模式：可用 k/j 逐行、Ctrl+u/Ctrl+d 半页翻页</p>
<p>Emacs 模式：可用 Ctrl+p/Ctrl+n 逐行滚动</p>
<p>退出滚动模式：按 q 即可回到正常终端交互模式</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1091-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-05-27 08:53</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1090-1.html</guid>
			<title>debian postgresql</title>
			<author>admin</author>
			<description><![CDATA[<div>apt install postgresql postgresql-contrib</div>
<div>&nbsp;</div>
<div>sudo -u postgres psql</div>
<div>&nbsp;</div>
<div>GRANT ALL PRIVILEGES ON DATABASE app_db TO app_user;</div>
<div>&nbsp;</div>
<div>ALTER DATABASE app_db OWNER TO app_user;</div>
<div>&nbsp;</div>
<div>CREATE DATABASE app_db OWNER app_user;</div>
<div>&nbsp;</div>
<div>\l&nbsp; # 查看数据库及其所有者</div>
<div>\du&nbsp; # 列出所有数据库用户及其角色属性</div>
<div>连接到数据库：</div>
<div>\c mydatabase</div>
<div>列出当前数据库的所有表：</div>
<div>\dt</div>
<div>列出所有用户</div>
<div>\du</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>创建用户并设置密码</div>
<div>CREATE USER postgres WITH PASSWORD 'your_password';</div>
<div>&nbsp;</div>
<div>3.8 修改指定用户的密码</div>
<div>ALTER USER username WITH PASSWORD 'new_password';</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>备份数据库并包含创建数据库命令：</div>
<div>pg_dump -U postgres -h localhost -p 5432 -F c -b -v -C -f /path/to/backup/aibox_cloud.backup mydatabase</div>
<div>&nbsp;</div>
<div>参数解释：</div>
<div>pg_dump：用于备份 PostgreSQL 数据库的工具。</div>
<div>-U postgres：指定数据库用户名为 postgres。</div>
<div>-h localhost：指定数据库服务器的主机名为 localhost。</div>
<div>-p 5432：指定数据库服务器的端口号为 5432。</div>
<div>-F c：指定备份文件格式为自定义格式（custom）。这种格式支持压缩和并行恢复。</div>
<div>-b：包含大对象（blobs）在备份中。</div>
<div>-v：启用详细模式，显示备份过程中的详细信息（verbose）。</div>
<div>-C：在备份文件中包含创建数据库的命令（--create）。</div>
<div>-f /path/to/backup/aibox_cloud.backup：指定输出备份文件的路径和文件名为 /path/to/backup/aibox_cloud.backup。</div>
<div>mydatabase：要备份的数据库名。</div>
<div>&nbsp;</div>
<div>5.恢复包含创建数据库命令的备份文件：</div>
<div>pg_restore -U postgres -h localhost -p 5432 -C -d postgres -v /path/to/backup/aibox_cloud.backup</div>
<div>&nbsp;</div>
<div>参数解释：</div>
<div>pg_restore：用于恢复由 pg_dump 创建的备份文件的工具。</div>
<div>-U postgres：指定数据库用户名为 postgres。</div>
<div>-h localhost：指定数据库服务器的主机名为 localhost。</div>
<div>-p 5432：指定数据库服务器的端口号为 5432。</div>
<div>-C：在恢复过程中创建数据库。如果备份文件中包含了创建数据库的命令（--create）。</div>
<div>-d postgres：指定连接的目标数据库。在使用 -C 选项时，这个数据库仅用作连接，并在其中执行创建和恢复新数据库的操作。通常使用默认的 postgres 数据库。</div>
<div>-v：启用详细模式，显示恢复过程中的详细信息（verbose）。</div>
<div>/path/to/backup/aibox_cloud.backup：要恢复的备份文件的路径和文件名。</div>
<div>&nbsp;</div>
<div>&nbsp;</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1090-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-05-08 13:09</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1087-1.html</guid>
			<title>systemctl</title>
			<author>admin</author>
			<description><![CDATA[<p><code class="bash plain" style="font-size: 12px; white-space: nowrap; margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">systemctl list-unit-files --</code><code class="bash functions" style="font-size: 12px; white-space: nowrap; margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(255, 20, 147) !important;">type</code><code class="bash plain" style="font-size: 12px; white-space: nowrap; margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">=service --state=enabled</code></p>
<div><code class="bash plain" style="font-size: 12px; white-space: nowrap; margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;"><br />
</code></div>
<div><code class="bash plain" style="margin: 0px !important; padding: 0px !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; font-size: 12px; white-space: nowrap;"><font face="Consolas, Bitstream Vera Sans Mono, Courier New, Courier, monospace">systemctl is-enabled name</font></code></div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1087-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-04-16 17:28</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1086-1.html</guid>
			<title>debian iptables</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;On Debian, iptables is a command-line utility for configuring packet filtering, NAT, and firewall rules. Since Debian 10 (Buster), the default backend is nftables via the iptables-nft compatibility layer, but you can still use the traditional syntax.</p>
<div>&nbsp;</div>
<div>Installing iptables</div>
<div>&nbsp;</div>
<div>If not already installed:</div>
<div>&nbsp;</div>
<div>sudo apt update</div>
<div>sudo apt install iptables -y</div>
<div>&nbsp;</div>
<div>You can check the current rules with:</div>
<div>&nbsp;</div>
<div>sudo iptables -L</div>
<div>&nbsp;</div>
<div>This lists the INPUT, FORWARD, and OUTPUT chains with their policies and rules .</div>
<div>&nbsp;</div>
<div>Adding Rules</div>
<div>&nbsp;</div>
<div>To allow incoming SSH traffic on port 22:</div>
<div>&nbsp;</div>
<div>sudo iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT</div>
<div>&nbsp;</div>
<div>To allow HTTP/HTTPS:</div>
<div>&nbsp;</div>
<div>sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT</div>
<div>sudo iptables -A INPUT -p tcp --dport 443 -j ACCEPT</div>
<div>&nbsp;</div>
<div>To drop all other inbound traffic:</div>
<div>&nbsp;</div>
<div>sudo iptables -A INPUT -j REJECT</div>
<div>sudo iptables -A FORWARD -j REJECT</div>
<div>&nbsp;</div>
<div>You can view detailed rules with:</div>
<div>&nbsp;</div>
<div>sudo iptables -L -n -v</div>
<div>&nbsp;</div>
<div>Saving Rules Permanently</div>
<div>&nbsp;</div>
<div>By default, iptables rules are lost after reboot. To persist them:</div>
<div>&nbsp;</div>
<div>Using iptables-persistent package:</div>
<div>&nbsp;</div>
<div>sudo apt install iptables-persistent</div>
<div>sudo sh -c '/sbin/iptables-save &gt; /etc/iptables/rules.v4'</div>
<div>sudo sh -c '/sbin/ip6tables-save &gt; /etc/iptables/rules.v6'</div>
<div>&nbsp;</div>
<div>Ensure the service is enabled:</div>
<div>&nbsp;</div>
<div>sudo systemctl enable netfilter-persistent.service</div>
<div>&nbsp;</div>
<div>Manual restore on boot: Create /etc/network/if-pre-up.d/iptables:</div>
<div>&nbsp;</div>
<div>#!/bin/sh</div>
<div>/sbin/iptables-restore &lt; /etc/iptables.up.rules #/etc/iptables/rules.v4 可以注释不用也不影响</div>
<div>&nbsp;</div>
<div>Make it executable:</div>
<div>&nbsp;</div>
<div>sudo chmod +x /etc/network/if-pre-up.d/iptables</div>
<div>&nbsp;</div>
<div>Switching Between nftables and Legacy</div>
<div>&nbsp;</div>
<div>If you need legacy iptables instead of nftables backend:</div>
<div>&nbsp;</div>
<div>sudo update-alternatives --set iptables /usr/sbin/iptables-legacy</div>
<div>&nbsp;</div>
<div>Switch back to nftables:</div>
<div>&nbsp;</div>
<div>sudo update-alternatives --set iptables /usr/sbin/iptables-nft</div>
<div>&nbsp;</div>
<div>Tip: Always test new firewall rules in a separate SSH session to avoid locking yourself out.</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1086-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-04-16 17:18</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1085-1.html</guid>
			<title>debian vi</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;一、编辑/etc/vim/vimrc.tiny</p>
<div>由于/etc/vim/vimrc.tiny的拥有者是root用户，所以要在root的权限下对这个文件进行修改。方法很简单：可以输入命令&ldquo;su&rdquo;，然后键入密码获得root权限，然后对文件进行修改；或者输入命令&ldquo;sudo vi/etc/vim/vimrc.tiny&rdquo;，输入密码后直接对文件进行编辑。</div>
<div>至于编辑的内容也是超级简单：vimrc.tiny文件中的倒数第二句话是&ldquo;set compatible&rdquo;，</div>
<div>将&ldquo;compatible&rdquo;改为&ldquo;nocompatible&rdquo;，这样非兼容模式就可以解决方向键变ABCD的问题了。</div>
<div>二、set backspace=2</div>
<div>那么接下来要解决Backspace键的问题也非常简单，就在刚才那句话的后面加一句：</div>
<div>set backspace=2</div>
<div>即：</div>
<div>set nocompatible</div>
<div>set backspace=2</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>ls时目录文件均没有颜色</div>
<div>~/.bashrc</div>
<div>&nbsp;</div>
<div><span style="color: rgba(0, 0, 0, 0.8); font-family: monospace; white-space: pre-wrap; background-color: rgb(248, 244, 241);">alias ls='ls --color=auto'</span></div>
<div><span style="color: rgba(0, 0, 0, 0.8); font-family: monospace; white-space: pre-wrap; background-color: rgb(248, 244, 241);"><br />
</span></div>
<div><span style="color: rgba(0, 0, 0, 0.8); font-family: monospace; white-space: pre-wrap; background-color: rgb(248, 244, 241);"><br />
</span></div>
<div>
<div class="line number1 index0 alt2" style="font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; font-size: 12px; color: rgb(51, 51, 51); margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background: none rgb(244, 244, 244) !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; white-space: nowrap !important;"><code class="csharp plain" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 0) !important;">vim /etc/vim/vimrc</code></div>
<div class="line number2 index1 alt1" style="font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; font-size: 12px; color: rgb(51, 51, 51); margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; white-space: nowrap !important;"><code class="csharp plain" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 0) !important;">取消&ldquo;syntax&nbsp;</code><code class="csharp keyword" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 255) !important;">on</code><code class="csharp plain" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 0) !important;">&rdquo;的注释</code></div>
</div>
<div class="line number2 index1 alt1" style="font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; font-size: 12px; color: rgb(51, 51, 51); margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; white-space: nowrap !important;"><code class="csharp plain" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 0) !important;">或</code></div>
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">cat .vimrc</div>
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">syntax on</div>
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">colorscheme desert</div>
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">&nbsp;</div>
<div class="line number2 index1 alt1" style="margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important;">没有主题或颜色或没有vim，apt install vim</div>
</div>
<div class="line number2 index1 alt1" style="font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace; font-size: 12px; color: rgb(51, 51, 51); margin: 0px !important; padding: 0px 1em !important; border-radius: 0px !important; background-image: none !important; background-position: initial !important; background-size: initial !important; background-repeat: initial !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; white-space: nowrap !important;"><code class="csharp plain" style="margin: 0px !important; padding: 0px !important; font-family: Consolas, &quot;Bitstream Vera Sans Mono&quot;, &quot;Courier New&quot;, Courier, monospace !important; border-radius: 0px !important; background: none !important; border: 0px !important; inset: auto !important; float: none !important; height: auto !important; line-height: 1.8em !important; outline: 0px !important; overflow: visible !important; position: static !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; min-height: auto !important; color: rgb(0, 0, 0) !important;"><br />
</code></div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1085-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-04-16 16:23</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1082-1.html</guid>
			<title>ssh反向连接</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span class="token function" style="font-family: var(--ds-font-family-code); white-space: pre-wrap; color: rgb(64, 120, 242);">ssh</span><span style="color: rgb(15, 17, 21); font-family: var(--ds-font-family-code); white-space: pre-wrap;"> </span><span class="token parameter variable" style="font-family: var(--ds-font-family-code); white-space: pre-wrap; color: rgb(64, 120, 242);">-NfR</span><span style="color: rgb(15, 17, 21); font-family: var(--ds-font-family-code); white-space: pre-wrap;"> </span><span class="token number" style="font-family: var(--ds-font-family-code); white-space: pre-wrap; color: rgb(183, 107, 1);">2222</span><span style="color: rgb(15, 17, 21); font-family: var(--ds-font-family-code); white-space: pre-wrap;">:localhost:22 root@ip</span></p>
<div><span style="color: rgb(15, 17, 21); font-family: var(--ds-font-family-code); white-space: pre-wrap;"><br />
</span></div>
<div><font color="#0f1115"><span style="white-space: pre-wrap;">远程连接</span></font></div>
<p>/etc/ssh/sshd_config，将 GatewayPorts 设置为 yes</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-1082-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2026-03-19 11:53</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1080-1.html</guid>
			<title>在 Vim 中启用右键粘贴</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<span style="color: var(--smtc-foreground-content-neutral-secondary); background-color: rgb(240, 243, 255);">在使用 Vim 编辑器时，可能会遇到右键无法粘贴的问题。这通常是由于 Vim 的默认配置启用了鼠标支持，导致右键点击进入了可视模式。以下是解决这一问题的几种方法：</span></p>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p class="rd_sub_header" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: var(--smtc-gap-between-content-small) 0 var(--smtc-gap-between-content-small) 0; color: var(--smtc-foreground-content-neutral-primary); line-height: 22px;">方法一：临时解决方案</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">在 Vim 中输入以下命令可以临时禁用鼠标支持，从而启用右键粘贴功能：</p>
</span></div>
<div class="devmag_code" style="font-family: Consolas, Courier, monospace; padding: var(--smtc-gap-between-content-x-small); border-radius: var(--mai-smtc-corner-list-card-nested-default); background: var(--smtc-background-card-on-primary-default-rest); border-left: 5px solid var(--bing-smtc-stroke-ctrl-strong); word-break: break-word; color: var(--smtc-foreground-content-neutral-primary); margin: var(--smtc-gap-between-content-x-small) 0 var(--smtc-gap-between-content-small) 0;">
<div id="rd_code_11_96E0B3" style="display: inline-block; width: calc(100% - 25px);">
<div class="devmag_cCodeBg">:set mouse-=a</div>
</div>
<div class="devmag_cd_cpy" style="align-content: baseline; width: 20px; vertical-align: top; float: right; display: inline-block;"><span class="b_floatR" style="float: right;">
<div class="devmag_cpy_d" style="position: relative;">
<div id="infobubble_item_12_96E0E0" class="infobubble_item infobubble_tooltip" data-bubbleid="infobubble_12_96E0E0" aria-haspopup="true"><button role="button" id="devmag_cpy_10_tbsc" aria-label="复制" style="padding: 0px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; cursor: pointer;"><img alt="复制" class="rms_img" src="data:image/svg+xml,%EF%BB%BF%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%0A%20%20%20%20%3Cpath%20d%3D%22M4.11363%203.54174L4.11153%205.16645V13.2054C4.11153%2014.579%205.19925%2015.6926%206.54102%2015.6926L12.982%2015.6929C12.751%2016.3615%2012.1281%2016.8406%2011.3958%2016.8406H6.54102C4.57998%2016.8406%202.99023%2015.2131%202.99023%2013.2054V5.16645C2.99023%204.41591%203.45927%203.77752%204.11363%203.54174ZM13.2688%201.53125C14.1977%201.53125%2014.9508%202.30219%2014.9508%203.25319V13.2022C14.9508%2014.1531%2014.1977%2014.9241%2013.2688%2014.9241H6.54102C5.6121%2014.9241%204.85907%2014.1531%204.85907%2013.2022V3.25319C4.85907%202.30219%205.6121%201.53125%206.54102%201.53125H13.2688ZM13.2688%202.67921H6.54102C6.23138%202.67921%205.98037%202.93619%205.98037%203.25319V13.2022C5.98037%2013.5192%206.23138%2013.7761%206.54102%2013.7761H13.2688C13.5784%2013.7761%2013.8295%2013.5192%2013.8295%2013.2022V3.25319C13.8295%202.93619%2013.5784%202.67921%2013.2688%202.67921Z%22%20fill%3D%22%23767676%22%20%2F%3E%0D%0A%3C%2Fsvg%3E" data-bm="32" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: 0px; padding: 0px;" /></button></div>
</div>
</span></div>
</div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">此命令会禁用所有模式下的鼠标支持，使右键点击可以正常粘贴。</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p class="rd_sub_header" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: var(--smtc-gap-between-content-small) 0 var(--smtc-gap-between-content-small) 0; color: var(--smtc-foreground-content-neutral-primary); line-height: 22px;">方法二：永久解决方案</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">如果希望每次打开 Vim 都能使用右键粘贴功能，可以编辑 Vim 的配置文件&nbsp;<span class="rd_inl_code" style="font-family: Consolas, Courier, monospace; background: var(--smtc-background-card-on-primary-default-hover); border-radius: var(--smtc-ctrl-badge-sm-corner); border: 1px solid var(--smtc-stroke-ctrl-on-neutral-rest); padding: 1px var(--smtc-gap-between-content-xx-small); box-sizing: border-box; color: var(--bing-smtc-foreground-content-neutral-secondary-alt);">~/.vimrc</span>，添加以下代码：</p>
</span></div>
<div class="devmag_code" style="font-family: Consolas, Courier, monospace; padding: var(--smtc-gap-between-content-x-small); border-radius: var(--mai-smtc-corner-list-card-nested-default); background: var(--smtc-background-card-on-primary-default-rest); border-left: 5px solid var(--bing-smtc-stroke-ctrl-strong); word-break: break-word; color: var(--smtc-foreground-content-neutral-primary); margin: var(--smtc-gap-between-content-x-small) 0 var(--smtc-gap-between-content-small) 0;">
<div id="rd_code_17_96E216" style="display: inline-block; width: calc(100% - 25px);">
<div class="devmag_cCodeBg">
<div>if has('mouse')</div>
<div style="padding-left: 16px;">set mouse-=a</div>
<div>endif</div>
</div>
</div>
<div class="devmag_cd_cpy" style="align-content: baseline; width: 20px; vertical-align: top; float: right; display: inline-block;"><span class="b_floatR" style="float: right;">
<div class="devmag_cpy_d" style="position: relative;">
<div id="infobubble_item_18_96E223" class="infobubble_item infobubble_tooltip" data-bubbleid="infobubble_18_96E223" aria-haspopup="true"><button role="button" id="devmag_cpy_16_tbsc" aria-label="复制" style="padding: 0px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; cursor: pointer;"><img alt="复制" class="rms_img" src="data:image/svg+xml,%EF%BB%BF%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%0A%20%20%20%20%3Cpath%20d%3D%22M4.11363%203.54174L4.11153%205.16645V13.2054C4.11153%2014.579%205.19925%2015.6926%206.54102%2015.6926L12.982%2015.6929C12.751%2016.3615%2012.1281%2016.8406%2011.3958%2016.8406H6.54102C4.57998%2016.8406%202.99023%2015.2131%202.99023%2013.2054V5.16645C2.99023%204.41591%203.45927%203.77752%204.11363%203.54174ZM13.2688%201.53125C14.1977%201.53125%2014.9508%202.30219%2014.9508%203.25319V13.2022C14.9508%2014.1531%2014.1977%2014.9241%2013.2688%2014.9241H6.54102C5.6121%2014.9241%204.85907%2014.1531%204.85907%2013.2022V3.25319C4.85907%202.30219%205.6121%201.53125%206.54102%201.53125H13.2688ZM13.2688%202.67921H6.54102C6.23138%202.67921%205.98037%202.93619%205.98037%203.25319V13.2022C5.98037%2013.5192%206.23138%2013.7761%206.54102%2013.7761H13.2688C13.5784%2013.7761%2013.8295%2013.5192%2013.8295%2013.2022V3.25319C13.8295%202.93619%2013.5784%202.67921%2013.2688%202.67921Z%22%20fill%3D%22%23767676%22%20%2F%3E%0D%0A%3C%2Fsvg%3E" data-bm="33" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: 0px; padding: 0px;" /></button></div>
</div>
</span></div>
</div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">保存并退出后，重新打开 Vim 即可生效。</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p class="rd_sub_header" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: var(--smtc-gap-between-content-small) 0 var(--smtc-gap-between-content-small) 0; color: var(--smtc-foreground-content-neutral-primary); line-height: 22px;">方法三：针对特定系统的解决方案</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">在某些系统（如 Debian11）下，Vim 的默认配置文件可能会启用鼠标支持。可以通过编辑全局配置文件来解决此问题。以下是具体步骤：</p>
</span></div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<ul class="b_vList b_divsec b_bullet" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
    <li data-priority="" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: disc; margin: 0px 0px 0px 15px; padding: 0px 0px 10px;">
    <p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">编辑 Vim 的全局配置文件（如果文件不存在，可以新建一个）：</p>
    </li>
</ul>
</span></div>
<div class="devmag_code" style="font-family: Consolas, Courier, monospace; padding: var(--smtc-gap-between-content-x-small); border-radius: var(--mai-smtc-corner-list-card-nested-default); background: var(--smtc-background-card-on-primary-default-rest); border-left: 5px solid var(--bing-smtc-stroke-ctrl-strong); word-break: break-word; color: var(--smtc-foreground-content-neutral-primary); margin: var(--smtc-gap-between-content-x-small) 0 var(--smtc-gap-between-content-small) 0;">
<div id="rd_code_24_96E3BB" style="display: inline-block; width: calc(100% - 25px);">
<div class="devmag_cCodeBg">
<div style="padding-left: 4px;"><span class=" rd_code_blu" style="color: rgb(27, 106, 199);">sudo</span>&nbsp;vim /etc/vim/vimrc.<span class=" rd_code_blu" style="color: rgb(27, 106, 199);">local</span></div>
</div>
</div>
<div class="devmag_cd_cpy" style="align-content: baseline; width: 20px; vertical-align: top; float: right; display: inline-block;"><span class="b_floatR" style="float: right;">
<div class="devmag_cpy_d" style="position: relative;">
<div id="infobubble_item_25_96E3C1" class="infobubble_item infobubble_tooltip" data-bubbleid="infobubble_25_96E3C1" aria-haspopup="true"><button role="button" id="devmag_cpy_23_tbsc" aria-label="复制" style="padding: 0px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; cursor: pointer;"><img alt="复制" class="rms_img" src="data:image/svg+xml,%EF%BB%BF%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%0A%20%20%20%20%3Cpath%20d%3D%22M4.11363%203.54174L4.11153%205.16645V13.2054C4.11153%2014.579%205.19925%2015.6926%206.54102%2015.6926L12.982%2015.6929C12.751%2016.3615%2012.1281%2016.8406%2011.3958%2016.8406H6.54102C4.57998%2016.8406%202.99023%2015.2131%202.99023%2013.2054V5.16645C2.99023%204.41591%203.45927%203.77752%204.11363%203.54174ZM13.2688%201.53125C14.1977%201.53125%2014.9508%202.30219%2014.9508%203.25319V13.2022C14.9508%2014.1531%2014.1977%2014.9241%2013.2688%2014.9241H6.54102C5.6121%2014.9241%204.85907%2014.1531%204.85907%2013.2022V3.25319C4.85907%202.30219%205.6121%201.53125%206.54102%201.53125H13.2688ZM13.2688%202.67921H6.54102C6.23138%202.67921%205.98037%202.93619%205.98037%203.25319V13.2022C5.98037%2013.5192%206.23138%2013.7761%206.54102%2013.7761H13.2688C13.5784%2013.7761%2013.8295%2013.5192%2013.8295%2013.2022V3.25319C13.8295%202.93619%2013.5784%202.67921%2013.2688%202.67921Z%22%20fill%3D%22%23767676%22%20%2F%3E%0D%0A%3C%2Fsvg%3E" data-bm="34" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: 0px; padding: 0px;" /></button></div>
</div>
</span></div>
</div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<ul class="b_vList b_divsec b_bullet" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
    <li data-priority="" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: disc; margin: 0px 0px 0px 15px; padding: 0px 0px 10px;">
    <p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">添加以下配置项：</p>
    </li>
</ul>
</span></div>
<div class="devmag_code" style="font-family: Consolas, Courier, monospace; padding: var(--smtc-gap-between-content-x-small); border-radius: var(--mai-smtc-corner-list-card-nested-default); background: var(--smtc-background-card-on-primary-default-rest); border-left: 5px solid var(--bing-smtc-stroke-ctrl-strong); word-break: break-word; color: var(--smtc-foreground-content-neutral-primary); margin: var(--smtc-gap-between-content-x-small) 0 var(--smtc-gap-between-content-small) 0;">
<div id="rd_code_28_96E46B" style="display: inline-block; width: calc(100% - 25px);">
<div class="devmag_cCodeBg">
<div style="padding-left: 4px;">source /usr/share/vim/vim80/defaults.vim</div>
<div style="padding-left: 4px;">let skip_defaults_vim = 1</div>
<div style="padding-left: 4px;">if has('mouse')</div>
<div style="padding-left: 20px;">set mouse-=a</div>
<div style="padding-left: 4px;">endif</div>
</div>
</div>
<div class="devmag_cd_cpy" style="align-content: baseline; width: 20px; vertical-align: top; float: right; display: inline-block;"><span class="b_floatR" style="float: right;">
<div class="devmag_cpy_d" style="position: relative;">
<div id="infobubble_item_29_96E46F" class="infobubble_item infobubble_tooltip" data-bubbleid="infobubble_29_96E46F" aria-haspopup="true"><button role="button" id="devmag_cpy_27_tbsc" aria-label="复制" style="padding: 0px; background-image: none; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; cursor: pointer;"><img alt="复制" class="rms_img" src="data:image/svg+xml,%EF%BB%BF%3Csvg%20width%3D%2218%22%20height%3D%2219%22%20viewBox%3D%220%200%2018%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%0A%20%20%20%20%3Cpath%20d%3D%22M4.11363%203.54174L4.11153%205.16645V13.2054C4.11153%2014.579%205.19925%2015.6926%206.54102%2015.6926L12.982%2015.6929C12.751%2016.3615%2012.1281%2016.8406%2011.3958%2016.8406H6.54102C4.57998%2016.8406%202.99023%2015.2131%202.99023%2013.2054V5.16645C2.99023%204.41591%203.45927%203.77752%204.11363%203.54174ZM13.2688%201.53125C14.1977%201.53125%2014.9508%202.30219%2014.9508%203.25319V13.2022C14.9508%2014.1531%2014.1977%2014.9241%2013.2688%2014.9241H6.54102C5.6121%2014.9241%204.85907%2014.1531%204.85907%2013.2022V3.25319C4.85907%202.30219%205.6121%201.53125%206.54102%201.53125H13.2688ZM13.2688%202.67921H6.54102C6.23138%202.67921%205.98037%202.93619%205.98037%203.25319V13.2022C5.98037%2013.5192%206.23138%2013.7761%206.54102%2013.7761H13.2688C13.5784%2013.7761%2013.8295%2013.5192%2013.8295%2013.2022V3.25319C13.8295%202.93619%2013.5784%202.67921%2013.2688%202.67921Z%22%20fill%3D%22%23767676%22%20%2F%3E%0D%0A%3C%2Fsvg%3E" data-bm="35" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin: 0px; padding: 0px;" /></button></div>
</div>
</span></div>
</div>
<div style="color: rgb(68, 68, 68); font-family: Arial, Helvetica, sans-serif; background-color: rgb(240, 243, 255);"><span class="devmag_cntnt_snip" style="font: var(--bing-smtc-text-global-body3); color: var(--smtc-foreground-content-neutral-secondary);">
<ul class="b_vList b_divsec b_bullet" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-right: 0px; margin-bottom: 0px; margin-left: 0px;">
    <li data-priority="" style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: disc; margin: 0px 0px 0px 15px; padding: 0px 0px 10px;">
    <p style="border: 0px; border-collapse: collapse; border-spacing: 0px; list-style: none; margin-bottom: 0px; line-height: 22px;">保存并退出后，再次使用 Vim 时即可正常使用右键粘贴功能。</p>
    </li>
</ul>
</span></div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1080-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2025-09-25 11:50</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1050-1.html</guid>
			<title>使用 HAProxy 加速 Shadowsocks</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;
<header>
<h1 class="title">使用 HAProxy 加速  Shadowsocks</h1>
</header>
</p>
<div class="entry">
<p>最近用 ss 上网的速度越来越慢，工作日晚上 Google 都很难连上。ping 了下服务器，发现都在 300、400 ms，或者 time_out，得想些方法加速一下。<br />
后来发现 ss 支持中继，那么只要有一个服务器，连接自己电脑和 ss 服务器都很快的话就能实现加速。下面选了阿里云作为中继服务器进行实践。</p>
<figure class="highlight plain">
<table>
    <tbody>
        <tr>
            <td class="gutter">
            <pre><span class="line">1</span></pre>
            </td>
            <td class="code">
            <pre><span class="line">客户端 &lt; - &gt; 中继服务器 &lt; - &gt; Shadowsocks 服务器</span></pre>
            </td>
        </tr>
    </tbody>
</table>
</figure>
<p>&nbsp;</p>
<p>在自己电脑上 ping 中继服务器，中继服务器 ping ss 服务器，延迟分别为 10+ ms、60+ ms。阿里云的出口带宽果然不一样。加速条件满足，开始进入安装配置。</p>
<h2 id="HAProxy">HAProxy</h2>
<p>简单介绍下 HAProxy，HAProxy 是一个高效的负载均衡软件，可以实现 TCP/HTTP 的代理。这里使用它将我们发给它的请求转发给 ss 服务器。</p>
<h3 id="安装">安装</h3>
<figure class="highlight bash">
<table>
    <tbody>
        <tr>
            <td class="gutter">
            <pre><span class="line">1</span><br /><span class="line">2</span></pre>
            </td>
            <td class="code">
            <pre><span class="line">// 以 CentOS 7 为例</span><br /><span class="line">yum install haproxy</span></pre>
            </td>
        </tr>
    </tbody>
</table>
</figure>
<h3 id="配置">配置</h3>
<p>编辑 <code>/etc/haproxy/haproxy.cfg</code>，保存以下内容</p>
<figure class="highlight bash">
<table>
    <tbody>
        <tr>
            <td class="gutter">
            <pre><span class="line">1</span><br /><span class="line">2</span><br /><span class="line">3</span><br /><span class="line">4</span><br /><span class="line">5</span><br /><span class="line">6</span><br /><span class="line">7</span><br /><span class="line">8</span><br /><span class="line">9</span><br /><span class="line">10</span><br /><span class="line">11</span><br /><span class="line">12</span><br /><span class="line">13</span><br /><span class="line">14</span><br /><span class="line">15</span><br /><span class="line">16</span><br /><span class="line">17</span></pre>
            </td>
            <td class="code">
            <pre><span class="line">global</span><br /><span class="line">        <span class="built_in">ulimit</span>-n  51200</span><br /><br /><span class="line">defaults</span><br /><span class="line">        <span class="built_in">log</span> global</span><br /><span class="line">        mode    tcp</span><br /><span class="line">        option  dontlognull</span><br /><span class="line">        contimeout 1000</span><br /><span class="line">        clitimeout 150000</span><br /><span class="line">        srvtimeout 150000</span><br /><br /><span class="line">frontend ss-in</span><br /><span class="line">        <span class="built_in">bind</span> *:8388</span><br /><span class="line">        default_backend ss-out</span><br /><br /><span class="line">backend ss-out</span><br /><span class="line">        server server1 222.222.222.222:2222 maxconn 20480</span></pre>
            </td>
        </tr>
    </tbody>
</table>
</figure>
<p>&nbsp;</p>
<p>其中，<code>*:8388</code> 中的 8388 是中继服务器接受请求的端口，<code>222.222.222.222:2222</code> 是 ss 服务器的 IP 地址加端口号。<br />
然后执行</p>
<figure class="highlight bash">
<table>
    <tbody>
        <tr>
            <td class="gutter">
            <pre><span class="line">1</span></pre>
            </td>
            <td class="code">
            <pre><span class="line">service haproxy restart</span></pre>
            </td>
        </tr>
    </tbody>
</table>
</figure>
<p>&nbsp;</p>
<p>HAProxy 就会在后台进行启动。可以使用 <code>ps -ef</code> 查看进程，<code>lsof -i</code> 查看端口占用情况来验证 HAProxy 是否已经运行。若无法连接中继服务器，使用 <code>iptables -L</code> 查看防火墙规则是否有问题。</p>
<p>客户端的配置，只要将原来配置的 ip 地址和端口更换成中继服务器的 ip 地址和端口号就可以了。</p>
<h3 id="未解之迷">未解之迷</h3>
<p>加速之后，公司电脑和手机使用都没问题，个人电脑却死活连不上去，一直显示 <code>ERR_CONNECTION_CLOSED</code>，将原来的 Shadowsocks Mac 客户端替换成 <code>Shadowsocks-libev</code> 之后才行，但明明公司电脑使用的客户端是一样的。</p>
<h2 id="其他加速方法">其他加速方法</h2>
<p>除 HAProxy 加速之外，还可以使用微林加速，具体可以参考代码家的<a href="http://www.jianshu.com/p/475182d8c503" target="_blank" rel="noopener">提速 Shadowsocks</a>。还有个更偷懒的方法，直接购买 CN2 线路的 Shadowsocks。</p>
<h2 id="参考">参考</h2>
<ul>
    <li><a href="https://github.com/shadowsocks/shadowsocks/wiki/Setup-a-Shadowsocks-relay" target="_blank" rel="noopener">官方文档</a></li>
</ul>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1050-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2018-09-07 13:52</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-1002-1.html</guid>
			<title>在64系统里执行32位程序如果出现/lib/ld-linux.so.2</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;1、在64系统里执行32位程序如果出现/lib/ld-linux.so.2:&nbsp;</p>
<div>bad ELF interpreter: No such file or directory，安装下glic即可</div>
<div>&nbsp;</div>
<div>yum install glibc.i686</div>
<div>&nbsp;</div>
<div>2、error while loading shared libraries: libz.so.1:&nbsp;</div>
<div>cannot open shared object file: No such file or directory</div>
<div>yum install zlib.i686&nbsp;</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-1002-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-12-12 14:54</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-982-1.html</guid>
			<title>GraphicsMagick为图片添加水印</title>
			<author>admin</author>
			<description><![CDATA[<p>GraphicsMagick号称图像处理领域的瑞士军刀。提供了健壮及高效的图像处理工具包和库，支持超过88种主流图片格式包括：BMP，GIF，JPEG，JPEG-2000，PNG，PDF，PNM，TIFF，DPX&hellip;</p>
<p>现在最新稳定版本为：1.3.12。安装之前，因为是图片处理，所以需要系统中安装了libpng和libjpeg的开发包，否则的话不会安装这两种文件的支持。</p>
<p>官方下载地址：http://www.graphicsmagick.org/&lt;br&gt;&lt;br&gt;&lt;br&gt;http://www.imagemagick.org/download/&lt;br&gt;&lt;br&gt;&lt;br&gt;</p>
<p>&nbsp;</p>
<p>命令格式：gm convert [ options ... ] input_file output_file</p>
<p>&nbsp;</p>
<p>下面给出一些常用玩法，本文也将陆续添加其他玩法，敬请关注！</p>
<p>&nbsp;</p>
<p>重定义尺寸，取样质量</p>
<p>&nbsp;</p>
<p>gm convert -quality 80 -resize 100&times;100 input.jpg output.jpg</p>
<p>加文字水印，指定字体、字体大小、颜色、位置</p>
<p>&nbsp;</p>
<p>gm convert -font ArialBold -pointsize 45 -fill red -draw &ldquo;text 100,100 www.saysth.com&rdquo; input.jpg output.jpg</p>
<p>加图片水印至右下角，透明度50%</p>
<p>&nbsp;</p>
<p>gm composite -gravity southeast -dissolve 50 watermark.png input.jpg output.jpg</p>
<p>加图片水印至制定位置，透明度50%</p>
<p>&nbsp;</p>
<p>&nbsp;gm composite -geometry +50+50 -dissolve 50 watermark.png input.jpg output.jpg&lt;br&gt;&lt;br&gt;&lt;br&gt;http://www.imagemagick.org/download/</p>
<div>&nbsp;</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-982-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-11-29 10:59</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-968-1.html</guid>
			<title>Linux中的pushd和popd</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;http://www.jianshu.com/p/53cccae3c443</p>]]></description>
			<link>http://meisw.wdlinux.cn//show-968-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-08-08 20:14</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-964-1.html</guid>
			<title>libiconv</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;In file included from progname.c:26:0:</p>
<div>./stdio.h:1010:1: error: &lsquo;gets&rsquo; undeclared here (not in a function)</div>
<div>&nbsp;_GL_WARN_ON_USE (gets, &quot;gets is a security hole - use fgets instead&quot;);</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>
<p style="font-family: &quot;Microsoft YaHei&quot;; color: rgb(63, 63, 63); line-height: 30px;"><span style="padding: 0px;">cd /tmp/libiconv-1.14/srclib</span></p>
<p style="font-family: &quot;Microsoft YaHei&quot;; color: rgb(63, 63, 63); line-height: 30px;"><span style="padding: 0px;">vi stdio.in.h</span></p>
<p style="font-family: &quot;Microsoft YaHei&quot;; color: rgb(63, 63, 63); line-height: 30px;">&nbsp;<span style="color: rgb(255, 0, 0); background-color: rgb(246, 246, 246); white-space: pre-wrap;">找到这行内容：</span></p>
<div class="cnblogs_code" style="font-family: &quot;Microsoft YaHei&quot;; padding: 0px; color: rgb(63, 63, 63); line-height: 30px;">
<pre class="bbcode_code" style="font-family: &quot;Microsoft YaHei&quot;; padding: 5px; background-color: rgb(246, 246, 246); border: 1px dotted rgb(170, 170, 170); white-space: pre-wrap; word-wrap: break-word;"><span style="padding: 0px; color: rgb(0, 0, 0);">_GL_WARN_ON_USE (gets, </span><span style="padding: 0px; color: rgb(128, 0, 0);">&quot;</span><span style="padding: 0px; color: rgb(128, 0, 0);">gets is a security hole - use fgets instead</span><span style="padding: 0px; color: rgb(128, 0, 0);">&quot;</span>);<br style="padding: 0px;" /><br style="padding: 0px;" /><span style="padding: 0px; color: rgb(255, 0, 0);">替换成：</span><br style="padding: 0px;" />#if defined(__GLIBC__) &amp;&amp; !defined(__UCLIBC__) &amp;&amp; !__GLIBC_PREREQ(2, 16) _GL_WARN_ON_USE (gets, &quot;gets is a security hole - use fgets instead&quot;); #endif<br style="padding: 0px;" /><br style="padding: 0px;" /><span style="padding: 0px; color: rgb(255, 0, 255);">注意：结尾的#endif也要包括。</span></pre>
</div>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-964-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-06-26 20:11</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-949-1.html</guid>
			<title>iptables</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;:syn-flood - [0:0]</p>
<div>...</div>
<div>-A INPUT -p icmp -m limit --limit 1/sec --limit-burst 10 -j ACCEPT</div>
<div>-A INPUT -f -m limit --limit 100/sec --limit-burst 100 -j ACCEPT</div>
<div>-A INPUT -p tcp -m tcp --tcp-flags FIN,SYN,RST,ACK SYN -j syn-flood</div>
<div>-A INPUT -j REJECT --reject-with icmp-host-prohibited</div>
<div>-A syn-flood -p tcp -m limit --limit 3/sec --limit-burst 6 -j RETURN</div>
<div>-A syn-flood -j REJECT --reject-with icmp-port-unreachable</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-949-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-05-16 12:26</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-941-1.html</guid>
			<title>linux screen 命令详解</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;<strong style="font-size: 16px; line-height: 1.8; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: rgb(128, 0, 0);">一、背景</span></strong></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器，经常运行一些需要很长时间才能完成的任务，比如系统备份、ftp 传输等等。通常情况下我们都是为每一个这样的任务开一个远程终端窗口，因为它们执行的时间太长了。必须等待它们执行完毕，在此期间不能关掉窗口或者断开连接，否则这个任务就会被杀掉，一切半途而废了。</p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: rgb(128, 0, 0);">二、简介</span></strong></span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><strong style="margin: 0px; padding: 0px;">GNU Screen</strong><span style="margin: 0px; padding: 0px; line-height: 1.8;">是一款由</span>GNU计划<span style="margin: 0px; padding: 0px; line-height: 1.8;">开发的用于</span>命令行终端<span style="margin: 0px; padding: 0px; line-height: 1.8;">切换的</span>自由软件<span style="margin: 0px; padding: 0px; line-height: 1.8;">。用户可以通过该软件同时连接多个本地或远程的命令行</span>会话<span style="margin: 0px; padding: 0px; line-height: 1.8;">，并在其间自由切换。</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">GNU Screen可以看作是窗口管理器的命令行界面版本。它提供了统一的管理多个会话的界面和相应的功能。</p>
<ul style="margin-right: 0px; margin-bottom: 0px; margin-left: 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">
    <li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">会话恢复</strong></li>
</ul>
<dl style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><dd style="margin: 0px; padding: 0px;">只要Screen本身没有终止，在其内部运行的会话都可以恢复。这一点对于远程登录的用户特别有用&mdash;&mdash;即使网络连接中断，用户也不会失去对已经打开的命令行会话的控制。只要再次登录到主机上执行<strong style="margin: 0px; padding: 0px;">screen -r</strong>就可以恢复会话的运行。同样在暂时离开的时候，也可以执行分离命令<strong style="margin: 0px; padding: 0px;">detach</strong>，在保证里面的程序正常运行的情况下让Screen挂起（切换到后台）。这一点和图形界面下的VNC很相似。</dd></dl>
<ul style="margin-right: 0px; margin-bottom: 0px; margin-left: 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">
    <li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">多窗口</strong></li>
</ul>
<dl style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><dd style="margin: 0px; padding: 0px;">在Screen环境下，所有的会话都独立的运行，并拥有各自的编号、输入、输出和窗口缓存。用户可以通过快捷键在不同的窗口下切换，并可以自由的重定向各个窗口的输入和输出。Screen实现了基本的文本操作，如复制粘贴等；还提供了类似滚动条的功能，可以查看窗口状况的历史记录。窗口还可以被分区和命名，还可以监视后台窗口的活动。</dd></dl>
<ul style="margin-right: 0px; margin-bottom: 0px; margin-left: 30px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">
    <li style="margin: 0px; padding: 0px; list-style: disc;"><strong style="margin: 0px; padding: 0px;">会话共享</strong></li>
</ul>
<dl style="margin: 0px; padding: 0px; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><dd style="margin: 0px; padding: 0px;">Screen可以让一个或多个用户从不同终端多次登录一个会话，并共享会话的所有特性（比如可以看到完全相同的输出）。它同时提供了窗口访问权限的机制，可以对窗口进行密码保护。</dd></dl>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;">GNU's Screen 官方站点：<a href="http://www.gnu.org/software/screen/" target="_blank" style="margin: 0px; padding: 0px; text-decoration: none; color: rgb(0, 0, 0); border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(51, 51, 51);">http://www.gnu.org/software/screen/</a></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; font-size: 16px;"><strong style="margin: 0px; padding: 0px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: rgb(128, 0, 0);">三、语法</span></strong></span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"># screen [-AmRvx -ls -wipe][-d &lt;作业名称&gt;][-h &lt;行数&gt;][-r &lt;作业名称&gt;][-s ][-S &lt;作业名称&gt;]</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><strong style="margin: 0px; padding: 0px;">参数说明</strong></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">-A 　将所有的视窗都调整为目前终端机的大小。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-d &lt;作业名称&gt; 　将指定的screen作业离线。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-h &lt;行数&gt; 　指定视窗的缓冲区行数。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-m 　即使目前已在作业中的screen作业，仍强制建立新的screen作业。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-r &lt;作业名称&gt; 　恢复离线的screen作业。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-R 　先试图恢复离线的作业。若找不到离线的作业，即建立新的screen作业。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-s 　指定建立新视窗时，所要执行的shell。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-S &lt;作业名称&gt; 　指定screen作业的名称。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-v 　显示版本信息。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-x 　恢复之前离线的screen作业。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-ls或--list 　显示目前所有的screen作业。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">-wipe 　检查目前所有的screen作业，并删除已经无法使用的screen作业。</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8; color: rgb(128, 0, 0); font-size: 16px;"><strong style="margin: 0px; padding: 0px;">四、常用screen参数</strong></span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -S yourname -&gt; 新建一个叫yourname的session</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -ls -&gt; 列出当前所有的session</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -r yourname -&gt; 回到yourname这个session</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -d yourname -&gt; 远程detach某个session</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">screen -d -r yourname -&gt; 结束当前session并回到yourname这个session</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><strong style="margin: 0px; padding: 0px;">在每个screen session 下，所有命令都以 ctrl+a(C-a) 开始。</strong><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a ? -&gt;&nbsp;<span style="margin: 0px; padding: 0px; line-height: 1.8;">显示所有键绑定信息</span></span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a c -&gt;&nbsp;<span style="margin: 0px; padding: 0px; line-height: 1.8;">创建一个新的运行shell的窗口并切换到该窗口</span></span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a n -&gt; Next，切换到下一个 window&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a p -&gt; Previous，切换到前一个 window&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a 0..9 -&gt; 切换到第 0..9 个 window</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">Ctrl+a [Space] -&gt; 由视窗0循序切换到视窗9</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a C-a -&gt; 在两个最近使用的 window 间切换&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a x -&gt; 锁住当前的 window，需用用户密码解锁</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a d -&gt; detach，暂时离开当前session，将目前的 screen session (可能含有多个 windows) 丢到后台执行，并会回到还没进 screen 时的状态，此时在 screen session 里，每个 window 内运行的 process (无论是前台/后台)都在继续执行，即使 logout 也不影响。&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a z -&gt; 把当前session放到后台执行，用 shell 的 fg 命令则可回去。</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a w -&gt;&nbsp;<span style="margin: 0px; padding: 0px; line-height: 1.8;">显示所有窗口列表</span></span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a t -&gt; Time，显示当前时间，和系统的 load&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a k -&gt; kill window，强行关闭当前的 window</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a [ -&gt; 进入 copy mode，在 copy mode 下可以回滚、搜索、复制就像用使用 vi 一样</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; C-b Backward，PageUp&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; C-f Forward，PageDown&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; H(大写) High，将光标移至左上角&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; L Low，将光标移至左下角&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; 0 移到行首&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; $ 行末&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; w forward one word，以字为单位往前移&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; b backward one word，以字为单位往后移&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; Space 第一次按为标记区起点，第二次按为终点&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">&nbsp;&nbsp;&nbsp; Esc 结束 copy mode&nbsp;</span><br style="margin: 0px; padding: 0px;" />
<span style="margin: 0px; padding: 0px; line-height: 1.8;">C-a ] -&gt; Paste，把刚刚在 copy mode 选定的内容贴上</span></p>
<p style="margin: 10px auto; color: rgb(51, 51, 51); font-family: verdana, Arial, Helvetica, sans-serif; line-height: 25.2px;"><span style="margin: 0px; padding: 0px; line-height: 1.8;"><br />
</span></p>
<p style="margin: 10px auto;"><span style="margin: 0px; padding: 0px; line-height: 25.2px;"><font color="#333333" face="verdana, Arial, Helvetica, sans-serif">http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html</font></span></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-941-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-04-26 22:09</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-931-1.html</guid>
			<title>VMware Workstation克隆CentOS 没有网卡eth0 无法开启网络服务</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<h2 id="解决办法" style="margin: 0.8em 0px; padding: 0px; box-sizing: border-box; font-weight: 100; font-family: 'microsoft yahei'; line-height: 26px;">解决办法：</h2>
<p style="box-sizing: border-box; font-family: 'microsoft yahei'; line-height: 26px;">因为这台虚拟机是通过克隆而来，MAC地址和源虚拟机一样，因此需要修改MAC地址&nbsp;<br style="box-sizing: border-box;" />
步骤如下：&nbsp;<br style="box-sizing: border-box;" />
1.<strong style="box-sizing: border-box;">vi /etc/sysconfig/network-scripts/ifcfg-eth0</strong>&nbsp;<br style="box-sizing: border-box;" />
将HWADDR修改为：&nbsp;<br style="box-sizing: border-box;" />
<img src="http://img.blog.csdn.net/20150803151528286" alt="在虚拟机设置中" title="" style="border: none; box-sizing: border-box; max-width: 100%;" /></p>
<p style="box-sizing: border-box; font-family: 'microsoft yahei'; line-height: 26px;">2.删除 /etc/udev/rules.d/70-persistent-net.rules 然后重启&nbsp;<br style="box-sizing: border-box;" />
<strong style="box-sizing: border-box;">rm /etc/udev/rules.d/70-persistent-net.rules</strong>&nbsp;<br style="box-sizing: border-box;" />
<strong style="box-sizing: border-box;">reboot</strong></p>
<p style="box-sizing: border-box; font-family: 'microsoft yahei'; line-height: 26px;"><strong style="box-sizing: border-box;">-------------</strong></p>
<p style="box-sizing: border-box;"><font face="microsoft yahei"><span style="line-height: 26px;"><strong>cat /etc/sysconfig/network-scripts/ifcfg-eth0</strong></span></font></p>
<p style="box-sizing: border-box;"><font face="microsoft yahei"><span style="line-height: 26px;"><strong>DEVICE=&quot;eth1&quot;</strong></span></font></p>
<p style="box-sizing: border-box;">&nbsp;</p>
<p style="box-sizing: border-box;"><font face="microsoft yahei"><span style="line-height: 26px;"><strong>BOOTPROTO=&quot;static&quot;</strong></span></font></p>
<div>&nbsp;</div>
<p style="box-sizing: border-box; font-family: 'microsoft yahei'; line-height: 26px;"><strong style="box-sizing: border-box;"><br />
</strong></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-931-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-04-17 18:31</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-926-1.html</guid>
			<title>linux crontab 实现每秒执行</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<ol start="1" style="border: none; color: rgb(92, 92, 92); font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; line-height: 26px; margin-right: 0px !important; margin-bottom: 1px !important; margin-left: 45px !important;">
    <li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;"><span style="margin: 0px; padding: 0px; border: none; background-color: inherit;">#!/bin/bash&nbsp;&nbsp;</span></span></li>
    <li class="" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">&nbsp;&nbsp;</span></li>
    <li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">step=2&nbsp;#间隔的秒数，不能大于60&nbsp;&nbsp;</span></li>
    <li class="" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">&nbsp;&nbsp;</span></li>
    <li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">for&nbsp;((&nbsp;i&nbsp;=&nbsp;0;&nbsp;i&nbsp;&lt;&nbsp;60;&nbsp;i=(i+step)&nbsp;));&nbsp;do&nbsp;&nbsp;</span></li>
    <li class="" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">&nbsp;&nbsp;&nbsp;&nbsp;echo &quot;OK&quot; &nbsp;</span></li>
    <li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">&nbsp;&nbsp;&nbsp;&nbsp;sleep&nbsp;$step&nbsp;&nbsp;</span></li>
    <li class="" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">done&nbsp;&nbsp;</span></li>
    <li class="alt" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; color: inherit; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important;"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">&nbsp;&nbsp;</span></li>
    <li class="" style="border-style: none none none solid; border-left-width: 3px; border-left-color: rgb(108, 226, 108); list-style: decimal-leading-zero outside; line-height: 18px; margin: 0px !important; padding: 0px 3px 0px 10px !important; background-color: rgb(248, 248, 248);"><span style="margin: 0px; padding: 0px; border: none; color: black; background-color: inherit;">exit&nbsp;0 &nbsp;</span></li>
</ol>
<div><font face="Consolas, Courier New, Courier, mono, serif"><span style="font-size: 12px; line-height: 18px;"><br />
</span></font></div>
<div><font face="Consolas, Courier New, Courier, mono, serif"><span style="font-size: 12px; line-height: 18px;"><br />
</span></font></div>
<div><font face="Consolas, Courier New, Courier, mono, serif"><span style="font-size: 12px; line-height: 18px;">
<div>#!/bin/bash</div>
<div>step=3</div>
<div>for (( i = 0; i &lt; 60; i=(i+step) )); do</div>
<div>id=`ps ax | grep &quot;.php&quot; | grep -v grep | awk -F&quot; &quot; '{print $1}'`</div>
<div>echo $id</div>
<div>if [ &quot;$id&quot;x = x ];then</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;no&quot;</div>
<div>else</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; sleep 1</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; nid=`ps ax | grep &quot;.php&quot; | grep -v grep | awk -F&quot; &quot; '{print $1}'`</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; if [ &quot;$id&quot; == &quot;$nid&quot; ];then</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; echo $nid</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; kill $id</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; fi</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; echo $id</div>
<div>fi</div>
<div>sleep $step</div>
<div>done</div>
<div>&nbsp;</div>
<div>exit 0</div>
</span></font></div>]]></description>
			<link>http://meisw.wdlinux.cn//show-926-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2017-02-18 20:43</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-898-1.html</guid>
			<title>linux环境下NPM安装小结（淘宝镜像）</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<h2 style="margin: 10px 0px; padding: 0px; font-size: 21px; line-height: 1.5; font-family: Verdana, Arial, Helvetica, sans-serif;">1、安装Nodejs</h2>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　官网地址为http://nodejs.org</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　但国外地址下载太慢了，建议从淘宝下载（https://npm.taobao.org/mirrors/node/）</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">wget</span> https:<span style="margin: 0px; padding: 0px; color: rgb(0, 128, 0); line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: rgb(0, 128, 0); line-height: 1.5 !important;">npm.taobao.org/mirrors/node/latest-v4.x/node-v4.4.7-linux-x64.tar.gz</span></pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　解压：</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;"><span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">tar</span> -zxvf node-v4.<span style="margin: 0px; padding: 0px; color: rgb(128, 0, 128); line-height: 1.5 !important;">4.7</span>-linux-x64.<span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">tar</span>.gz</pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　设置环境变量：</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;">export PATH=$PATH:/opt/node-v4.<span style="margin: 0px; padding: 0px; color: rgb(128, 0, 128); line-height: 1.5 !important;">4.7</span>-linux-x64/bin</pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">&nbsp;</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">-----</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">wget https://npm.taobao.org/mirrors/node/latest-v6.x/node-v6.9.2.tar.gz</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">tar zxvf&nbsp;</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">./configure;make;make install</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">---------------------&nbsp;</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">&nbsp;</p>
<h2 style="margin: 10px 0px; padding: 0px; font-size: 21px; line-height: 1.5; font-family: Verdana, Arial, Helvetica, sans-serif;">2、安装NMP</h2>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　下载nmp安装包，<span style="margin: 0px; padding: 0px; color: rgb(255, 0, 0);">一般nodejs包中已经包含了，设置过环境变量就可以直接使用nmp命令了</span>，如果没有安装，先下载：</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　官网地址:www.npmjs.com<span class="c-icons-outer" style="margin: 0px; padding: 0px;">&nbsp;</span></p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;"><span class="c-icons-outer" style="margin: 0px; padding: 0px;">　　</span>淘宝地址：https://npm.taobao.org/mirrors/npm/</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　安装使用如下命令：</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;">node cli.js <span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">install</span> npm -gf</pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">&nbsp;</p>
<h2 style="margin: 10px 0px; padding: 0px; font-size: 21px; line-height: 1.5; font-family: Verdana, Arial, Helvetica, sans-serif;">3、安装CNMP（非必要）</h2>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　由于NMP源都在国外，下载相关资源很慢，所以建议用国内的淘宝NPM镜像（http://npm.taobao.org/）</p>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　通过cnmp命令安装的包都会从淘宝NMP下载，速度很快。　　</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;">$ npm <span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">install</span> -g cnpm --registry=https:<span style="margin: 0px; padding: 0px; color: rgb(0, 128, 0); line-height: 1.5 !important;">//</span><span style="margin: 0px; padding: 0px; color: rgb(0, 128, 0); line-height: 1.5 !important;">registry.npm.taobao.org</span></pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　安装完之后，安装模块的命令就变为：</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;">$ cnpm <span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">install</span> [name]</pre>
</div>
<p style="margin: 10px auto; font-family: Verdana, Arial, Helvetica, sans-serif; line-height: 21px;">　　同步模块命令为：</p>
<div class="cnblogs_code" style="margin: 5px 0px; padding: 5px; border: 1px solid rgb(204, 204, 204); overflow: auto; font-family: 'Courier New' !important; font-size: 12px !important; background-color: rgb(245, 245, 245);">
<pre style="margin-top: 0px; margin-bottom: 0px; padding: 0px; white-space: pre-wrap; word-wrap: break-word; font-family: 'Courier New' !important;">$ cnpm <span style="margin: 0px; padding: 0px; color: rgb(0, 0, 255); line-height: 1.5 !important;">sync</span> connect</pre>
</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-898-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2016-12-20 21:54</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-895-1.html</guid>
			<title>tar.xz文件如何解压</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;</p>
<h1 class="entry-title" style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px;">XZ压缩最新压缩率之王</h1>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">xz这个压缩可能很多都很陌生，不过您可知道xz是绝大数linux默认就带的一个压缩工具。</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">之前xz使用一直很少，所以几乎没有什么提起。</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">我是在下载phpmyadmin的时候看到这种压缩格式的，phpmyadmin压缩包xz格式的居然比7z还要小，这引起我的兴趣。</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">最新一段时间会经常听到xz被采用的声音，像是最新的archlinux某些东西就使用xz压缩。不过xz也有一个坏处就是压缩时间比较长，比7z压缩时间还长一些。不过压缩是一次性的，所以可以忽略。</p>
<h3 style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px;"><a name="t1" style="color: rgb(202, 0, 0);"></a>xz压缩文件方法或命令</h3>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">xz -z 要压缩的文件</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">如果要保留被压缩的文件加上参数 -k ，如果要设置压缩率加入参数 -0 到 -9调节压缩率。如果不设置，默认压缩等级是6.</p>
<h3 style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px;"><a name="t2" style="color: rgb(202, 0, 0);"></a>xz解压文件方法或命令</h3>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">xz -d 要解压的文件</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">同样使用 -k 参数来保留被解压缩的文件。</p>
<h3 style="margin: 0px; padding: 0px; font-family: Arial; line-height: 26px;"><a name="t3" style="color: rgb(202, 0, 0);"></a>创建或解压tar.xz文件的方法</h3>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">习惯了 tar czvf 或 tar xzvf 的人可能碰到 tar.xz也会想用单一命令搞定解压或压缩。其实不行 tar里面没有征对xz格式的参数比如 z是针对 gzip，j是针对 bzip2。</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;">创建tar.xz文件：只要先 tar cvf xxx.tar xxx/ 这样创建xxx.tar文件先，然后使用 xz -z xxx.tar 来将 xxx.tar压缩成为 xxx.tar.xz</p>
<p style="margin-bottom: 0px; font-family: Arial; line-height: 26px;"><strong><span style="color: rgb(255, 0, 0);">解压tar.xz文件：先 xz -d xxx.tar.xz 将 xxx.tar.xz解压成 xxx.tar 然后，再用 tar xvf xxx.tar来解包。</span></strong></p>]]></description>
			<link>http://meisw.wdlinux.cn//show-895-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2016-12-18 19:34</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-894-1.html</guid>
			<title>DNF的命令使用教学</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;DNF新一代的RPM软件包管理器。他首先出现在 Fedora 18 这个发行版中。而最近，他取代了YUM，正式成为 Fedora 22 的包管理器。</p>
<div>&nbsp;</div>
<div>DNF包管理器克服了YUM包管理器的一些瓶颈，提升了包括用户体验，内存占用，依赖分析，运行速度等多方面的内容。</div>
<div>&nbsp;</div>
<div>DNF使用 RPM, libsolv 和 hawkey 库进行包管理操作。尽管它没有预装在 CentOS 和 RHEL 7 中，但你可以在使用 YUM 的同时使用 DNF 。</div>
<div>&nbsp;</div>
<div>DNF 的最新稳定发行版版本号是 1.0，发行日期是2015年5月11日。 这一版本的额 DNF 包管理器（包括在他之前的所有版本） 都大部分采用 Pathon 编写，发行许可为GPL v2.</div>
<div>&nbsp;</div>
<div>&ndash; 安装 DNF 包管理器</div>
<div>&nbsp;</div>
<div>DNF 并未默认安装在 RHEL 或 CentOS 7系统中，但是 Fedora 22 已经默认使用 DNF .</div>
<div>&nbsp;</div>
<div>1.为了安装 DNF ，您必须先安装并启用 epel-release 依赖。</div>
<div>&nbsp;</div>
<div>在系统中执行以下命令：</div>
<div>&nbsp;</div>
<div># yum install epel-release</div>
<div>&nbsp;</div>
<div>或者</div>
<div>&nbsp;</div>
<div># yum install epel-release -y</div>
<div>&nbsp;</div>
<div>其实这里并没有强制使用&rdquo;-y&rdquo;的理由，相反的，在不使用&rdquo;-y&rdquo;的情况下，用户可以在安装过程中查看到底有哪些东西被安装进了系统。但对于没有这个需求的用户，您可以在 YUM 中使用&rdquo;-y&rdquo;参数来自动安装所有东西。</div>
<div>&nbsp;</div>
<div>2.使用 epel-release 依赖中的 YUM 命令来安装 DNF 包。、</div>
<div>&nbsp;</div>
<div>在系统中执行以下命令：# yum install dnf</div>
<div>&nbsp;</div>
<div>然后， DNF 包管理器就被成功的安装到你的系统中了。接下来，是时候开始我们的教程了！在这个教程中，您将会学到27个用于 DNF 包管理器的命令。使用这些命令，你可以方便有效的管理您系统中的 RPM 软件包。现在，让我们开始学习 DNF 包管理器的27条常用命令吧！</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-894-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2016-12-18 19:24</pubDate>
		</item>
		<item>
			<guid>http://meisw.wdlinux.cn//show-889-1.html</guid>
			<title>samba</title>
			<author>admin</author>
			<description><![CDATA[<p>&nbsp;yum install -y samba</p>
<div>&nbsp;</div>
<div>chkconfig --level 35 smb on</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>vi /etc/samba/smb.conf</div>
<div>&nbsp;</div>
<div>[web]</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; comment = web</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; path = /data/web</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; browseable = yes</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; writable = yes</div>
<div>&nbsp;</div>
<div>chown webd.webd web</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>system user,etc:webd</div>
<div>useradd webd</div>
<div>添加smb用户</div>
<div>/usr/local/samba/bin/smbpasswd -a webd</div>
<div>&nbsp;</div>
<div>列出共享目录</div>
<div>smbclient -L 127.0.0.1 -U webd%123456</div>
<div>&nbsp;</div>
<div>进入命令行模式</div>
<div>smbclient //127.0.0.1/web -U webd%123456</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>---------------------------</div>
<div>1，列出某个IP地址所提供的共享文件夹&nbsp;</div>
<div>smbclient -L 198.168.0.1 -U username%password&nbsp;</div>
<div>&nbsp;</div>
<div>2,像FTP客户端一样使用smbclient&nbsp;</div>
<div>smbclient //192.168.0.1/tmp -U username%password</div>
<div>执行smbclient命令成功后，进入smbclient环境，出现提示符： smb:/&gt; 这时输入？会看到支持的命令</div>
<div>这里有许多命令和ftp命令相似，如cd 、lcd、get、megt、put、mput等。通过这些命令，我们可以访问远程主机的共享资源。&nbsp;</div>
<div>&nbsp;</div>
<div>3,直接一次性使用smbclient命令&nbsp;</div>
<div>smbclient -c &quot;ls&quot; //192.168.0.1/tmp -U username%password</div>
<div>和&nbsp;</div>
<div>smbclient //192.168.0.1/tmp -U username%password</div>
<div>smb:/&gt;ls&nbsp;</div>
<div>功能一样的&nbsp;</div>
<div>&nbsp;</div>
<div>例，创建一个共享文件夹&nbsp;</div>
<div>smbclient -c &quot;mkdir share1&quot; //192.168.0.1/tmp -U username%password&nbsp;</div>
<div>如果用户共享//192.168.0.1/tmp的方式是只读的，会提示&nbsp;</div>
<div>NT_STATUS_ACCESS_DENIED making remote directory /share1&nbsp;</div>
<div>&nbsp;</div>
<div>4，除了使用smbclient，还可以通过mount和smbcount挂载远程共享文件夹&nbsp;</div>
<div>挂载 mount -t cifs -o username=administrator,password=123456 //192.168.0.1/tmp /mnt/tmp&nbsp;</div>
<div>取消挂载 umount /mnt/tmp</div>]]></description>
			<link>http://meisw.wdlinux.cn//show-889-1.html</link>
			<category domain="http://meisw.wdlinux.cn//category-2-1.html">linux</category>
			<pubDate>2016-12-16 11:13</pubDate>
		</item>
	</channel>
</rss>
