<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>张明浩 Good Luck To You!</title>
    <description>本博客刊载的所有内容，均为个人学习、研究IT技术所用。</description>
    <link>https://www.zhangminghao.com/</link>
    <atom:link href="https://www.zhangminghao.com/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 14 Oct 2026 17:33:14 +0800</pubDate>
    <lastBuildDate>Wed, 14 Oct 2026 17:33:14 +0800</lastBuildDate>
    <generator>Jekyll v4.4.1</generator>
    
      <item>
        <title>[转]如何阻止 MS OfficePLUS 自动安装？</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#前言&quot; id=&quot;markdown-toc-前言&quot;&gt;前言&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#操作步骤&quot; id=&quot;markdown-toc-操作步骤&quot;&gt;操作步骤&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;前言&quot;&gt;前言&lt;/h2&gt;
&lt;p&gt;Microsoft OfficePLUS 是一款微软与 iSlide 公司合作运营的 Office 插件，主要提供 PPT 插件和模板，官网地址为: https://www.officeplus.cn/&lt;/p&gt;

&lt;p&gt;OfficePLUS 会通过 Microsoft Office 推送，在后台静默安装，很多用户在不知情的情况下就被装上了，但我们有办法可以阻止它。&lt;/p&gt;

&lt;!--more--&gt;

&lt;h2 id=&quot;操作步骤&quot;&gt;操作步骤&lt;/h2&gt;
&lt;p&gt;使用管理员权限打开命令提示符、PowerShell 或 Windows 终端，输入以下命令并回车：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Powershell&quot;&gt;reg add &quot;HKLM\SOFTWARE\Microsoft\MSOfficePLUS&quot; /v &quot;InstallSuccess&quot; /f
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;这个值的主要作用是让 Microsoft Edge 和 Microsoft Office 认为 OfficePLUS 已成功安装了，然后它们就不会再次推送安装了，原理就是这么简单&lt;/p&gt;

&lt;p&gt;其它方法我们也在研究/监测当中。修改 Windows 区域并不是一个完美的解决方案，并且修改区域会导致 Office Tool Plus 无法获取最佳的服务器，进而导致大家在获取 Office Tool Plus 更新的时候显得速度有点慢。所以如果没什么问题的话，我们一般是不建议更改 Windows 区域设置的哦~&lt;/p&gt;

&lt;p&gt;原文：&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;https://blog.yerong.org/archives/641&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sat, 07 Mar 2026 15:23:47 +0800</pubDate>
        <link>https://www.zhangminghao.com/2026/03/07/1772868227/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2026/03/07/1772868227/</guid>
        
        <category>Office</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>QNAP 威联通NAS QTS-416使用非管理型UPS实现停电后自动关机</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#关机脚本&quot; id=&quot;markdown-toc-关机脚本&quot;&gt;关机脚本&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#需要配置的参数&quot; id=&quot;markdown-toc-需要配置的参数&quot;&gt;需要配置的参数&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#crontab配置&quot; id=&quot;markdown-toc-crontab配置&quot;&gt;crontab配置&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;本文脚本仅在威联通 QTS-416上测试通过，其他机型需自行修改适配。
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;开机运行版本：&lt;a href=&quot;https://github.com/zhangminghao1989/QNAP_NAS_PowerCheck&quot;&gt;https://github.com/zhangminghao1989/QNAP_NAS_PowerCheck&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;原理是使用NAS跑脚本ping路由器或者某个没断电可以正常网络联通的设备，如果断电，这个设备必然ping不通，超过一定次数，可判定为断电，调用脚本关机。&lt;/p&gt;

&lt;h2 id=&quot;关机脚本&quot;&gt;关机脚本&lt;/h2&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;#!/bin/bash

function usage()
{
echo &quot;$ARG0 usage:
    $ARG0 -c check parameter
    $ARG0 -h help
    $ARG0 -d drill,not really shutdown
    &quot;
}
# write qnap log
log=true
# UPS live minute
live_min=10
# nas shutdown cost minute
shutdown_min=5
# buffer minute
buffer_min=3
# ping check count
check_cnt=5
# ping check interval seconds
interval_sec=3
# ping ip,default can set router
ip=192.168.1.1
# script crontab iterval
task_interval_sec=60
# shutdown cost second= shutdown cost + buffer time
shutdown_buffer_cost_min=`expr $shutdown_min + $buffer_min`
#echo &quot;shutdown_buffer_cost_min = $shutdown_buffer_cost_min&quot;
shutdown_buffer_cost_sec=`expr $shutdown_buffer_cost_min \* 60`
#echo &quot;shutdown_buffer_cost_sec = $shutdown_buffer_cost_sec&quot;
# check cost = check interval * check_count
check_cost_max_sec=`expr $interval_sec \* $check_cnt`
#echo &quot;check_cost_max_sec = $check_cost_max_sec&quot;

# check can use seconds = live_min - shutdown_cost - one_crontab_interval
check_can_use_sec=`expr $live_min \* 60 - $shutdown_buffer_cost_sec - $check_cost_max_sec - $task_interval_sec`
#echo &quot;check_can_use_sec = $check_can_use_sec&quot;
DRILL=false
while getopts &quot;dhc&quot; opts
do
    case $opts in
    c)
        echo &quot;shutdown cost(s)      = $shutdown_buffer_cost_sec s&quot;
        echo &quot;ping check cost(s)    = $check_cost_max_sec s&quot;
        echo &quot;ping check can use(s) = $check_can_use_sec s&quot;
        if [ $check_cost_max_sec -gt $check_can_use_sec ]; then
            echo &quot;alert:ping check cost time &amp;lt; ping can use time !!! may got not enought time to shutdown&quot;
        else
            echo &quot;parameter all OK!!!&quot;
        fi
        exit;
    ;;
    h)
    usage; exit;
    ;;
    d)
        DRILL=true
    esac
done

