<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom"
    xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
    >
<channel>
    <title>Extrawdw Blog</title>
    <atom:link href="https://blog.extrawdw.eth.limo/rss.xml" rel="self" type="application/rss+xml" />
    <link>https://blog.extrawdw.eth.limo/</link>
    <description><![CDATA[
    <p><a href="https://i.extrawdw.net">Extrawdw Blog</a> on IPFS</p>

    ]]></description>
    
    
    <item>
        <title>Commenting is Live!</title>
        <link>https://blog.extrawdw.eth.limo/EE31A4EB-821A-43A0-B597-E7B22EE98DDD/</link>
        <guid>https://blog.extrawdw.eth.limo/EE31A4EB-821A-43A0-B597-E7B22EE98DDD/</guid>
        <pubDate>Wed, 01 Jan 2025 03:15:14 -0500</pubDate>
        
        
        <description><![CDATA[
            <p>Powered by <a href="https://giscus.app">giscus</a>.</p>
        ]]></description>
    </item>
    
    <item>
        <title>Setting Up WSL for Development</title>
        <link>https://blog.extrawdw.eth.limo/C05539DF-8C63-474E-BB62-90DBBD0F06AD/</link>
        <guid>https://blog.extrawdw.eth.limo/C05539DF-8C63-474E-BB62-90DBBD0F06AD/</guid>
        <pubDate>Tue, 31 Dec 2024 23:41:21 -0500</pubDate>
        
        
        <description><![CDATA[
            <p>This post documents some of my commonly used WSL configurations.</p> 
<h2>Install Common Packages</h2> 
<p><strong>Ubuntu:</strong></p> 
<pre><code class="language-sh">sudo apt install build-essential
</code></pre> 
<p><strong>Debian:</strong></p> 
<pre><code class="language-sh">sudo apt install gcc g++
</code></pre> 
<p><strong>Debian Common:</strong></p> 
<pre><code class="language-sh">sudo apt install gdb valgrind git gpg curl wget zip unzip zsh
</code></pre> 
<h2>Configure Zsh</h2> 
<p>Set <code>/bin/zsh</code> as the default shell:</p> 
<pre><code class="language-bash">chsh -s /bin/zsh
</code></pre> 
<p>Install <code>oh-my-zsh</code> and commonly used plugins:</p> 
<pre><code class="language-bash">wget https://gist.githubusercontent.com/dingwen07/1261eac531f7f080d72b78f931a8ca01/raw/omz-setup.sh
chmod +x ./omz-setup.sh
./omz-setup.sh
</code></pre> 
<p>Edit <code>~/.zshrc</code> to enable plugins:</p> 
<pre><code class="language-sh">plugins=(
    git
    zsh-autosuggestions
    zsh-syntax-highlighting
)
</code></pre> 
<h2>Java Environment</h2> 
<p>Java environments are generally managed using <a href="https://sdkman.io/">SDKMAN!</a>. Make sure the <code>unzip</code> package is installed:</p> 
<pre><code class="language-sh">curl -s "https://get.sdkman.io" | bash
</code></pre> 
<h2>Configure Windows Terminal for WSL</h2> 
<h3>Enable Mouse Scrolling for CLI Programs</h3> 
<p>By default, CLI programs in WSL, such as <code>less</code> and <code>nano</code>, do not support mouse scrolling. After configuration, mouse operations will default to being received by the application. To select content, hold the <strong>Shift</strong> key while selecting.</p> 
<h4><strong><code>less</code> (Including <code>man</code>)</strong></h4> 
<p>Save the following content as a text file:</p> 
<pre><code>#env
LESS = --mouse
</code></pre> 
<p>Then run <code>lesskey &lt;filename&gt;</code> (for newer distributions, save the text directly to <code>~/.lesskey</code>).</p> 
<h4><strong><code>nano</code></strong></h4> 
<p>Add the following to <code>~/.nanorc</code>:</p> 
<pre><code>set mouse
</code></pre> 
<h4><strong><code>vi[m]</code></strong></h4> 
<p>Add the following to <code>~/.vi[m]rc</code>:</p> 
<pre><code>set mouse=a
</code></pre> 
<h2>SSH Agent</h2> 
<p>Use <code>npiperelay.exe</code> to forward the Windows socket <code>//./pipe/openssh-ssh-agent</code> to WSL <sup class="footnote-ref"><a href="#fn-1" id="fnref-1" data-footnote-ref>1</a></sup><sup class="footnote-ref"><a href="#fn-2" id="fnref-2" data-footnote-ref>2</a></sup>.</p> 
<p>Make sure <code>npiperelay.exe</code> is in the Windows <code>PATH</code>. This allows WSL to directly access it. It can be installed via WinGet. Then install <code>socat</code> in WSL:</p> 
<pre><code class="language-sh">sudo apt install socat
</code></pre> 
<p>Next, put the following script into <code>~/.win-ssh-agent/agent-bridge.sh</code>:</p> 
<pre><code class="language-sh"># Code extracted from https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/ with minor modifications

# Configure ssh forwarding
export SSH_AUTH_SOCK=$HOME/.win-ssh-agent/agent.sock
# need `ps -ww` to get non-truncated command for matching
# use square brackets to generate a regex match for the process we want but that doesn't match the grep command running it!
ALREADY_RUNNING=$(ps -auxww | grep -q "[n]piperelay.exe -ei -s //./pipe/openssh-ssh-agent"; echo $?)
if [[ $ALREADY_RUNNING != "0" ]]; then
    if [[ -S $SSH_AUTH_SOCK ]]; then
        # not expecting the socket to exist as the forwarding command isn't running (http://www.tldp.org/LDP/abs/html/fto.html)
        echo "removing previous socket..."
        rm $SSH_AUTH_SOCK
    fi
    echo "Starting SSH-Agent relay..."
    # setsid to force new session to keep running
    # set socat to listen on $SSH_AUTH_SOCK and forward to npiperelay which then forwards to openssh-ssh-agent on windows
    (setsid socat UNIX-LISTEN:$SSH_AUTH_SOCK,fork EXEC:"npiperelay.exe -ei -s //./pipe/openssh-ssh-agent",nofork &amp;) &gt;/dev/null 2&gt;&amp;1
fi
</code></pre> 
<p>Add the following to <code>.bashrc</code> or <code>.zshrc</code>:</p> 
<pre><code class="language-sh">source $HOME/.win-ssh-agent/agent-bridge.sh
</code></pre> 
<h2>GnuPG</h2> 
<p>Refer to <a href="./E8F6E4D8-A27B-4869-BD85-022DFE2D0168/">Using GPG Command-Line Tools in WSL2 and Signing Git Commits</a><sup class="footnote-ref"><a href="#fn-3" id="fnref-3" data-footnote-ref>3</a></sup>.</p> 
<h2>1Password CLI</h2> 
<p>Use the <code>op</code> command-line tool for convenient and secure credential access. First, install it on Windows:</p> 
<pre><code class="language-powershell">winget install AgileBits.1Password.CLI
</code></pre> 
<p>Then add the following to <code>.bashrc</code> or <code>.zshrc</code>:</p> 
<pre><code class="language-sh"># Aliases
alias op="op.exe"
# alias sudo="sudo -S &lt;&lt;&lt; $(op read "op://Personal/Account Password/password")"

# Completions
eval "$(op completion zsh)"; compdef _op op.exe
</code></pre> 
<h2>References</h2> 
<section class="footnotes" data-footnotes> 
 <ol> 
  <li id="fn-1"> <p><a href="https://dev.to/d4vsanchez/use-1password-ssh-agent-in-wsl-2j6m">Use 1Password SSH Agent in WSL - DEV Community</a> <a href="#fnref-1" class="footnote-backref" data-footnote-backref aria-label="Back to content">↩</a></p> </li> 
  <li id="fn-2"> <p><a href="https://stuartleeks.com/posts/wsl-ssh-key-forward-to-windows/">Forwarding SSH Agent requests from WSL to Windows - stuartleeks.com</a> <a href="#fnref-2" class="footnote-backref" data-footnote-backref aria-label="Back to content">↩</a></p> </li> 
  <li id="fn-3"> <p><a href="./E8F6E4D8-A27B-4869-BD85-022DFE2D0168/">Using GPG Command-Line Tools in WSL2 and Signing Git Commits</a> <a href="#fnref-3" class="footnote-backref" data-footnote-backref aria-label="Back to content">↩</a></p> </li> 
 </ol> 
</section>
        ]]></description>
    </item>
    
    <item>
        <title>Solution to &#x22;Time Machine detected that your backups can not be reliably restored&#x22;</title>
        <link>https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/</link>
        <guid>https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/</guid>
        <pubDate>Tue, 31 Dec 2024 03:46:39 -0500</pubDate>
        
        <itunes:image href="https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/IMG_3843.png" />    
        
        
        <description><![CDATA[
            <p>Recently, my MacBook's Time Machine backup to a network disk (on a Mac mini) gives following error:</p> 
<img width="358" alt="IMG_3843" src="https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/IMG_3843.png" /> 
<p>The exact error message was:</p> 
<blockquote> 
 <p>Time Machine detected that your backups on “destination” can not be reliably restored. Time Machine must erase your existing backup history and start a new backup to correct this.</p> 
</blockquote> 
<p>This happens after a kernel panic.</p> 
<p>After some digging, it does not necessarily mean the backup disk image is corrupted, but in some cases, Time Machine will 'mark' a backup disk image as 'bad' and refuse further backups to it.</p> 
<p>To bypass this issue without erasing the backup history, locate the backup disk image (<code>sparsebundle</code>) in the network share. The disk image file might be in a "locked" state. Use <kbd>⌘ + I</kbd> to open the info panel and unlock it.</p> 
<img width="377" alt="Screenshot 2024-12-12 at 13.49.01" src="https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/Screenshot 2024-12-12 at 13.49.01.png" /> 
<p>Then right-click → <strong>Show Package Contents</strong>, where the <code>token</code> file might also be locked. Unlock it similarly.</p> 
<img width="979" alt="Screenshot-2024-12-12-at-13.51.36" src="https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/Screenshot-2024-12-12-at-13.51.36.png" /> 
<p>Next, use Xcode to open file <code>com.apple.TimeMachine.MachineID.plist</code>. Change the value of the key <code>VerificationState</code> from <code>2</code> to <code>1</code> and save the file.</p> 
<img width="962" alt="Screenshot-2024-12-12-at-13.53.07" src="https://blog.extrawdw.eth.limo/E9D02EA8-784F-4291-A736-4FA185E68EE3/Screenshot-2024-12-12-at-13.53.07.png" /> 
<p>Now we should be able to complete backups, but make sure to verify the backup after the first completed backup. If the verification succeeds, then the backup disk image is not corrupted.</p> 
<hr /> 
<p>Translated from my Chinese blog post: <a href="https://cn.extrawdw.eth.limo/BF15E650-41F6-4F5E-8610-1DDCBDFBE34D/">Mac 时间机器“检测到备份无法可靠恢复”的解决方法</a></p>
        ]]></description>
    </item>
    
    <item>
        <title>Using GPG Command-Line Tools in WSL2 and Signing Git Commits</title>
        <link>https://blog.extrawdw.eth.limo/E8F6E4D8-A27B-4869-BD85-022DFE2D0168/</link>
        <guid>https://blog.extrawdw.eth.limo/E8F6E4D8-A27B-4869-BD85-022DFE2D0168/</guid>
        <pubDate>Tue, 31 Dec 2024 03:08:59 -0500</pubDate>
        
        
        <description><![CDATA[
            <p>Most of the methods found online involve using <code>npiperelay</code> to map the Gpg4win GPG Agent's socket into WSL2. However, a simpler approach is to use <code>gpg.exe</code> directly within WSL2.</p> 
<p>If you want to sign Git commits but your private key is stored on a smart card, you can directly set it with:<br /> <code>git config --global gpg.program gpg.exe</code><br /> (If GPG is not in Windows' PATH, you need to use the absolute path, which is usually <code>/mnt/c/Program Files (x86)/GnuPG/bin/gpg.exe</code>. For convenience, it's better to add it to PATH. After doing so, open a new terminal.)</p> 
<p>Unless a program requires direct GPG Agent access or does not support custom GPG binaries, this approach is far more convenient than mapping the GPG Agent socket.</p> 
<hr /> 
<p>Translated from my Chinese blog post: <a href="https://cn.extrawdw.eth.limo/E866F5DA-F9C4-4137-9D7F-60A1F68FC0AD/">在 WSL2 中使用 GPG 命令行工具以及对 Git commit 进行签名</a></p>
        ]]></description>
    </item>
    
    <item>
        <title>Update IPNS record</title>
        <link>https://blog.extrawdw.eth.limo/70DF291A-1AE9-4058-8CB6-D2DC7E9FBF38/</link>
        <guid>https://blog.extrawdw.eth.limo/70DF291A-1AE9-4058-8CB6-D2DC7E9FBF38/</guid>
        <pubDate>Tue, 01 Nov 2022 13:35:10 -0400</pubDate>
        
        
        <description><![CDATA[
            <p>First, make sure there is IPNS Key in local IPFS keystore:</p> 
<pre><code>ipfs key list
</code></pre> 
<p>If the key is not present, import with:</p> 
<pre><code>ipfs key import &lt;name&gt; &lt;key&gt;
</code></pre> 
<p>Then, update IPNS record with:</p> 
<pre><code>ipfs name publish --key=&lt;key name&gt; /ipfs/...
</code></pre>
        ]]></description>
    </item>
    
    <item>
        <title>.bit address</title>
        <link>https://blog.extrawdw.eth.limo/F1A42BFB-4222-45C3-86FA-983D95724071/</link>
        <guid>https://blog.extrawdw.eth.limo/F1A42BFB-4222-45C3-86FA-983D95724071/</guid>
        <pubDate>Thu, 06 Oct 2022 02:31:00 -0400</pubDate>
        
        
        <description><![CDATA[
            <p>Extrawdw Blog will also be accessible on <a href="https://extrawdw.bit.cc">extrawdw.bit</a> from now on.</p> 
<p>The .bit is another blockchain domain name that can be registered here:</p> 
<p><a href="https://app.did.id/explorer?inviter=extrawdw.bit">.bit</a></p> 
<p>Note: The above is the referral link, if you register through the above link then I will receive a pay back, feel free to delete and replace the referrer. The registration fee will be reduced by 5% if there is a referrer.</p> 
<p>One advantage of .bit addresses over .eth is that updating domain records is free: you don't need to pay gas (network fee) for it.</p>
        ]]></description>
    </item>
    
    <item>
        <title>Welcome to Extrawdw Blog on IPFS</title>
        <link>https://blog.extrawdw.eth.limo/58EE7099-4A3F-428B-832D-EE2C6E2B07F2/</link>
        <guid>https://blog.extrawdw.eth.limo/58EE7099-4A3F-428B-832D-EE2C6E2B07F2/</guid>
        <pubDate>Wed, 31 Aug 2022 02:48:00 -0400</pubDate>
        
        
        <description><![CDATA[
            <p>Welcome visitor,</p> 
<p>This is Extrawdw Blog (<a href="https://blog.extrawdw.net">blog.extrawdw.net</a> and <a href="https://i.extrawdw.net">i.extrawdw.net</a>) on IPFS.</p> 
<p>Archives of obsolete/deleted articles are available at <a href="https://ipfs.io/ipns/k51qzi5uqu5dk04xxfqzcfc2ya5dhoer3xy1i4ppo9u1r4cilcxhih6fpbvfg0/"><code>/ipns/k51qzi5uqu5dk04xxfqzcfc2ya5dhoer3xy1i4ppo9u1r4cilcxhih6fpbvfg0/</code></a>. It might contain posts in Chinese.</p> 
<p>Articles will start being posted here soon.</p> 
<p>Enjoy!</p>
        ]]></description>
    </item>
    
</channel>
</rss>
