<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel rdf:about="https://dwt.life/feed/rss/category/linux/">
<title>dwt&#039;s life - Linux</title>
<link>https://dwt.life/category/linux/</link>
<description></description>
<items>
<rdf:Seq>
<rdf:li resource="https://dwt.life/archives/341/"/>
<rdf:li resource="https://dwt.life/archives/336/"/>
<rdf:li resource="https://dwt.life/archives/335/"/>
<rdf:li resource="https://dwt.life/archives/334/"/>
<rdf:li resource="https://dwt.life/archives/330/"/>
<rdf:li resource="https://dwt.life/archives/329/"/>
<rdf:li resource="https://dwt.life/archives/328/"/>
<rdf:li resource="https://dwt.life/archives/318/"/>
<rdf:li resource="https://dwt.life/archives/316/"/>
<rdf:li resource="https://dwt.life/archives/315/"/>
</rdf:Seq>
</items>
</channel>
<item rdf:about="https://dwt.life/archives/341/">
<title>macOS llvm@14</title>
<link>https://dwt.life/archives/341/</link>
<dc:date>2024-05-19T16:28:22+08:00</dc:date>
<description>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;</description>
</item>
<item rdf:about="https://dwt.life/archives/336/">
<title>Android studio 编译aar</title>
<link>https://dwt.life/archives/336/</link>
<dc:date>2024-02-26T23:34:41+08:00</dc:date>
<description>有时候可能因为交叉编译导致c jni有些头文件路径不对，修改对了以后再执行./gradlew :Tun2socks:assembleDebug即可</description>
</item>
<item rdf:about="https://dwt.life/archives/335/">
<title>MacOS 编译.net到linux平台</title>
<link>https://dwt.life/archives/335/</link>
<dc:date>2023-11-19T20:32:20+08:00</dc:date>
<description>dotnet publish --configuration Release  --os linux --arch x64</description>
</item>
<item rdf:about="https://dwt.life/archives/334/">
<title>MacOS下的openresty编译过程</title>
<link>https://dwt.life/archives/334/</link>
<dc:date>2023-10-30T22:56:49+08:00</dc:date>
<description>其实还是比较简单的，毕竟homebrew已经很方便的安装了依赖，还是记录一下基本依赖我本地的brew是更新过了的，从github下载的最新releasebrew update                            
brew install pcre opensslconfigureLinux:./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; \
   -j8MacOS:./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这里的路径是我自己找的，brew应该都一样，但是看到别的文章和我的不一样，所以应该先检查include和lib的路径brotliBrotli比我当年编译的简单多了: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然后make -j8 && make install 就到了/usr/local/openresty下了</description>
</item>
<item rdf:about="https://dwt.life/archives/330/">
<title>nslookup指定端口</title>
<link>https://dwt.life/archives/330/</link>
<dc:date>2023-04-10T17:26:00+08:00</dc:date>
<description>dig google.com @192.168.0.1 -p 65053在线nslookup：https://tool.hi.cn/nslookup/</description>
</item>
<item rdf:about="https://dwt.life/archives/329/">
<title>LXD公网IPv6篇</title>
<link>https://dwt.life/archives/329/</link>
<dc:date>2023-04-10T03:25:00+08:00</dc:date>
<description>官方论坛给出的回复：https://discuss.linuxcontainers.org/t/how-to-make-lxd-give-public-ipv6-addresses-to-containers/11602/2那么具体操作就是，先announce ipv6，再加到dummy1上即可。</description>
</item>
<item rdf:about="https://dwt.life/archives/328/">
<title>Vultr BlockStrorage</title>
<link>https://dwt.life/archives/328/</link>
<dc:date>2023-04-10T01:12:52+08:00</dc:date>
<description>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</description>
</item>
<item rdf:about="https://dwt.life/archives/318/">
<title>wireguard基本安装和配置（by GPT3 达芬奇）</title>
<link>https://dwt.life/archives/318/</link>
<dc:date>2022-12-06T13:31:14+08:00</dc:date>
<description>安装wireguard：sudo apt-get install wireguard创建配置文件：sudo nano /etc/wireguard/wg0.conf编辑配置文件：[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启动wireguard：sudo wg-quick up wg0检查wireguard状态：sudo wg show</description>
</item>
<item rdf:about="https://dwt.life/archives/316/">
<title>MySQL 主从恢复记录</title>
<link>https://dwt.life/archives/316/</link>
<dc:date>2022-11-15T03:21:01+08:00</dc:date>
<description>流程过程大致如下：从主库找到备份文件，放到从库服务器。恢复数据到从库设置MySQL还原点启动从库开始主从复制连接数据库先连接主库mysql -uroot -p切换数据库（或者不切换也行）    use yourdatabase;停止主从复制stop slave;
reset slave all;设置写入缓存大小。提高mysql导入速度。(和磁盘IO差不多就行)set global bulk_insert_buffer_size=128*1024*1024;恢复数据 （根据自己的备份方式恢复）source /bakfile找到mysql binlog 备份点 （在linux 下面执行，其他操作系统同理）less  /bakfile 找到-- CHANGE MASTER TO MASTER_LOG_FILE=&#039;mysql-bin-190.000640&#039;, MASTER_LOG_POS=120;
/*获取时间binlog文件名和pos*/注意，实际可能并不需要这样，直接在主库执行：show master status取得了bin-log和pos后直接修改从库，pos其实可以为0，会自动follow。修改从库同步位置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;修改缓存。启动复制set global bulk_insert_buffer_size=8*1024*1024;
start slave ;查看主从同步状态show slave status \G;如果有问题。查看mysql 错误日志。同步开始后可能会有少量的冲突出现 ，使用下面语句可以跳过一个事务并查看同步状态stop slave;
SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1 ;
start slave ;
show slave status \G;</description>
</item>
<item rdf:about="https://dwt.life/archives/315/">
<title>如何清理Linux服务器磁盘空间？</title>
<link>https://dwt.life/archives/315/</link>
<dc:date>2022-10-25T02:46:17+08:00</dc:date>
<description>df -h：显示磁盘占用apt-get autoclean：清理旧版本缓存apt-get clean：清理所有缓存apt-get autoremove：移除孤立软件（可以清理出500M+的空间）rm -rf /var/log/*：删除所有log（删了后last命令提示找不到一个/var/log下的文件。。。）find / -size +100M：列出所有大于100M的文件其中，主要是通过find找出大文件并进行删除，有时候可能是垃圾邮件过多，此时需要直接删除/var/mail目录（如果不是邮件服务器的话）。</description>
</item>
</rdf:RDF>