# ping fail counter
fail_cnt=0
while [ $fail_cnt -le $check_cnt ]; do
    now=`date &quot;+%Y-%m-%d %H:%M:%S&quot;`
    if ping -c 1 $ip &amp;gt; /dev/null; then
        echo &quot;$now $ip ping success&quot;
        if [ $log = true ]; then
            log_tool -t 0 -N &quot;Power Check&quot; -G &quot;NAS Power Status&quot; -a &quot;[Power Check] ping success&quot; 4
        fi
        break
    else
        let fail_cnt++
        echo &quot;$ip ping fail,count $fail_cnt&quot;
        log_tool -t 0 -N &quot;Power Check&quot; -G &quot;NAS Power Status&quot; -a &quot;[Power Check] $ip ping fail,fail count $fail_cnt&quot; 4
        if [ $fail_cnt -ge $check_cnt ]; then
            echo &quot;$now $ip ping fail,fail count $fail_cnt great than $check_cnt,start to shutdown NAS&quot;
            if [ $log = true ]; then
                log_tool -t 1 -N &quot;Power Check&quot; -G &quot;NAS Power Status&quot; -a &quot;[Power Check] ping fail count great than $check_cnt, shut down NAS&quot; 2
            fi
            if [ $DRILL = true ]; then
                echo &quot;drill end ,$ip check fail&quot;
                exit;
            else
                /sbin/poweroff
            fi
            break
        fi
        sleep $interval_sec
    fi
done
&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
  &lt;li&gt;-h 可以查看帮助&lt;/li&gt;
  &lt;li&gt;-d 演习模式，不会实际执行关机指令，可以测试下脚本是否跑通&lt;/li&gt;
  &lt;li&gt;-c 会根据配置参数计算出是否有足够实际来做ping检测和关机操作，具体为：&lt;br /&gt;
检测可用时间 = ups断电支持时间 - NAS关机时间 - 机动时间 - crontab时间间隔&lt;br /&gt;
检测时间 = 检测间隔 * 一次ping时间&lt;br /&gt;
如果 检测可用时间&amp;lt;检测时间，会提示，此时需要调整参数，保证NAS有足够时间关机&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&quot;需要配置的参数&quot;&gt;需要配置的参数&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;# 是否输出qnap日志，默认开
log=true
# 断电后，UPS预估关机耗时，单位分钟
live_min=10
# NAS关机预估耗时，单位分钟
shutdown_min=5
# 预留机动时间，单位分钟
buffer_min=3
# ping检查失败最大次数
check_cnt=5
# ping检查间隔
interval_sec=3
# ping的IP，一般为路由器
ip=192.168.1.1
# 脚本在crontab内的调用间隔，单位秒，根据crontab配置调整，只用于使用-c参数时计算时间，不影响实际执行效果
task_interval_sec=60
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;crontab配置&quot;&gt;crontab配置&lt;/h2&gt;
&lt;p&gt;crontab 配置方式详细可以参考&lt;a href=&quot;https://wiki.qnap.com/wiki/Add_items_to_crontab&quot;&gt;https://wiki.qnap.com/wiki/Add_items_to_crontab&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;vi /etc/config/crontab
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;添加内容，按实际脚本路径修改命令。&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;* * * * * /share/CACHEDEV1_DATA/homes/admin/powerchk.sh
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;重启crontab&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;crontab /etc/config/crontab &amp;amp;&amp;amp; /etc/init.d/crond.sh restart
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;参考文章：&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;https://blog.csdn.net/asynct/article/details/103826950&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Sat, 23 Mar 2024 17:41:13 +0800</pubDate>
        <link>https://www.zhangminghao.com/2024/03/23/1711186873/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2024/03/23/1711186873/</guid>
        
        <category>NAS</category>
        
        <category>Linux</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>ASP网站从Windows Server 2003 IIS6 升级到Windows Server 2008 R2 IIS7.5需要做的兼容性设置</title>
        <description>
&lt;p&gt;在Windows Server 2003 的 IIS6 下正常运行的ASP网站，在升级到Windows Server 2008 R2 的 IIS7.5 以后大部分情况下是不能正常运行的，需要进行以下兼容性设置。
&lt;!--more--&gt;&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;应用程序池的基本设置中“托管管道模式”设置为“经典(Classic)”。&lt;/li&gt;
  &lt;li&gt;应用程序池的高级设置中“启用32位应用程序”设置为“True”。&lt;/li&gt;
  &lt;li&gt;IIS的“ASP”设置中“启用父路径”按需求可设置为“True”。&lt;/li&gt;
  &lt;li&gt;为了安全性，对于不需要执行脚本的目录，可在该目录的功能视图中打开“处理程序映射”，在右边的“编辑功能权限”中取消“脚本”。&lt;/li&gt;
  &lt;li&gt;对于需要写权限的文件，增加“IUSR”用户的写权限即可。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;经此设置，使用老旧代码的ASP网站大部分情况下应该可以正常运行了。&lt;br /&gt;
当然，你也可以选择代码重构以使用IIS7.5的新特性。&lt;/p&gt;
</description>
        <pubDate>Tue, 21 Mar 2023 23:56:41 +0800</pubDate>
        <link>https://www.zhangminghao.com/2023/03/21/1679414227/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2023/03/21/1679414227/</guid>
        
        <category>Web</category>
        
        <category>ASP</category>
        
        <category>Windows</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>在Debian 10系统上搭建ERPNext系统</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#硬件要求&quot; id=&quot;markdown-toc-硬件要求&quot;&gt;硬件要求&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#安装基础运行环境&quot; id=&quot;markdown-toc-安装基础运行环境&quot;&gt;安装基础运行环境&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#安装mysql&quot; id=&quot;markdown-toc-安装mysql&quot;&gt;安装MySQL&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#安装其他运行环境&quot; id=&quot;markdown-toc-安装其他运行环境&quot;&gt;安装其他运行环境&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#安装erpnext&quot; id=&quot;markdown-toc-安装erpnext&quot;&gt;安装ERPNext&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#修复运行故障&quot; id=&quot;markdown-toc-修复运行故障&quot;&gt;修复运行故障&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#修复pdf乱码&quot; id=&quot;markdown-toc-修复pdf乱码&quot;&gt;修复PDF乱码&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#完成安装&quot; id=&quot;markdown-toc-完成安装&quot;&gt;完成安装&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;本文介绍在Debian 10系统上搭建ERPNext系统的方法。
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;本人收费提供ERPNext系统搭建、定制、运维服务，有需要的老板请与我联系。&lt;/p&gt;

