<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MacOS on Ricky</title><link>https://995facee.rickylin.pages.dev/zh-tw/tags/macos/</link><description>Recent content in MacOS on Ricky</description><generator>Hugo -- gohugo.io</generator><language>zh-tw</language><lastBuildDate>Sat, 20 Jun 2026 22:55:33 +0800</lastBuildDate><atom:link href="https://995facee.rickylin.pages.dev/zh-tw/tags/macos/index.xml" rel="self" type="application/rss+xml"/><item><title>Local LLM on MacBookPro - Image</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260620-local-llm-image/</link><pubDate>Sat, 20 Jun 2026 22:55:33 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260620-local-llm-image/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://huggingface.co/mlx-community" target="_blank" rel="noopener">https://huggingface.co/mlx-community&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/filipstrand/mflux" target="_blank" rel="noopener">https://github.com/filipstrand/mflux&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/lpalbou/mlx-gen" target="_blank" rel="noopener">https://github.com/lpalbou/mlx-gen&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://huggingface.co/AbstractFramework" target="_blank" rel="noopener">https://huggingface.co/AbstractFramework&lt;/a>&lt;/li>
&lt;/ul>
&lt;h4 id="install">Install&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>uv tool install --upgrade mflux
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uv tool install --upgrade --force mlx-gen
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="download-model">Download Model&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># mlx-community/FLUX.2-klein-9B&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># AbstractFramework/z-image-turbo-8bit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># AbstractFramework/qwen-image-edit-2511-8bit&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>HF_HUB_DISABLE_XET&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> hf download mlx-community/FLUX.2-klein-9B --local-dir FLUX.2-klein-9B --max-workers &lt;span style="color:#ae81ff">1&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="run">Run&lt;/h4>
&lt;h5 id="flux2-klein-9b">FLUX.2-klein-9B&lt;/h5>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>mflux-generate-flux2 &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --model &lt;span style="color:#e6db74">&amp;#34;/Users/ricky/git/mlx/FLUX.2-klein-9B&amp;#34;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --prompt &lt;span style="color:#e6db74">&amp;#39;Charmander from Pokemon, a specific Nintendo character, iconic appearance, very clean large eyes, friendly wide smile, smooth round belly, long distinct tail with simple flame outlines&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --steps &lt;span style="color:#ae81ff">6&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --seed &lt;span style="color:#ae81ff">42&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --width &lt;span style="color:#ae81ff">1240&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --height &lt;span style="color:#ae81ff">1754&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --output pics/charmander.png
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="z-image-turbo-8bit">z-image-turbo-8bit&lt;/h5>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>mlxgen generate &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --model /Users/ricky/git/mlx/z-image-turbo-8bit &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --prompt &lt;span style="color:#e6db74">&amp;#39;哆啦Ａ夢使用竹蜻蜓飛在天空中&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --steps &lt;span style="color:#ae81ff">6&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --seed &lt;span style="color:#ae81ff">42&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --width &lt;span style="color:#ae81ff">1240&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --height &lt;span style="color:#ae81ff">1754&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --output pics/doramon.png
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h5 id="qwen-image-edit-2511-8bit">qwen-image-edit-2511-8bit&lt;/h5>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>mlxgen generate &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --model /Users/ricky/git/mlx/qwen-image-edit-2511-8bit &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --prompt &lt;span style="color:#e6db74">&amp;#39;哆啦Ａ夢使用竹蜻蜓飛在天空中，旁邊有大雄&amp;#39;&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --steps &lt;span style="color:#ae81ff">6&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --seed &lt;span style="color:#ae81ff">42&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --width &lt;span style="color:#ae81ff">1240&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --height &lt;span style="color:#ae81ff">1754&lt;/span> &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --image-path pics/doramon.png &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --output pics/doramon1.png
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Articles</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260610-articles/</link><pubDate>Wed, 10 Jun 2026 10:59:53 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260610-articles/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://pokeemerald.com/" target="_blank" rel="noopener">Pokemon Emerald in WebAssembly(https://github.com/tripplyons/pokeemerald-wasm)&lt;/a>&lt;/li>
&lt;li>&lt;strong>Github&lt;/strong>
&lt;ul>
&lt;li>&lt;a href="https://github.com/wxt-dev/wxt" target="_blank" rel="noopener">wxt: Next-gen Web Extension Framework&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/anthropics/defending-code-reference-harness" target="_blank" rel="noopener">Skills for threat modeling, scanning, triage, patching, plus an autonomous scanning harness you can &lt;code>/customize&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/ad-si/awesome-3d-printing" target="_blank" rel="noopener">A curated list of awesome 3D printing resources&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/NousResearch/hermes-agent" target="_blank" rel="noopener">hermes-agent: It&amp;rsquo;s the only agent with a built-in learning loop - it creates skills from experience, improves them during use, nudges itself to persist knowledge, searches its own past conversations, and builds a deepening model of who you are across sessions. Run it on a $5 VPS, a GPU cluster, or serverless infrastructure that costs nearly nothing when idle. It&amp;rsquo;s not tied to your laptop - talk to it from Telegram while it works on a cloud VM.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/mysk-research/loupe" target="_blank" rel="noopener">loupe: A privacy-focused iOS app that raises awareness about what native apps can see(https://apps.apple.com/cn/app/loupe-app%E8%83%BD%E7%9C%8B%E5%88%B0%E4%BB%80%E4%B9%88/id6766152470)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/RoversX/LaunchNext" target="_blank" rel="noopener">LaunchNext: Bring your Launchpad back in MacOS26+ ,highly customizable, powerful, free.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/skeeto/endlessh" target="_blank" rel="noopener">endlessh: SSH tarpit that slowly sends an endless banner&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/akerouanton/iptables-tracer" target="_blank" rel="noopener">iptables-tracer: Trace packets as they go through iptables chains&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/serverless-dns/serverless-dns" target="_blank" rel="noopener">serverless-dns: The RethinkDNS resolver that deploys to Cloudflare Workers, Deno Deploy, Fastly, and Fly.io&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/ouch-org/ouch" target="_blank" rel="noopener">ouch: stands for Obvious Unified Compression Helper. It&amp;rsquo;s a CLI tool for compressing and decompressing various formats.(https://github.com/ouch-org/ouch#supported-formats)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/shell-pool/shpool" target="_blank" rel="noopener">shpool: shpool is a service that enables session persistence by allowing the creation of named shell sessions owned by shpool so that the session is not lost if the connection drops. shpool can be thought of as a lighter weight alternative to tmux or GNU screen. While tmux and screen take over the whole terminal and provide window splitting and tiling features, shpool only provides persistent sessions. The biggest advantage of this approach is that shpool does not break native scrollback or copy-paste.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/google/capslock" target="_blank" rel="noopener">capslock: is a capability analysis CLI for Go packages that informs users of which privileged operations a given package can access. This works by classifying the capabilities of Go packages by following transitive calls to privileged standard library operations.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/psviderski/unregistry" target="_blank" rel="noopener">unregistry: Push docker images directly to remote servers without an external registry&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/Ranchero-Software/NetNewsWire" target="_blank" rel="noopener">NetNewsWire is a free and open-source feed reader for macOS and iOS. It supports RSS, Atom, JSON Feed, and RSS-in-JSON formats.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/k4yt3x/sysctl" target="_blank" rel="noopener">K4YT3X&amp;rsquo;s Hardened &amp;amp; Optimized Linux Kernel Parameters&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/tursodatabase/turso" target="_blank" rel="noopener">Turso is an in-process SQL database, compatible with SQLite.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/zizmorcore/zizmor" target="_blank" rel="noopener">zizmor is a static analysis tool for GitHub Actions.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/rustfs/rustfs" target="_blank" rel="noopener">RustFS is a high-performance, distributed object storage system built in Rust.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/jdx/usage" target="_blank" rel="noopener">Usage: is a spec and CLI for defining CLI tools. Arguments, flags, environment variables, and config files can all be defined in a Usage spec. It can be thought of like OpenAPI (swagger) for CLIs.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/MODSetter/SurfSense" target="_blank" rel="noopener">SurfSense: An open source, privacy focused alternative to NotebookLM for teams with no data limits.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/icann/icann-rdap" target="_blank" rel="noopener">ICANN implementation of the Registry Data Access Protocol (RDAP)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/openrdap/rdap" target="_blank" rel="noopener">OpenRDAP is a command line RDAP client implementation in Go.&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;li>&lt;strong>Article&lt;/strong>
&lt;ul>
&lt;li>&lt;a href="https://blog.ammaraskar.com/github-token-stealing/" target="_blank" rel="noopener">1-Click GitHub Token Stealing via a VSCode Bug&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.zhihu.com/question/590661860" target="_blank" rel="noopener">Linux 系统误将 chmod 权限改成 了 000，如何恢复?&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://ahelwer.ca/post/2026-05-08-builtin-u2f/" target="_blank" rel="noopener">Laptops all have built-in security tokens these days&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://tailscale.com/blog/tailscale-rustdesk-remote-desktop-access" target="_blank" rel="noopener">Tailscale and RustDesk: Secure remote access to all your desktops&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.trailofbits.com/2025/06/17/unexpected-security-footguns-in-gos-parsers/" target="_blank" rel="noopener">Unexpected security footguns in Go&amp;rsquo;s parsers&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://marvin.yabi.me/misc/junzishendoo.htm" target="_blank" rel="noopener">君子慎讀&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://marvin.yabi.me/misc/wenbai.htm" target="_blank" rel="noopener">辭典中標注的「讀音」和「語音」是什麼？&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://marvin.yabi.me/misc/AND.htm" target="_blank" rel="noopener">拜託別再「我汗你」了！&lt;/a>&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="linux-系统误将-chmod-权限改成-了-000如何恢复">Linux 系统误将 chmod 权限改成 了 000，如何恢复?&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">#include&lt;/span> &lt;span style="color:#75715e">&amp;lt;sys/stat.h&amp;gt;&lt;/span>&lt;span style="color:#75715e">
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">int&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>() {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">chmod&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;/usr/bin/chmod&amp;#34;&lt;/span>, &lt;span style="color:#ae81ff">0755&lt;/span>);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#ae81ff">0&lt;/span>;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ which chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>/usr/bin/chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>lrwxrwxrwx &lt;span style="color:#ae81ff">1&lt;/span> root root &lt;span style="color:#ae81ff">8&lt;/span> Sep &lt;span style="color:#ae81ff">27&lt;/span> &lt;span style="color:#ae81ff">2025&lt;/span> /usr/bin/chmod -&amp;gt; gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>-rwxr-xr-x &lt;span style="color:#ae81ff">1&lt;/span> root root 67K Jan &lt;span style="color:#ae81ff">23&lt;/span> 21:34 /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ sudo chmod &lt;span style="color:#ae81ff">000&lt;/span> /usr/bin/chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>lrwxrwxrwx &lt;span style="color:#ae81ff">1&lt;/span> root root &lt;span style="color:#ae81ff">8&lt;/span> Sep &lt;span style="color:#ae81ff">27&lt;/span> &lt;span style="color:#ae81ff">2025&lt;/span> /usr/bin/chmod -&amp;gt; gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>---------- &lt;span style="color:#ae81ff">1&lt;/span> root root 67K Jan &lt;span style="color:#ae81ff">23&lt;/span> 21:34 /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ cat main.c
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">#include &amp;lt;sys/stat.h&amp;gt;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>int main&lt;span style="color:#f92672">()&lt;/span> &lt;span style="color:#f92672">{&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> chmod&lt;span style="color:#f92672">(&lt;/span>&lt;span style="color:#e6db74">&amp;#34;/usr/bin/chmod&amp;#34;&lt;/span>, 0755&lt;span style="color:#f92672">)&lt;/span>;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> 0;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">}&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ gcc ./main.c
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ sudo ./a.out
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/chmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>lrwxrwxrwx &lt;span style="color:#ae81ff">1&lt;/span> root root &lt;span style="color:#ae81ff">8&lt;/span> Sep &lt;span style="color:#ae81ff">27&lt;/span> &lt;span style="color:#ae81ff">2025&lt;/span> /usr/bin/chmod -&amp;gt; gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>ubuntu@ubuntu:~$ ls -lh /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>-rwxr-xr-x &lt;span style="color:#ae81ff">1&lt;/span> root root 67K Jan &lt;span style="color:#ae81ff">23&lt;/span> 21:34 /usr/bin/gnuchmod
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="laptops-all-have-built-in-security-tokens-these-days">Laptops all have built-in security tokens these days&lt;/h2>
&lt;h3 id="macos">macOS&lt;/h3>
&lt;blockquote>
&lt;p>&lt;a href="https://github.com/yubico/libfido2" target="_blank" rel="noopener">https://github.com/yubico/libfido2&lt;/a>&lt;/p></description></item><item><title>Local LLM on MacBookPro</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260601-local-llm/</link><pubDate>Mon, 01 Jun 2026 10:58:17 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260601-local-llm/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://huggingface.co/mlx-community" target="_blank" rel="noopener">https://huggingface.co/mlx-community&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/ml-explore/mlx-lm" target="_blank" rel="noopener">https://github.com/ml-explore/mlx-lm&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/jundot/omlx" target="_blank" rel="noopener">https://github.com/jundot/omlx&lt;/a>&lt;/li>
&lt;/ul>
&lt;h4 id="install">Install&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install hf&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uv tool install &lt;span style="color:#e6db74">&amp;#34;huggingface_hub&amp;#34;&lt;/span> --with hf-xet --upgrade
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hf auth login
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hf auth whoami
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install mlx_lm&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uv tool install --force &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --from &lt;span style="color:#e6db74">&amp;#39;git+https://github.com/ml-explore/mlx-lm.git@refs/pull/1192/head&amp;#39;&lt;/span> mlx-lm &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --with &lt;span style="color:#e6db74">&amp;#39;transformers @ git+https://github.com/huggingface/transformers.git&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install mlx-openai-server&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uv pip install git+https://github.com/cubist38/mlx-openai-server.git --system
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install [litellm](https://github.com/BerriAI/litellm)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>uv tool install &lt;span style="color:#e6db74">&amp;#39;litellm[proxy]&amp;#39;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># install [claw-code](https://github.com/ultraworkers/claw-code)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>cargo install agent-code
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="download-model">Download Model&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>HF_HUB_DISABLE_XET&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">1&lt;/span> hf download mlx-community/DeepSeek-V4-Flash-4bit &lt;span style="color:#ae81ff">\
&lt;/span>&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ae81ff">&lt;/span> --local-dir deepseekV4 --repo-type model
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h4 id="run-server">Run Server&lt;/h4>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>mlx_lm.server --model /Users/ricky/git/mlx/deepseekV4 --port &lt;span style="color:#ae81ff">8080&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;strong>or&lt;/strong>&lt;/p></description></item><item><title>Articles</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260513-articles/</link><pubDate>Wed, 13 May 2026 11:15:33 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260513-articles/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://github.com/itgoyo/TelegramChannels" target="_blank" rel="noopener">TelegramChannels&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/warp-tech/warpgate" target="_blank" rel="noopener">warpgate: is a smart &amp;amp; fully transparent SSH, HTTPS, Kubernetes, MySQL, PostgreSQL bastion host that doesn&amp;rsquo;t require a client app or an SSH wrapper.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://jakub.kr/writing/details-that-make-interfaces-feel-better" target="_blank" rel="noopener">Details that make interfaces feel better: &lt;code>npx skills add jakubkrehel/make-interfaces-feel-better&lt;/code>&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/TheStageAI/TheWhisper" target="_blank" rel="noopener">TheWhisper: High-Performance Speech-to-Text&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/nexu-io/open-design" target="_blank" rel="noopener">Open Design: The open-source alternative to Claude Design. Local-first, web-deployable, BYOK at every layer — 16 coding-agent CLIs auto-detected on your PATH (Claude Code, Codex, Devin for Terminal, Cursor Agent, Gemini CLI, OpenCode, Qwen, Qoder CLI, GitHub Copilot CLI, Hermes, Kimi, Pi, Kiro, Kilo, Mistral Vibe, DeepSeek TUI) become the design engine, driven by 31 composable Skills and 72 brand-grade Design Systems. No CLI? An OpenAI-compatible BYOK proxy is the same loop minus the spawn.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/ultraworkers/claw-code" target="_blank" rel="noopener">Claw Code is the public Rust implementation of the claw CLI agent harness. The canonical implementation lives in rust/, and the current source of truth for this repository is ultraworkers/claw-code.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/LING71671/Open-ClaudeCode" target="_blank" rel="noopener">Open-ClaudeCode: 完整开源的 Claude Code 项目 - 基于 Anthropic 官方源码重建&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/claude-code-best/claude-code" target="_blank" rel="noopener">Claude Code Best V5 (CCB): 牢 A (Anthropic) 官方 Claude Code CLI 工具的源码反编译/逆向还原项目。目标是将 Claude Code 大部分功能及工程化能力复现 (问就是老佛爷已经付过钱了)。虽然很难绷, 但是它叫做 CCB(踩踩背)&amp;hellip; 而且, 我们实现了企业版或者需要登陆 Claude 账号才能使用的特性, 实现技术普惠&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/aattaran/deepclaude" target="_blank" rel="noopener">deepclaude: Use Claude Code&amp;rsquo;s autonomous agent loop with DeepSeek V4 Pro, OpenRouter, or any Anthropic-compatible backend. Same UX, 17x cheaper.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/pyinfra-dev/pyinfra" target="_blank" rel="noopener">pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands. Think ansible but Python instead of YAML, and a lot faster.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/jdx/mise" target="_blank" rel="noopener">mise: Dev tools, env vars, and tasks in one CLI&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/endevco/aube" target="_blank" rel="noopener">Aube installs automatically when you run a script. The tightest security defaults of any Node.js package manager - and the only one with a lifecycle-script jail. Drops into existing projects using existing lockfiles.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/V4bel/dirtyfrag" target="_blank" rel="noopener">Dirty Frag: Universal Linux LPE&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://sinceyouarrived.world/taken" target="_blank" rel="noopener">taken. You opened this page. It already knows the following.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://internetarchive.ch/" target="_blank" rel="noopener">internetarchive.ch&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.kronis.dev/blog/apple-is-increasing-my-cortisol-levels" target="_blank" rel="noopener">Apple is increasing my cortisol levels&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/dwarvesf/hidden" target="_blank" rel="noopener">Hidden Bar lets you hide menu bar items to give your Mac a cleaner look.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/stonerl/Thaw" target="_blank" rel="noopener">Thaw is a powerful menu bar management tool for macOS 26. While its primary function is hiding and showing menu bar items, it aims to cover a wide variety of additional features to make it one of the most versatile menu bar tools available.&lt;/a>&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="dirty-frag">Dirty Frag&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>git clone https://github.com/V4bel/dirtyfrag.git &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> cd dirtyfrag &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> gcc -O0 -Wall -o exp exp.c -lutil &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> ./exp
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>Articles</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260415-articles/</link><pubDate>Wed, 15 Apr 2026 09:22:42 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2026/20260415-articles/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://ganhua.wang/singleflight" target="_blank" rel="noopener">SingleFlight&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://catcoding.me/p/apple-gatekeeper-scan/" target="_blank" rel="noopener">macOS 奇怪的安全扫码机制&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/xindoo/agentic-design-patterns" target="_blank" rel="noopener">Agentic Design Patterns&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://tw93.fun/2026-03-12/claude.html" target="_blank" rel="noopener">你不知道的 Claude Code：架构、治理与工程实践&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://tw93.fun/2026-03-21/agent.html" target="_blank" rel="noopener">你不知道的 Agent：原理、架构与工程实践&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/rtk-ai/rtk" target="_blank" rel="noopener">rtk: CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/Wilfred/difftastic" target="_blank" rel="noopener">difftastic: a structural diff that understands syntax&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.anisafifi.com/en/blog/i-ditched-elasticsearch-for-meilisearch-heres-what-nobody-tells-you/" target="_blank" rel="noopener">I Ditched Elasticsearch for Meilisearch. Here&amp;rsquo;s What Nobody Tells You.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://taiwan.md/" target="_blank" rel="noopener">策展島嶼的深度敘事&lt;/a>: &lt;a href="https://github.com/frank890417/taiwan-md" target="_blank" rel="noopener">https://github.com/frank890417/taiwan-md&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://colobu.com/2025/11/01/Linux%20%E4%B8%AD%E7%BD%91%E7%BB%9C%E5%8C%85%E7%9A%84%E4%B8%80%E7%94%9F/index/" target="_blank" rel="noopener">Linux 中网络包的一生&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/coderamp-labs/gitingest" target="_blank" rel="noopener">Gitingest: Turn any Git repository into a prompt-friendly text ingest for LLMs.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.ilograph.com/blog/posts/more-common-diagram-mistakes/" target="_blank" rel="noopener">7 More Common Mistakes in Architecture Diagrams&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://claude.com/resources/use-cases" target="_blank" rel="noopener">Use Cases&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/obra/superpowers" target="_blank" rel="noopener">Superpowers&lt;/a>: Superpowers is a complete software development workflow for your coding agents, built on top of a set of composable &amp;ldquo;skills&amp;rdquo; and some initial instructions that make sure your agent uses them.&lt;/li>
&lt;li>&lt;a href="https://github.com/affaan-m/everything-claude-code" target="_blank" rel="noopener">everything-claude-code&lt;/a>: The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.&lt;/li>
&lt;li>&lt;a href="https://github.com/msitarzewski/agency-agents" target="_blank" rel="noopener">Agency Agents&lt;/a>: A complete AI agency at your fingertips - From frontend wizards to Reddit community ninjas, from whimsy injectors to reality checkers. Each agent is a specialized expert with personality, processes, and proven deliverables.&lt;/li>
&lt;li>&lt;a href="https://github.com/666ghj/MiroFish" target="_blank" rel="noopener">MiroFish: A Simple and Universal Swarm Intelligence Engine, Predicting Anything.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/lightpanda-io/browser" target="_blank" rel="noopener">Lightpanda Browser: the headless browser designed for AI and automation&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://blog.dailydoseofds.com/p/anatomy-of-the-claude-folder" target="_blank" rel="noopener">Anatomy of the .claude/ Folder&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/J-x-Z/cocoa-way" target="_blank" rel="noopener">Cocoa-Way: Native macOS Wayland Compositor written in Rust using Smithay. Experience seamless Linux app streaming on macOS without XQuartz.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/chenglou/pretext" target="_blank" rel="noopener">Pretext: Fast, accurate &amp;amp; comprehensive text measurement &amp;amp; layout&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.mgrunwald.com/ghostmoon/" target="_blank" rel="noopener">Ghostmoon.app: A Swiss Army Knife for your macOS menu bar&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://www.codingfont.com/" target="_blank" rel="noopener">CodingFont: A game to help you pick a coding font&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://piechowski.io/post/git-commands-before-reading-code/" target="_blank" rel="noopener">The Git Commands I Run Before Reading Any Code&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/memstechtips/Winhance" target="_blank" rel="noopener">Winhance: Application designed to optimize, customize and enhance your Windows experience.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://arhan.sh/blog/native-instant-space-switching-on-macos/" target="_blank" rel="noopener">Native Instant Space Switching on MacOS&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/Fluid-CAD/FluidCAD" target="_blank" rel="noopener">FluidCAD: Write CAD models in JavaScript. See the result in real time.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/VoltAgent/awesome-design-md" target="_blank" rel="noopener">Awesome DESIGN.md: Copy a DESIGN.md into your project, tell your AI agent &amp;ldquo;build me a page that looks like this&amp;rdquo; and get pixel-perfect UI that actually matches.&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://github.com/safishamsi/graphify" target="_blank" rel="noopener">graphify&lt;/a>: AI coding assistant skill (Claude Code, Codex, OpenCode, Cursor, Gemini CLI, GitHub Copilot CLI, OpenClaw, Factory Droid, Trae, Google Antigravity). Turn any folder of code, docs, papers, images, or videos into a queryable knowledge graph&lt;/li>
&lt;/ul>
&lt;hr>
&lt;h2 id="singleflight">SingleFlight&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-go" data-lang="go">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">package&lt;/span> &lt;span style="color:#a6e22e">analyzer&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> (
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;context&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;sync&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;golang.org/x/sync/singleflight&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#e6db74">&amp;#34;github.com/nathan/stock_bot/internal/storage&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">type&lt;/span> &lt;span style="color:#a6e22e">AnalysisService&lt;/span> &lt;span style="color:#66d9ef">struct&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">genai&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">GenAIClient&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">d1Client&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">storage&lt;/span>.&lt;span style="color:#a6e22e">D1Client&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">stockCache&lt;/span> &lt;span style="color:#66d9ef">map&lt;/span>[&lt;span style="color:#66d9ef">string&lt;/span>]&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">mu&lt;/span> &lt;span style="color:#a6e22e">sync&lt;/span>.&lt;span style="color:#a6e22e">RWMutex&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">sf&lt;/span> &lt;span style="color:#a6e22e">singleflight&lt;/span>.&lt;span style="color:#a6e22e">Group&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">AnalysisService&lt;/span>) &lt;span style="color:#a6e22e">analyzeStock&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span> &lt;span style="color:#a6e22e">context&lt;/span>.&lt;span style="color:#a6e22e">Context&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span>, &lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) (&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 1. 第一層防護：檢查記憶體快取 (L1 Cache)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">mu&lt;/span>.&lt;span style="color:#a6e22e">RLock&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">result&lt;/span>, &lt;span style="color:#a6e22e">ok&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">stockCache&lt;/span>[&lt;span style="color:#a6e22e">code&lt;/span>]; &lt;span style="color:#a6e22e">ok&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">mu&lt;/span>.&lt;span style="color:#a6e22e">RUnlock&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">result&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">mu&lt;/span>.&lt;span style="color:#a6e22e">RUnlock&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 2. 第二層防護：Singleflight (請求合併)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;stock:&amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">code&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>, &lt;span style="color:#a6e22e">_&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">sf&lt;/span>.&lt;span style="color:#a6e22e">Do&lt;/span>(&lt;span style="color:#a6e22e">key&lt;/span>, &lt;span style="color:#66d9ef">func&lt;/span>() (&lt;span style="color:#66d9ef">interface&lt;/span>{}, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 3. 執行昂貴的邏輯 (DB + Gemini API)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">result&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">doAnalyzeStock&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span>, &lt;span style="color:#a6e22e">name&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 4. 寫入快取 (務必在 singleflight 內部完成，防止下一波瞬間擊穿)&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">mu&lt;/span>.&lt;span style="color:#a6e22e">Lock&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">stockCache&lt;/span>[&lt;span style="color:#a6e22e">code&lt;/span>] = &lt;span style="color:#a6e22e">result&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">mu&lt;/span>.&lt;span style="color:#a6e22e">Unlock&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">result&lt;/span>, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> })
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>.(&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>), &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">AnalysisService&lt;/span>) &lt;span style="color:#a6e22e">doAnalyzeStock&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span> &lt;span style="color:#a6e22e">context&lt;/span>.&lt;span style="color:#a6e22e">Context&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span>, &lt;span style="color:#a6e22e">name&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) (&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 建立一個子 Context 用於內部的多個非同步任務&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">g&lt;/span>, &lt;span style="color:#a6e22e">ctx&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">errgroup&lt;/span>.&lt;span style="color:#a6e22e">WithContext&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">dbData&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">var&lt;/span> &lt;span style="color:#a6e22e">aiResult&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 任務 1：查資料庫&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">g&lt;/span>.&lt;span style="color:#a6e22e">Go&lt;/span>(&lt;span style="color:#66d9ef">func&lt;/span>() &lt;span style="color:#66d9ef">error&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 隨時檢查 Context 是否已取消&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">select&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">case&lt;/span> &lt;span style="color:#f92672">&amp;lt;-&lt;/span>&lt;span style="color:#a6e22e">ctx&lt;/span>.&lt;span style="color:#a6e22e">Done&lt;/span>():
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">ctx&lt;/span>.&lt;span style="color:#a6e22e">Err&lt;/span>()
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">default&lt;/span>:
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 模擬資料庫查詢&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">dbData&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;Historical Data&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> })
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 任務 2：呼叫 Gemini API&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">g&lt;/span>.&lt;span style="color:#a6e22e">Go&lt;/span>(&lt;span style="color:#66d9ef">func&lt;/span>() &lt;span style="color:#66d9ef">error&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 將 ctx 傳入 API 客戶端，讓它能跟隨整體的超時控制&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">res&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">genai&lt;/span>.&lt;span style="color:#a6e22e">Generate&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Analyze this: &amp;#34;&lt;/span>&lt;span style="color:#f92672">+&lt;/span>&lt;span style="color:#a6e22e">code&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">aiResult&lt;/span> = &lt;span style="color:#a6e22e">res&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> })
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 等待所有任務完成或其中一個出錯&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">g&lt;/span>.&lt;span style="color:#a6e22e">Wait&lt;/span>(); &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#f92672">&amp;amp;&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>{&lt;span style="color:#a6e22e">Data&lt;/span>: &lt;span style="color:#a6e22e">dbData&lt;/span>, &lt;span style="color:#a6e22e">Analysis&lt;/span>: &lt;span style="color:#a6e22e">aiResult&lt;/span>}, &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">func&lt;/span> (&lt;span style="color:#a6e22e">s&lt;/span> &lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">AnalysisService&lt;/span>) &lt;span style="color:#a6e22e">analyzeStockWithMetrics&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span> &lt;span style="color:#a6e22e">context&lt;/span>.&lt;span style="color:#a6e22e">Context&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span> &lt;span style="color:#66d9ef">string&lt;/span>) (&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">key&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;stock:&amp;#34;&lt;/span> &lt;span style="color:#f92672">+&lt;/span> &lt;span style="color:#a6e22e">code&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">v&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>, &lt;span style="color:#a6e22e">shared&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">sf&lt;/span>.&lt;span style="color:#a6e22e">Do&lt;/span>(&lt;span style="color:#a6e22e">key&lt;/span>, &lt;span style="color:#66d9ef">func&lt;/span>() (&lt;span style="color:#66d9ef">interface&lt;/span>{}, &lt;span style="color:#66d9ef">error&lt;/span>) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">doAnalyzeStock&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span>, &lt;span style="color:#e6db74">&amp;#34;Name&amp;#34;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> })
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#75715e">// 紀錄監控指標：分辨是「原始呼叫」還是「共享結果」&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">status&lt;/span> &lt;span style="color:#f92672">:=&lt;/span> &lt;span style="color:#e6db74">&amp;#34;original&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">shared&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">status&lt;/span> = &lt;span style="color:#e6db74">&amp;#34;shared&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">s&lt;/span>.&lt;span style="color:#a6e22e">sfCounter&lt;/span>.&lt;span style="color:#a6e22e">Add&lt;/span>(&lt;span style="color:#a6e22e">ctx&lt;/span>, &lt;span style="color:#ae81ff">1&lt;/span>, &lt;span style="color:#a6e22e">metric&lt;/span>.&lt;span style="color:#a6e22e">WithAttributes&lt;/span>(
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">attribute&lt;/span>.&lt;span style="color:#a6e22e">String&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;stock_code&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">code&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#a6e22e">attribute&lt;/span>.&lt;span style="color:#a6e22e">String&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;type&amp;#34;&lt;/span>, &lt;span style="color:#a6e22e">status&lt;/span>),
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ))
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">if&lt;/span> &lt;span style="color:#a6e22e">err&lt;/span> &lt;span style="color:#f92672">!=&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#66d9ef">nil&lt;/span>, &lt;span style="color:#a6e22e">err&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">return&lt;/span> &lt;span style="color:#a6e22e">v&lt;/span>.(&lt;span style="color:#f92672">*&lt;/span>&lt;span style="color:#a6e22e">StockAnalysisResult&lt;/span>), &lt;span style="color:#66d9ef">nil&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;hr>
&lt;h2 id="macos-奇怪的安全扫码机制">macOS 奇怪的安全扫码机制&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-shell" data-lang="shell">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># 查看最近的 syspolicyd 扫描记录&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>log show --predicate &lt;span style="color:#e6db74">&amp;#39;subsystem == &amp;#34;com.apple.syspolicy.exec&amp;#34;&amp;#39;&lt;/span> --last 5m --style compact | grep performScan
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>&lt;code>System Settings → Privacy &amp;amp; Security → Full Disk Access，给 VS Code 完全磁盘访问权限有效&lt;/code>&lt;/p></description></item><item><title>macOS 使用技巧與小訣竅</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2025/20250307-macos-tips/</link><pubDate>Fri, 07 Mar 2025 16:05:00 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2025/20250307-macos-tips/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://saurabhs.org/macos-tips" target="_blank" rel="noopener">macOS 使用技巧與小訣竅&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="一般">一般&lt;/h3>
&lt;h4 id="原生-ui-習慣">原生 UI 習慣&lt;/h4>
&lt;ul>
&lt;li>按 ⇧⌘/ 可搜尋目前應用程式的所有選單項目，接著用上下箭頭瀏覽結果，按 &lt;code>Return&lt;/code> 執行該選單動作。&lt;/li>
&lt;li>按 ⌃F2 將鍵盤焦點移到應用程式的選單列，輸入選單標題的前幾個字母即可跳到該選單。&lt;/li>
&lt;li>展開樹狀清單時按住 &lt;code>Option&lt;/code> 可遞迴展開所有子項（最容易測試的地方是 Finder 的列表檢視）。&lt;/li>
&lt;li>在對話框/工作表上，按 &lt;code>Command&lt;/code> 加按鈕的首字母可直接按下該按鈕。⌘. 等同於 &lt;code>Escape&lt;/code>。&lt;/li>
&lt;li>按住 &lt;code>Control&lt;/code> 與 &lt;code>Option&lt;/code> 點擊視窗，可切換焦點但不把視窗置頂。&lt;/li>
&lt;li>拖曳工具列圖示時按住 &lt;code>Command&lt;/code> 可改變位置。&lt;/li>
&lt;li>預設在捲軸上點擊會部分捲動到該位置；按住 &lt;code>Option&lt;/code> 點擊捲軸可直接跳到點擊處。&lt;/li>
&lt;li>拖曳捲軸滑塊時按住 &lt;code>Option&lt;/code> 可慢速捲動。&lt;/li>
&lt;li>在可捲動區域，用上下鍵小幅捲動；按住 &lt;code>Option&lt;/code> 可大幅捲動，按住 &lt;code>Command&lt;/code> 則捲到開頭或結尾。&lt;/li>
&lt;li>按 Page Up/Page Down 時按住 &lt;code>Option&lt;/code>，捲動同時移動游標。&lt;/li>
&lt;li>在 Tab 鍵被視為輸入的欄位中，按 &lt;code>Control-Tab&lt;/code> 和 &lt;code>Control-Shift-Tab&lt;/code> 可移動到前一或下一個控制項。&lt;/li>
&lt;li>游標停在單字上時按 ⌃⌘D 可顯示行內字典解釋。&lt;/li>
&lt;li>按 ⌃F6 可把焦點移到浮動視窗。&lt;/li>
&lt;li>快速尋找文字：選取文字後按 ⌘E，再按 ⌘G。&lt;/li>
&lt;li>按 ⌃⌫ 可只刪除上一個字元的重音符號（例如 é 變成 e）。&lt;/li>
&lt;li>在字體視窗輸入 &lt;code>*X&lt;/code> 可縮放目前字體大小，例如 &lt;code>*1.5&lt;/code>。&lt;/li>
&lt;li>輸入文字時，按 ⌥⇧K（美式鍵盤）可插入蘋果標誌。&lt;/li>
&lt;li>拖曳子母畫面（PiP）視窗時按住 &lt;code>Command&lt;/code>，可自由移動而不會吸附到螢幕角落。&lt;/li>
&lt;/ul>
&lt;h4 id="截圖">截圖&lt;/h4>
&lt;ul>
&lt;li>按下 ⇧⌘4 並拖曳選取截圖區域時，按住 &lt;code>Option&lt;/code> 可從中心縮放，按住 &lt;code>Shift&lt;/code> 可只調整單一軸向。畫好區域後，按住空白鍵並拖曳可移動選取區域。&lt;/li>
&lt;li>按下 ⇧⌘4 後截圖時按住 &lt;code>Control&lt;/code>，可複製到剪貼簿而非儲存檔案。&lt;/li>
&lt;li>按下 ⇧⌘4 後按空白鍵可選擇視窗截圖，截圖時按住 &lt;code>Option&lt;/code> 可移除視窗陰影。&lt;/li>
&lt;li>在浮動截圖預覽上按右鍵可使用更多動作。&lt;/li>
&lt;/ul>
&lt;h4 id="開啟儲存對話框">開啟/儲存對話框&lt;/h4>
&lt;ul>
&lt;li>將 Finder 中的檔案或資料夾拖到開啟/儲存對話框，可直接跳到該位置。&lt;/li>
&lt;li>在儲存對話框按 ⌘= 可切換精簡與展開版面。&lt;/li>
&lt;li>在儲存對話框，按 ⌘⌫ 啟用 Delete，⌘D 啟用 Don&amp;rsquo;t Save，⌘.（或 &lt;code>Esc&lt;/code>）啟用 Cancel。&lt;/li>
&lt;li>按 &lt;code>~&lt;/code> 會開啟 Go To File 對話框並預填家目錄；按 &lt;code>/&lt;/code> 則預填根目錄。&lt;/li>
&lt;li>按 ⌘R 可在 Finder 顯示選取項目。&lt;/li>
&lt;/ul>
&lt;h4 id="mission-control--視窗管理">Mission Control / 視窗管理&lt;/h4>
&lt;ul>
&lt;li>視窗未啟用時，按住 &lt;code>Command&lt;/code> 可操作它而不會讓它變成前景視窗。&lt;/li>
&lt;li>按 Mission Control 功能鍵時按住 &lt;code>Control&lt;/code>，只顯示目前應用程式的視窗；按住 &lt;code>Command&lt;/code> 則顯示桌面。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 雙擊視窗角落可把視窗擴展填滿螢幕。&lt;/li>
&lt;li>&lt;code>Option&lt;/code> 點擊可切換視窗並隱藏前一個應用程式；&lt;code>Command-Option&lt;/code> 點擊可切換視窗並隱藏其他應用程式。&lt;/li>
&lt;li>在 Command-Tab 切換器中，按上下箭頭（或數字鍵 1）可查看該應用程式的視窗。&lt;/li>
&lt;li>在 Command-Tab 切換器中，按住 &lt;code>Option&lt;/code> 切換到應用程式，可解除最小化該應用程式的所有視窗。&lt;/li>
&lt;li>按 ⌘` 可在前景應用程式的視窗間循環切換。&lt;/li>
&lt;li>按 ⌃F4 可在目前桌面空間的所有應用程式視窗間循環切換。&lt;/li>
&lt;li>把視窗拖到螢幕頂部並向上推，可在 Mission Control 中選取該視窗。&lt;/li>
&lt;li>按 ⌥⌘W，或按住 &lt;code>Option&lt;/code> 點擊紅色關閉鍵，可關閉前景應用程式的所有視窗。&lt;/li>
&lt;li>按 ⌥⌘M，或按住 &lt;code>Option&lt;/code> 點擊黃色最小化鍵，可最小化前景應用程式的所有視窗。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 點擊綠色縮放鍵可填滿螢幕，而不是進入全螢幕。&lt;/li>
&lt;li>在系統設定中配置熱角時，按住 &lt;code>Control&lt;/code>、&lt;code>Option&lt;/code>、&lt;code>Command&lt;/code> 或 &lt;code>Shift&lt;/code> 可讓角落只在按住這些按鍵時才會觸發。&lt;/li>
&lt;li>在觸控板上，用兩指輕點（不是點擊）Dock 上的應用程式圖示，可顯示該應用程式的所有視窗；也可在該圖示上使用 App Exposé 手勢。&lt;/li>
&lt;li>調整視窗大小時按住 &lt;code>Option&lt;/code> 可從中心縮放；按住 &lt;code>Shift&lt;/code> 可鎖定長寬比。&lt;/li>
&lt;li>雙擊視窗邊框可把該邊延伸填滿螢幕；按住 &lt;code>Option&lt;/code> 雙擊則可同時延伸兩側。&lt;/li>
&lt;li>在 Mission Control 中，對一組應用程式視窗向上捲動可展開到單一視窗；游標停在視窗上按空白鍵可放大。&lt;/li>
&lt;li>在 Mission Control 中，Option 點擊另一個桌面空間可切換到該空間並保持 Mission Control 開啟。&lt;/li>
&lt;li>在 Mission Control 中，拖曳視窗下方的應用程式圖示可將該應用程式的所有視窗移到另一個空間。&lt;/li>
&lt;li>在 Mission Control 的應用程式視窗模式下，按 &lt;code>Tab&lt;/code> 與 &lt;code>Shift-Tab&lt;/code> 可切換應用程式。&lt;/li>
&lt;li>視窗若在其他空間被最小化，按住 &lt;code>Command&lt;/code> 再解除最小化可讓它回到目前空間。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 解除最小化視窗，可同時解除最小化該應用程式的所有視窗。&lt;/li>
&lt;li>若某應用在多個空間有視窗，重複點 Dock 圖示可在這些空間間切換。&lt;/li>
&lt;li>若啟用切換桌面空間的快捷鍵，按住快捷鍵並拖曳視窗可把視窗移到該空間。&lt;/li>
&lt;li>在幕前調度中，按住 &lt;code>Shift&lt;/code> 點擊視窗可將其加入目前舞台，而不是取代。&lt;/li>
&lt;/ul>
&lt;h4 id="功能鍵">功能鍵&lt;/h4>
&lt;ul>
&lt;li>調整音量或亮度時按住 &lt;code>Shift&lt;/code> 與 &lt;code>Option&lt;/code> 可做更細微的調整。&lt;/li>
&lt;li>調整亮度時按住 &lt;code>Option&lt;/code> 可快速開啟顯示器設定；調整音量時按住 &lt;code>Option&lt;/code> 可快速開啟聲音設定。&lt;/li>
&lt;li>調整音量時按住 &lt;code>Shift&lt;/code> 可預覽音量。&lt;/li>
&lt;li>連接外接螢幕時，調整亮度時按住 &lt;code>Control&lt;/code> 可調整非目前顯示器的亮度。&lt;/li>
&lt;li>按住 Mission Control 功能鍵不放，鬆開時會自動退出 Mission Control。&lt;/li>
&lt;/ul>
&lt;h4 id="選單列--通知中心">選單列 / 通知中心&lt;/h4>
&lt;ul>
&lt;li>按住 &lt;code>Option&lt;/code> 開啟 Wi-Fi 與藍牙選單可顯示更多選項。&lt;/li>
&lt;li>拖曳選單列圖示時按住 &lt;code>Command&lt;/code> 可改變位置。&lt;/li>
&lt;li>從控制中心拖曳圖示到選單列可新增選單列項目。&lt;/li>
&lt;li>Option 點擊選單列的日期時間可切換請勿打擾。&lt;/li>
&lt;li>右鍵點擊小工具可變更大小。&lt;/li>
&lt;li>在觸控板上，用兩指橫向滑過通知可將其移除。&lt;/li>
&lt;/ul>
&lt;h3 id="finder">Finder&lt;/h3>
&lt;ul>
&lt;li>複製檔案後按 ⌥⌘V 可移動檔案而非貼上副本。&lt;/li>
&lt;li>選取多個檔案時按 ⌃⌘N 可建立包含這些項目的新資料夾。&lt;/li>
&lt;li>按 &lt;code>Tab&lt;/code> 與 &lt;code>Shift-Tab&lt;/code> 可依字母順序瀏覽檔案，無視目前排序方式（僅限圖示與列表檢視）。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 啟動 Quick Look 可直接進入全螢幕。&lt;/li>
&lt;li>以多個檔案開啟 Quick Look 後，按 ⌘⏎ 可顯示所有項目的格狀檢視，用方向鍵選取並按 Return 聚焦。&lt;/li>
&lt;li>在 Quick Look 中，右鍵點擊「Open with」可選擇不同的開啟應用程式。&lt;/li>
&lt;li>在欄位檢視中，按住 &lt;code>Option&lt;/code> 拖曳欄位寬度可同時調整所有欄位。&lt;/li>
&lt;li>在欄位檢視中，雙擊欄位分隔線可自動調整該欄寬度；按住 &lt;code>Option&lt;/code> 雙擊可自動調整所有欄位。&lt;/li>
&lt;li>在欄位檢視中，點擊資料夾底部的空白區可回到上一層資料夾。&lt;/li>
&lt;li>在欄位檢視中，當你位於深層目錄時，按 &lt;code>Shift-Tab&lt;/code> 與 &lt;code>Tab&lt;/code> 可在不丟失路徑的情況下切換父層目錄。&lt;/li>
&lt;li>拖曳檔案時按住 &lt;code>Option&lt;/code> 可建立副本，按住 &lt;code>Command&lt;/code> 與 &lt;code>Option&lt;/code> 則會建立捷徑。&lt;/li>
&lt;li>在列表檢視中，按 ⌘+ 與 ⌘- 可放大或縮小列高。&lt;/li>
&lt;li>在列表檢視中，按 ⌥↑ 與 ⌥↓ 可選取最上或最下的項目。&lt;/li>
&lt;li>在列表檢視中，按左右箭頭可折疊或展開目錄；選取檔案時按左鍵可回到父層目錄。&lt;/li>
&lt;li>按 ⌘I 可開啟目前檔案的檢查器；按 ⌥⌘I 則開啟會隨選取變化的浮動檢查器。&lt;/li>
&lt;li>按 ⌥⌘C 可複製目前選取檔案的完整路徑。&lt;/li>
&lt;li>按 ⇧⌘. 可切換顯示隱藏檔案。&lt;/li>
&lt;li>按 ⌥⌘⌫ 可立即刪除檔案而不送進垃圾桶。&lt;/li>
&lt;li>拖曳資料夾到另一個資料夾上時按住 &lt;code>Option&lt;/code> 可合併資料夾。&lt;/li>
&lt;li>複製新圖示後，開啟檢查器（⌘I），選取左上角資料夾圖示並按 ⌘V 可設定自訂圖示。&lt;/li>
&lt;li>將選取文字拖到 Finder 視窗，可快速建立文字剪貼並儲存（文字剪貼是無法編輯、且不需命名的文字檔）。&lt;/li>
&lt;li>按 ⌥⌘O 可開啟所選檔案並自動關閉 Finder 視窗。&lt;/li>
&lt;li>按 ⌥⇧⌘V 可貼上項目並保留檔案權限標記。&lt;/li>
&lt;li>在圖示檢視中拖曳圖示時按住 &lt;code>Command&lt;/code> 可對齊格線。&lt;/li>
&lt;li>在 Finder Dock 圖示上按住 &lt;code>Option&lt;/code> 右鍵並選擇 Relaunch 可重新啟動 Finder。&lt;/li>
&lt;li>拖曳資料夾到新分頁按鈕（需已有多個分頁）可在新分頁開啟該資料夾。&lt;/li>
&lt;li>按 ⌃⌘↑ 可在新視窗開啟父層資料夾。&lt;/li>
&lt;li>若工具列被隱藏（⌥⌘T），Finder 會在新視窗開啟資料夾。&lt;/li>
&lt;li>選取圖片後按 ⌘R 可順時針旋轉，按 ⌘L 可逆時針旋轉。&lt;/li>
&lt;/ul>
&lt;h3 id="dock">Dock&lt;/h3>
&lt;ul>
&lt;li>按 ⌥⌘D 可顯示或隱藏 Dock。&lt;/li>
&lt;li>按 ⌃F3 將鍵盤焦點移到 Dock，再用左右箭頭選取應用程式，或輸入應用程式前幾個字母，按 &lt;code>Enter&lt;/code> 開啟；按上箭頭可打開該應用程式的選單。&lt;/li>
&lt;li>按住 &lt;code>Control&lt;/code> 與 &lt;code>Shift&lt;/code> 在 Dock 上移動滑鼠可暫時開啟放大效果。&lt;/li>
&lt;li>拖曳 Dock 的縮放把手時按住 &lt;code>Shift&lt;/code> 可快速把 Dock 移到不同螢幕邊緣。&lt;/li>
&lt;li>調整 Dock 大小時按住 &lt;code>Option&lt;/code> 可用 16 點的倍數縮放。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 與 &lt;code>Command&lt;/code> 點擊正在執行的 Dock 圖示，可隱藏其他應用程式。&lt;/li>
&lt;li>將檔案拖到 Dock 上的應用程式圖示可用指定應用程式開啟；若預設不支援該檔案類型，拖曳時按住 &lt;code>Option&lt;/code> 與 &lt;code>Command&lt;/code> 可強制開啟。&lt;/li>
&lt;li>Dock 圖示持續彈跳時，把游標移到圖示上可停止彈跳。&lt;/li>
&lt;li>右鍵點擊 Dock 圖示時按住 &lt;code>Control&lt;/code> 與 &lt;code>Command&lt;/code> 可只顯示預設系統選單項目。&lt;/li>
&lt;li>按住 &lt;code>Option&lt;/code> 與 &lt;code>Command&lt;/code> 點擊 Dock 中的資料夾可在新的 Finder 視窗開啟。&lt;/li>
&lt;li>在堆疊中開啟多個項目時，按住 &lt;code>Option&lt;/code> 點選可在背景開啟，堆疊不會關閉。&lt;/li>
&lt;li>開啟堆疊後，把游標移到項目上並按空白鍵可用 Quick Look 預覽。&lt;/li>
&lt;li>右鍵點擊 Launchpad 圖示可從行內選單開啟應用程式。&lt;/li>
&lt;li>在 Launchpad 中按住 &lt;code>Option&lt;/code> 可進入抖動模式，重新排列或刪除應用程式。&lt;/li>
&lt;li>要把 AirDrop 加到 Dock，請在 Finder 前往 &lt;code>/System/Library/CoreServices/Finder.app/Contents/Applications&lt;/code>，並把 AirDrop 圖示拖到 Dock。&lt;/li>
&lt;/ul>
&lt;h3 id="spotlight">Spotlight&lt;/h3>
&lt;ul>
&lt;li>按 ⌘B 可用目前的查詢搜尋網頁。&lt;/li>
&lt;li>按 ⌘C 可複製所選檔案的完整路徑，或複製目前計算結果。&lt;/li>
&lt;li>按 ⌘D 可用目前查詢開啟字典。&lt;/li>
&lt;li>按 ⌘L 可跳到結果中的字典區塊（若存在）。&lt;/li>
&lt;li>按 ⌘⏎ 或 ⌘R 可在 Finder 顯示所選檔案。&lt;/li>
&lt;li>使用 &lt;code>name:&lt;/code> 篩選只搜尋檔名。&lt;/li>
&lt;li>使用 &lt;code>kind:folder&lt;/code> 只搜尋資料夾名稱。&lt;/li>
&lt;li>按住 &lt;code>Command&lt;/code> 可顯示目前選取檔案的路徑。&lt;/li>
&lt;/ul>
&lt;h3 id="safari">Safari&lt;/h3>
&lt;ul>
&lt;li>分頁群組會以空間方式整理分頁；使用 ⌥⌘{↑,↓,←,→} 可在 2D 空間中瀏覽分頁。&lt;/li>
&lt;li>播放影片時，右鍵點擊網址列或分頁上的喇叭圖示可進入子母畫面（PiP）。&lt;/li>
&lt;li>關閉分頁時按住 &lt;code>Option&lt;/code> 可關閉其他分頁，僅保留目前分頁。&lt;/li>
&lt;li>點擊並按住返回鍵可查看近期瀏覽記錄；按住 &lt;code>Option&lt;/code> 可顯示 URL 而非標題。&lt;/li>
&lt;li>把選取文字拖到 Safari 的 Dock 圖示可快速搜尋網頁。&lt;/li>
&lt;li>按 ⇧⌘T 可重新開啟最近關閉的分頁或視窗。&lt;/li>
&lt;li>按住工具列的新分頁圖示可查看最近關閉的分頁。&lt;/li>
&lt;li>在網址列開頭按空白鍵可變更搜尋引擎並查看近期網頁搜尋。&lt;/li>
&lt;li>在 Spotlight 搜尋中加入 &lt;code>kind:bookmark&lt;/code> 可搜尋 Safari 書籤與瀏覽記錄。&lt;/li>
&lt;li>&lt;code>Shift&lt;/code> 點擊連結可加入閱讀列表。&lt;/li>
&lt;li>點擊並按住書籤列的書籤可編輯顯示標題。&lt;/li>
&lt;li>Option 點擊重新整理圖示或按 ⌥⌘R 可強制重新載入目前網頁。&lt;/li>
&lt;li>右鍵點擊網址列的閱讀器圖示，可讓目前網站的所有頁面自動開啟閱讀模式。&lt;/li>
&lt;li>執行網頁搜尋並在同一分頁開啟結果後，按 ⌥⌘S 可回到搜尋結果頁。&lt;/li>
&lt;li>按 ⇧⌘I 可建立包含目前頁面內容的新郵件。&lt;/li>
&lt;li>在 History &amp;gt; Clear History 上按住 &lt;code>Option&lt;/code> 可只清除瀏覽記錄並保留網站資料。&lt;/li>
&lt;li>游標停在連結上按 ⌃⌘D 可顯示連結的行內預覽。&lt;/li>
&lt;/ul>
&lt;h3 id="mail">Mail&lt;/h3>
&lt;ul>
&lt;li>在左側欄以 &lt;code>Command&lt;/code> 點擊多個信箱可同時檢視其郵件。&lt;/li>
&lt;li>回覆或轉寄前先選取訊息中的部分文字，可只在新訊息中包含該段落。&lt;/li>
&lt;li>將檔案拖到 Mail 的 Dock 圖示可建立新郵件並附上該檔案。&lt;/li>
&lt;li>按 ⌥⇧⌘N 可建立新分頁。&lt;/li>
&lt;li>在訊息結尾按空白鍵可前往下一封訊息；在訊息開頭按住 &lt;code>Shift&lt;/code> 再按空白鍵可回到上一封訊息。&lt;/li>
&lt;li>開始輸入寄件者、主旨或內文的前幾個字元可快速跳到該訊息。&lt;/li>
&lt;li>按 ⌥⌘↑ 與 ⌥⌘↓ 可跳到最上或最下的訊息。&lt;/li>
&lt;li>將重要郵件拖到 Finder 可保留額外備份。&lt;/li>
&lt;li>若郵件退信，可在退信上使用 &lt;code>Message &amp;gt; Send Again&lt;/code> 改寄到其他地址。&lt;/li>
&lt;li>拖曳郵件到資料夾時按住 Command 可同時加入多個資料夾。&lt;/li>
&lt;li>按 ⇧⌘C 可替郵件標記顏色。&lt;/li>
&lt;li>把郵件拖到 Notes 或 Reminders 可新增連結。&lt;/li>
&lt;li>回覆郵件時按 ⌘R 與 ⇧⌘R 可在回覆與回覆全部之間切換。&lt;/li>
&lt;li>按 ⌥⌫ 可刪除郵件且不會自動開啟下一封。&lt;/li>
&lt;li>&lt;code>Command&lt;/code> 點擊目前選取的郵件可取消選取。&lt;/li>
&lt;li>若郵件已被回覆，可點訊息列表中的回覆圖示在新視窗開啟回覆。&lt;/li>
&lt;li>建立新信箱時，在名稱中加入斜線可建立巢狀信箱。&lt;/li>
&lt;li>After performing a search, select a mailbox from the left sidebar to filter the search to that mailbox.&lt;/li>
&lt;li>Hold &lt;code>Shift&lt;/code> while launching Mail to reset the index.&lt;/li>
&lt;/ul>
&lt;h3 id="preview">Preview&lt;/h3>
&lt;ul>
&lt;li>Press ` to bring up a magnifier, and then press &lt;code>+&lt;/code> and &lt;code>-&lt;/code> to resize it.&lt;/li>
&lt;li>In a PDF document, re-order the pages in the document by re-ordering the pages in the sidebar.&lt;/li>
&lt;li>Merge two PDF documents by dragging pages from one document&amp;rsquo;s sidebar to the other document&amp;rsquo;s sidebar.&lt;/li>
&lt;li>In the save dialog for an image, hold &lt;code>Option&lt;/code> while opening the Format menu to access an extended list of formats.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> and the Space bar to activate the pan tool.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> while in text selection mode to switch to rectangular text selection.&lt;/li>
&lt;/ul>
&lt;h3 id="calendar">Calendar&lt;/h3>
&lt;ul>
&lt;li>Hold &lt;code>Shift&lt;/code> while dragging an event to set a more precise time instead of snapping to 15-minute intervals.&lt;/li>
&lt;li>Click and hold the &lt;code>Accept&lt;/code> button in a calendar invite to change which calendar the event is accepted to.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> while pressing the &lt;code>Accept&lt;/code> button in a calendar invite to accept all events.&lt;/li>
&lt;li>Hold &lt;code>Command&lt;/code> while clicking any calendar&amp;rsquo;s checkbox in the left sidebar to show or hide all calendars.&lt;/li>
&lt;li>Hold &lt;code>Command&lt;/code> and &lt;code>Option&lt;/code> while clicking a calendar&amp;rsquo;s checkbox to only show that calendar.&lt;/li>
&lt;li>Add &lt;code>kind:event&lt;/code> to Spotlight searches to search calendar events.&lt;/li>
&lt;li>Resize the mini-calendar in the bottom-left to preview more months.&lt;/li>
&lt;li>With an event selected, press ⌃⌥↑ and ⌃⌥↓ to adjust the time of the event. This also works with multiple events selected.&lt;/li>
&lt;li>In Week view, press ⌥⌘← and ⌥⌘→ to shift the view by a single day.&lt;/li>
&lt;/ul>
&lt;h3 id="messages">Messages&lt;/h3>
&lt;ul>
&lt;li>Press ⌘R to directly reply to the latest message in the conversation.
Press ⇧⌘R to reply to the latest thread in the conversation.&lt;/li>
&lt;li>Press ⌘T to bring up the tapback selector for the latest message. Use the 1-6 number keys to select a reaction.&lt;/li>
&lt;li>Press ⌘E to edit the latest sent message.&lt;/li>
&lt;li>Press ⌥↑ and ⌥↓ in the message input field to cycle through previously sent messages.&lt;/li>
&lt;li>Press ⌘1-9 to jump to a pinned conversation.&lt;/li>
&lt;li>Right-click on a message and select Show Times to view exact timestamps for each message.&lt;/li>
&lt;li>Right-click the Messages icon in the Dock to quickly view and jump to unread conversations.&lt;/li>
&lt;/ul>
&lt;h3 id="photos">Photos&lt;/h3>
&lt;ul>
&lt;li>Drag an item to the &amp;ldquo;My Albums&amp;rdquo; header section to quickly create an album with that item.&lt;/li>
&lt;li>After adding an item to an album, use ⌃⌘A to add other items to that same album.&lt;/li>
&lt;li>When editing an image, hold down the &lt;code>M&lt;/code> key to compare the modifications to the original.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> while launching Photos to choose a different photo library to open.&lt;/li>
&lt;li>Drag a photo from the Photos app into a Finder window to quickly export the photo, or into the Mail or Messages app to attach the photo.&lt;/li>
&lt;li>When editing an image, double-click an adjustment slider to reset it.&lt;/li>
&lt;li>When editing an image, hold &lt;code>Option&lt;/code> while holding the pointer over an adjustment slider to extend the adjustment range.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> while clicking the rotate button to reverse the rotation direction.&lt;/li>
&lt;li>Hold &lt;code>Shift&lt;/code> while cropping a photo to maintain the current aspect ratio, and hold &lt;code>Option&lt;/code> to crop from the center of the photo.&lt;/li>
&lt;/ul>
&lt;h3 id="textedit">TextEdit&lt;/h3>
&lt;ul>
&lt;li>In rich text mode, press &lt;code>Option-Tab&lt;/code> to insert an outlined list.&lt;/li>
&lt;li>Press &lt;code>Option-Escape&lt;/code> to autocomplete the current word.&lt;/li>
&lt;li>Press ⌃⌥⌘P in the find text field (⌘F) to access special search tokens.&lt;/li>
&lt;li>Hold &lt;code>Option&lt;/code> while selecting text to make vertical text selections.&lt;/li>
&lt;li>The select line dialog (⌘L) supports the following formats:
&lt;code>1-3&lt;/code> selects lines 1-3 in the document
&lt;code>+2&lt;/code> selects the 2nd line below the cursor
&lt;code>-2&lt;/code> selects the 2nd line above the cursor
&lt;code>+2-4&lt;/code> selects 3 lines, starting from 2 lines below the cursor
&lt;code>-2-4&lt;/code> selects 3 lines, starting from 2 lines above the cursor&lt;/li>
&lt;/ul>
&lt;h3 id="terminal">Terminal&lt;/h3>
&lt;ul>
&lt;li>Press ⇧⌘A to select the output from the previous command.&lt;/li>
&lt;li>Press ⌘L to clear the output from the previous command.&lt;/li>
&lt;li>Press ⌃⌘V to paste and format text that is properly escaped for the shell.&lt;/li>
&lt;li>Press ⌃T while a command is executing to view runtime statistics about the execution so far.&lt;/li>
&lt;li>Press ⌘{↑,↓} to select the previous/next commands. Then press ⇧⌘A to select the output of the currently selected command.&lt;/li>
&lt;li>Press ⇧⌘I to set a title for the current window and tab.&lt;/li>
&lt;li>Drag a file or folder into a Terminal window to insert its full path. Alternatively, copy a file or folder in Finder and paste it in Terminal to insert its path.&lt;/li>
&lt;/ul>
&lt;h3 id="calculator">Calculator&lt;/h3>
&lt;ul>
&lt;li>Press ⌘T to open a new window that keeps a running history of calculations.&lt;/li>
&lt;li>Press ⌘R to enable Reverse Polish notation (RPN) mode.&lt;/li>
&lt;li>Press &lt;code>p&lt;/code> to insert pi.&lt;/li>
&lt;li>Right-click the number display and select &amp;ldquo;Large Type&amp;rdquo; to view the current result in a large overlay window.&lt;/li>
&lt;li>Use the Convert menu to perform various unit conversions.&lt;/li>
&lt;li>In Programmer view (⌘3), click the individual binary bits to toggle between 0 and 1.&lt;/li>
&lt;/ul>
&lt;h3 id="quicktime-player">QuickTime Player&lt;/h3>
&lt;ul>
&lt;li>Grab a single frame from a video by pausing on the desired frame (using the Left and Right arrow keys to navigate individual frames) and pressing ⌘C.&lt;/li>
&lt;/ul>
&lt;h3 id="photo-booth">Photo Booth&lt;/h3>
&lt;ul>
&lt;li>Hold &lt;code>Option&lt;/code> while taking a picture to skip the countdown.&lt;/li>
&lt;li>Hold &lt;code>Shift&lt;/code> while taking a picture to disable the screen flash.&lt;/li>
&lt;li>When choosing one of the distortion effects (on the third page), click and drag the cursor on the image preview to change the effects origin.&lt;/li>
&lt;/ul></description></item><item><title>Mac 小眾軟體推薦與工作流程分享（2024）</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241114-mac-app-share/</link><pubDate>Thu, 14 Nov 2024 09:52:00 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241114-mac-app-share/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://blog.ursb.me/posts/mac-app-share-2024/" target="_blank" rel="noopener">Mac 小眾軟體推薦與工作流程分享（2024）&lt;/a>&lt;/li>
&lt;/ul></description></item><item><title>Objective-See：一個關於 Apple 裝置隱私與安全的開源專案組織</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241113-objective-see/</link><pubDate>Wed, 13 Nov 2024 09:44:00 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241113-objective-see/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://t.me/misakatech/1349" target="_blank" rel="noopener">Objective-See：一個關於 Apple 裝置隱私與安全的開源專案組織&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>今天在找小工具時發現他們做了一堆 macOS 上的開源軟體，基本都是和隱私與安全相關。&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;a href="https://objective-see.org/products/knockknock.html" target="_blank" rel="noopener">KnockKnock&lt;/a>：查看你的 Mac 上有哪些背景行程、守護行程、啟動項、核心擴充、登入項、瀏覽器外掛等等。能看到的比「Login Items」詳細得多（有的軟體會用其他方式自啟）。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://objective-see.org/products/lulu.html" target="_blank" rel="noopener">LuLu&lt;/a>：一個開源的 macOS 網路防火牆，可以讓你詳細控制每個軟體的網路連線（類似 Hands Off!）。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://objective-see.org/products/taskexplorer.html" target="_blank" rel="noopener">TaskExplorer&lt;/a>：增強版的工作管理員，可以看到應用的簽名、開啟的檔案、網路連線等等，還可以根據 sha256 自動幫你搜尋 VirusTotal 的結果。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://objective-see.org/products/dnd.html" target="_blank" rel="noopener">Do Not Disturb&lt;/a>：可以阻止你的 Mac 被打擾（沒錯），當你的 Mac 被別人打開上蓋時可以發送警告、執行腳本、偵測裝置變化之類的。&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;a href="https://objective-see.org/products/blockblock.html" target="_blank" rel="noopener">BlockBlock&lt;/a>：可以阻止背景的持久化安裝，RansomWhere 可以偵測檔案被加密的行為，還有一些雜七雜八的獨立工具。&lt;/p>
&lt;/li>
&lt;/ul>
&lt;p>&lt;a href="https://objective-see.org" target="_blank" rel="noopener">https://objective-see.org&lt;/a>&lt;/p></description></item><item><title>Advanced macOS Command-Line Tools</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241113-advanced-macos-commands/</link><pubDate>Wed, 13 Nov 2024 09:14:26 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2024/20241113-advanced-macos-commands/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://saurabhs.org/advanced-macos-commands" target="_blank" rel="noopener">Advanced macOS Command-Line Tools&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://weiyen.net/articles/useful-macos-cmd-line-utilities/" target="_blank" rel="noopener">Useful built-in macOS command-line utilities&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://catcoding.me/p/apple-perf/" target="_blank" rel="noopener">苹果：为了安全让 M2 吃灰&lt;/a>&lt;/li>
&lt;/ul>
&lt;h4 id="sips---image-manipulation">sips - image manipulation&lt;/h4>
&lt;p>&lt;code>sips -z &amp;lt;height&amp;gt; &amp;lt;width&amp;gt; &amp;lt;image&amp;gt;&lt;/code> resizes the specified image, ignoring the previous aspect ratio.&lt;/p>
&lt;p>&lt;code>sips -Z &amp;lt;size&amp;gt; &amp;lt;image&amp;gt;&lt;/code> resizes the largest side of the specified image, preserving the aspect ratio.&lt;/p>
&lt;p>&lt;code>sips -c &amp;lt;height&amp;gt; &amp;lt;width&amp;gt; &amp;lt;image&amp;gt;&lt;/code> crops the specified image to the given dimensions (relative to the center of the original image).&lt;/p>
&lt;p>&lt;code>sips -r &amp;lt;degrees&amp;gt; &amp;lt;image&amp;gt;&lt;/code> rotates the image by the specified degrees.&lt;/p></description></item><item><title>制作macOS系统dmg包及iso可引导镜像</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2023/20230612-macos-dmg-iso/</link><pubDate>Mon, 12 Jun 2023 10:04:20 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2023/20230612-macos-dmg-iso/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://www.newlearner.site/2019/03/07/macos-dmg-iso.html" target="_blank" rel="noopener">制作 macOS 系统 dmg 包及 iso 可引导镜像&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="dmg">dmg&lt;/h3>
&lt;ol>
&lt;li>AppStore ==&amp;gt; search &amp;lsquo;install macos&amp;rsquo; ==&amp;gt; get installer ==&amp;gt; &lt;code>du -sh /Applications/Install\ macOS\ Mojave.app/&lt;/code>&lt;/li>
&lt;li>磁碟工具程式 ==&amp;gt; 檔案 ==&amp;gt; 新增映像檔 ==&amp;gt; 空白映像檔
&lt;ol>
&lt;li>大小: installer size&lt;/li>
&lt;li>格式: Mac OS 擴充格式(日誌式)&lt;/li>
&lt;li>分割區: 單一分割區 - GUID 分割區配置表&lt;/li>
&lt;li>映像檔格式: 可讀寫的磁碟映像檔&lt;/li>
&lt;li>same as &lt;code>hdiutil create -o ~/Desktop/macOS\ Mojave -size 6500m -layout SPUD -fs HFS+J&lt;/code>&lt;/li>
&lt;/ol>
&lt;/li>
&lt;li>&lt;code>sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/macOS\ Mojave&lt;/code>&lt;/li>
&lt;/ol>
&lt;h3 id="iso">iso&lt;/h3>
&lt;ol>
&lt;li>&lt;code>hdiutil convert ~/Desktop/macOS\ Mojave.dmg -format UDTO -o ~/Desktop/macOS\ Mojave.iso&lt;/code>&lt;/li>
&lt;li>&lt;code>mv ~/Desktop/macOS\ Mojave.iso.cdr ~/Desktop/macOS\ Mojave.iso&lt;/code>&lt;/li>
&lt;/ol></description></item><item><title>我的提升生產力 Mac 設定與軟體</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2023/20230420-my-mac-setting/</link><pubDate>Thu, 20 Apr 2023 14:52:08 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2023/20230420-my-mac-setting/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://jason-memo.dev/posts/my-mac-setting/" target="_blank" rel="noopener">我的提升生產力 Mac 設定與軟體&lt;/a>&lt;/li>
&lt;/ul>
&lt;h3 id="控制個別-app-是否進入-dark-mode">控制個別 App 是否進入 dark mode&lt;/h3>
&lt;blockquote>
&lt;p>&lt;a href="https://nightowlapp.co/" target="_blank" rel="noopener">https://nightowlapp.co/&lt;/a>&lt;/p>&lt;/blockquote>
&lt;p>&lt;code>brew install --cask nightowl&lt;/code>&lt;/p>
&lt;h3 id="用鍵盤控制外接螢幕亮度---monitorcontrol">用鍵盤控制外接螢幕亮度 - MonitorControl&lt;/h3>
&lt;blockquote>
&lt;p>&lt;a href="https://github.com/MonitorControl/MonitorControl" target="_blank" rel="noopener">https://github.com/MonitorControl/MonitorControl&lt;/a>&lt;/p>&lt;/blockquote>
&lt;p>&lt;code>brew install --cask monitorcontrol&lt;/code>&lt;/p>
&lt;h3 id="raycast">Raycast&lt;/h3>
&lt;p>Raycast 可以視為免費而且功能更強大的 Alfred，讓你不需要用滑鼠，靠鍵盤 Option + Space 快速啟用各種功能，內建許多付費 App 才有的功能&lt;/p>
&lt;ul>
&lt;li>快速啟動 App&lt;/li>
&lt;li>快速查字典跟使用計算機&lt;/li>
&lt;li>內建查找剪貼簿歷史紀錄&lt;/li>
&lt;li>自帶像是 Magnet 得 window managment 功能，利用快捷鍵迅速調整視窗大小置左置右&lt;/li>
&lt;li>與行事曆整合，會議時間快到可以用快捷鍵快速開啟 Google Meet 遠端會議，而且會帶入對的 email 帳戶&lt;/li>
&lt;li>可以自行寫 shell nodejs applescript 綁定快捷鍵快速啟用。&lt;/li>
&lt;li>豐富的 extenstion store 可以下載&lt;/li>
&lt;/ul>
&lt;blockquote>
&lt;p>&lt;a href="https://www.raycast.com/" target="_blank" rel="noopener">https://www.raycast.com/&lt;/a>&lt;/p>&lt;/blockquote>
&lt;p>&lt;code>brew install --cask raycast&lt;/code>&lt;/p>
&lt;h3 id="減少風扇起飛---讓-spotlight-排除你的專案資料夾">減少風扇起飛 - 讓 Spotlight 排除你的專案資料夾&lt;/h3>
&lt;p>系統設定 &amp;gt; Spotlight &amp;gt; 搜尋隱私權&lt;/p></description></item><item><title>在 macOS 中檢視 Web Views</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2022/20221202-inspecting-web-views-in-macos/</link><pubDate>Fri, 02 Dec 2022 13:51:24 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2022/20221202-inspecting-web-views-in-macos/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://blog.jim-nielsen.com/2022/inspecting-web-views-in-macos/" target="_blank" rel="noopener">在 macOS 中檢視 Web Views&lt;/a>&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>defaults write NSGlobalDomain WebKitDeveloperExtras -bool true
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>defaults write -g WebKitDeveloperExtras -bool YES
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>ZSH 自动读取 macOS 系统代理配置并设置环境变量</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2021/20210111-macos-auto-read-proxy-settings-zsh/</link><pubDate>Mon, 11 Jan 2021 14:50:11 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2021/20210111-macos-auto-read-proxy-settings-zsh/</guid><description>&lt;ul>
&lt;li>&lt;a href="https://blog.skk.moe/post/macos-auto-read-proxy-settings-zsh/" target="_blank" rel="noopener">ZSH 自动读取 macOS 系统代理配置并设置环境变量&lt;/a>&lt;/li>
&lt;/ul>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-zsh" data-lang="zsh">&lt;span style="display:flex;">&lt;span>$ system_profiler SPNetworkDataType &lt;span style="color:#75715e"># 获取完整网络配置信息&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ networksetup -listallnetworkservices &lt;span style="color:#75715e"># 列举所有网络设备&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ networksetup -getwebproxy Wi-Fi &lt;span style="color:#75715e"># 获取特定网络设备的系统代理配置&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>$ scutil --proxy &lt;span style="color:#75715e"># 获取当前已启用的代理配置，是对 system_profiler 的封装&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div></description></item><item><title>MacBook 设置 SSLKEYLOGFILE 环境变量解密 HTTPS 流量</title><link>https://995facee.rickylin.pages.dev/zh-tw/posts/2020/20201106-sslkeylog/</link><pubDate>Fri, 06 Nov 2020 20:02:54 +0800</pubDate><guid>https://995facee.rickylin.pages.dev/zh-tw/posts/2020/20201106-sslkeylog/</guid><description>&lt;ul>
&lt;li>&lt;a href="http://www.luwenpeng.cn/2020/04/29/MacBook%E8%AE%BE%E7%BD%AESSLKEYLOGFILE%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E8%A7%A3%E5%AF%86HTTPS%E6%B5%81%E9%87%8F/" target="_blank" rel="noopener">MacBook 设置 SSLKEYLOGFILE 环境变量解密 HTTPS 流量&lt;/a>&lt;/li>
&lt;/ul>
&lt;p>创建 keylogfile&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>mkdir ~/sslkeylogfile &lt;span style="color:#f92672">&amp;amp;&amp;amp;&lt;/span> touch ~/sslkeylogfile/keylogfile.log &lt;span style="color:#75715e"># 创建 keylogfile.log 文件&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>sudo chmod &lt;span style="color:#ae81ff">777&lt;/span> ~/sslkeylogfile/keylogfile.log &lt;span style="color:#75715e"># 更改权限，确保 chrome 启动时能写入数据&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>配置环境变量&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>vim ~/.zshrc &lt;span style="color:#75715e"># 打开配置文件&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>export SSLKEYLOGFILE&lt;span style="color:#f92672">=&lt;/span>~/sslkeylogfile/keylogfile.log &lt;span style="color:#75715e"># 配置环境变量&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>source ~/.zshrc &lt;span style="color:#75715e"># 使配置文件生效&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>配置 wireshark&lt;/p>
&lt;p>perferences -&amp;gt; Protocols -&amp;gt; TLS&lt;/p>
&lt;ul>
&lt;li>配置 TSL debug file 记录解密日志&lt;/li>
&lt;li>配置 (Pre)-Master-Secret log filename 路径为 keylogfile.log 的绝对路径&lt;/li>
&lt;/ul>
&lt;p>使用 termial 启动 chrome&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>open -a &lt;span style="color:#e6db74">&amp;#39;Google Chrome&amp;#39;&lt;/span> https://www.baidu.com/
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>注意：从 termial 启动 chrome，为了确保 chrome 可以读取 SSLKEYLOGFILE 环境变量。&lt;/p></description></item></channel></rss>