<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Linux与系统运维 on Laning's Blog</title><link>https://blog.laning.org/categories/linux%E4%B8%8E%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/</link><description>Recent content in Linux与系统运维 on Laning's Blog</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Tue, 23 Dec 2025 12:07:16 +0800</lastBuildDate><atom:link href="https://blog.laning.org/categories/linux%E4%B8%8E%E7%B3%BB%E7%BB%9F%E8%BF%90%E7%BB%B4/index.xml" rel="self" type="application/rss+xml"/><item><title>服务备份与同步脚本实现</title><link>https://blog.laning.org/posts/wp-0428/</link><pubDate>Tue, 06 Aug 2024 14:21:25 +0800</pubDate><guid>https://blog.laning.org/posts/wp-0428/</guid><description>&lt;h2 id="脚本地址"&gt;脚本地址&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/laningya/Raspberry-Pi/refs/heads/master/shell/back.sh"&gt;raw.githubusercontent.com/laningya/Raspberry-Pi/refs/heads/master/shell/back.sh&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://raw.githubusercontent.com/laningya/Raspberry-Pi/refs/heads/master/shell/rsync.sh"&gt;raw.githubusercontent.com/laningya/Raspberry-Pi/refs/heads/master/shell/rsync.sh&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="使用说明"&gt;使用说明&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;为防止服务器宕机开发，需要配合crontab等服务实现定时备份&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;针对采用docker-compose部署的服务编写，如为其他方式部署的服务，此脚本并不使用&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Armbian/build脚本分析</title><link>https://blog.laning.org/posts/wp-0380/</link><pubDate>Thu, 06 Jun 2024 13:44:10 +0800</pubDate><guid>https://blog.laning.org/posts/wp-0380/</guid><description>&lt;h2 id="1-脚本目录检测和代码健壮性保证"&gt;1. 脚本目录检测和代码健壮性保证&lt;/h2&gt;
&lt;h3 id="11-程序报错退出脚本"&gt;1.1 程序报错退出脚本&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;#set -o pipefail # trace ERR through pipes - will be enabled &amp;#34;soon&amp;#34;
#set -o nounset ## set -u : exit the script if you try to use an uninitialised variable - one day will be enabled
set -e
set -o errtrace # trace ERR through - enabled
set -o errexit ## set -e : exit the script if any statement returns a non-true return value - enabled
# Important, go read http://mywiki.wooledge.org/BashFAQ/105 NOW!
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="12-compilesh脚本目录检测"&gt;1.2. ./compile.sh脚本目录检测&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;SRC=&amp;#34;$(dirname &amp;#34;$(realpath &amp;#34;${BASH_SOURCE[0]}&amp;#34;)&amp;#34;)&amp;#34;
cd &amp;#34;${SRC}&amp;#34; || exit
# check for whitespace in ${SRC} and exit for safety reasons
grep -q &amp;#34;[[:space:]]&amp;#34; &amp;lt;&amp;lt;&amp;lt; &amp;#34;${SRC}&amp;#34; &amp;amp;&amp;amp; {
echo &amp;#34;\&amp;#34;${SRC}\&amp;#34; contains whitespace. Not supported. Aborting.&amp;#34; &amp;gt;&amp;amp;2
exit 1
}
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="2-singlesh-文件加载位于lib"&gt;2. single.sh 文件加载（位于./lib）&lt;/h2&gt;
&lt;h3 id="21-检查bash版本是否高于5x"&gt;2.1 检查bash版本是否高于5.x&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;# The Armbian functions require Bash 5.x.
if [[ &amp;#34;${BASH_VERSINFO:-0}&amp;#34; -lt 5 ]]; then
echo &amp;#34;Armbian build scripts require Bash 5.x. Go get it...&amp;#34; &amp;gt;&amp;amp;2
if [[ &amp;#34;${OSTYPE}&amp;#34; == &amp;#34;darwin&amp;#34;* ]]; then
echo &amp;#34;Armbian build scripts require brew to be installed and working on macOS. (old Bash version)&amp;#34; &amp;gt;&amp;amp;2
echo &amp;#34;Please install brew, *restart your terminal*.&amp;#34; &amp;gt;&amp;amp;2
echo &amp;#34;Then run &amp;#39;brew install bash coreutils git&amp;#39;, *restart your terminal* and then try again.&amp;#34; &amp;gt;&amp;amp;2
exit 51
fi
exit 50
fi
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="22-macos系统检查"&gt;2.2 macOS系统检查&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;是否以root运行脚本&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Homebrew 包管理器已安装并正常工作&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;通过 Homebrew 的 &lt;code&gt;coreutils&lt;/code&gt; 安装的 &lt;code&gt;realpath&lt;/code&gt; 命令是否可用&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;更新 &lt;code&gt;PATH&lt;/code&gt; 环境变量以包含由 Homebrew 安装的 GNU &lt;code&gt;coreutils&lt;/code&gt; 二进制文件。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;确保 &lt;code&gt;${SRC}&lt;/code&gt; 变量（应指向构建脚本的源目录）位于用户的主目录中。这对于 macOS 上的 Docker 兼容性很重要。&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>甲骨文防火墙设置</title><link>https://blog.laning.org/posts/wp-0370/</link><pubDate>Fri, 26 Apr 2024 10:50:59 +0800</pubDate><guid>https://blog.laning.org/posts/wp-0370/</guid><description>&lt;h2 id="前言"&gt;前言&lt;/h2&gt;
&lt;p&gt;甲骨文啊，你真狗！甲骨文除了与其他云厂商一样有防火墙面板，额外在系统镜像上也默认配置了防火墙，这直接导致开机更换ssh端口从而机器失联。。。&lt;/p&gt;
&lt;h2 id="面板防火墙设置"&gt;面板防火墙设置&lt;/h2&gt;
&lt;p&gt;不多说，与其他云厂商没有多大区别&lt;/p&gt;
&lt;h2 id="系统镜像关闭防火墙"&gt;系统镜像关闭防火墙&lt;/h2&gt;
&lt;h3 id="开放所有端口ubuntudebian"&gt;开放所有端口（Ubuntu、Debian）&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="关闭防火墙"&gt;关闭防火墙&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;apt-get purge netfilter-persistent &amp;amp;&amp;amp; reboot
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="参考文章"&gt;参考文章&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://isedu.top/index.php/archives/33/"&gt;Oracle开放全部端口并关闭防火墙 - 清~幽殇 (isedu.top)&lt;/a&gt;&lt;/p&gt;</description></item><item><title>VPS测试脚本</title><link>https://blog.laning.org/posts/wp-0305/</link><pubDate>Sun, 14 Apr 2024 11:08:01 +0800</pubDate><guid>https://blog.laning.org/posts/wp-0305/</guid><description>&lt;h2 id="三网回程测试脚本"&gt;三网回程测试脚本&lt;/h2&gt;
&lt;h3 id="脚本地址"&gt;脚本地址&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/zhanghanyun/backtrace"&gt;zhanghanyun/backtrace: 三网回程路由测试 (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="命令行"&gt;命令行&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="流媒体gpt解锁测试脚本"&gt;流媒体/GPT解锁测试脚本&lt;/h2&gt;
&lt;h3 id="脚本地址-1"&gt;脚本地址&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/lmc999/RegionRestrictionCheck"&gt;lmc999/RegionRestrictionCheck: A bash script to check the status of your IP on various geo-restricted services. (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="命令行-1"&gt;命令行&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;bash &amp;lt;(curl -L -s check.unlock.media)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="bbr加速"&gt;BBR加速&lt;/h2&gt;
&lt;h3 id="脚本地址-2"&gt;脚本地址&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/Chikage0o0/Linux-NetSpeed"&gt;Chikage0o0/Linux-NetSpeed: 将Linux现常用的网络加速集成在一起 (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="命令行-2"&gt;命令行&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;wget -N --no-check-certificate &amp;#34;https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh&amp;#34; &amp;amp;&amp;amp; chmod +x tcp.sh &amp;amp;&amp;amp; ./tcp.sh
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="缝合怪"&gt;缝合怪&lt;/h2&gt;
&lt;h3 id="脚本地址-3"&gt;脚本地址&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/spiritLHLS/ecs/blob/main/README.md"&gt;ecs/README.md at main · spiritLHLS/ecs (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;h3 id="命令行-3"&gt;命令行&lt;/h3&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh &amp;amp;&amp;amp; chmod +x ecs.sh &amp;amp;&amp;amp; bash ecs.sh
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id="xraycli安装脚本"&gt;XrayCLI安装脚本&lt;/h2&gt;
&lt;h3 id="脚本地址-4"&gt;脚本地址&lt;/h3&gt;
&lt;p&gt;&lt;a href="https://github.com/233boy/Xray/wiki/Xray%E4%B8%80%E9%94%AE%E5%AE%89%E8%A3%85%E8%84%9A%E6%9C%AC"&gt;Xray一键安装脚本 · 233boy/Xray Wiki (github.com)&lt;/a&gt;&lt;/p&gt;</description></item><item><title>local</title><link>https://blog.laning.org/posts/wp-0084/</link><pubDate>Fri, 22 Apr 2022 15:54:22 +0800</pubDate><guid>https://blog.laning.org/posts/wp-0084/</guid><description>&lt;h1 id="pip换源"&gt;&lt;strong&gt;pip换源&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;配置文件地址：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;~/.config/pip/pip.conf
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;文件内容：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;命令行操作：&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;附清华大学开源镜像站pypi帮助：&lt;/p&gt;
&lt;p&gt;&lt;a href="https://mirrors.tuna.tsinghua.edu.cn/help/pypi/"&gt;https://mirrors.tuna.tsinghua.edu.cn/help/pypi/&lt;/a&gt;&lt;/p&gt;
&lt;h1 id="vimrc"&gt;&lt;strong&gt;.vimrc&lt;/strong&gt;&lt;/h1&gt;
&lt;p&gt;Github项目地址：&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/amix/vimrc"&gt;https://github.com/amix/vimrc&lt;/a&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.sh
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;~/.vim_runtime/vimrcs/extended.vim中 可以禁用主题和背景色，搭配终端配置透明终端&lt;/p&gt;</description></item></channel></rss>