&lt;h2 id=&quot;硬件要求&quot;&gt;硬件要求&lt;/h2&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;网站数量&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;每个站点的用户&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;内存（GB）&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;磁盘空间（GB）&lt;/th&gt;
      &lt;th style=&quot;text-align: center&quot;&gt;处理器&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;5-10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;40&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;1&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;10-30&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;4&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;40&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;1-5&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;5-10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;8&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;40&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;2&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;1-5&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;10-30&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;16&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;80&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;5-10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;5-10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;16&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;80&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;4&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;5-10&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;10-30&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;32&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;160&lt;/td&gt;
      &lt;td style=&quot;text-align: center&quot;&gt;8&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;安装基础运行环境&quot;&gt;安装基础运行环境&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo apt-get install xvfb libfontconfig wkhtmltopdf
sudo apt-get install git python-dev python3-dev python-setuptools python-pip python3-setuptools python3-pip
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;安装mysql&quot;&gt;安装MySQL&lt;/h2&gt;
&lt;p&gt;使用Debian默认的10.3版本&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo apt-get install mariadb-server
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;按提示设置root用户密码&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;设置使用密码登陆mysql&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo mysql -u root
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;然后在SQL终端中输入以下命令&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-SQL&quot;&gt;use mysql;
update user set plugin=&apos;&apos; where User=&apos;root&apos;;
flush privileges;
exit;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;安装MySQL开发文件&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo apt-get install default-libmysqlclient-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;修改MySQL配置文件&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo nano /etc/mysql/my.cnf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;添加以下内容&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[mysqld]
character-set-client-handshake = FALSE
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci
[mysql]
default-character-set = utf8mb4
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;重启MySQL&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo service mysql restart
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;安装其他运行环境&quot;&gt;安装其他运行环境&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo apt-get install redis-server
sudo apt-get install curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
nvm install 12
npm install -g yarn
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;安装erpnext&quot;&gt;安装ERPNext&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;pip install frappe-bench
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;注销并重新登陆&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;安装Frapp并指定版本号为12&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;bench init --frappe-branch version-12 frappe-bench
cd ~/frappe-bench
./env/bin/pip install -e apps/frappe/
./env/bin/pip3 install -e apps/frappe/
bench start
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;打开一个新的终端&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;cd frappe-bench/
bench new-site erpnext.site
bench get-app --branch version-12 erpnext
./env/bin/pip install -e apps/erpnext/
./env/bin/pip3 install -e apps/erpnext/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;创建一个名称为&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;erpnext.site&lt;/code&gt;的工作台，按提示输入MySQL root用户密码，并设置ERPNext管理员密码。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;bench --site erpnext.site install-app erpnext
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;设置生产模式（即开机自动运行）&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;cd ~/frappe-bench/
sudo apt-get install nginx
bench setup nginx
sudo ln -s `pwd`/config/nginx.conf /etc/nginx/sites-enabled/frappe-bench.conf
sudo rm /etc/nginx/sites-enabled/default
sudo nginx -s reload
sudo apt-get install supervisor
bench setup supervisor
sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe-bench.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;设置自动备份&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;bench setup backups
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;修复运行故障&quot;&gt;修复运行故障&lt;/h2&gt;
&lt;h3 id=&quot;修复pdf乱码&quot;&gt;修复PDF乱码&lt;/h3&gt;
&lt;p&gt;将Windows相关字体复制到&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/share/fonts&lt;/code&gt;目录，然后执行&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;fc-cache -fv
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;修复redis启动异常&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo su
echo &quot;vm.overcommit_memory=1&quot; &amp;gt;&amp;gt; /etc/sysctl.conf
echo &quot;net.core.somaxconn=511&quot; &amp;gt;&amp;gt; /etc/sysctl.conf
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo nano /etc/rc.local
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;添加以下内容&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;#!/bin/sh
echo never &amp;gt; /sys/kernel/mm/transparent_hugepage/enabled
exit 0
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;设置运行权限并重启&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo chmod +x /etc/rc.local
sudo reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;完成安装&quot;&gt;完成安装&lt;/h2&gt;
&lt;p&gt;用浏览器打开服务器80端口，按提示初始化网站即可。&lt;/p&gt;
</description>
        <pubDate>Sun, 29 Dec 2019 23:25:12 +0800</pubDate>
        <link>https://www.zhangminghao.com/2019/12/29/1577628568/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2019/12/29/1577628568/</guid>
        
        <category>Web</category>
        
        <category>软件应用</category>
        
        <category>Linux</category>
        
        <category>ERP</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>在Debian中启用sudo</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#一安装sudo&quot; id=&quot;markdown-toc-一安装sudo&quot;&gt;一、安装sudo&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#二将用户加入sudo组&quot; id=&quot;markdown-toc-二将用户加入sudo组&quot;&gt;二、将用户加入sudo组&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#三配置文件解析&quot; id=&quot;markdown-toc-三配置文件解析&quot;&gt;三、配置文件解析&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#四实例应用&quot; id=&quot;markdown-toc-四实例应用&quot;&gt;四、实例应用&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#1获取sftp程序路径&quot; id=&quot;markdown-toc-1获取sftp程序路径&quot;&gt;1.获取sftp程序路径&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2配置sudo&quot; id=&quot;markdown-toc-2配置sudo&quot;&gt;2.配置sudo&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3修改winscp设置&quot; id=&quot;markdown-toc-3修改winscp设置&quot;&gt;3.修改WinSCP设置&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;刚安装好的Debian默认是没有sudo功能的，用以下方法可开启sudo功能。
&lt;!--more--&gt;&lt;/p&gt;

&lt;h2 id=&quot;一安装sudo&quot;&gt;一、安装sudo&lt;/h2&gt;
&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;su
apt-get install sudo
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;二将用户加入sudo组&quot;&gt;二、将用户加入sudo组&lt;/h2&gt;
&lt;p&gt;将需要启用sudo功能的用户加入sudo组（user为用户名）。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;adduser user sudo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;至此user已可以正常使用sudo&lt;/p&gt;

