<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[Felix021]]></title> 
<link>https://www.felix021.com/blog/index.php</link> 
<description><![CDATA[So far so good]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[Felix021]]></copyright>
<ttl>10</ttl>
<item>
    <title><![CDATA[Claude Code  GLM 4.7]]></title> 
    <link>https://www.felix021.com/blog/read.php?2263</link>
    <description><![CDATA[2026 年，这里终于有一点不一样了：用 Claude Code + 智谱的 GLM 4.7 给这个十几年的老博客换了个新皮。<br/><br/>实际还做得更多一些，把旧的 PHP5 代码改造升级为 PHP7-Compatible，并且修了几个潜在的安全问题。<br/><br/>总体上做得还不错，但是在换皮的细节上有点坑，有个问题来来回回说了好几遍，也没完全改好，就先将就了。<br/><br/>Anyway，有个助手还是不错的，终于把早就想做的事情落地了。<br/><br/>如果你也需要的话，可以通过我的邀请链接注册购买（我买了超大杯，完全没有token焦虑了）：<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">速来拼好模，智谱 GLM Coding 超值订阅，邀你一起薅羊毛！Claude Code、Cline 等 20+ 大编程工具无缝支持，“码力”全开，越拼越爽！立即开拼，享限时惊喜价！<br/><br/>链接：<a href="https://www.bigmodel.cn/glm-coding?ic=2HQBSJHLXR" target="_blank">https://www.bigmodel.cn/glm-coding?ic=2HQBSJHLXR</a></div></div><br/><br/>以及这是智谱官方的上手教程，非常简单：<br/><br/><a href="https://docs.bigmodel.cn/cn/coding-plan/quick-start" target="_blank">https://docs.bigmodel.cn/cn/coding-plan/quick-start</a><br/>]]></description>
    <pubDate>Tue, 27 Jan 2026 16:32:50 +0000</pubDate> 
    <category><![CDATA[AI]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2263</guid> 
</item>
<item>
    <title><![CDATA[Gitea cleanup]]></title> 
    <link>https://www.felix021.com/blog/read.php?2262</link>
    <description><![CDATA[Gitea does not provide official way to cleanup action running history.<br/><br/><br/>Had to do it manually by<br/><br/><br/><div class="code">#!/bin/bash<br/><br/>mysql giteadb -e &quot;delete from action where created_unix &lt; UNIX_TIMESTAMP(date_sub(now(), interval 45 day))&quot;<br/>mysql giteadb -e &quot;delete from action_run where created &lt; UNIX_TIMESTAMP(date_sub(now(), interval 45 day))&quot;<br/>mysql giteadb -e &quot;delete from action_task where created &lt; UNIX_TIMESTAMP(date_sub(now(), interval 45 day))&quot;<br/>mysql giteadb -e &quot;delete from action_run_job where created &lt; UNIX_TIMESTAMP(date_sub(now(), interval 45 day))&quot;<br/>mysql giteadb -e &quot;delete from action_task_step where created &lt; UNIX_TIMESTAMP(date_sub(now(), interval 45 day))&quot;<br/><br/>find /home/gitea/.cache/act -maxdepth 1 -ctime +45 &#124; xargs rm -rf</div>]]></description>
    <pubDate>Fri, 19 Dec 2025 14:37:00 +0000</pubDate> 
    <category><![CDATA[软件]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2262</guid> 
</item>
<item>
    <title><![CDATA[Maven: 阿里云镜像]]></title> 
    <link>https://www.felix021.com/blog/read.php?2261</link>
    <description><![CDATA[<div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>&lt;settings&gt;<br/>&nbsp; &nbsp; &lt;!-- omitted xml --&gt;<br/>&nbsp; &nbsp; &lt;servers&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;server&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;id&gt;private_repo&lt;/id&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;username&gt;USERNAME&lt;/username&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;password&gt;PASSWORD&lt;/password&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/server&gt;<br/>&nbsp; &nbsp; &lt;/servers&gt;<br/>&nbsp; &nbsp; &lt;mirrors&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &lt;mirror&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;id&gt;aliyunmaven&lt;/id&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;mirrorOf&gt;*,!private_repo&lt;/mirrorOf&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;name&gt;阿里云公共仓库&lt;/name&gt;<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;url&gt;<a href="https://maven.aliyun.com/repository/public&lt;/url&gt;" target="_blank">https://maven.aliyun.com/repository/public&lt;/url&gt;</a><br/>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/mirror&gt;<br/>&nbsp; &nbsp; &lt;/mirrors&gt;<br/>&lt;/settings&gt;<br/></div></div><br/>]]></description>
    <pubDate>Thu, 18 Dec 2025 10:30:16 +0000</pubDate> 
    <category><![CDATA[程序设计]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2261</guid> 
</item>
<item>
    <title><![CDATA[Intellij IDEA: cannot resolve symbol]]></title> 
    <link>https://www.felix021.com/blog/read.php?2260</link>
    <description><![CDATA[结论：IDEA 是 SH*T.<br/><br/><br/>问题：报错，找不到符号，通常是 Lombok annotation 生成的，比如 @Builder 生成的 XXXBuilder。<br/><br/><br/>【可能】的解决方案<br/><br/>(1) IDE 参数，玄学，可能有用<br/><br/>Help -> Custom VM Option<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">-Xms2g<br/>-Xmx16g</div></div><br/><br/>Settings -> Compiler:<br/>- Shared VM Options: "-Xss1024m"<br/>- Heap Size: 16384 (Mbytes)<br/><br/><br/>(2) 将 IDE 构建/运行操作委托给 Maven<br/>Settings -> Build Tools -> Delegate IDE Build/Run actions to Maven.<br/><br/><br/>(3) 跳过 IDE 的编译<br/><br/>- 使用 mvn compile -T 4 、 mvn test-compile -T 4（编译测试代码）<br/>- 在Run Configuration的 "Modify options" 里选择 "Do not build before run"]]></description>
    <pubDate>Tue, 16 Dec 2025 03:07:06 +0000</pubDate> 
    <category><![CDATA[程序设计]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2260</guid> 
</item>
<item>
    <title><![CDATA[MySQL/MariaDB 主从同步]]></title> 
    <link>https://www.felix021.com/blog/read.php?2259</link>
    <description><![CDATA[== Master ==<br/><br/>$ vi /etc/mysql/mariadb.conf.d/50-server.cnf<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">server-id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 1<br/>log_bin&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = /var/log/mysql/mysql-bin.log<br/>expire_logs_days&nbsp; &nbsp; &nbsp;  = 10<br/>max_binlog_size&nbsp; &nbsp; &nbsp; &nbsp; = 1024M<br/>binlog_do_db&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  = testdb<br/></div></div><br/><br/>$ mysql<br/><div class="code">CREATE USER &#039;username&#039;@&#039;%&#039; IDENTIFIED BY &#039;12345678&#039;;<br/>GRANT ALL PRIVILEGES ON giteadb.* TO &#039;username&#039;@&#039;%&#039;;<br/>GRANT REPLICATION SLAVE ON testdb.* TO &#039;username&#039;@&#039;%&#039;;<br/>&#91;/code<br/><br/>&#91;code&#93;<br/>mysqldump --databases testdb --master-data &gt; testdb.sql</div><br/><br/>== Slave ==<br/><br/>$ vi /etc/mysql/mariadb.conf.d/50-server.cnf<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">server-id&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = 2<br/>relay_log = /var/log/mysql/mysql-relay-bin.log<br/>log_bin = /var/log/mysql/mysql-bin.log<br/>binlog_do_db = testdb<br/>read_only = 1<br/></div></div><br/><br/><br/><div class="code">mysql&gt; CHANGE MASTER TO<br/>MASTER_HOST=&#039;HOSTNAME&#039;,<br/>MASTER_USER=&#039;testdb&#039;,<br/>MASTER_PASSWORD=&#039;12345678&#039;,</div><br/><br/><br/><div class="code">$ mysql &lt; testdb.sql</div><br/><br/><br/><div class="code">mysql&gt; start slave;<br/><br/>mysql&gt; SHOW SLAVE STATUS&#92;G</div><br/><br/><br/><br/>另：如果报错<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">mysql error 1273 (hy000) at line 33: unknown collation: 'utf8mb4_0900_as_cs'</div></div><br/><br/>需要把 sql 里的 utf8mb4_0900_as_cs 替换成 MariaDB 的 utf8mb4_unicode_520_ci]]></description>
    <pubDate>Sun, 14 Dec 2025 11:12:27 +0000</pubDate> 
    <category><![CDATA[数据库]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2259</guid> 
</item>
<item>
    <title><![CDATA[备查：MySQL Client CLI - CTRL+W 只删除一个单词]]></title> 
    <link>https://www.felix021.com/blog/read.php?2258</link>
    <description><![CDATA[ref: <a href="https://unix.stackexchange.com/questions/252546/control-w-delete-word-deletes-whole-line-in-mariadb-client" target="_blank">https://unix.stackexchange.com/questions/252546/control-w-delete-word-deletes-whole-line-in-mariadb-client</a><br/><br/>vi ~/.editrc<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>bind "^W" ed-delete-prev-word<br/></div></div>]]></description>
    <pubDate>Thu, 11 Dec 2025 16:22:07 +0000</pubDate> 
    <category><![CDATA[shell]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2258</guid> 
</item>
<item>
    <title><![CDATA[git pre-commit hook]]></title> 
    <link>https://www.felix021.com/blog/read.php?2257</link>
    <description><![CDATA[vi .git/hooks/pre-commit<br/><br/><div class="code">#!/bin/bash<br/><br/>function color() &#123;<br/>&nbsp; &nbsp;  scheme=$1<br/>&nbsp; &nbsp;  shift<br/>&nbsp; &nbsp;  echo -e &quot;&#92;e&#91;$&#123;scheme&#125;m&quot;$*&quot;&#92;e&#91;0m&quot;<br/>&#125;<br/><br/>rebasing=`git status &#124; grep &#039;currently rebasing&#039;`<br/>if &#91; ! -z &quot;$rebasing&quot; &#93;; then<br/>&nbsp; &nbsp; &nbsp; &nbsp; color &#039;31;43&#039; &quot;currently rebasing, commit not allowed&quot;<br/>&nbsp; &nbsp; &nbsp; &nbsp; echo<br/>&nbsp; &nbsp; &nbsp; &nbsp; exit 1<br/>fi</div>]]></description>
    <pubDate>Wed, 03 Dec 2025 13:06:47 +0000</pubDate> 
    <category><![CDATA[软件]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2257</guid> 
</item>
<item>
    <title><![CDATA[Ollama API example]]></title> 
    <link>https://www.felix021.com/blog/read.php?2256</link>
    <description><![CDATA[<div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>curl -X POST <a href="http://localhost:11434/api/chat" target="_blank">http://localhost:11434/api/chat</a> &#92;<br/>&nbsp; -H "Content-Type: application/json" &#92;<br/>&nbsp; -d '&#123;<br/>&nbsp; &nbsp; "model": "hf.co/Triangle104/Qwen3-30B-A3B-abliterated-Q5_K_M-GGUF:Q5_K_M",<br/>&nbsp; &nbsp; "messages": [<br/>&nbsp; &nbsp; &nbsp; &#123;<br/>&nbsp; &nbsp; &nbsp; &nbsp; "role": "user",<br/>&nbsp; &nbsp; &nbsp; &nbsp; "content": "Pourquoi le ciel est-il bleu? Reponds en anglais, svp."<br/>&nbsp; &nbsp; &nbsp; &#125;<br/>&nbsp; &nbsp; ],<br/>&nbsp; &nbsp; "options": &#123;<br/>&nbsp; &nbsp; &nbsp; "num_ctx": 40960<br/>&nbsp; &nbsp; &#125;,<br/>&nbsp; &nbsp; "stream": false<br/>&nbsp; &#125;'<br/><br/></div></div><br/><br/><br/><br/># HOWTO <br/><br/>1. 让模型一直加载在内存/显存中<br/><br/>$ vi /etc/systemd/system/ollama.service<br/><br/>增加配置 Environment="OLLAMA_KEEP_ALIVE=-1"<br/><br/>然后 service ollama restart ，加载模型后 ollama ps 看 UTIL 列，值是 Forever 说明生效了。<br/><br/>2. 改变监听的 IP、端口 允许来自外部的请求<br/><br/>新增环境变量<br/><br/>- 允许来自外部的请求：<br/><br/>OLLAMA_HOST=0.0.0.0<br/><br/>- 更换端口：<br/><br/>OLLAMA_HOST=0.0.0.0:8080<br/><br/><br/><br/>Embedding API:<br/><br/><a href="http://localhost:11434/api/embed" target="_blank">http://localhost:11434/api/embed</a><br/><br/>参考：<a href="https://ollama.com/library/qwen3-embedding" target="_blank">https://ollama.com/library/qwen3-embedding</a>]]></description>
    <pubDate>Wed, 22 Oct 2025 10:48:08 +0000</pubDate> 
    <category><![CDATA[随想]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2256</guid> 
</item>
<item>
    <title><![CDATA[ClickHouse Playground]]></title> 
    <link>https://www.felix021.com/blog/read.php?2255</link>
    <description><![CDATA[docker-compose.yml<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content"><br/>services:<br/>&nbsp; clickhouse:<br/>&nbsp; &nbsp; image: clickhouse/clickhouse-server:latest<br/>&nbsp; &nbsp; container_name: my-clickhouse<br/>&nbsp; &nbsp; ports:<br/>&nbsp; &nbsp; &nbsp; - "8123:8123"&nbsp; # HTTP API 端口，用于Web界面和HTTP请求<br/>&nbsp; &nbsp; &nbsp; - "9000:9000"&nbsp; # 原生TCP协议端口，用于clickhouse-client连接<br/>&nbsp; &nbsp; volumes:<br/>&nbsp; &nbsp; &nbsp; - ./data:/var/lib/clickhouse&nbsp; # 数据持久化到主机的 ./data 目录<br/>&nbsp; &nbsp; environment:<br/>&nbsp; &nbsp; &nbsp; - CLICKHOUSE_DB=default<br/>&nbsp; &nbsp; &nbsp; - CLICKHOUSE_USER=default<br/>&nbsp; &nbsp; &nbsp; - CLICKHOUSE_PASSWORD=123456<br/>&nbsp; &nbsp; &nbsp; - CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT=1<br/>&nbsp; &nbsp; deploy:<br/>&nbsp; &nbsp; &nbsp; resources:<br/>&nbsp; &nbsp; &nbsp; &nbsp; limits:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cpus: '4.0'<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memory: 8G<br/>&nbsp; &nbsp; &nbsp; &nbsp; reservations:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cpus: '1.0'<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; memory: 2G<br/></div></div><br/><br/><br/>启动<br/><br/>$ docker compose up -d<br/><br/>连接<br/><br/>$ docker exec -it my-clickhouse clickhouse-client --user default --password 123456<br/><br/><div class="code">CREATE DATABASE learn;<br/><br/>CREATE USER &#039;learn&#039; IDENTIFIED WITH sha256_password BY &#039;123456&#039;;<br/><br/>GRANT ALL ON learn.* to &#039;learn&#039;;</div><br/><br/><br/>Playground: <br/><br/>$ git clone <a href="https://github.com/VKCOM/lighthouse.git" target="_blank">https://github.com/VKCOM/lighthouse.git</a><br/><br/><br/>访问（替换 $CLICKHOUSE 为部署的 IP 或域名）<br/><a href="http://127.0.0.1/lighthouse/#http://$CLICKHOUSE:8123/?user=learn&password=123456" target="_blank">http://127.0.0.1/lighthouse/#http://$CLICKHOUSE:8123/?user=learn&password=123456</a><br/><br/>]]></description>
    <pubDate>Tue, 21 Oct 2025 08:39:22 +0000</pubDate> 
    <category><![CDATA[数据库]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2255</guid> 
</item>
<item>
    <title><![CDATA[ClickHouse: Dictionary]]></title> 
    <link>https://www.felix021.com/blog/read.php?2254</link>
    <description><![CDATA[备查<br/><br/><div class="code">CREATE DICTIONARY xxx.ip_region_dict<br/>ON CLUSTER default_cluster<br/>(<br/>&nbsp; &nbsp; `prefix` UInt32,<br/>&nbsp; &nbsp; `province` Nullable(String),<br/>&nbsp; &nbsp; `province_code` UInt32,<br/>&nbsp; &nbsp; `city` Nullable(String),<br/>&nbsp; &nbsp; `city_code` UInt32,<br/>&nbsp; &nbsp; `area` Nullable(String),<br/>&nbsp; &nbsp; `area_code` UInt32<br/>)<br/>PRIMARY KEY prefix<br/>SOURCE(CLICKHOUSE(HOST &#039;127.0.01&#039; USER &#039;user&#039; PASSWORD &#039;xxxx&#039; DB &#039;test&#039; TABLE &#039;ip_region&#039; ))<br/>LIFETIME(MIN 0 MAX 0) -- 需要手动刷新<br/>LAYOUT(HASHED())</div><br/><br/>or from mysql:<br/><br/><div class="code">SOURCE(MYSQL(HOST &#039;127.0.0.1&#039; PORT 3306 USER &#039;root&#039; PASSWORD &#039;xxxxx&#039; DB &#039;test&#039; TABLE &#039;xxx&#039;))<br/>LIFETIME(MIN 300 MAX 600) -- 5~10分钟自动刷新<br/>LAYOUT(HASHED())</div><br/><br/>Manually reload:<br/><div class="code">SYSTEM RELOAD DICTIONARY<br/>ON CLUSTER default_cluster<br/>ip_region_dict;</div><br/><br/>Usage<br/><div class="code">dictGet(&#039;xxx.ip_region_dict&#039;, &#039;city&#039;, intDiv(IPv4StringToNumOrDefault(ip), 256))</div><br/><br/><br/>UDF:<br/><div class="code">CREATE FUNCTION getIPCity<br/>ON CLUSTER default_cluster<br/>AS (ip) -&gt; <br/>&nbsp; &nbsp; &nbsp; &nbsp; dictGet(&#039;xxx.ip_region_dict&#039;, &#039;city&#039;, intDiv(IPv4StringToNumOrDefault(ip), 256));</div>]]></description>
    <pubDate>Thu, 16 Oct 2025 02:18:37 +0000</pubDate> 
    <category><![CDATA[数据库]]></category>
    <author>felix021 &lt;i[#at]felix021.com&gt;</author>
    <guid>https://www.felix021.com/blog/read.php?2254</guid> 
</item>

</channel>
</rss>