<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:wfw="http://wellformedweb.org/CommentAPI/">
<channel>
<title>dwt&#039;s life - Linux</title>
<link>https://dwt.life/category/linux/</link>
<atom:link href="https://dwt.life/feed/category/linux/" rel="self" type="application/rss+xml" />
<language>zh-CN</language>
<description></description>
<lastBuildDate>Sun, 19 May 2024 16:28:22 +0800</lastBuildDate>
<pubDate>Sun, 19 May 2024 16:28:22 +0800</pubDate>
<item>
<title>macOS llvm@14</title>
<link>https://dwt.life/archives/341/</link>
<guid>https://dwt.life/archives/341/</guid>
<pubDate>Sun, 19 May 2024 16:28:22 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[brew install llvm@14  export LDFLAGS=&quot;-L/opt/homebrew/opt/llvm@14/lib&quot;  export CPPFLAGS...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<pre><code>brew install llvm@14
  export LDFLAGS=&quot;-L/opt/homebrew/opt/llvm@14/lib&quot;
  export CPPFLAGS=&quot;-I/opt/homebrew/opt/llvm@14/include&quot;</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/341/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>Android studio 编译aar</title>
<link>https://dwt.life/archives/336/</link>
<guid>https://dwt.life/archives/336/</guid>
<pubDate>Mon, 26 Feb 2024 23:34:41 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[有时候可能因为交叉编译导致c jni有些头文件路径不对，修改对了以后再执行./gradlew :Tun2socks:assembleDebug即可]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>有时候可能因为交叉编译导致c jni有些头文件路径不对，修改对了以后再执行</p><pre><code>./gradlew :Tun2socks:assembleDebug</code></pre><p>即可</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/336/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>MacOS 编译.net到linux平台</title>
<link>https://dwt.life/archives/335/</link>
<guid>https://dwt.life/archives/335/</guid>
<pubDate>Sun, 19 Nov 2023 20:32:20 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[dotnet publish --configuration Release  --os linux --arch x64]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p><code>dotnet publish --configuration Release  --os linux --arch x64</code></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/335/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>MacOS下的openresty编译过程</title>
<link>https://dwt.life/archives/334/</link>
<guid>https://dwt.life/archives/334/</guid>
<pubDate>Mon, 30 Oct 2023 22:56:49 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[其实还是比较简单的，毕竟homebrew已经很方便的安装了依赖，还是记录一下基本依赖我本地的brew是更新过了的，从github下载的最新releasebrew update          ...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>其实还是比较简单的，毕竟<code>homebrew</code>已经很方便的安装了依赖，还是记录一下</p><h2>基本依赖</h2><p>我本地的brew是更新过了的，从github下载的最新release</p><pre><code>brew update                            
brew install pcre openssl</code></pre><h2>configure</h2><p>Linux:</p><pre><code>./configure \                          
   --with-cc-opt=&quot;-I/usr/local/opt/openssl/include/ -I/usr/local/opt/pcre/include/&quot; \
   --with-ld-opt=&quot;-L/usr/local/opt/openssl/lib/ -L/usr/local/opt/pcre/lib/&quot; \
   -j8</code></pre><p>MacOS:</p><pre><code>./configure \                     
   --with-cc-opt=&quot;-I/opt/homebrew/include/openssl/ -I/opt/homebrew/include/&quot; \
   --with-ld-opt=&quot;-L/opt/homebrew/lib/&quot; \
   -j8</code></pre><p>这里的路径是我自己找的，brew应该都一样，但是看到别的文章和我的不一样，所以应该先检查include和lib的路径</p><h2>brotli</h2><p>Brotli比我当年编译的简单多了:</p><pre><code>git clone https://github.com/google/ngx_brotli.git`
cd ngx_brotli/deps/brotli
git clone https://github.com/google/brotli.git
cd ..
./configure \                      
   --with-cc-opt=&quot;-I/opt/homebrew/include/openssl/ -I/opt/homebrew/include/&quot; \
   --with-ld-opt=&quot;-L/opt/homebrew/lib/ --add-module=/路径/ngx_brotli&quot; \
   -j8</code></pre><p>然后make -j8 && make install 就到了<code>/usr/local/openresty</code>下了</p>
]]></content:encoded>
<slash:comments>1</slash:comments>
<comments>https://dwt.life/archives/334/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>nslookup指定端口</title>
<link>https://dwt.life/archives/330/</link>
<guid>https://dwt.life/archives/330/</guid>
<pubDate>Mon, 10 Apr 2023 17:26:00 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[dig google.com @192.168.0.1 -p 65053在线nslookup：https://tool.hi.cn/nslookup/]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p><code>dig google.com @192.168.0.1 -p 65053</code></p><p>在线nslookup：<a href="https://tool.hi.cn/nslookup/">https://tool.hi.cn/nslookup/</a></p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/330/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>LXD公网IPv6篇</title>
<link>https://dwt.life/archives/329/</link>
<guid>https://dwt.life/archives/329/</guid>
<pubDate>Mon, 10 Apr 2023 03:25:00 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[官方论坛给出的回复：https://discuss.linuxcontainers.org/t/how-to-make-lxd-give-public-ipv6-addresses-to-con...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<p>官方论坛给出的回复：<br><a href="https://discuss.linuxcontainers.org/t/how-to-make-lxd-give-public-ipv6-addresses-to-containers/11602/2">https://discuss.linuxcontainers.org/t/how-to-make-lxd-give-public-ipv6-addresses-to-containers/11602/2</a></p><p>那么具体操作就是，先announce ipv6，再加到dummy1上即可。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/329/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>Vultr BlockStrorage</title>
<link>https://dwt.life/archives/328/</link>
<guid>https://dwt.life/archives/328/</guid>
<pubDate>Mon, 10 Apr 2023 01:12:52 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[Create new empty partitions:# parted -s /dev/vdb mklabel gpt# parted -s /dev/vdb unit mib mkpart ...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<pre><code>Create new empty partitions:
# parted -s /dev/vdb mklabel gpt
# parted -s /dev/vdb unit mib mkpart primary 0% 100%

Create new empty filesystem:
# mkfs.ext4 /dev/vdb1

Mount block storage:

# mkdir /mnt/blockstorage
# echo &gt;&gt; /etc/fstab
# echo /dev/vdb1               /mnt/blockstorage       ext4    defaults,noatime,nofail 0 0 &gt;&gt; /etc/fstab
# mount /mnt/blockstorage</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/328/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>wireguard基本安装和配置（by GPT3 达芬奇）</title>
<link>https://dwt.life/archives/318/</link>
<guid>https://dwt.life/archives/318/</guid>
<pubDate>Tue, 06 Dec 2022 13:31:14 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[安装wireguard：sudo apt-get install wireguard创建配置文件：sudo nano /etc/wireguard/wg0.conf编辑配置文件：[Interfa...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<ol><li>安装wireguard：</li></ol><pre><code>sudo apt-get install wireguard</code></pre><ol start="2"><li>创建配置文件：</li></ol><pre><code>sudo nano /etc/wireguard/wg0.conf</code></pre><ol start="3"><li>编辑配置文件：</li></ol><pre><code>[Interface]
Address = 10.0.0.1/24
ListenPort = 51820
PrivateKey = &lt;Your Private Key&gt;

[Peer]
PublicKey = &lt;Peer&#039;s Public Key&gt;
AllowedIPs = 10.0.0.2/32
Endpoint = &lt;Peer&#039;s IP Address&gt;:51820</code></pre><ol start="4"><li>启动wireguard：</li></ol><pre><code>sudo wg-quick up wg0</code></pre><ol start="5"><li>检查wireguard状态：</li></ol><pre><code>sudo wg show</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/318/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>MySQL 主从恢复记录</title>
<link>https://dwt.life/archives/316/</link>
<guid>https://dwt.life/archives/316/</guid>
<pubDate>Tue, 15 Nov 2022 03:21:01 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[流程过程大致如下：从主库找到备份文件，放到从库服务器。恢复数据到从库设置MySQL还原点启动从库开始主从复制连接数据库先连接主库mysql -uroot -p切换数据库（或者不切换也行）    ...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<h2>流程</h2><p>过程大致如下：</p><ul><li>从主库找到备份文件，放到从库服务器。</li><li>恢复数据到从库</li><li>设置MySQL还原点</li><li>启动从库开始主从复制</li></ul><h3>连接数据库</h3><p>先连接主库<br><code>mysql -uroot -p</code></p><h3>切换数据库（或者不切换也行）</h3><p><code>    use yourdatabase;</code></p><h3>停止主从复制</h3><pre><code class="lang-sql">stop slave;
reset slave all;</code></pre><h3>设置写入缓存大小。提高mysql导入速度。(和磁盘IO差不多就行)</h3><p><code>set global bulk_insert_buffer_size=128*1024*1024;</code></p><h3>恢复数据 （根据自己的备份方式恢复）</h3><p><code>source /bakfile</code></p><h3>找到mysql binlog 备份点 （在linux 下面执行，其他操作系统同理）</h3><pre><code class="lang-shell">less  /bakfile </code></pre><p>找到</p><pre><code>-- CHANGE MASTER TO MASTER_LOG_FILE=&#039;mysql-bin-190.000640&#039;, MASTER_LOG_POS=120;
/*获取时间binlog文件名和pos*/</code></pre><p>注意，实际可能并不需要这样，直接在主库执行：<br><code>show master status</code><br><a href="https://i.peo.pw/2022/11/15/637294db240f2.png"><img src="https://i.peo.pw/2022/11/15/637294db240f2.png" alt="1668453592882.png" title="1668453592882.png"></a><br>取得了bin-log和pos后直接修改从库，pos其实可以为0，会自动follow。</p><h3>修改从库同步位置</h3><pre><code class="lang-sql">CHANGE MASTER TO 
MASTER_HOST=&#039;10.251.192.18&#039;, 
MASTER_USER=&#039;sync&#039;, 
MASTER_PASSWORD=&#039;DBect98773!_sync&#039;, 
MASTER_PORT=3306,
MASTER_LOG_FILE=&#039;mysql-bin-190.000640&#039;,
MASTER_LOG_POS=120;</code></pre><h3>修改缓存。启动复制</h3><pre><code class="lang-sql">set global bulk_insert_buffer_size=8*1024*1024;
start slave ;</code></pre><h3>查看主从同步状态</h3><p><code>show slave status \G;</code></p><h3>如果有问题。查看mysql 错误日志。</h3><h3>同步开始后可能会有少量的冲突出现 ，使用下面语句可以跳过一个事务并查看同步状态</h3><pre><code class="lang-sql">stop slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1 ;
start slave ;
show slave status \G;</code></pre>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/316/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
<item>
<title>如何清理Linux服务器磁盘空间？</title>
<link>https://dwt.life/archives/315/</link>
<guid>https://dwt.life/archives/315/</guid>
<pubDate>Tue, 25 Oct 2022 02:46:17 +0800</pubDate>
<dc:creator>Ricky</dc:creator>
<description><![CDATA[df -h：显示磁盘占用apt-get autoclean：清理旧版本缓存apt-get clean：清理所有缓存apt-get autoremove：移除孤立软件（可以清理出500M+的空间）...]]></description>
<content:encoded xml:lang="zh-CN"><![CDATA[
<ol><li>df -h：显示磁盘占用</li><li>apt-get autoclean：清理旧版本缓存</li><li>apt-get clean：清理所有缓存</li><li>apt-get autoremove：移除孤立软件（可以清理出500M+的空间）</li><li>rm -rf /var/log/*：删除所有log（删了后last命令提示找不到一个/var/log下的文件。。。）</li><li>find / -size +100M：列出所有大于100M的文件</li></ol><p>其中，主要是通过find找出大文件并进行删除，有时候可能是垃圾邮件过多，此时需要直接删除/var/mail目录（如果不是邮件服务器的话）。</p>
]]></content:encoded>
<slash:comments>0</slash:comments>
<comments>https://dwt.life/archives/315/#comments</comments>
<wfw:commentRss>https://dwt.life/feed/category/linux/</wfw:commentRss>
</item>
</channel>
</rss>