&lt;h2 id=&quot;三配置文件解析&quot;&gt;三、配置文件解析&lt;/h2&gt;
&lt;p&gt;使用&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;visudo&lt;/code&gt;命令可以修改sudo的配置文件&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers&lt;/code&gt;文件，而且会自动检查配置文件语法，保存时会显示保存为&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/sudoers.tmp&lt;/code&gt;文件，直接保存即可，无需修改文件名。&lt;/p&gt;

&lt;p&gt;根据我的测试，对同一个用户生效的规则，后面的规则会覆盖前面的规则，在编写配置文件时需要注意。&lt;/p&gt;

&lt;p&gt;我们来看看sudoers配置中的root用户，root用户可以做任何事情：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;root ALL=(ALL:ALL) ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;ul&gt;
  &lt;li&gt;root指root用户&lt;/li&gt;
  &lt;li&gt;第一个ALL表示此规则适用于从所有主机登录的root用户&lt;/li&gt;
  &lt;li&gt;第二个ALL表示root用户可以作为所有用户运行命令&lt;/li&gt;
  &lt;li&gt;第三个ALL表示root用户可以作为所有组运行命令&lt;/li&gt;
  &lt;li&gt;第四个ALL表示此规则适用于所有命令&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;允许用户组使用sudo&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;%sudo ALL=(ALL:ALL) ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;此处&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%sudo&lt;/code&gt;指sudo用户组，由于此条配置的存在，所以将任意用户直接加入sudo用户组即可使该用户使用sudo命令。&lt;/p&gt;

&lt;p&gt;允许特定用户使用sudo命令而不需要密码&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;user ALL(ALL:ALL) NOPASSWD:ALL
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;其中最后一个ALL可以修改为指定程序路径，则此用户使用sudo运行指定程序时不需要密码。如果该用户同时是sudo用户组的成员，则此条配置必须在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%sudo ALL=(ALL:ALL) ALL&lt;/code&gt;后面才可生效。&lt;/p&gt;

&lt;h2 id=&quot;四实例应用&quot;&gt;四、实例应用&lt;/h2&gt;
&lt;p&gt;在WinSCP中使普通用户以root权限登录&lt;/p&gt;

&lt;h3 id=&quot;1获取sftp程序路径&quot;&gt;1.获取sftp程序路径&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo cat /etc/ssh/sshd_config | grep sftp
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;结果：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;Subsystem sftp /usr/lib/openssh/sftp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;2配置sudo&quot;&gt;2.配置sudo&lt;/h3&gt;

&lt;p&gt;使用visudo修改配置文件，使sftp-server可以免密码使用sudo运行&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;user ALL=(ALL:ALL) NOPASSWD:/usr/lib/openssh/sftp-server
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;如果user在sudo用户组内，则此条配置必须在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;%sudo ALL=(ALL:ALL) ALL&lt;/code&gt;后面才能生效。&lt;/p&gt;

&lt;p&gt;将&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Defaults requiretty&lt;/code&gt;这一行注释掉，这一步的目的是关闭可交互终端需求。&lt;/p&gt;

&lt;h3 id=&quot;3修改winscp设置&quot;&gt;3.修改WinSCP设置&lt;/h3&gt;

&lt;p&gt;使用SFTP协议，在“高级设置-环境-SFTP-SFTP服务器”中输入&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo /usr/lib/openssh/sftp-server&lt;/code&gt;保存即可。&lt;/p&gt;

&lt;p&gt;参考&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;https://serversforhackers.com/c/sudo-and-sudoers-configuration&lt;/p&gt;
&lt;/blockquote&gt;
</description>
        <pubDate>Thu, 26 Oct 2017 23:17:59 +0800</pubDate>
        <link>https://www.zhangminghao.com/2017/10/26/1509026968/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2017/10/26/1509026968/</guid>
        
        <category>Linux</category>
        
        <category>软件应用</category>
        
        
        <category>Linux</category>
        
      </item>
    
      <item>
        <title>解决使用logrotate切割日志后新日志无法写入的问题</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#方案1&quot; id=&quot;markdown-toc-方案1&quot;&gt;方案1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#方案2&quot; id=&quot;markdown-toc-方案2&quot;&gt;方案2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;部分软件在logrotate切割日志无法将新日志写入日志文件，可用以下方法解决：
&lt;!--more--&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;方案1：给软件发信号，重新打开log文件。具体方法需参考各软件文档。&lt;/li&gt;
  &lt;li&gt;方案2：加入copytruncate参数。&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;原理详见&lt;a href=&quot;http://www.cnblogs.com/sailrancho/p/4784763.html&quot;&gt;http://www.cnblogs.com/sailrancho/p/4784763.html&lt;/a&gt;，在此节录部分内容。&lt;/p&gt;

&lt;h2 id=&quot;方案1&quot;&gt;方案1&lt;/h2&gt;

&lt;p&gt;这个方案会创建一个新的日志文件给程序输出日志。&lt;/p&gt;

&lt;p&gt;这个方案的思路是重命名原日志文件，创建新的日志文件。详细步骤如下：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;重命名程序当前正在输出日志的程序。因为重命名只会修改目录文件的内容，而进程操作文件靠的是inode编号，所以并不影响程序继续输出日志。&lt;/li&gt;
  &lt;li&gt;创建新的日志文件，文件名和原来日志文件一样。虽然新的日志文件和原来日志文件的名字一样，但是inode编号不一样，所以程序输出的日志还是往原日志文件输出。&lt;/li&gt;
  &lt;li&gt;通过某些方式通知程序，重新打开日志文件。程序重新打开日志文件，靠的是文件路径而不是inode编号，所以打开的是新的日志文件。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;什么方式通知程序我重新打开日志呢，简单粗暴的方法是杀死进程重新打开。很多场景这种作法会影响在线的服务，于是有些程序提供了重新打开日志的接口，比如可以通过信号通知nginx。各种IPC方式都可以，前提是程序自身要支持这个功能。&lt;/p&gt;

&lt;p&gt;有个地方值得一提，一个程序可能输出了多个需要滚动的日志文件。每滚动一个就通知程序重新打开所有日志文件不太划得来。有个sharedscripts的参数，让程序把所有日志都重命名了以后，只通知一次。&lt;/p&gt;

&lt;h2 id=&quot;方案2&quot;&gt;方案2&lt;/h2&gt;

&lt;p&gt;如果程序不支持重新打开日志的功能，又不能粗暴地重启程序，怎么滚动日志呢？copytruncate的方案出场了。&lt;/p&gt;

&lt;p&gt;这个方案的思路是把正在输出的日志拷(copy)一份出来，再清空(trucate)原来的日志。详细步骤如下：&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;拷贝程序当前正在输出的日志文件，保存文件名为滚动结果文件名。这期间程序照常输出日志到原来的文件中，原来的文件名也没有变。&lt;/li&gt;
  &lt;li&gt;清空程序正在输出的日志文件。清空后程序输出的日志还是输出到这个日志文件中，因为清空文件只是把文件的内容删除了，文件的inode编号并没有发生变化，变化的是元信息中文件内容的信息。&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;结果上看，旧的日志内容存在滚动的文件里，新的日志输出到空的文件里。实现了日志的滚动。&lt;/p&gt;

&lt;p&gt;这个方案有两个有趣的地方。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;文件清空并不影响到输出日志的程序的文件表里的文件位置信息，因为各进程的文件表是独立的。那么文件清空后，程序输出的日志应该接着之前日志的偏移位置输出，这个位置之前会被\0填充才对。但实际上logroate清空日志文件后，程序输出的日志都是从文件开始处开始写的。这是怎么做到的？这个问题让我纠结了很久，直到某天灵光一闪，这不是logrotate做的，而是成熟的写日志的方式，都是用O_APPEND的方式写的。如果程序没有用O_APPEND方式打开日志文件，变会出现copytruncate后日志文件前面会被一堆&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\0&lt;/code&gt;填充的情况。&lt;/li&gt;
  &lt;li&gt;日志在拷贝完到清空文件这段时间内，程序输出的日志没有备份就清空了，这些日志不是丢了吗？是的，copytruncate有丢失部分日志内容的风险。所以能用create的方案就别用copytruncate。所以很多程序提供了通知我更新打开日志文件的功能来支持create方案，或者自己做了日志滚动，不依赖logrotate。&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Thu, 14 Sep 2017 23:10:09 +0800</pubDate>
        <link>https://www.zhangminghao.com/2017/09/14/1505398168/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2017/09/14/1505398168/</guid>
        
        <category>Linux</category>
        
        
        <category>Linux</category>
        
      </item>
    
      <item>
        <title>将网站迁移到PHP7.0环境</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#1配置debian系统&quot; id=&quot;markdown-toc-1配置debian系统&quot;&gt;1、配置Debian系统&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#2安装nginx服务端&quot; id=&quot;markdown-toc-2安装nginx服务端&quot;&gt;2、安装Nginx服务端&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3安装php运行环境&quot; id=&quot;markdown-toc-3安装php运行环境&quot;&gt;3、安装PHP运行环境&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#4配置nginx服务端和php运行环境&quot; id=&quot;markdown-toc-4配置nginx服务端和php运行环境&quot;&gt;4、配置Nginx服务端和PHP运行环境&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;之前PHP7.0发布的时候使用了升级模式来运行网站，现在把VPS的系统升级到Debian 8，全新安装PHP7.0运行环境。
&lt;!--more--&gt;&lt;/p&gt;

&lt;h2 id=&quot;1配置debian系统&quot;&gt;1、配置Debian系统&lt;/h2&gt;

&lt;p&gt;安装安装一些常用的系统软件&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;apt-get install logrotate screen software-properties-common
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Debian 8 需添加第三方源dotdeb.org&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;add-apt-repository &apos;deb http://packages.dotdeb.org jessie all&apos;
add-apt-repository &apos;deb-src http://packages.dotdeb.org jessie all&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Debian 8 安装dotdeb.org证书&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;wget http://www.dotdeb.org/dotdeb.gpg
apt-key add dotdeb.gpg
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Debian 8 添加Nginx源&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;add-apt-repository &apos;deb http://nginx.org/packages/mainline/debian/ jessie nginx&apos;
add-apt-repository &apos;deb-src http://nginx.org/packages/mainline/debian/ jessie nginx&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Debian 9 添加Nginx源&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;add-apt-repository &apos;deb http://nginx.org/packages/mainline/debian/ stretch nginx&apos;
add-apt-repository &apos;deb-src http://nginx.org/packages/mainline/debian/ stretch nginx&apos;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;安装Nginx证书&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;wget http://nginx.org/keys/nginx_signing.key
apt-key add nginx_signing.key
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;至此，各软件所需的源添加完成，更新源列表&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;apt-get update
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;2安装nginx服务端&quot;&gt;2、安装Nginx服务端&lt;/h2&gt;

&lt;p&gt;进入终端执行以下命令：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;apt-get install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;3安装php运行环境&quot;&gt;3、安装PHP运行环境&lt;/h2&gt;

&lt;p&gt;进入终端执行以下命令：&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;apt-get install php7.0 php7.0-fpm php7.0-gd php7.0-curl php7.0-sqlite3
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;这是运行Z-Blog PHP版本所需的最少组件，还可根据需要安装其他组件，下面列出常用组件&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;apt-get install php7.0-opcache php7.0-common php7.0-mcrypt php7.0-cgi php7.0-cli php7.0-imagick php7.0-xmlrpc php7.0-dev php7.0-pspell php7.0-recode php7.0-tidy php7.0-xsl php-pear
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;4配置nginx服务端和php运行环境&quot;&gt;4、配置Nginx服务端和PHP运行环境&lt;/h2&gt;

&lt;p&gt;打开文件&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/nginx/nginx.conf&lt;/code&gt;，修改以下内容&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#改运行用户
user  www-data;

#开启gzip压缩
gzip  on;
gzip_disable &quot;msie6&quot;;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;打开文件&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/nginx/fastcgi_params&lt;/code&gt;，添加以下内容&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#开启php支持
fastcgi_param   SCRIPT_FILENAME    $document_root$fastcgi_script_name;
fastcgi_param   PATH_INFO          $fastcgi_path_info;
fastcgi_param   PATH_TRANSLATED    $document_root$fastcgi_path_info;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;打开文件&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/php/7.0/fpm/php.ini&lt;/code&gt;，修改以下内容&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#设置PHP脚本占用最大内存
memory_limit = 32M
#POST方法提交最大限制
post_max_size = 8M
#上传文件最大限制
upload_max_filesize = 8M

[opcache]
; 开关打开
opcache.enable=1
; 开启CLI
opcache.enable_cli=1
; 可用内存, 酌情而定, 单位为：Mb
opcache.memory_consumption=16
; Zend Optimizer + 暂存池中字符串的占内存总量.(单位:MB)
;opcache.interned_strings_buffer=4
; 对多缓存文件限制, 命中率不到 100% 的话, 可以试着提高这个值
;opcache.max_accelerated_files=2000
; Opcache 会在一定时间内去检查文件的修改时间, 这里设置检查的时间周期, 默认为 2, 定位为秒
;opcache.revalidate_freq=2
; 打开快速关闭, 打开这个在PHP Request Shutdown的时候回收内存的速度会提高
opcache.fast_shutdown=1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;打开文件&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/php/7.0/fpm/pool.d/www.conf&lt;/code&gt;，修改以下内容&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;pm.max_children = 1
pm.start_servers = 1
pm.min_spare_servers = 1
pm.max_spare_servers = 1
pm.max_requests = 500
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Fri, 17 Feb 2017 22:54:38 +0800</pubDate>
        <link>https://www.zhangminghao.com/2017/02/17/1487340568/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2017/02/17/1487340568/</guid>
        
        <category>Linux</category>
        
        <category>软件应用</category>
        
        <category>Web</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>在Linux终端环境中使用Socks5代理</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#一使用proxychains&quot; id=&quot;markdown-toc-一使用proxychains&quot;&gt;一、使用Proxychains&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#1安装proxychains&quot; id=&quot;markdown-toc-1安装proxychains&quot;&gt;1.安装Proxychains&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2配置proxychains&quot; id=&quot;markdown-toc-2配置proxychains&quot;&gt;2.配置Proxychains&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3使用proxychains&quot; id=&quot;markdown-toc-3使用proxychains&quot;&gt;3.使用Proxychains&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#二设置全局代理&quot; id=&quot;markdown-toc-二设置全局代理&quot;&gt;二、设置全局代理&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;在Linux终端环境中只支持http代理，本文介绍两种使用Socks5代理的方法。
&lt;!--more--&gt;&lt;/p&gt;

&lt;h2 id=&quot;一使用proxychains&quot;&gt;一、使用Proxychains&lt;/h2&gt;
&lt;h3 id=&quot;1安装proxychains&quot;&gt;1.安装Proxychains&lt;/h3&gt;

&lt;p&gt;在终端中输入以下命令&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure --prefix=/usr --sysconfdir=/etc
make
sudo make install
sudo make install-config
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;2配置proxychains&quot;&gt;2.配置Proxychains&lt;/h3&gt;

&lt;p&gt;修改/etc/proxychains.conf文件&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[ProxyList]
# 将代理服务器添加到此处
# 格式:
#  socks5   192.168.67.78   1080  lamer   secret
#  http       192.168.89.3     8080  justu    hidden
#  socks4   192.168.1.49     1080
#  http       192.168.39.93   8080 
#  支持的代理种类: http, socks4, socks5
#  支持的验证模式: &quot;basic&quot;-http  &quot;user/pass&quot;-socks
socks5 127.0.0.1 1080
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3使用proxychains&quot;&gt;3.使用Proxychains&lt;/h3&gt;

&lt;p&gt;当前Proxychains的版本是4.11，所以编译的二进制程序名是proxychains4，按以下格式使用&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;proxychains4  wget www.google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;二设置全局代理&quot;&gt;二、设置全局代理&lt;/h2&gt;

&lt;p&gt;1.使用Privoxy将Socks5代理转换为http代理&lt;/p&gt;

&lt;p&gt;详细步骤参考&lt;a href=&quot;https://www.zhangminghao.com/2016/08/24/1472047768/&quot;&gt;使用树莓派建立公共Http代理服务器&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2.输入以下命令&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;export http_proxy=127.0.0.1:8118
export https_proxy=127.0.0.1:8118
export ftp_proxy=127.0.0.1:1080
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;http和https协议走Privoxy的http代理，ftp协议可以走socks代理&lt;/p&gt;

&lt;p&gt;3.设置为默认代理&lt;/p&gt;

&lt;p&gt;将上述命令添加到个人文件夹的&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.bashrc&lt;/code&gt;文件末端，就可以使每次开启终端都自动设置代理。&lt;/p&gt;

&lt;p&gt;4.部分程序需要单独设置，如git&lt;/p&gt;
</description>
        <pubDate>Thu, 25 Aug 2016 22:42:47 +0800</pubDate>
        <link>https://www.zhangminghao.com/2016/08/25/1472134168/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2016/08/25/1472134168/</guid>
        
        <category>Linux</category>
        
        <category>科学上网</category>
        
        <category>软件应用</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>使用树莓派建立Http公共代理服务器</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#一安装shadowsocks客户端&quot; id=&quot;markdown-toc-一安装shadowsocks客户端&quot;&gt;一、安装Shadowsocks客户端&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#二配置shadowsocks客户端&quot; id=&quot;markdown-toc-二配置shadowsocks客户端&quot;&gt;二、配置Shadowsocks客户端&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#1修改initd服务脚本&quot; id=&quot;markdown-toc-1修改initd服务脚本&quot;&gt;1.修改init.d服务脚本&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2修改shadowsocks配置文件&quot; id=&quot;markdown-toc-2修改shadowsocks配置文件&quot;&gt;2.修改Shadowsocks配置文件&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3运行shadowsocks客户端&quot; id=&quot;markdown-toc-3运行shadowsocks客户端&quot;&gt;3.运行Shadowsocks客户端&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#三配置http公共代理服务器&quot; id=&quot;markdown-toc-三配置http公共代理服务器&quot;&gt;三、配置http公共代理服务器&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#1安装privoxy&quot; id=&quot;markdown-toc-1安装privoxy&quot;&gt;1.安装Privoxy&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2配置privoxy&quot; id=&quot;markdown-toc-2配置privoxy&quot;&gt;2.配置Privoxy&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#3重载配置文件&quot; id=&quot;markdown-toc-3重载配置文件&quot;&gt;3.重载配置文件&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#四配置自动切换代理&quot; id=&quot;markdown-toc-四配置自动切换代理&quot;&gt;四、配置自动切换代理&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;#1修改etcprivoxyconfig文件&quot; id=&quot;markdown-toc-1修改etcprivoxyconfig文件&quot;&gt;1.修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/privoxy/config&lt;/code&gt;文件&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;#2新建etcprivoxypacaction文件输入以下内容&quot; id=&quot;markdown-toc-2新建etcprivoxypacaction文件输入以下内容&quot;&gt;2.新建&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/privoxy/pac.action&lt;/code&gt;文件，输入以下内容&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;目前最有效的翻墙方式是Shadowsocks，但是Shadowsocks是socks5代理且需要安装客户端，所以在部分设备上无法使用。而最为通用的代理方式是http代理，几乎所有的设备都可以使用http代理。本文介绍如何在树莓派上安装Shadowsocks客户端，并将其转换为http公共代理服务器。
&lt;!--more--&gt;&lt;/p&gt;

&lt;h2 id=&quot;一安装shadowsocks客户端&quot;&gt;一、安装Shadowsocks客户端&lt;/h2&gt;

&lt;p&gt;首先安装Shadowsocks客户端，Shadowsocks客户端有多种选择，可随意安装其中一种，本人偏爱libev版客户端。&lt;/p&gt;

&lt;p&gt;在终端中执行以下命令&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;git clone https://github.com/shadowsocks/shadowsocks-libev.git
cd shadowsocks-libev
sudo apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev gawk debhelper dh-systemd init-system-helpers pkg-config asciidoc xmlto
dpkg-buildpackage -b -us -uc -i
cd ..
sudo dpkg -i shadowsocks-libev*.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;也可以使用breakwa11的ShadowsocksR&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;git clone https://github.com/breakwa11/shadowsocks-libev.git
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;二配置shadowsocks客户端&quot;&gt;二、配置Shadowsocks客户端&lt;/h2&gt;

&lt;h3 id=&quot;1修改initd服务脚本&quot;&gt;1.修改init.d服务脚本&lt;/h3&gt;

&lt;p&gt;使用root权限修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/init.d/shadowsocks-libev&lt;/code&gt;文件，将其中的&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DAEMON=/usr/bin/ss-server
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;修改为&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;DAEMON=/usr/bin/ss-local
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/bin/ss-server&lt;/code&gt;是服务端程序，&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/usr/bin/ss-local&lt;/code&gt;是客户端程序。&lt;/p&gt;

&lt;h3 id=&quot;2修改shadowsocks配置文件&quot;&gt;2.修改Shadowsocks配置文件&lt;/h3&gt;

&lt;p&gt;使用root权限修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/shadowsocks-libev/config.json&lt;/code&gt;文件&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;{
  &quot;server&quot;:&quot;www.example.com&quot;  #服务器IP
  &quot;server_port&quot;:8388,     #服务器端口
  &quot;local_address&quot;:&quot;0.0.0.0&quot;,  #客户端监听IP范围
  &quot;local_port&quot;:1080,      #客户端监听端口
  &quot;password&quot;:&quot;password&quot;,    #认证密码
  &quot;timeout&quot;:60,
  &quot;method&quot;:&quot;aes-256-cfb&quot;    #加密方式，常用的是aes-256-cfb
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3运行shadowsocks客户端&quot;&gt;3.运行Shadowsocks客户端&lt;/h3&gt;

&lt;p&gt;一般安装完libev版Shadowsocks，默认都会把Shadowsocks设置为开机自动运行，只需要重启树莓派即可自动加载新的配置。也可以手动重启Shadowsocks服务。&lt;/p&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo service shadowsocks-libev restart
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;至此，Shadowsocks客户端配置完成，可以使用其他设备测试是否正常。&lt;/p&gt;

&lt;h2 id=&quot;三配置http公共代理服务器&quot;&gt;三、配置http公共代理服务器&lt;/h2&gt;

&lt;h3 id=&quot;1安装privoxy&quot;&gt;1.安装Privoxy&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo apt-get install privoxy
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 id=&quot;2配置privoxy&quot;&gt;2.配置Privoxy&lt;/h3&gt;

&lt;p&gt;修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/privoxy/config&lt;/code&gt;文件&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#修改监听端口，设置为全局监听，也可设置为仅监听局域网
#listen-address  localhost:8118
listen-address  0.0.0.0:8118

#设置所有网站通过socks5转发，不要漏了最后的.
forward-socks5 / 127.0.0.1:1080 .
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;3重载配置文件&quot;&gt;3.重载配置文件&lt;/h3&gt;

&lt;pre&gt;&lt;code class=&quot;language-Shell&quot;&gt;sudo service privoxy restart
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id=&quot;四配置自动切换代理&quot;&gt;四、配置自动切换代理&lt;/h2&gt;

&lt;p&gt;可以为Privoxy设置白名单和黑名单，实现仅被墙网站走Shadowsocks通道。&lt;/p&gt;

&lt;h3 id=&quot;1修改etcprivoxyconfig文件&quot;&gt;1.修改&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/privoxy/config&lt;/code&gt;文件&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;#删除之前设置的所有网站通过socks5转发
#forward-socks5 / 127.0.0.1:1080 .

#在最后一行添加以下内容
actionsfile pac.action
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;2新建etcprivoxypacaction文件输入以下内容&quot;&gt;2.新建&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/privoxy/pac.action&lt;/code&gt;文件，输入以下内容&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;
direct      = +forward-override{forward .}
shadowsocks         = +forward-override{forward-socks5 127.0.0.1:1080 .}
default     = direct
#==========默认代理==========
{default}
/
#==========直接连接==========
{direct} 
.edu.cn
202.117.255.
222.24.211.70
#==========shadowsocks代理==========
{shadowsocks}
com.google
domains.google
googleapis.com
googleapps.com
googleartproject.com
googleblog.com
googlebot.com
googlecode.com
googlecommerce.com
googledomains.com
googledrive.com
googleearth.com
googlegroups.com
googlehosted.com
googleideas.com
googlelabs.com
googlemail.com
googleplay.com
googleplus.com
googlesource.com
googleusercontent.com
googlevideo.com
googlezip.net
groups.google.cn
gstatic.com
.google.com
.googlesile.com
.git.io
.github.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;也可以直接使用我编辑好的文件，基本涵盖了常见的被墙网站。&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/upload/2016/08/24/pac.action&quot;&gt;pac.action&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 24 Aug 2016 22:35:05 +0800</pubDate>
        <link>https://www.zhangminghao.com/2016/08/24/1472047768/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2016/08/24/1472047768/</guid>
        
        <category>网络</category>
        
        <category>Linux</category>
        
        <category>软件应用</category>
        
        <category>科学上网</category>
        
        <category>树莓派</category>
        
        
        <category>软件应用</category>
        
      </item>
    
      <item>
        <title>树莓派设置USB存储设备自动挂载</title>
        <description>
&lt;p&gt;树莓派的系统一般都装有usbmount，已经可以实现插上USB存储设备时自动挂载，但当需要将USB存储设备中的文件进行共享时，就会遇到读写权限的问题，本文介绍如何配置usbmount，使其自动挂载USB存储设备时配置合适的挂载参数。
&lt;!--more--&gt;&lt;/p&gt;

&lt;p&gt;usbmount的配置文件在&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/usbmount/usbmount.conf&lt;/code&gt;，使用root权限对其进行编辑。&lt;/p&gt;

&lt;p&gt;下面是一个典型的配置文件：&lt;/p&gt;
&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;# Configuration file for the usbmount package, which mounts removable
# storage devices when they are plugged in and unmounts them when they
# are removed.
# 改为0可以禁用usbmount
ENABLED=1
# 是否启动UDisks守护进程
STARTUDISKS=0
# 自动挂载的文件系统类型
FILESYSTEMS=&quot;btrfs ntfs vfat ext2 ext3 ext4 hfsplus exfat msdos iso9660 xfs jfs&quot;
# 挂载目录
MNTPNTDIR=&quot;/media&quot;
# 是否包含分区UUID
UUIDNAME=no 
# 创建USBx符号链接的目录
LINKDIR=&quot;/media&quot;
# 是否通过samba共享
SHARESMB=yes
# samba共享读写权限
SHARERW=yes
SHARELT=no
# 空闲时关闭硬盘
SPINDOWN=0
#############################################################################
# WARNING!                                                                  #
#                                                                           #
# The &quot;sync&quot; option may not be a good choice to use with flash drives, as   #
# it forces a greater amount of writing operating on the drive. This makes  #
# the writing speed considerably lower and also leads to a faster wear out  #
# of the disk.                                                              #
#                                                                           #
# If you omit it, don&apos;t forget to use the command &quot;sync&quot; to synchronize the #
# data on your disk before removing the drive or you may experience data    #
# loss.                                                                     #
#                                                                           #
# It is highly recommended that you use the pumount command (as a regular   #
# user) before unplugging the device. It makes calling the &quot;sync&quot; command   #
# and mounting with the sync option unnecessary---this is similar to other  #
# operating system&apos;s &quot;safely disconnect the device&quot; option.                 #
#############################################################################
# Mount options: Options passed to the mount command with the -o flag.
# See the warning above regarding removing &quot;sync&quot; from the options.
# 设置通用的挂载参数，rw是读写权限，noexec是禁止运行程序
# 如果需要在USB存储设备上运行或者编译程序，需要将noexec删除
MOUNTOPTIONS=&quot;sync,noexec,nodev,noatime,rw&quot;
# Filesystem type specific mount options: This variable contains a space
# separated list of strings, each which the form &quot;-fstype=TYPE,OPTIONS&quot;.
#
# If a filesystem with a type listed here is mounted, the corresponding
# options are appended to those specificed in the MOUNTOPTIONS variable.
#
# For example, &quot;-fstype=vfat,gid=floppy,dmask=0007,fmask=0117&quot; would add
# the options &quot;gid=floppy,dmask=0007,fmask=0117&quot; when a vfat filesystem
# is mounted.
# 针对某些文件系统设置挂载参数
FS_MOUNTOPTIONS=&quot;-fstype=ntfs,gid=xbian,uid=xbian,umask=0,big_writes,allow_other \
 -fstype=vfat,gid=xbian,uid=xbian,umask=0 \
 -fstype=hfsplus,gid=xbian,uid=xbian,umask=0,force \
 -fstype=exfat,gid=xbian,uid=xbian,umask=0 \
 -fstype=btrfs,compress=lzo,subvol=/&quot;
 
# 是否输出详细日志
VERBOSE=no
# 是否使用内存交换区
USESWAPS=no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;另外&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/usbmount/&lt;/code&gt;目录下还有三个文件夹，分别储存挂载和卸载USB设备时的配置文件。&lt;/p&gt;

&lt;p&gt;附上配置文件打包&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;/upload/2016/08/12/usbmount.tgz&quot;&gt;usbmount.tgz&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 12 Aug 2016 22:26:33 +0800</pubDate>
        <link>https://www.zhangminghao.com/2016/08/12/1471010968/</link>
        <guid isPermaLink="true">https://www.zhangminghao.com/2016/08/12/1471010968/</guid>
        
        <category>Linux</category>
        
        <category>树莓派</category>
        
        
        <category>软件应用</category>
        
      </item>
    
  </channel>
</rss>
