<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="https://blog.checo.cc/en/rss.xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <atom:link href="https://blog.checo.cc/en/rss.xml" rel="self" type="application/rss+xml"/>
    <title>Checo&amp;apos;s Blog</title>
    <link>https://blog.checo.cc/en/</link>
    <description>Cloud / DevOps / Security / Frontend / Transport / Photography</description>
    <language>en-US</language>
    <pubDate>Mon, 09 Nov 2026 17:50:23 GMT</pubDate>
    <lastBuildDate>Mon, 09 Nov 2026 17:50:23 GMT</lastBuildDate>
    <generator>@vuepress/plugin-feed</generator>
    <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
    <copyright>© 2026 Checo&amp;apos;s Blog. All rights reserved.</copyright>
    <category>Windows</category>
    <category>DevOps</category>
    <category>Virtualization</category>
    <category>Linux</category>
    <category>macOS</category>
    <category>Identity</category>
    <category>Networking</category>
    <category>AI</category>
    <category>AWS</category>
    <category>Security</category>
    <category>VPS</category>
    <category>Developer Tools</category>
    <category>Security Research</category>
    <category>Blog</category>
    <category>Automation</category>
    <category>Gaming</category>
    <item>
      <title>AD AdminSDHolder Delegation Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-adminsdholder-delegation.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-adminsdholder-delegation.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD AdminSDHolder Delegation Troubleshooting</source>
      <description>Compare ordinary and protected accounts in one OU, inspect DACL replacement and adminCount limitations, and separate protected membership from inheritance/delegation recovery.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-delegation-replaced-by-ad-adminsdholder" style="scroll-margin-top: 5rem"></div>
<p>Helpdesk can reset most ordinary users in an OU, but one account begins returning Access is denied after being added to Domain Admins. Check the target’s DACL as well as the caller’s rights: the delegated ACE may have been replaced by protected-account processing.</p>
<p>The examples compare two users in the isolated <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a> domain. t5sdadmin joined Domain Admins while t5sdctrl remained ordinary, in the same OU with the same delegation. Compare DACLs, inheritance, and actual password-reset results rather than relying on a fixed ACE count.</p>
<div id="observe-the-change-over-time" style="scroll-margin-top: 5rem"></div>
<h2>1. Permission timeline</h2>
<p>Twenty seconds after addition, memberOf already contained Domain Admins but adminCount was empty:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>SamAccountName : t5sdadmin</span></span>
<span class="line"><span>adminCount     :</span></span>
<span class="line"><span>memberOf       : CN=Domain Admins,CN=Users,DC=corp,DC=test,DC=checo,DC=cc</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Across a later observation interval of roughly sixteen minutes, adminCount became 1 and the helpdesk Reset Password ACE disappeared. Sixteen minutes is an observed gap, not an inferred default scheduling interval.</p>
<p>Microsoft describes a default approximately 60-minute protected-account check on the PDC Emulator, using AdminSDHolder’s permissions and disabling inheritance on protected objects. An immediate test after adding membership can therefore miss the later replacement. See <a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/appendix-c--protected-accounts-and-groups-in-active-directory" target="_blank" rel="noopener noreferrer">protected-account processing</a>.</p>
<!-- more -->
<div id="compare-the-target-dacl-and-actual-operations" style="scroll-margin-top: 5rem"></div>
<h2>2. DACL and operation results</h2>
<p>The recorded template/target comparison was:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>ACEs=23/23  len=1457/1457  equal=True</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The same helpdesk identity then produced:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>RESET_FAIL CN=t5sdadmin,OU=SD,OU=KB-T5,... : Access is denied. (Exception from HRESULT: 0x80070005)</span></span>
<span class="line"><span>RESET_OK   CN=t5sdctrl,OU=SD,OU=KB-T5,...</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>The ordinary control remained usable, the protected object lost its delegation, and its DACL matched the template. Together those observations support template replacement; Access is denied alone does not distinguish that cause.</p>
<p>Counts 23 and 1457 describe this domain’s template at that time. Exchange or other supported configuration can change it. Neither a fixed ACE count nor an identity list is a universal fingerprint.</p>
<p>The record also observed changes to the security descriptor’s Owner and Group. Preserve that as an observation, not a rule that Owner alone diagnoses protection or must always become one particular value. O:/G: are separate from the DACL; the descriptor’s G: is also not the user’s primaryGroupID attribute.</p>
<div id="treat-admincount-as-evidence-not-a-current-state-boolean" style="scroll-margin-top: 5rem"></div>
<h2>3. Check adminCount</h2>
<p>This reviewed read-only example selects the PDC, reads the target and template, and extracts the Access section rather than splitting SDDL at D: and potentially retaining other sections:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Import-Module</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ActiveDirectory</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dc</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-ADDomain</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">).PDCEmulator</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$domain</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-ADDomain</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Server </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dc</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$user</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-ADUser</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> t5sdadmin </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Server </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dc</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Properties adminCount,memberOf,nTSecurityDescriptor,whenChanged</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$holderDN</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'CN=AdminSDHolder,CN=System,'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> +</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $domain.DistinguishedName</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$holder</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-ADObject</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $holderDN</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Server </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dc</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Properties nTSecurityDescriptor</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$section</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> [</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">System.Security.AccessControl.AccessControlSections</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]::Access</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">pscustomobject</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    DC</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $dc</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    UserDN</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.DistinguishedName</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    AdminCount</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.adminCount</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    InheritanceBlocked</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.nTSecurityDescriptor.AreAccessRulesProtected</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    UserOwner</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.nTSecurityDescriptor.Owner</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    HolderOwner</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $holder.nTSecurityDescriptor.Owner</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    UserAceCount</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.nTSecurityDescriptor.Access.Count</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    HolderAceCount</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $holder.nTSecurityDescriptor.Access.Count</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    DaclEqual</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.nTSecurityDescriptor.GetSecurityDescriptorSddlForm</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$section</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-eq</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">                $holder.nTSecurityDescriptor.GetSecurityDescriptorSddlForm</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$section</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$user.memberOf</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">dsacls.exe</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $user.DistinguishedName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">A</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Verify the account belongs to the intended domain. Failure to read a security descriptor must not become an empty-DACL result. Exact equality is useful direct evidence. Inequality requires comparing ACEs, order, propagation/inheritance, and object types rather than automatically claiming different effective rights.</p>
<p>Protection can come through transitive membership. memberOf can miss nested paths; adminCount can lag and can retain historical protection. Neither independently answers whether the object is currently protected. Combine group paths, inheritance, ACL/template comparisons, and subsequent changes.</p>
<p>Removing one protected-group membership is insufficient if another path remains. Nesting an ordinary administration group into Domain Admins does not bypass protection; it introduces privileged membership.</p>
<div id="leaving-a-protected-group-does-not-restore-the-old-acl" style="scroll-margin-top: 5rem"></div>
<h2>4. Leaving protected groups</h2>
<p><strong>Removal does not automatically clear adminCount, re-enable inheritance, or recreate the former delegated DACL.</strong> Microsoft explicitly notes that adminCount remains 1 unless separately changed. See <a href="https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/plan/security-best-practices/reducing-the-active-directory-attack-surface" target="_blank" rel="noopener noreferrer">historical protected-account state</a>.</p>
<p>Waiting for automatic clearing is not recovery. Conversely, clearing the attribute does not remove current privileged membership or rebuild OU delegation.</p>
<p>| Observation | Follow-up |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>AD Audit Configuration and Logs</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-audit-events.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-audit-events.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD Audit Configuration and Logs</source>
      <description>Validate audit policy and object SACLs, then correlate 4662, account lifecycle, and group membership events by SID and local logon context.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="auditing-ad-account-group-and-directory-access-changes" style="scroll-margin-top: 5rem"></div>
<p>A 4728 event does not automatically identify the person who added a privileged member. Enabling Directory Service Access also does not make every attribute read generate 4662. Establish whether the required evidence can be produced, then correlate object identity, operation, and logon context.</p>
<p>The examples use the Windows Server 2022 DC LAB-DC1 in <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a>. Configure logon, account-management, and directory-access auditing, then verify the resulting records with dedicated objects for reads, group changes, and account lifecycle operations.</p>
<div id="choose-events-from-the-question" style="scroll-margin-top: 5rem"></div>
<h2>1. Select events</h2>
<p>| Question | Events/subcategory | Additional conditions or limits |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ad-audit-events/h363-4662-Details视图-读属性与AccessMask.png" type="image/png"/>
    </item>
    <item>
      <title>Query and Restore Deleted AD Objects</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-deleted-object-restore.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-deleted-object-restore.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Query and Restore Deleted AD Objects</source>
      <description>Follow ShowDeleted visibility through Recycle Bin restoration, validating GUID, SID, groups, properties, parent containers, and the distinction between visibility and recoverability.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="querying-and-restoring-deleted-ad-objects" style="scroll-margin-top: 5rem"></div>
<p>A successful deletion followed by a GUID search returning zero is not contradictory. Ordinary searches hide deleted objects. Conversely, finding a deleted object does not automatically mean complete restoration remains possible.</p>
<p>The examples use LAB-DC1 in <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a> to query by exact GUID and verify Recycle Bin restoration. Query and restoration use different test objects. The restore procedure assumes Recycle Bin was enabled before the object was deleted.</p>
<div id="one-guid-different-visibility" style="scroll-margin-top: 5rem"></div>
<h2>1. Query deleted objects</h2>
<p>The query lab first checked RootDSE support for ShowDeletedControl, OID 1.2.840.113556.1.4.417, among 40 advertised controls. It queried a target and a live control, then deleted the target.</p>
<p>| Query | ShowDeletedControl | Result | Count |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>AD Loopback: Merge and Replace</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-gpo-loopback.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-gpo-loopback.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD Loopback: Merge and Replace</source>
      <description>Use three real logons by the same user to compare normal processing, Merge, and Replace, including policy selection, effective values, configuration, diagnosis, and rollback.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="ad-group-policy-loopback-processing-with-merge-and-replace" style="scroll-margin-top: 5rem"></div>
<p>A user’s usual desktop policy follows the user object’s OU. A shared terminal or remote desktop server may instead need user settings selected by the computer’s location. Linking a GPO containing user settings to a computer OU does not, on its own, make those settings apply to every person signing in there. Loopback supplies that different policy selection.</p>
<p>Merge and Replace can produce the same value for a conflicting setting. To distinguish them, include a setting that exists only at the user location: Merge keeps it, whereas Replace uses the computer-location list instead.</p>
<p>The recorded lab used <code>corp.test.checo.cc</code>, NetBIOS <code>ADLAB</code>, LAB-DC1, and LAB-MEMBER. Both machines were Windows Server 2022 Datacenter; the member reported <code>10.0.20348</code>, and Windows PowerShell was <code>5.1.20348.5386</code>. The same ordinary <code>ADLAB\KB03-User</code> completed three real console logons on the same member server. Each mode change was followed by computer-policy refresh and a server restart to obtain a fresh logon.</p>
<div id="loopback-selects-user-policy-through-the-computer-location" style="scroll-margin-top: 5rem"></div>
<h2>1. Loopback policy selection</h2>
<p>Ordinarily, the computer object selects computer policy and the user object selects user policy. The loopback setting is a computer policy, but its result is still <strong>user configuration</strong> from GPOs. It does not convert HKLM settings into HKCU settings.</p>
<p>Merge gathers the ordinary user list, then appends the computer-location list. For ordinary conflicts, the latter user settings have precedence. Replace does not gather the user-location list. The user object stays in its OU and the account identity is unchanged; the selected policy list changes. Links, inheritance, filtering, and enabled user/computer sections still matter. Microsoft describes the two list-building modes in <a href="https://learn.microsoft.com/en-us/troubleshoot/windows-server/group-policy/loopback-processing-of-group-policy" target="_blank" rel="noopener noreferrer">Loopback processing</a>.</p>
<p>The member’s own <code>C:\Windows\PolicyDefinitions\GroupPolicy.admx</code> identified the setting:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>class="Machine"</span></span>
<span class="line"><span>key="Software\Policies\Microsoft\Windows\System"</span></span>
<span class="line"><span>valueName="UserPolicyMode"</span></span>
<span class="line"><span>UserPolicyMode_Merge: decimal value="1"</span></span>
<span class="line"><span>UserPolicyMode_Replace: decimal value="2"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The key is <code>HKLM\Software\Policies\Microsoft\Windows\System\UserPolicyMode</code>. The historical off control wrote <code>0</code>, Merge wrote <code>1</code>, and Replace wrote <code>2</code>. That records this experiment’s input, not a general recommendation to substitute a hand-written zero for the administrative template’s Disabled/Not Configured state. Final rollback removed the experimental policy and the value was absent again.</p>
<!-- more -->
<div id="use-a-unique-setting-as-well-as-a-conflicting-setting" style="scroll-margin-top: 5rem"></div>
<h2>2. Compare policy markers</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>OU=KB-Lab-20261009</span></span>
<span class="line"><span>  OU=Loopback03-Users</span></span>
<span class="line"><span>    KB03-User</span></span>
<span class="line"><span>    link: KB03-UserLocation</span></span>
<span class="line"><span>  OU=Loopback03-Computers</span></span>
<span class="line"><span>    LAB-MEMBER</span></span>
<span class="line"><span>    links: KB03-ComputerLocation, KB03-LoopbackMode</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The user-location GPO set <code>Conflict=UserOU</code> and <code>UserOnly=Present</code>. The computer-location GPO’s <strong>user configuration</strong> set <code>Conflict=ComputerOU</code> and <code>ComputerOnly=Present</code>. All three values were under <code>HKCU\Software\Policies\KB03Loopback</code>. A separate GPO controlled the loopback mode, so the switch was the only changing input.</p>
<p>| Mode | Experimental GPOs in user gpresult | Conflict | UserOnly | ComputerOnly |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting AD Group Policy That Does Not Apply</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-gpo-not-applied.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-gpo-not-applied.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Troubleshooting AD Group Policy That Does Not Apply</source>
      <description>Trace permissions, links and restore scope, WMI, disabled sections, and preference targeting through five independent lab records with commands, results, and rollback.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A successful <code>gpupdate</code> with no expected setting is not one diagnosis. The GPO may be outside scope, unreadable, disabled for the relevant section, or fully applied while a particular preference item is legitimately skipped. Rejoining the domain or broadening permissions at the first missing value often changes the wrong layer.</p>
<p>The examples use Windows Server 2022 Datacenter hosts LAB-DC1 and LAB-MEMBER in <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a> with Windows PowerShell 5.1. Work through permissions, backup restoration, WMI filtering, disabled sections, and preference targeting using dedicated OUs, GPOs, and registry markers.</p>
<p>Start on the actual affected client. Use an elevated session for computer policy; inspect user policy in the intended user’s real session, not another administrator’s HKCU:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-Date</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">whoami </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">user</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">gpupdate </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">target:computer </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">force </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">wait:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">120</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$updateExit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> $LASTEXITCODE</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">gpresult </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">scope computer </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$resultExit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> $LASTEXITCODE</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"GPUpdateExit=</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">updateExit</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">; GPResultExit=</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">resultExit</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WinEvent</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">FilterHashtable </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    LogName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Microsoft-Windows-GroupPolicy/Operational'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    StartTime</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">} | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> TimeCreated,Id,RecordId,Message</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>/wait</code> limits command waiting. If output says background processing continues, wait for that cycle to finish before deciding or starting another refresh. The report, events, and effective setting need the same observation window.</p>
<!-- more -->
<div id="locate-the-missing-stage" style="scroll-margin-top: 5rem"></div>
<h2>1. Locate the failure</h2>
<p>| Observation | First checks |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>AD Group Policy Inheritance and Precedence</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-gpo-precedence.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-gpo-precedence.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD Group Policy Inheritance and Precedence</source>
      <description>Compare six parent/child link configurations through RSoP and registry readback, including link order, blocked inheritance, Enforced, reproducible commands, and cleanup.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Several GPOs can appear in a member server’s applied list while only one supplies a particular registry value. A child OU winning a conflict does not mean the parent GPO disappeared. Conversely, a successful policy refresh does not tell us whether an inherited GPO was excluded.</p>
<p>The experiment used LAB-DC1 and LAB-MEMBER, both Windows Server 2022 Datacenter, in the isolated <code>corp.test.checo.cc</code> domain. The DC used Windows PowerShell <code>5.1.20348.5386</code>; the member reported Windows <code>10.0.20348</code>. Their IPv4 addresses were <code>10.77.77.10</code> and <code>10.77.77.20</code>, with IPv6 ULA also enabled. DC configuration and member computer-policy refreshes ran as SYSTEM in their respective machines.</p>
<p>The member computer was temporarily moved beneath this OU structure and returned to its original container afterward:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>DC=corp,DC=test,DC=checo,DC=cc</span></span>
<span class="line"><span>  OU=KB-Lab-20261009</span></span>
<span class="line"><span>    OU=Parent      &#x3C;- KB-GPO-221-Parent</span></span>
<span class="line"><span>      OU=Child     &#x3C;- KB-GPO-221-ChildA / ChildB</span></span>
<span class="line"><span>        LAB-MEMBER</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>All three GPOs set <code>HKLM\Software\Policies\KB-GPO-221\Winner</code> to their own name: <code>Parent</code>, <code>ChildA</code>, or <code>ChildB</code>. The parent additionally set <code>ParentOnly=InheritedParent</code>. The dedicated OUs, GPOs, and marker key did not exist at baseline. No default GPO was edited.</p>
<p>The second value matters: <code>Winner</code> identifies the surviving conflict value, while <code>ParentOnly</code> tells us whether a nonconflicting parent setting remains.</p>
<!-- more -->
<div id="read-the-conflict-and-the-parent-only-value-together" style="scroll-margin-top: 5rem"></div>
<h2>1. Compare final values</h2>
<p>Four experimental phases covered six link configurations. Each phase started and ended with no experimental links, no inheritance block, and no marker key, followed by refresh and readback.</p>
<p>| Configuration | Winner | ParentOnly | Observation |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>AD Kerberos Encryption Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-kerberos-encryption.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-kerberos-encryption.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD Kerberos Encryption Troubleshooting</source>
      <description>Compare an RC4 policy failure with an AES service-account control, interpreting 4769, capability masks, actual ticket types, migration, and rollback.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-ad-kerberos-encryption-and-service-tickets" style="scroll-margin-top: 5rem"></div>
<p>A user can log on successfully but fail to obtain a ticket for one HTTP service. A single klist cache can also contain an AES TGT and an RC4 service ticket. Diagnose the exact SPN, service account, and TGS exchange.</p>
<p>The examples use Windows Server 2022 hosts LAB-DC1 and LAB-MEMBER in <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a>. HTTP/KB1RC4 demonstrates ticket failure after RC4 is disallowed; a separate account, kb4769-svc, shows how changing the service declaration affects the resulting ticket.</p>
<div id="two-different-number-spaces" style="scroll-margin-top: 5rem"></div>
<h2>1. Bitmasks and type IDs</h2>
<p>The account attribute is a bitmask; TicketEncryptionType is an algorithm identifier.</p>
<p>| Location | Value | Meaning |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ad-kerberos-encryption/h333-4769-Details视图-TicketEncryptionType与Status.png" type="image/png"/>
    </item>
    <item>
      <title>LDAP Queries for AD Objects and Groups</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-ldap-complete-results.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-ldap-complete-results.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">LDAP Queries for AD Objects and Groups</source>
      <description>Separate object paging, multivalued ranges, nested membership, and primary groups using four lab records, read-only query examples, and explicit completeness checks.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Mon, 19 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="complete-ldap-queries-for-ad-objects-and-group-membership" style="scroll-margin-top: 5rem"></div>
<p>LDAP Success does not prove that a synchronization client received complete data. A search can omit objects, one returned object can omit attribute values, and a group query can answer direct membership instead of the eligibility question the application intended.</p>
<p>A complete query needs separate handling for object paging, multi-value ranges, transitive membership, and primary groups. The examples use Windows Server 2022, <a href="http://LAB-DC1.corp.test.checo.cc" target="_blank" rel="noopener noreferrer">LAB-DC1.corp.test.checo.cc</a>, and Windows PowerShell 5.1 to check each layer of a synchronization query.</p>
<div id="define-which-collection-must-be-complete" style="scroll-margin-top: 5rem"></div>
<h2>1. Query completeness</h2>
<p>| Layer | What can be missing | Inspect |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ad-ldap-complete-results/h264-file-17932707010.png" type="image/png"/>
    </item>
    <item>
      <title>Least-Privilege AD OU Delegation</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-ou-delegation.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-ou-delegation.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Least-Privilege AD OU Delegation</source>
      <description>Use password-reset, property-right, and inheritance controls to verify permitted and forbidden helpdesk actions, userAccountControl side effects, and precise revocation.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="least-privilege-ad-ou-delegation-and-verification" style="scroll-margin-top: 5rem"></div>
<p>Delegating one writable property does not necessarily delegate only the business action intended. In one ordinary-user maintenance test, helpdesk could enable/disable accounts but also set PasswordNotRequired. Property-level authorization still needed review.</p>
<p>The examples configure single-object password reset and OU delegation in <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a>, then check child-OU inheritance and operations that should remain denied. Verification uses ordinary-operator credentials, distinct from the management identity that prepares the environment.</p>
<div id="establish-what-reset-password-actually-grants" style="scroll-margin-top: 5rem"></div>
<h2>1. Single-object password reset</h2>
<p>Reset Password has rights GUID <code>00299570-246d-11d0-a768-00aa006e0529</code>. The single-object control added only that ACE to a disposable ordinary user, without WriteDACL, GenericAll, or an OU-wide grant.</p>
<p>| Phase | Ordinary operator’s LDAP result | Authentication check |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>AD Password and Group Access Changes</title>
      <link>https://blog.checo.cc/en/posts/Windows/ad-permission-session-lifetime.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/ad-permission-session-lifetime.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">AD Password and Group Access Changes</source>
      <description>Use two recorded experiments to separate directory state, access tokens, Kerberos caches, and SMB sessions when validating password and group changes.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="verifying-access-after-ad-password-and-group-changes" style="scroll-margin-top: 5rem"></div>
<p>A password or group membership can change in AD while a user's share access stays unchanged. First establish whether the test concerns fresh authentication, a current process token, or an established SMB session. Refreshing one does not demonstrate that the others changed.</p>
<p>Two controls on Windows Server 2022 with Windows PowerShell 5.1 compare resetting u01's password and granting kb13g1 a group membership. The domain is <a href="http://corp.test.checo.cc" target="_blank" rel="noopener noreferrer">corp.test.checo.cc</a>, with LAB-DC1 and client LAB-MEMBER. Inspect directory, client, and file-server state separately.</p>
<div id="collect-the-states-being-compared" style="scroll-margin-top: 5rem"></div>
<h2>1. States and inspection</h2>
<p>| State | Evidence | Question answered |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ad-permission-session-lifetime/h269-file-17932707011.png" type="image/png"/>
    </item>
    <item>
      <title>IIS Request and Configuration Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/Windows/iis-request-configuration.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/iis-request-configuration.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">IIS Request and Configuration Troubleshooting</source>
      <description>Diagnose WebDAV 405, two upload limits, and inherited 500.19 conflicts through modules, substatus, HRESULT, and scoped effective configuration.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-iis-request-limits-and-configuration-inheritance" style="scroll-margin-top: 5rem"></div>
<p>A 405 response, rejected upload, or 500.19 on one directory can occur before application code runs. Read the module, notification stage, substatus, and HRESULT, then inspect effective configuration at the exact application scope before changing routes or filesystem rights.</p>
<p>The examples use Windows 10 Enterprise 21H1 19043.2364 and IIS 10, with <a href="http://ASP.NET" target="_blank" rel="noopener noreferrer">ASP.NET</a> Framework 4.x handlers in the integrated v4.0 pipeline. Diagnose WebDAV method conflicts, upload limits, and static-directory inheritance separately. <a href="http://ASP.NET" target="_blank" rel="noopener noreferrer">ASP.NET</a> Core/Kestrel needs its own request-limit configuration.</p>
<div id="the-same-status-can-originate-in-different-layers" style="scroll-margin-top: 5rem"></div>
<h2>1. Locate the response source</h2>
<p>| Symptom | Recorded evidence | Direction |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/iis-request-configuration/h385-file-17938861380.png" type="image/png"/>
    </item>
    <item>
      <title>Windows MSI Installation and Maintenance</title>
      <link>https://blog.checo.cc/en/posts/Windows/windows-msi-maintenance.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/windows-msi-maintenance.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows MSI Installation and Maintenance</source>
      <description>Trace missing sources, file-version replacement, and product contexts through controls explaining stale programs, inner 1603 errors, and SYSTEM repair 1605.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Thu, 05 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-windows-msi-installation-updates-and-repair" style="scroll-margin-top: 5rem"></div>
<p>An MSI update can succeed while the program remains old. An application can exist while SYSTEM reports an unknown product. A cached MSI can remain present while repair asks for original media. Separate product instance, source media, and file replacement decisions.</p>
<p>The examples use Windows 10 Enterprise 21H1 (19043.2364) and Windows Installer 5.0. Source Report illustrates source resolution, Version Report illustrates file replacement, and Report illustrates per-user context. These are different products; substitute the exact identity and paths of the product being maintained.</p>
<div id="preserve-identity-and-version-evidence" style="scroll-margin-top: 5rem"></div>
<h2>1. Product identity and versions</h2>
<p>| Information | Purpose |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/windows-msi-maintenance/h389-file-17938908000.png" type="image/png"/>
    </item>
    <item>
      <title>Windows Scheduled Task Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/Windows/windows-scheduled-task-context.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/windows-scheduled-task-context.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Scheduled Task Troubleshooting</source>
      <description>Trace working directories, instance policies, logon types, HKCU, and mapped drives across five controls, separating accepted requests from completed work.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-windows-scheduled-task-execution-context" style="scroll-margin-top: 5rem"></div>
<p>A scheduled task has at least three success boundaries: the scheduler accepts a request, an action process starts, and the business operation completes with a fresh result. SUCCESS from schtasks /run is a reason to continue tracing that chain, not to stop.</p>
<p>Using Windows Server 2022 and Windows 10 LTSC 2021, work through directory, instance policy, logon type, HKCU, and mapped-drive checks. Each branch captures the task's actual execution context before comparing it with a manual run.</p>
<div id="start-with-the-exported-definition" style="scroll-margin-top: 5rem"></div>
<h2>1. Task definition</h2>
<p>Confirm the full TaskPath and internal name; identical names can exist in different folders. Read the actual action, principal, settings, and latest result:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'NAD0820261009'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$taskPath</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> '\'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Get-ScheduledTask</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskName </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskPath </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$taskPath</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ErrorAction Stop</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t.Actions</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Execute,Arguments,WorkingDirectory</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t.Principal</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> UserId,LogonType,RunLevel</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$t.Settings</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> MultipleInstances,ExecutionTimeLimit,StartWhenAvailable</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-ScheduledTaskInfo</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskName </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskPath </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$taskPath</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> |</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">    Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> LastRunTime,LastTaskResult,NumberOfMissedRuns</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">xml</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$xml</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Export-ScheduledTask</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskName </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskPath </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$taskPath</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$xml.Task.Principals.Principal</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$xml.Task.Settings.MultipleInstancesPolicy</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Compare executable versus arguments, working directory, identity/logon type, and existing-instance behavior. Record PowerShell version/bitness too; an administrator shell's PATH need not match the background process.</p>
<p>| Evidence | Interpretation |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/windows-scheduled-task-context/h320-file-17937886650.jpg" type="image/jpeg"/>
    </item>
    <item>
      <title>Windows Service Certificates and Private Keys</title>
      <link>https://blog.checo.cc/en/posts/Windows/windows-service-certificate-key.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/windows-service-certificate-key.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Service Certificates and Private Keys</source>
      <description>Use store-location and key-ACL controls to diagnose lookup, key opening, and signing under the actual identity, including PFX deployment, renewal, and rollback.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Sun, 11 Oct 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="configuring-certificate-lookup-and-private-key-access-for-windows-services" style="scroll-margin-top: 5rem"></div>
<p>Certificate not found and private key unavailable fail at different layers. Confirm the service's real identity and exact store before testing an operation with the associated key. An administrator seeing the certificate in a management console proves neither.</p>
<p>The examples use Windows Server 2022 Datacenter and PowerShell 5.1.20348.5386. First compare CurrentUser/My with LocalMachine/My under SYSTEM, then inspect an ordinary signer's access to a different machine certificate. Store selection and key authorization are separate checks.</p>
<div id="separate-the-failure-layers" style="scroll-margin-top: 5rem"></div>
<h2>1. Locate the failure</h2>
<p>| Result | First checks |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows Service Startup and Recovery</title>
      <link>https://blog.checo.cc/en/posts/Windows/windows-service-start-recovery.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/windows-service-start-recovery.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows Service Startup and Recovery</source>
      <description>Use recorded 1069, 1053, initialization, and crash-recovery controls to distinguish account logon, SCM state, failure actions, and application readiness.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Wed, 04 Nov 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="troubleshooting-windows-service-startup-and-crash-recovery" style="scroll-margin-top: 5rem"></div>
<p>When a Windows service fails, identify the stage: account logon, connection to SCM, startup processing, or termination after it ran. Error 1053, error 1069, and recovery actions address different stages; increasing a timeout cannot solve all three.</p>
<p>Start with service logon and dispatcher-entry checks on Windows Server 2022, compare connection versus initialization on Windows 10 LTSC 2021, then inspect crash recovery on Server 2022. Each example uses a dedicated service; identify the failing stage before changing a business service.</p>
<div id="error-codes-guide-the-first-check" style="scroll-margin-top: 5rem"></div>
<h2>1. Errors and logs</h2>
<p>| Symptom | First evidence | Unsupported shortcut |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Connect authentik to AD and Cloudflare</title>
      <link>https://blog.checo.cc/en/posts/DevOps/11.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/11.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Connect authentik to AD and Cloudflare</source>
      <description>Connect AD, authentik, and Cloudflare Dashboard SSO; troubleshoot TLS, authorization grants, launch URLs, and account lifecycle limits.</description>
      <category>DevOps</category>
      <category>Windows</category>
      <pubDate>Wed, 16 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="using-ad-accounts-to-sign-in-to-cloudflare-through-authentik" style="scroll-margin-top: 5rem"></div>
<p>This deployment connected <strong>Windows AD → authentik → the Cloudflare dashboard</strong>. A domain user signed into authentik and launched Cloudflare from an application card. The last obstacle was the card’s URL: the ordinary dashboard homepage was a bookmark, not an entry point into this SSO flow.</p>
<p>This deployment uses authentik 2026.8.2, two writable DCs, and a cloud RODC. The complete dashboard sign-in worked. The authentik domain is <code>sso.checo.cc</code>, and the AD domain is <code>corp.checo.cc</code>.</p>
<!-- more -->
<div id="separate-directory-access-password-validation-and-federation" style="scroll-margin-top: 5rem"></div>
<h2>1. Authentication flow</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>AD DS ── LDAPS ── authentik ── OIDC ── Cloudflare Access</span></span>
<span class="line"><span>                                            ↓</span></span>
<span class="line"><span>                                   Cloudflare Dashboard SSO</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>AD supplies directory data and password checks; authentik supplies an OIDC identity; Cloudflare consumes it. AD FS was not deployed because an existing authentik installation was reused. Dashboard email-domain verification is a separate requirement.</p>
<p>Browser access uses HTTPS through a reverse proxy, while DC traffic travels over private WireGuard links. One connectivity failure had a route to <code>wg0</code> but no matching destination in the peer’s AllowedIPs. Check both route and peer selection:</p>
<p>The authentik host uses tunnel address 10.0.0.5 and cloud DC3 uses 10.0.0.6. Check routing and peer selection for DC3.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> route</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> get</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 10.0.0.6</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wg</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> wg0</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> allowed-ips</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wg</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> wg0</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> latest-handshakes</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="healthy-containers-can-still-serve-a-broken-login-page" style="scroll-margin-top: 5rem"></div>
<h2>2. Login page 500</h2>
<p>The official Compose deployment contained PostgreSQL, server, and worker, with application ports bound to loopback behind HTTPS. Dependencies are version-specific; an old Redis configuration should not be copied automatically.</p>
<p>Initially all containers were healthy and <code>/</code> returned 302, but the final page returned 500:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>PermissionError: [Errno 13] Permission denied: '/templates/if/flow.html'</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The empty host template directory was root-owned with mode 700. Application UID 1000 could not traverse it. Correcting that directory’s access restored HTTP 200 without broadly relaxing secret-file permissions.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -sS</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -L</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/null</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -w</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'HTTP=%{http_code} final=%{url_effective}\n'</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  https://sso.checo.cc/</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Following redirects exposes failures hidden behind a healthy root URL. A 200 response still does not prove authentication.</p>
<div id="a-dedicated-ldap-reader-and-explicit-password-behavior" style="scroll-margin-top: 5rem"></div>
<h2>3. LDAP source</h2>
<p>The ordinary bind account lived in a dedicated OU with default directory-reading rights, without DCSync, password-reset, or directory-write permissions. It was not a gMSA. An empty MemberOf list does not eliminate primary-group membership.</p>
<p>| Setting | Selection |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Building a Two-Node PVE Cluster</title>
      <link>https://blog.checo.cc/en/posts/DevOps/12.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/12.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Building a Two-Node PVE Cluster</source>
      <description>Create on the existing workload node, join an empty node, and verify quorum transitions, configuration integrity, and service continuity.</description>
      <category>DevOps</category>
      <category>Virtualization</category>
      <pubDate>Sat, 19 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="adding-a-second-pve-node-while-keeping-existing-guests-running" style="scroll-margin-top: 5rem"></div>
<p>The first PVE host already ran domain controllers, ASR, and monitoring. The second was a fresh empty installation. On September 19, 2026, they became a cluster for unified management and manual migration. No HA resources were configured, and QDevice was still a plan.</p>
<p>The important decisions were which host created the cluster and how to demonstrate that the existing guests remained running throughout.</p>
<!-- more -->
<div id="four-separate-responsibilities" style="scroll-margin-top: 5rem"></div>
<h2>1. Cluster components</h2>
<p>| Component | Responsibility |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Monitoring Windows with Prometheus</title>
      <link>https://blog.checo.cc/en/posts/DevOps/13.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/13.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Monitoring Windows with Prometheus</source>
      <description>Use windows_exporter 0.30.7 and an LHM exporter for two metric sources, PromQL, missing-service alerts, and Grafana panels.</description>
      <category>DevOps</category>
      <category>Windows</category>
      <pubDate>Tue, 25 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="collecting-windows-system-and-hardware-metrics-with-prometheus" style="scroll-margin-top: 5rem"></div>
<p><code>windows_exporter</code> supplies Windows CPU, memory, and disk metrics, while temperature, GPU power, and VRAM need a verified sensor source. On a Ryzen 5600H / RTX 3050 Ti laptop, I used two exporters and one Prometheus server.</p>
<p>OS metrics are based on <code>windows_exporter 0.30.7</code>; hardware comes from HardwareExporterWindows / LibreHardwareMonitor. The August deployment record was rechecked against endpoints on September 15. The configurations below are examples, not the complete live dashboard, and other hardware may expose different sensors.</p>
<!-- more -->
<div id="two-sources-for-one-machine" style="scroll-margin-top: 5rem"></div>
<h2>1. Metric sources</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Windows</span></span>
<span class="line"><span>  ├─ windows_exporter :9182 → CPU/memory/disk/network/services</span></span>
<span class="line"><span>  └─ HardwareExporter :9888 → temperature/GPU/power/VRAM</span></span>
<span class="line"><span>                ↓</span></span>
<span class="line"><span>            Prometheus → Grafana</span></span>
<span class="line"><span>                └─ alert rules → Alertmanager</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Two processes are the choice here, not a universal requirement. WMI thermalzone must not be assumed to represent CPU core temperature. Verify sensor names, units, and behavior.</p>
<div id="read-real-metrics-after-installation" style="scroll-margin-top: 5rem"></div>
<h2>2. Install and inspect</h2>
<p>Run the official downloaded MSI in elevated cmd.exe. The permitted monitoring server is 192.168.100.113:</p>
<div class="language-bat line-numbers-mode" data-highlighter="shiki" data-ext="bat" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bat"><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">msiexec</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /i windows_exporter-0.30.7-amd64.msi /qn /norestart ENABLED_COLLECTORS=cpu,memory,logical_disk,net,os,service,system LISTEN_PORT=</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">9182</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> REMOTE_ADDR=192.168.100.113</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Inspect all existing firewall allows: adding a narrow rule does not override a broad old allow. Both endpoints should be restricted to the monitoring path.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Service</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> windows_exporter,HardwareExporter,PawnIO</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Invoke-WebRequest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> http:</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">//</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">localhost:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">9182</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">metrics </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">UseBasicParsing</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Invoke-WebRequest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> http:</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">//</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">localhost:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">9888</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">metrics </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">UseBasicParsing</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Hardware runtime and driver requirements depend on the chosen release. This deployment used .NET 10 and PawnIO. A running driver does not guarantee every chipset is supported.<a href="https://github.com/naughtyGitCat/HardwareExporterWindows" target="_blank" rel="noopener noreferrer">HardwareExporterWindows</a></p>
<p>| OS metric, version 0.30.7 | Meaning |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Linux Fan Control and PVE Quiet-Tuning: From hwmon to EC Registers</title>
      <link>https://blog.checo.cc/en/posts/DevOps/9.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/9.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Linux Fan Control and PVE Quiet-Tuning: From hwmon to EC Registers</source>
      <description>Linux fan control from hwmon and fancontrol to EC register control, with a PVE mini-PC case study covering multi-sensor curves, hysteresis, fail-safe rollback, and load testing.</description>
      <category>DevOps</category>
      <category>Linux</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>There is no universal Linux fan-control command. Desktop boards usually expose PWM through hwmon, laptops use vendor interfaces, servers have BMC/IPMI policies, and some mini PCs leave all control inside the embedded controller (EC).</p>
<p>This article first chooses the safest control path, then shows how a noisy single-temperature PVE script became a multi-sensor controller with hysteresis, read-back verification, and automatic firmware fallback.</p>
<!-- more -->
<div id="identify-the-control-path" style="scroll-margin-top: 5rem"></div>
<h2>1. Identify the control path</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">for</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> h</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> in</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /sys/class/hwmon/hwmon*</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">; </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">do</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">  printf</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> '%s: '</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">  cat</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/name"</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">  find</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -maxdepth</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 1</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \(</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -name</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'temp*_input'</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -name</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'pwm*'</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -name</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'fan*_input'</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \)</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -print</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">done</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>| File | Meaning |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>M4 Hardware Transcoding: Converting 234 WMV/RM Videos to MP4</title>
      <link>https://blog.checo.cc/en/posts/Mac/6.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/6.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">M4 Hardware Transcoding: Converting 234 WMV/RM Videos to MP4</source>
      <description>Converting 234 legacy WMV/RM videos to MP4 on a Mac mini M4, with x264/VideoToolbox benchmarks and a resumable, failure-safe batch workflow.</description>
      <category>macOS</category>
      <category>DevOps</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<figure><img src="/assets/images/posts/mac-mini-m4-nas-transcoding-hero.png" alt="Transparent Mac mini M4 connected to a two-bay NAS for video transcoding" tabindex="0" loading="lazy"><figcaption>Transparent Mac mini M4 connected to a two-bay NAS for video transcoding</figcaption></figure>
<p>I had 234 legacy WMV/RM videos on a NAS: about 42.8GB and 78.5 hours in total. The goal was to create compatible MP4 copies without touching the source directory, while keeping quality, size, power use, and restart safety under control.</p>
<p>The final choice was <code>h264_videotoolbox -q:v 50</code>. On a representative 720p clip it ran roughly twice as fast as x264, produced a similar file size, and reduced the sustained CPU load and fan noise dramatically.</p>
<!-- more -->
<div id="inventory-before-conversion" style="scroll-margin-top: 5rem"></div>
<h2>1. Inventory before conversion</h2>
<p>Inspect the actual codecs, dimensions, and duration before choosing one command for the whole archive:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ffprobe</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -v</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> error</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -select_streams</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> v:0</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -show_entries</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> stream=codec_name,width,height,r_frame_rate,duration,bit_rate</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -of</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> default=noprint_wrappers=</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> sample.wmv</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The archive included WMV3, RealVideo 4, several resolutions, and different audio layouts. A complete scan identifies missing audio, suspicious durations, and codec outliers before a long batch job begins.</p>
<div id="benchmark-real-content" style="scroll-margin-top: 5rem"></div>
<h2>2. Benchmark real content</h2>
<p>Use a 60-second segment and compare size, speed, SSIM, and CPU load:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ffmpeg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -ss</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 200</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -t</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 60</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> sample.wmv</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -c:v</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> libx264</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -preset</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> medium</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -crf</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 27</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -c:a</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> aac</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -b:a</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 96k</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -movflags</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +faststart</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -y</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /tmp/x264.mp4</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ffmpeg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -ss</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 200</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -t</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 60</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> sample.wmv</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -c:v</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> h264_videotoolbox</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -q:v</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 50</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -c:a</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> aac</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -b:a</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 96k</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -movflags</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +faststart</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -y</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /tmp/videotoolbox.mp4</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ffmpeg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> sample.wmv</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /tmp/videotoolbox.mp4</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -lavfi</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "ssim"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -f</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> null</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> -</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The representative 720p result was:</p>
<p>| Encoder | 60-second size | Speed | SSIM | Load |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/mac-mini-m4-nas-transcoding-hero.png" type="image/png"/>
    </item>
    <item>
      <title>Install Arch Linux ARM and Import It into UTM</title>
      <link>https://blog.checo.cc/en/posts/Mac/7.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/7.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Install Arch Linux ARM and Import It into UTM</source>
      <description>Connect ARM64 installation, kernel maintenance, and UTM disk import while distinguishing HVF, TCG, and Apple virtualization.</description>
      <category>macOS</category>
      <category>Virtualization</category>
      <pubDate>Wed, 15 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="installing-arch-linux-arm-with-qemu-and-moving-it-into-utm" style="scroll-margin-top: 5rem"></div>
<p>I wanted a small Linux VM on Apple Silicon: install Arch Linux ARM through QEMU, run Docker, then manage it in UTM. The VM can then use UTM's graphical management.</p>
<p>Install and verify ARM64 disk boot in QEMU, then move the disk to UTM's QEMU backend. Startup arguments determine TCG emulation versus HVF acceleration; import also requires matching firmware, disk references, and file access.</p>
<!-- more -->
<div id="distinguish-architecture-accelerator-and-backend" style="scroll-margin-top: 5rem"></div>
<h2>1. Architecture and acceleration</h2>
<p>An ARM64 guest matches Apple Silicon, but a QEMU command does not automatically establish HVF use. The original used <code>-cpu cortex-a72</code> without <code>-accel hvf</code>. It documents a bootable configuration, <strong>not verified hardware acceleration or performance</strong>.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uname</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -m</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sysctl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> kern.hv_support</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">qemu-system-aarch64</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -accel</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> help</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">qemu-system-aarch64</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --version</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Host capability and available accelerators are not the active VM configuration. Archive actual arguments, QEMU output, and the selected UTM backend.</p>
<p>| Route | Interpretation |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Mac AD Integration: Features and Limits</title>
      <link>https://blog.checo.cc/en/posts/Mac/9.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/9.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Mac AD Integration: Features and Limits</source>
      <description>Configure AD binding and domain login on macOS, verify mobile accounts, offline caching, and remote access, and distinguish Windows GPO from Mac management.</description>
      <category>macOS</category>
      <category>Identity</category>
      <pubDate>Wed, 16 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="what-joining-a-mac-to-active-directory-actually-gives-you" style="scroll-margin-top: 5rem"></div>
<p>Using AD accounts on macOS does not mean Windows device policies apply. I tested binding, GUI/SSH access, mobile accounts, and a GPO control on a macOS Sequoia lab VM. The useful result separates directory identity from device management.</p>
<p>The Sequoia VM is mac-vm105 at 192.168.100.181 in PVE. Its AD domain is <a href="http://corp.checo.cc" target="_blank" rel="noopener noreferrer">corp.checo.cc</a>, NetBIOS name CHECO, with DNS at 192.168.100.101 and 192.168.100.102. Substitute the example test account and OU as needed.</p>
<!-- more -->
<div id="check-dns-time-and-object-placement-first" style="scroll-margin-top: 5rem"></div>
<h2>1. DNS and time</h2>
<p>AD discovery needs SRV records and reachable hosts. Public DNS success does not validate internal-domain resolution. Save existing settings before directing the lab interface to AD-aware DNS; retain working public forwarding rather than disabling IPv6 or repeatedly flushing caches.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">networksetup</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -listallnetworkservices</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">networksetup</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -getdnsservers</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> Ethernet</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">scutil</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --dns</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dig</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +short</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> SRV</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> _ldap._tcp.dc._msdcs.corp.checo.cc</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dig</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +short</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> SRV</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> _kerberos._tcp.corp.checo.cc</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">date</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>Ethernet</code> is an example service name. Wi-Fi, VPN, and scoped resolvers can affect selection. Check returned A/AAAA destinations and clock alignment. SRV success alone does not validate LDAP, Kerberos, or trust passwords.</p>
<p>Create a test OU and delegate joining permissions to a dedicated account rather than a permanent Domain Admin automation account. Apple documents directory integration; permissions and placement remain deployment decisions. <a href="https://support.apple.com/guide/deployment/integrate-mac-computers-with-active-directory-depd1a7cad1f/web" target="_blank" rel="noopener noreferrer">Apple AD integration</a></p>
<div id="bind-then-configure-mobility-and-administrative-mapping" style="scroll-margin-top: 5rem"></div>
<h2>2. Binding and accounts</h2>
<p>Use Directory Utility or <code>dsconfigad</code>. These examples omit password arguments and use the tool's interactive prompt; inspect local help first. Check an existing computer object's ownership rather than adding <code>-force</code> automatically.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dsconfigad</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -add</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> corp.checo.cc</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -username</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> join-mac</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -computer</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mac-vm105</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -ou</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'OU=Mac Lab,DC=corp,DC=checo,DC=cc'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dsconfigad</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -mobile</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> enable</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -mobileconfirm</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> enable</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -localhome</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> enable</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -useuncpath</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> disable</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dsconfigad</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -show</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Mobile accounts, offline access, local homes, and network homes are separate choices. This example asks the user to confirm mobile-account creation. Binding can succeed while first login or home creation still fails.</p>
<p>If local administration is required, configure a specific group and inspect mapping:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dsconfigad</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -groups</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'Mac Local Admins'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">id</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mac-test</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>-groups</code> grants local administrative access, not SSH or screen-sharing authorization. The lab mapped Domain Admins; that is not a requirement to authorize the entire group on daily devices.</p>
<div id="accept-authentication-gui-login-and-remote-access-separately" style="scroll-margin-top: 5rem"></div>
<h2>3. Login and remote access</h2>
<p>Inspect identity, obtain an interactive ticket, and perform actual login without embedding passwords in shell history:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">id</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mac-test</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">kinit</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> mac-test@CORP.CHECO.CC</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">klist</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">stat</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -f%Su</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/console</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>kinit</code> validates its Kerberos path, not a GUI login. Match console ownership with the visible session and home directory. The record also used AutoLogon for some headless testing, so not every desktop appearance establishes manually entered credentials.</p>
<p>Short names, <code>CHECO\user</code>, and UPN worked in the recorded configuration; a DNS-domain backslash prefix failed. Keep that qualification. A controlled incorrect-password attempt can validate rejection, but do not loop until production accounts lock.</p>
<p>The lab's SSH ACL nested the local admin group; a regular domain user gained access after authorization. This does not prove every Mac defaults to administrator-only SSH. Inspect System Settings authorization and validate authentication, access rights, home, and usable shell separately.</p>
<div id="offline-login-establishes-cached-account-behavior" style="scroll-margin-top: 5rem"></div>
<h2>4. Offline login</h2>
<p>After creating a mobile account, the experiment blocked both DCs over IPv4/IPv6 and LDAP paths, rebooted, and still logged in without corresponding DC events. Together these support cached authentication in that trial; absent server events alone do not prove offline authentication.</p>
<p>The inverse no-cache test was not completed because cache removal met system restrictions. Keep the gap rather than disabling SIP or deleting directory databases. A new test user or clean VM is a better control.</p>
<p>Test password changes, lockout, account disabling, cache refresh, keychain behavior, and reconnection independently. The record did not establish immediate revocation of cached offline login after AD disabling. FileVault startup authorization is another requirement, not an automatic consequence of having a mobile account.</p>
<div id="a-gpo-control-does-not-give-macos-a-windows-policy-engine" style="scroll-margin-top: 5rem"></div>
<h2>5. GPO support</h2>
<p>The same banner GPO applied on the Windows control, with gpupdate/gpresult and registry evidence, but produced no equivalent Mac change. Server-side sampling saw no open SYSVOL session from the Mac, and corresponding managed artifacts were absent.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">gpresult </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-SmbSession</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-SmbOpenFile</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>These are Windows-control/server tools. RPC failure querying Mac RSoP does not diagnose broken GPO linking. Instantaneous SMB queries cannot establish that a Mac never accessed SYSVOL. Native directory binding does not supply Windows GPO execution.</p>
<p>| Capability | Evidence and limit |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why I Still Received DNS Replies from a Documentation Address</title>
      <link>https://blog.checo.cc/en/posts/Networking/10.html</link>
      <guid>https://blog.checo.cc/en/posts/Networking/10.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Why I Still Received DNS Replies from a Documentation Address</source>
      <description>Use WAN captures, 112 DNS transactions, and a documentation-address control to investigate transparent DNS replies without overstating attribution.</description>
      <category>Networking</category>
      <pubDate>Sun, 27 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Running <code>nslookup www.youtube.com 8.8.8.8</code> and seeing <code>Server: 8.8.8.8</code> is reassuring. It identifies the destination and the claimed source of the accepted reply, however, rather than authenticating who generated it. Plain UDP/53 provides no such authentication.</p>
<p>On September 27, 2026, I tested this from an iStoreOS router. The strongest observation was a matching DNS response to a query addressed to an IP reserved for documentation, where no public recursive resolver should exist.</p>
<!-- more -->
<div id="verify-that-the-query-leaves-the-wan" style="scroll-margin-top: 5rem"></div>
<h2>1. Verify WAN egress</h2>
<p>The router runs PassWall2. During the first attempt, <code>nslookup</code> returned plausible answers but <code>eth0</code> captured no corresponding UDP/53 traffic. Local TProxy interception made that attempt unsuitable for measuring the direct upstream path.</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Router-local query → OUTPUT/TProxy → eth0 (WAN capture)</span></span>
<span class="line"><span>                                         ↓</span></span>
<span class="line"><span>                                  Modem/upstream path</span></span>
<span class="line"><span>                                         ↓</span></span>
<span class="line"><span>                                  Selected DNS target</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>For the subsequent test, I applied a temporary exception only to router-local UDP/53 traffic for the selected targets. It used an existing <code>mark 0xff</code> return rule. The counter reached 112 and the outgoing packets appeared on the WAN. That mark belongs to this deployment; it is not a portable OpenWrt setting.</p>
<p>Neither an explicit resolver argument nor <code>ip route get</code> alone proves which path the DNS packet actually takes.</p>
<div id="the-112-query-experiment" style="scroll-margin-top: 5rem"></div>
<h2>2. Query samples</h2>
<p>Each target received A queries for 16 domains. Six public resolvers produced 96 transactions; the control added 16.</p>
<p>| Destination | No overlap with Google DoH | Some overlap |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>PVE Domain Promotion and IPv6 DNS</title>
      <link>https://blog.checo.cc/en/posts/Networking/8.html</link>
      <guid>https://blog.checo.cc/en/posts/Networking/8.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">PVE Domain Promotion and IPv6 DNS</source>
      <description>An iStoreOS RA/RDNSS advertisement made Windows query the router&amp;apos;s IPv6 DNS for an internal AD zone, returning NXDOMAIN and blocking promotion of a second domain controller.</description>
      <category>Networking</category>
      <category>Windows</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="pve-domain-controller-promotion-failure-caused-by-istoreos-ipv6-dns" style="scroll-margin-top: 5rem"></div>
<p>While promoting a second Windows Server domain controller in PVE, DC2 had its IPv4 DNS statically pointed at DC1, yet the AD DS wizard still could not contact the domain. Direct queries to DC1 returned the expected SRV records.</p>
<p>The router was advertising its own global IPv6 address as DNS through DHCPv6 and RA/RDNSS. Windows queried that server first; the router knew nothing about the private AD zone and returned a valid <code>NXDOMAIN</code> response.</p>
<p>All addresses, domain names, and device identifiers below are generalized.</p>
<!-- more -->
<div id="the-decisive-comparison" style="scroll-margin-top: 5rem"></div>
<h2>1. The decisive comparison</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>ISP IPv6-PD</span></span>
<span class="line"><span>      ↓</span></span>
<span class="line"><span>iStoreOS / OpenWrt (DHCPv4, DHCPv6, RA/RDNSS)</span></span>
<span class="line"><span>      ↓</span></span>
<span class="line"><span>PVE</span></span>
<span class="line"><span> ├─ DC1: existing domain controller and AD DNS</span></span>
<span class="line"><span> └─ DC2: server being promoted</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The default query used the router's IPv6 DNS:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">nslookup corp.checo.cc</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Server:  UnKnown</span></span>
<span class="line"><span>Address: 2001:db8:100::1</span></span>
<span class="line"><span></span></span>
<span class="line"><span>*** UnKnown can't find corp.checo.cc: Non-existent domain</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Querying DC1 explicitly worked:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Resolve-DnsName</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> _ldap._tcp.dc._msdcs.corp.checo.cc \</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Type SRV </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Server </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">192.168</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">100.11</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>That proves the AD zone and Netlogon records are healthy. The failure is DNS-server selection on DC2.</p>
<div id="trace-the-ipv6-dns-advertisement" style="scroll-margin-top: 5rem"></div>
<h2>2. Trace the IPv6 DNS advertisement</h2>
<p>Inspect both address families on Windows:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-DnsClientServerAddress</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Ethernet"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ipconfig </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">all</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Then inspect the LAN interface and DHCP configuration on the router:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -6</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> addr</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dev</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> br-lan</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp.lan</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>With RA and DHCPv6 server mode enabled and no explicit DNS override, <code>odhcpd</code> may advertise the LAN interface's own IPv6 address. Public upstream DNS cannot resolve a private AD zone, so <code>NXDOMAIN</code> is expected.</p>
<p><code>NXDOMAIN</code> is a valid negative answer, not a timeout. It should not be treated as “this resolver is down.” <code>Server: UnKnown</code> only indicates the absence of a PTR record and is not the root cause.</p>
<div id="why-a-windows-only-change-did-not-hold" style="scroll-margin-top: 5rem"></div>
<h2>3. Why a Windows-only change did not hold</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Set-DnsClientServerAddress</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> \</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Ethernet"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> \</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ServerAddresses </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"192.168.100.11"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>This does not stop future RA/RDNSS advertisements. Removing the dynamic IPv6 address on each client treats the symptom; the router continues to publish it.</p>
<div id="minimal-router-change" style="scroll-margin-top: 5rem"></div>
<h2>4. Minimal router change</h2>
<p>Every client in this lab retained IPv4 and could query AAAA records through IPv4 DNS. The chosen fix stopped advertising the router as IPv6 DNS while retaining IPv6 addressing, SLAAC, DHCPv6, RA, and the default route.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">cp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /etc/config/dhcp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /tmp/dhcp.before-ipv6-dns-change</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> changes</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">/etc/init.d/odhcpd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> status</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> export</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/dev/null</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> || </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">exit</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 10</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> set</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp.lan.dns_service='0'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> set</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp.lan.ra_dns='0'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> changes</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> export</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/dev/null</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> || </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">exit</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 10</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> commit</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">/etc/init.d/odhcpd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> restart</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Some compact iStoreOS builds do not implement <code>uci validate</code>; <code>uci export ... &gt;/dev/null</code> provides a basic parse check.</p>
<p>Validate that IPv6 remained healthy:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">/etc/init.d/odhcpd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> status</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -6</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> addr</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dev</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> br-lan</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -6</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> route</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> default</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">nslookup</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -type=AAAA</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ipv6.google.com</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 127.0.0.1</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">logread</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> odhcpd</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">tail</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -30</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="refresh-windows-and-verify-ad-discovery" style="scroll-margin-top: 5rem"></div>
<h2>5. Refresh Windows and verify AD discovery</h2>
<p>DC2 was not yet serving production, so a reboot cleared the DHCPv6 lease and RDNSS lifetime:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Restart-Computer</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>After reboot:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-DnsClientServerAddress</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">InterfaceAlias </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Ethernet"</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Resolve-DnsName</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> _ldap._tcp.dc._msdcs.corp.checo.cc </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Type SRV</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">nltest </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dsgetdc:corp.checo.cc</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Avoid rebooting the only existing domain controller merely to clear DNS state. Try a lease renewal and cache clear first, then schedule maintenance after DC2 promotion and replication validation.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ipconfig </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">release6 </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Ethernet"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ipconfig </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">renew6 </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Ethernet"</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Clear-DnsClientCache</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="ipv4-dns-can-still-return-ipv6-destinations" style="scroll-margin-top: 5rem"></div>
<h2>6. IPv4 DNS can still return IPv6 destinations</h2>
<p>Stopping an IPv6 DNS advertisement does not disable IPv6. A client can send a DNS query over IPv4, receive an AAAA record, and connect to the destination over IPv6.</p>
<p>The exception is a truly IPv6-only client that cannot reach any IPv4 resolver; such a network needs a separate design.</p>
<div id="rollback-and-long-term-design" style="scroll-margin-top: 5rem"></div>
<h2>7. Rollback and long-term design</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -q</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> delete</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp.lan.dns_service</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -q</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> delete</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp.lan.ra_dns</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uci</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> commit</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dhcp</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">/etc/init.d/odhcpd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> restart</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>A cleaner long-term design gives both DCs stable ULA addresses and advertises those addresses as DNS to an AD VLAN. Domain members should use only AD DNS; public lookups should go through AD DNS forwarders rather than a public resolver configured as a backup.</p>
<h2>Summary</h2>
<p>The problem was not an AD/IPv6 incompatibility. It was an incorrect resolver advertised in a dual-stack network:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Router advertises itself as IPv6 DNS</span></span>
<span class="line"><span>            ↓</span></span>
<span class="line"><span>Windows asks it for the private AD zone</span></span>
<span class="line"><span>            ↓</span></span>
<span class="line"><span>Router returns NXDOMAIN</span></span>
<span class="line"><span>            ↓</span></span>
<span class="line"><span>DC2 cannot discover a domain controller</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>When static IPv4 DNS looks correct, inspect IPv6 DNS and trace RA/RDNSS to the device that actually supplied it.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating a Domain Controller in PVE While Keeping Its IP Address</title>
      <link>https://blog.checo.cc/en/posts/Windows/1.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/1.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Migrating a Domain Controller in PVE While Keeping Its IP Address</source>
      <description>Rebuild a writable DC on PVE2, update names and TLS dependencies, and verify authentication, directory changes, and bidirectional SYSVOL replication.</description>
      <category>Windows</category>
      <category>Virtualization</category>
      <pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="rebuilding-my-second-domain-controller-and-reusing-its-ip" style="scroll-margin-top: 5rem"></div>
<p>Moving a healthy DC VM to another physical host would usually be simpler. Here I deliberately built a new writable DC from a generalized template, updated and promoted it, verified replication, and normally demoted the old DC2. The replacement kept its new name and eventually reused the old IP.</p>
<p>The core switch and functional checks completed on September 21, 2026. The old VM was removed from the domain, powered off, and disconnected, but its disks remained. <strong>Reusing an IP does not inherit an FQDN, TLS certificate, or client dependencies.</strong></p>
<!-- more -->
<div id="define-the-replacement-boundary" style="scroll-margin-top: 5rem"></div>
<h2>1. Migration environment</h2>
<p>| Component | Before | After |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting AD Replication Error 8524</title>
      <link>https://blog.checo.cc/en/posts/Windows/2.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/2.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Troubleshooting AD Replication Error 8524</source>
      <description>Investigate a post-outage Schema failure through DSA GUID CNAMEs, replication direction, and remote argument handling, separating recovery from root-cause proof.</description>
      <category>Windows</category>
      <category>DevOps</category>
      <pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="why-ad-replication-still-failed-with-8524-when-the-hostname-resolved" style="scroll-margin-top: 5rem"></div>
<p>After power returned on August 14, 2026, both PVE domain controllers started, hostnames resolved, and some IPv4/IPv6 probes passed. Yet PVE-DC1’s latest attempt to pull Schema from PVE-DC2 showed error 8524.</p>
<p>Requesting DNS registration on PVE-DC2, restarting Netlogon, correcting remote command wrapping, and retrying the specific replication relationship restored it. When reviewing the record on September 15, the key correction was that <strong>recovery does not prove which original DNS record was missing</strong>.</p>
<!-- more -->
<div id="identify-destination-source-and-naming-context" style="scroll-margin-top: 5rem"></div>
<h2>1. Direction and partition</h2>
<p>The error text is:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>The DSA operation is unable to proceed because of a DNS lookup failure.</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>The failed relationship was:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>PVE-DC1 (destination, initiates pull) ← Schema data ← PVE-DC2 (source)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Domain, Configuration, Schema, DomainDnsZones, and ForestDnsZones have separate replication state. Schema is an independent naming context despite its DN beneath Configuration. No schema edits or adprep operation occurred.</p>
<p>| Time, August 14 | Recorded observation |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Windows UEFI and BCD Boot Process</title>
      <link>https://blog.checo.cc/en/posts/Windows/3.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Windows UEFI and BCD Boot Process</source>
      <description>Inspect an isolated clone’s partitions, firmware variables, offline BCD, and cold-boot display while keeping static evidence separate from execution tracing.</description>
      <category>Windows</category>
      <category>Virtualization</category>
      <pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="following-a-windows-boot-through-uefi-and-bcd-in-pve" style="scroll-margin-top: 5rem"></div>
<p>“BIOS finds the disk; BCD boots Windows” compresses several different responsibilities. PVE’s virtual-device order, UEFI boot entries, and Windows BCD system selection are separate configurations.</p>
<p>On September 21, 2026, I fully cloned a Windows Server template into VM202, disconnected its network, disabled autostart, inspected it read-only, and observed a normal boot. Template VM200 and DC VM201 were untouched. This was static evidence plus boot verification, <strong>without firmware execution tracing or ETW boot timing</strong>.</p>
<!-- more -->
<div id="an-isolated-clone" style="scroll-margin-top: 5rem"></div>
<h2>1. Lab environment</h2>
<p>Recorded configuration:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>VMID      202</span></span>
<span class="line"><span>bios      ovmf</span></span>
<span class="line"><span>machine   pc-q35-11.0</span></span>
<span class="line"><span>boot      order=scsi0</span></span>
<span class="line"><span>scsi0     80 GiB, VirtIO SCSI</span></span>
<span class="line"><span>efidisk0  4 MiB, OVMF variables</span></span>
<span class="line"><span>TPM       separate 4 MiB state disk</span></span>
<span class="line"><span>network   link_down=1</span></span>
<span class="line"><span>onboot    0</span></span>
<span class="line"><span>memory    4096 MiB</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The disconnected link prevented template first-boot routines from reaching AD. Autostart remained off, and a full clone avoided dependence on the template base disk. Host-side disk inspection occurred only after verifying the VM was stopped, using read-only access and releasing mounts and loop devices afterward.</p>
<div id="gpt-and-actual-files" style="scroll-margin-top: 5rem"></div>
<h2>2. GPT and boot files</h2>
<p>The stopped system disk had this layout:</p>
<p>| Partition | Size | Type | Verified contents |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Creating a Golden Image in PVE</title>
      <link>https://blog.checo.cc/en/posts/Windows/4.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Creating a Golden Image in PVE</source>
      <description>Prepare a Windows Server base VM in PVE, install VirtIO and QEMU Guest Agent, generalize with Sysprep, and verify cloned identity, networking, and ballooning.</description>
      <category>Windows</category>
      <category>Virtualization</category>
      <pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="preparing-a-reusable-windows-server-template-in-pve" style="scroll-margin-top: 5rem"></div>
<p>A Windows Server template should do more than reach the desktop. It needs reusable drivers and baseline configuration while allowing every clone to establish its own identity, name, network settings, and management state.</p>
<p>The workflow covers Windows Server drivers and baseline configuration, an answer file, Sysprep sealing, and PVE cloning, followed by Guest Agent and balloon checks. The example uses a 4096-MiB maximum and 2048-MiB minimum; size business servers for their workload.</p>
<!-- more -->
<div id="check-identity-and-boot-configuration-before-sealing" style="scroll-margin-top: 5rem"></div>
<div id="correct-the-assumptions-before-copying-the-template" style="scroll-margin-top: 5rem"></div>
<h2>1. Pre-seal checks</h2>
<p>| Check | Deployment principle |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Streaming Windows Games to a Mac with Moonlight</title>
      <link>https://blog.checo.cc/en/posts/Windows/5.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Streaming Windows Games to a Mac with Moonlight</source>
      <description>Install Sunshine, pair Moonlight, establish a baseline, and troubleshoot black screens, crashes, NVENC timeouts, and game-stream quality.</description>
      <category>Windows</category>
      <category>macOS</category>
      <pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="the-problems-i-ran-into-streaming-windows-games-to-my-mac" style="scroll-margin-top: 5rem"></div>
<p>Sunshine runs on the Windows gaming PC, while Moonlight on the Mac receives video and sends keyboard, mouse, and controller input. The game still runs on Windows; the Mac needs neither the Windows game installation nor a compatibility layer.</p>
<p>My setup uses a Mac mini M4 and a Windows 11 laptop with an RTX 3050 Ti Laptop and 4 GiB of VRAM, playing GTA5. This guide starts with a LAN connection, then covers black screens, Sunshine crashes, NVENC timeouts, and image quality. On a low-VRAM laptop, game and encoder workloads need attention together.</p>
<!-- more -->
<div id="prepare-the-host-client-and-network" style="scroll-margin-top: 5rem"></div>
<h2>1. Preparation</h2>
<p>| Location | Preparation |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Background GPU and Virtual Display Troubleshooting</title>
      <link>https://blog.checo.cc/en/posts/Windows/6.html</link>
      <guid>https://blog.checo.cc/en/posts/Windows/6.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Background GPU and Virtual Display Troubleshooting</source>
      <description>Find background Windows applications keeping the GPU active, and check session tracking before disabling a RustDesk virtual display.</description>
      <category>Windows</category>
      <category>macOS</category>
      <pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="tracking-background-gpu-activity-and-an-unused-virtual-display" style="scroll-margin-top: 5rem"></div>
<p>After remote use, an apparently idle Windows desktop may still have a background application waking the discrete GPU, while a Mac virtual ultrawide display remains enabled. These are separate systems and require separate evidence.</p>
<p>On Windows, identify background load with process-level GPU counters before changing graphics preferences. On the Mac, confirm that every RustDesk session has ended before disabling a virtual display. The following checks address each side separately.</p>
<!-- more -->
<div id="device-0-does-not-establish-zero-engine-activity" style="scroll-margin-top: 5rem"></div>
<h2>1. GPU metrics</h2>
<p>Task Manager engines and NVIDIA SMI device utilization, power, and P-state have different semantics. Do not add 3D, Copy, and Video Encode percentages into a device total. Short rendering activity and a 0% device sample can occur in different windows. <a href="https://devblogs.microsoft.com/directx/gpus-in-the-task-manager/" target="_blank" rel="noopener noreferrer">Task Manager GPU metrics</a></p>
<p>Fix external displays, power source, MUX/hybrid mode, application windows, and monitoring polling. Align engine/device timestamps before closing a candidate. Do not simultaneously switch GPU mode, update drivers, and disable displays.</p>
<p>| State | Recorded observations | Supported interpretation |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Local Speech Recognition for Hermes Agent: From whisper.cpp to SenseVoice</title>
      <link>https://blog.checo.cc/en/posts/AI/10.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/10.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Local Speech Recognition for Hermes Agent: From whisper.cpp to SenseVoice</source>
      <description>The complete evolution of local speech recognition for Hermes Agent: from whisper.cpp and CT-Punc to Paraformer and SenseVoice, with OpenAI-compatible APIs, Nginx routing, config precedence, and IT-term correction.</description>
      <category>AI</category>
      <category>DevOps</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Hermes Agent's language model and speech recognition are independent pipelines. MiMo can continue to understand, reason, and answer, while a LAN ASR service converts recordings to text before MiMo sees them.</p>
<p>The first deployment used <code>whisper.cpp + CT-Punc</code>. After Paraformer and SenseVoice A/B testing, SenseVoice became the current Hermes backend, while Paraformer remains available for explicit terminology correction and rollback.</p>
<!-- more -->
<div id="final-architecture" style="scroll-margin-top: 5rem"></div>
<h2>1. Final architecture</h2>
<p>Addresses and container IDs are generalized; the example ASR host is <code>192.168.100.50</code>:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Hermes Agent</span></span>
<span class="line"><span>  stt.provider = openai</span></span>
<span class="line"><span>  base_url = http://192.168.100.50:8080/v1/sensevoice</span></span>
<span class="line"><span>                  │</span></span>
<span class="line"><span>                  ▼</span></span>
<span class="line"><span>             Nginx :8080</span></span>
<span class="line"><span>              ├─ /v1/sensevoice/ → SenseVoice :8085 (current)</span></span>
<span class="line"><span>              └─ /v1/paraformer/ → Paraformer :8084 (fallback/testing)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Both services bind only to container localhost and implement an OpenAI-style endpoint:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>POST /v1/audio/transcriptions</span></span>
<span class="line"><span>Content-Type: multipart/form-data</span></span>
<span class="line"><span>Response: {"text":"transcript"}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Hermes can therefore keep its built-in <code>openai</code> STT provider; no transcription client patch is required.</p>
<div id="why-move-beyond-whisper-cpp" style="scroll-margin-top: 5rem"></div>
<h2>2. Why move beyond whisper.cpp</h2>
<p>The first pipeline was:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Hermes → Nginx → whisper.cpp (Vulkan) → CT-Punc proxy</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p><code>whisper.cpp</code> was straightforward, quantized, and accelerated by the AMD iGPU. Chinese homophones, punctuation, and mixed Chinese/English IT terminology still required additional processing.</p>
<p>Two FunASR backends were then deployed:</p>
<p>| Backend | Strength | Role |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>English Regression After SenseVoice Fine-Tuning</title>
      <link>https://blog.checo.cc/en/posts/AI/11.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/11.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">English Regression After SenseVoice Fine-Tuning</source>
      <description>Investigate English regression after Chinese SenseVoice fine-tuning, compare checkpoints and weight interpolation, and evaluate with consistent CER.</description>
      <category>AI</category>
      <pubDate>Thu, 20 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<div id="fine-tuning-sensevoice-improved-chinese-but-made-english-worse" style="scroll-margin-top: 5rem"></div>
<p>The goal was a small ASR model that handled IT vocabulary and Mandarin-English speech better. Three-stage fine-tuning improved Chinese results but produced truncated or empty English technical-speech outputs. Before increasing epochs, I evaluated every checkpoint and tried interpolation with the base weights.</p>
<p>On the current 1,700-item test set, a 50/50 mixture reduced overall CER from 13.36% to 11.62%, with both Chinese and English below baseline. It remains a <strong>candidate</strong>, without independent IT-term acceptance or a completed model release.</p>
<!-- more -->
<div id="planned-numbers-versus-delivered-data" style="scroll-margin-top: 5rem"></div>
<h2>1. Training data</h2>
<p>The initial plan proposed LoRA, 72 hours of audio, and 12,000 terms. The actual run used supervised fine-tuning with a smaller dataset and vocabulary. Interpret its results against the training procedure and data that were actually used.</p>
<p>The actual procedure used FunASR supervised fine-tuning on a recorded Beijing-region g5.xlarge with an A10G:</p>
<p>| Split | Items | Duration | Human / synthetic |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Why SSM Agent Does Not Immediately Pick Up a Newly Attached IAM Role</title>
      <link>https://blog.checo.cc/en/posts/AWS/34.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/34.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Why SSM Agent Does Not Immediately Pick Up a Newly Attached IAM Role</source>
      <description>Why an EC2 instance may take 25–30 minutes to appear in SSM after attaching an IAM role, explained through IMDS propagation, credential refresh, backoff, and cache behavior.</description>
      <category>AWS</category>
      <category>Linux</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>After attaching an instance profile with <code>AmazonSSMManagedInstanceCore</code> to a running EC2 instance, the instance may still be absent from Systems Manager. It might recover after a service restart—or on its own almost half an hour later.</p>
<p>This is often the combined result of control-plane propagation, credential lifetime scheduling, and authentication backoff rather than an incorrect IAM policy.</p>
<!-- more -->
<div id="four-sources-of-delay" style="scroll-margin-top: 5rem"></div>
<h2>1. Four sources of delay</h2>
<div id="instance-profile-propagation-to-imds" style="scroll-margin-top: 5rem"></div>
<h3>1.1 Instance profile propagation to IMDS</h3>
<p>After <code>AssociateIamInstanceProfile</code>, the role must become visible through the instance metadata service. Until IMDS returns the role name, restarting the agent cannot produce usable credentials.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">TOKEN</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">$(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -sS</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -X</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> PUT</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  -H</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'X-aws-ec2-metadata-token-ttl-seconds: 21600'</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  http://169.254.169.254/latest/api/token</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -sS</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -H</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "X-aws-ec2-metadata-token: </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$TOKEN</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  http://169.254.169.254/latest/meta-data/iam/security-credentials/</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="refresh-at-the-credential-half-life" style="scroll-margin-top: 5rem"></div>
<h3>1.2 Refresh at the credential half-life</h3>
<p>The SSM Agent credential refresher schedules renewal around 50% of the current credential lifetime. Core treats instance-role credentials as valid for at least one hour, so the normal refresh point can be about 30 minutes later. A console-side role change does not automatically wake a process holding valid old credentials.</p>
<div id="long-backoff-after-accessdenied" style="scroll-margin-top: 5rem"></div>
<h3>1.3 Long backoff after AccessDenied</h3>
<p>If both the instance-profile path and Default Host Management credentials fail, authentication/authorization errors use a long sleep. In the agent source, <code>getLongSleepDuration()</code> waits about 25 minutes plus up to five minutes of jitter.</p>
<p>Even if IAM becomes correct seconds later, a sleeping process does not retry early.</p>
<div id="runtime-and-process-caches" style="scroll-margin-top: 5rem"></div>
<h3>1.4 Runtime and process caches</h3>
<p>The agent stores credential runtime state in <code>identity_config.json</code>, and some identity information is cached in memory. Removing the runtime credential cache can trigger a refresh; restarting the service rebuilds the complete process state.</p>
<div id="read-the-log-before-changing-configuration" style="scroll-margin-top: 5rem"></div>
<h2>2. Read the log before changing configuration</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -iE</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  'CredentialRefresher|credential|rotation|Sleeping|RemoteRetrieve|AccessDenied'</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  /var/log/amazon/ssm/amazon-ssm-agent.log</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">tail</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -50</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>| Log text | Meaning |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>EC2 Windows GPU: Install NVIDIA GRID and Publish CloudWatch Metrics</title>
      <link>https://blog.checo.cc/en/posts/AWS/35.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/35.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">EC2 Windows GPU: Install NVIDIA GRID and Publish CloudWatch Metrics</source>
      <description>Installing the AWS NVIDIA GRID driver on EC2 Windows g4dn/g5 and publishing nvidia-smi metrics to CloudWatch with PowerShell.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A standard Windows Server AMI on g4dn or g5 may initially expose only Microsoft Basic Display Adapter, with no working <code>nvidia-smi</code>. After installing the driver, another gap appears: the Windows CloudWatch Agent cannot use the Linux <code>nvidia_gpu</code> receiver.</p>
<p>This guide connects both steps—installing an AWS GRID driver and publishing parsed <code>nvidia-smi</code> values as custom CloudWatch metrics.</p>
<!-- more -->
<div id="select-and-install-the-driver" style="scroll-margin-top: 5rem"></div>
<h2>1. Select and install the driver</h2>
<p>GRID is appropriate for graphics, remote desktops, video encode, and WDDM workloads. Data Center/Tesla drivers are commonly used for compute/TCC workloads.</p>
<p>List the current files in the AWS public bucket instead of hard-coding a version from an article:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws s3 ls s3:</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">//</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ec2</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">windows</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">nvidia</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">drivers</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">latest</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">no</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">sign</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">request </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">region us</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">east</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Choose the file matching the Windows release:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E5C07B">$ErrorActionPreference</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'Stop'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$driver</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'C:\ProgramData\Amazon\NVIDIA\grid-driver.exe'</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">New-Item</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Split-Path</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $driver</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ItemType Directory </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Out-Null</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws s3 cp `</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  's3://ec2-windows-nvidia-drivers/latest/&#x3C;selected-driver>.exe'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  $driver</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">no</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">sign</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">request </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">region us</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">east</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$p</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Start-Process</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $driver</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">ArgumentList </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'-s -noreboot -noeula'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Wait </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PassThru</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">if</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$p.ExitCode</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -ne</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) { </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">throw</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Driver installer exit code </span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD">$(</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">p.ExitCode</span><span style="--shiki-light:#CA1243;--shiki-dark:#C678DD">)</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> }</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x26; </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">env:ProgramFiles</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">\NVIDIA Corporation\NVSMI\nvidia-smi.exe"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>A reboot may be required. Before a remote reboot, verify that SSM, EC2Launch, or another recovery path is available.</p>
<div id="iam-permission" style="scroll-margin-top: 5rem"></div>
<h2>2. IAM permission</h2>
<p>The instance role needs <code>cloudwatch:PutMetricData</code>. The permission can be constrained to the custom namespace:</p>
<div class="language-json line-numbers-mode" data-highlighter="shiki" data-ext="json" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-json"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  "Version"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"2012-10-17"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  "Statement"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [{</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    "Effect"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Allow"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    "Action"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"cloudwatch:PutMetricData"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    "Resource"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"*"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">    "Condition"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">"StringEquals"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">"cloudwatch:namespace"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Custom/GPU"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  }]</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="collector" style="scroll-margin-top: 5rem"></div>
<h2>3. Collector</h2>
<p>Use IMDSv2 for region and instance dimensions, parse every GPU row, and submit multiple values in one API call per GPU:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E5C07B">$ErrorActionPreference</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'Stop'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$smi</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span><span style="--shiki-light:#50A14F;--shiki-dark:#E06C75">$</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">env:ProgramFiles</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">\NVIDIA Corporation\NVSMI\nvidia-smi.exe"</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$token</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Invoke-RestMethod</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Method Put `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Uri </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'http://169.254.169.254/latest/api/token'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Headers </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">@</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'X-aws-ec2-metadata-token-ttl-seconds'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'21600'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'X-aws-ec2-metadata-token'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$token</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$region</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Invoke-RestMethod</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Headers </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Uri </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'http://169.254.169.254/latest/meta-data/placement/region'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$instanceId</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Invoke-RestMethod</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Headers </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Uri </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'http://169.254.169.254/latest/meta-data/instance-id'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$instanceType</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> Invoke-RestMethod</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Headers </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$h</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Uri </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'http://169.254.169.254/latest/meta-data/instance-type'</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$rows</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x26; </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$smi</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  '--query-gpu=index,utilization.gpu,utilization.memory,memory.total,memory.used,temperature.gpu,power.draw'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  '--format=csv,noheader,nounits'</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">foreach</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$row</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> in</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $rows</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) {</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  $v</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> $row.Split</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">','</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">ForEach-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> { $_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.Trim</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">() }</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  $dims</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'InstanceId'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$instanceId</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'InstanceType'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$instanceType</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Name</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'GPUIndex'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  )</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">  $metrics</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD"> @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'GPUUtilization'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Percent'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'MemoryUtilization'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">2</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Percent'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'MemoryTotal'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">3</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Megabytes'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'MemoryUsed'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">4</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Megabytes'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Temperature'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">5</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'None'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MetricName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'PowerDraw'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Value</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">double</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$v</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">6</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">];</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Unit</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'None'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Dimensions</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$dims</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  )</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  aws cloudwatch put</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">metric</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">data </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">namespace </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Custom/GPU'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">    --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">metric</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">data (</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$metrics</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">ConvertTo-Json</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Depth </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">5</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Compress) `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">    --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">region </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$region</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Save it as <code>C:\ProgramData\Amazon\GPUMetrics\collect.ps1</code> and schedule it once per minute:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$action</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> New-ScheduledTaskAction</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Execute </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'powershell.exe'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Argument `</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  '-NoProfile -ExecutionPolicy Bypass -File "C:\ProgramData\Amazon\GPUMetrics\collect.ps1"'</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$trigger</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> New-ScheduledTaskTrigger</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Once </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">At (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Date</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">).AddMinutes(</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">RepetitionInterval (</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">New-TimeSpan</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Minutes </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$principal</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> =</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> New-ScheduledTaskPrincipal</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">UserId </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'SYSTEM'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">LogonType ServiceAccount </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">RunLevel Highest</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Register-ScheduledTask</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">TaskName </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'GPU-Metrics-Collector'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Action </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$action</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Trigger </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$trigger</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Principal </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$principal</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Force</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="validation-and-alerts" style="scroll-margin-top: 5rem"></div>
<h2>4. Validation and alerts</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-ScheduledTaskInfo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'GPU-Metrics-Collector'</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">aws cloudwatch list</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">metrics </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">--</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">namespace </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Custom/GPU'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> --</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">region </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$region</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Useful alerts include sustained high temperature, prolonged saturation, memory exhaustion, and power unexpectedly dropping to zero. Thresholds must be based on the GPU model and workload baseline.</p>
<p>Common issues:</p>
<ul>
<li>Missing <code>nvidia-smi</code>: driver installation is incomplete or a reboot is pending.</li>
<li>No metrics: inspect IAM, the namespace condition, and <code>LastTaskResult</code>.</li>
<li>Multiple GPUs: parse every CSV row and include <code>GPUIndex</code>.</li>
<li>System proxy: bypass <code>169.254.169.254</code> or both IMDS and SSM may fail.</li>
<li>Custom metrics and API requests incur charges; check current regional pricing.</li>
</ul>
<h2>Summary</h2>
<p>Treat “the driver works” and “the workload is observable” as separate acceptance criteria. Select the current matching GRID package, verify <code>nvidia-smi</code>, then batch custom metric data into CloudWatch for dashboards and alarms across the Windows GPU fleet.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Amazon ENA Deep Dive: Safe Upgrades, Linearization, and DMA Mapping</title>
      <link>https://blog.checo.cc/en/posts/AWS/36.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/36.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Amazon ENA Deep Dive: Safe Upgrades, Linearization, and DMA Mapping</source>
      <description>Understanding the Amazon ENA Linux device lifecycle, safe DKMS upgrades, Tx skb linearization, and DMA mapping failures through source-oriented troubleshooting.</description>
      <category>AWS</category>
      <category>Linux</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>ENA incidents are often reduced to “upgrade the driver and reboot.” Packet loss, Tx failures, or a missing interface after hot replacement require a more precise model of both the PCI device lifecycle and the Linux transmit path.</p>
<p>This guide combines two related topics: upgrading ENA safely and interpreting <code>linearize_failed</code>, <code>dma_mapping_err</code>, and related counters.</p>
<!-- more -->
<div id="device-lifecycle-and-upgrade-risk" style="scroll-margin-top: 5rem"></div>
<h2>1. Device lifecycle and upgrade risk</h2>
<p>After module load, the PCI core matches the ENA device and calls <code>ena_probe()</code>. The driver validates versions, negotiates features, builds queues and interrupts, and registers the netdev.</p>
<p>During removal, <code>ena_remove()</code> reverses that process. <code>rmmod ena</code> therefore dismantles the active network driver; it does not merely replace a file. SSH and SSM may disappear with the primary NIC, so hot replacement requires EC2 Serial Console or another tested recovery channel.</p>
<p>Record a baseline first:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uname</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -r</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">modinfo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ena</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -E</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> '^(version|srcversion|vermagic|filename):'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -S</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> > </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/var/tmp/ena-stats.before</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -details</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> link</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dmesg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -T</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ena</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">tail</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -100</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">test</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "/lib/modules/$(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">uname</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -r</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">)/build"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> || </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">echo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'missing kernel headers'</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>Unknown symbol</code> and <code>Invalid module format</code> usually indicate a module/kernel ABI mismatch rather than broken ENA hardware.</p>
<div id="preferred-upgrade-order" style="scroll-margin-top: 5rem"></div>
<h2>2. Preferred upgrade order</h2>
<p>From lowest to highest operational risk:</p>
<ol>
<li>Upgrade the distribution kernel and its in-tree ENA driver.</li>
<li>Use DKMS to build the module for every target kernel and reboot in a window.</li>
<li>Use <code>rmmod</code>/<code>modprobe</code> hot replacement only with an independent recovery path.</li>
</ol>
<p>After the change:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">modinfo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ena</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -E</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> '^(version|filename|vermagic):'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ip</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> link</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> show</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -S</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -iE</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'reset|timeout|dma|linear|drop|error'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dmesg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -T</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ena</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">tail</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -100</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="skb-linearization" style="scroll-margin-top: 5rem"></div>
<h2>3. skb linearization</h2>
<p>A transmit <code>skb</code> can contain a linear head and multiple fragments. ENA has a finite descriptor budget. If the fragment count exceeds the supported limit, the driver attempts <code>skb_linearize()</code> to combine data into a contiguous buffer.</p>
<p>That operation allocates memory and copies data. Failure becomes more likely under memory pressure, fragmentation, unusual skb layouts, or changed GSO/TSO behavior.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -S</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> linear</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">cat</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /proc/buddyinfo</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">vmstat</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 1</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">slabtop</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -k</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -E</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'scatter-gather|tcp-segmentation|generic-segmentation'</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>A high linearization count without failures is not automatically a fault. A continuously increasing <code>linearize_failed</code> counter indicates that the memory consolidation itself is failing and packets may be dropped.</p>
<p>Do not disable offloads merely to reduce a counter. Run controlled A/B traffic tests; otherwise increased CPU cost may create a different bottleneck.</p>
<div id="dma-mapping-failures" style="scroll-margin-top: 5rem"></div>
<h2>4. DMA mapping failures</h2>
<p>After the skb fits the descriptor limits, every buffer must be mapped to a DMA address accessible by the device. An error from <code>dma_map_single()</code> or <code>dma_map_page()</code> increments <code>dma_mapping_err</code>, and the packet cannot be submitted to the hardware queue.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ethtool</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -S</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> eth0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> dma</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">dmesg</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -T</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -iE</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'dma|swiotlb|iommu|ena'</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> swiotlb</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /proc/meminfo</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> 2></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/dev/null</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> || </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">true</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Potential causes include IOMMU/SWIOTLB exhaustion, kernel defects, and extreme memory pressure. This is not ordinary queue congestion, and simply increasing queue length is unlikely to repair it.</p>
<div id="map-counters-back-to-stages" style="scroll-margin-top: 5rem"></div>
<h2>5. Map counters back to stages</h2>
<p>| Counter or symptom | Stage | First checks |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Safely Upgrading PV, ENA, and NVMe Drivers on EC2 Windows Domain Controllers</title>
      <link>https://blog.checo.cc/en/posts/AWS/37.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/37.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Safely Upgrading PV, ENA, and NVMe Drivers on EC2 Windows Domain Controllers</source>
      <description>A safe process for upgrading PV, ENA, and NVMe drivers on EC2 Windows domain controllers, including FSMO transfer, DSRM, System State, staged changes, and recovery.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Mon, 17 Aug 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Moving an older Windows Server domain controller from an early EC2 virtualization stack to Nitro may require PV, ENA, and NVMe driver work. Unlike an ordinary member server, a DC also carries AD DS, SYSVOL, FSMO, DSRM, and System State recovery requirements.</p>
<p>The following process assumes two domain controllers. Hostnames, volumes, and regions are examples; validate the exact Windows version, instance generation, and current AWS packages before execution.</p>
<!-- more -->
<div id="change-principles" style="scroll-margin-top: 5rem"></div>
<h2>1. Change principles</h2>
<ul>
<li>Change one DC at a time and keep the other healthy.</li>
<li>Move FSMO roles away from the DC under maintenance.</li>
<li>Validate AD, DNS, SYSVOL, and replication before touching drivers.</li>
<li>Preinstall ENA/NVMe support before moving to Nitro.</li>
<li>Keep AMI/EBS snapshots and System State, but do not treat a snapshot as the only AD recovery plan.</li>
<li>Confirm the DSRM password and an offline/serial recovery path.</li>
</ul>
<div id="health-checks" style="scroll-margin-top: 5rem"></div>
<h2>2. Health checks</h2>
<p>Run on both DCs:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dcdiag </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">e </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">c </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">f:C:\Temp\dcdiag</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">before.txt</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">repadmin </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">replsummary</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">repadmin </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">showrepl </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">*</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> /</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">csv > C:\Temp\repl</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">before.csv</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net share</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Confirm <code>SYSVOL</code> and <code>NETLOGON</code> shares and resolve existing AD DS, DNS, DFSR, storage, or event-log errors before the maintenance window.</p>
<p>Record drivers and platform details:</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-CimInstance</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_ComputerSystem | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Manufacturer,Model</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-CimInstance</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_PnPSignedDriver |</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">  Where-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {$_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.DeviceName</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -match</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'Amazon|ENA|NVMe|Xen'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">} |</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">  Select-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> DeviceName,DriverVersion,DriverDate</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="transfer-fsmo-and-verify-dsrm" style="scroll-margin-top: 5rem"></div>
<h2>3. Transfer FSMO and verify DSRM</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Move-ADDirectoryServerOperationMasterRole</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> `</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">  -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Identity </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'DC2'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">OperationMasterRole </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">2</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">3</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">4</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">netdom query fsmo</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Confirm or reset the local DSRM password through <code>ntdsutil</code>. DSRM uses a local recovery account, not necessarily the domain-administrator password. Store it in the approved secrets process, never in scripts or plaintext change notes.</p>
<div id="backups" style="scroll-margin-top: 5rem"></div>
<h2>4. Backups</h2>
<p>Prepare at least three layers:</p>
<ol>
<li>An EC2 AMI or snapshots of all related EBS volumes.</li>
<li>A Windows Server Backup System State copy.</li>
<li>A verified healthy, writable peer domain controller.</li>
</ol>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">wbadmin start systemstatebackup </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">backuptarget:E: </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">quiet</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">wbadmin get versions </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">backuptarget:E:</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>AD restore still has VM-Generation ID and supported-recovery constraints. Do not clone a snapshot and bring two identical domain-controller identities online.</p>
<div id="prepare-target-drivers" style="scroll-margin-top: 5rem"></div>
<h2>5. Prepare target drivers</h2>
<p>Use official AWS distribution locations, verify signatures and hashes, and test the same packages on a clone of the production OS. ENA and NVMe can be staged before the platform move so Windows can discover the network and boot volume on Nitro.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">pnputil </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">enum</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">drivers | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Select-String</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Pattern </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'Amazon|ENA|NVMe'</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Context </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">0</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">5</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-PnpDevice</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PresentOnly | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Where-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Status </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-ne</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'OK'</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>PV component upgrade/removal may require DSRM when legacy Xen components or filter drivers are involved. Never remove the active storage driver without a confirmed recovery route.</p>
<div id="staged-sequence" style="scroll-margin-top: 5rem"></div>
<h2>6. Staged sequence</h2>
<p>For the first DC:</p>
<ol>
<li>Verify FSMO has moved.</li>
<li>Verify replication, DNS, and SYSVOL.</li>
<li>Create System State and EC2 backups.</li>
<li>Preinstall ENA/NVMe.</li>
<li>Upgrade PV components according to the supported procedure.</li>
<li>Stop the instance and change the instance family/platform.</li>
<li>Boot and validate storage, network, time, and AD.</li>
<li>Observe stability before touching the second DC.</li>
</ol>
<p>Only repeat the process for the second DC after the first has fully rejoined and replication is healthy.</p>
<div id="post-boot-acceptance" style="scroll-margin-top: 5rem"></div>
<h2>7. Post-boot acceptance</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-Disk</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-NetAdapter</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-NetIPConfiguration</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-PnpDevice</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> -</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">PresentOnly | </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Where-Object</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Status </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-ne</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> 'OK'</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dcdiag </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">test:dns </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">v</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">repadmin </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">replsummary</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">repadmin </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">syncall </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">AdeP</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">nltest </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dsregdns</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">net share</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Also validate SSM/CloudWatch, Windows time, business ports, event logs, and stability after another reboot. “The installer succeeded” is not acceptance for a domain controller.</p>
<div id="recovery-paths" style="scroll-margin-top: 5rem"></div>
<h2>8. Recovery paths</h2>
<p>If DSRM works, roll back the recent driver/component, inspect SetupAPI/System/Directory Service logs, and verify boot/storage/network drivers before returning one DC to normal mode.</p>
<p>If Windows does not boot, stop repeated attempts, attach a copy of the root volume to a rescue instance in the same Availability Zone, preserve evidence, and repair drivers or the registry offline. Restore from the pre-change image when appropriate while following supported AD virtualization recovery rules.</p>
<p>If Windows boots but ENA does not, use Serial Console or offline repair and verify that the target driver is in Driver Store. Loss of RDP does not by itself mean AD data is corrupt.</p>
<h2>Summary</h2>
<p>The essential control is reducing the failure domain: transfer FSMO, change one DC at a time, pre-stage target drivers, retain layered backups, and validate every layer. Once PV/ENA/NVMe work is embedded in the AD recovery design, a failed driver or platform change has a defined and testable return path.</p>
]]></content:encoded>
    </item>
    <item>
      <title>An eval() engine enabled by default: code execution in gray-matter front matter (CVE-2026-78847)</title>
      <link>https://blog.checo.cc/en/posts/Security/1.html</link>
      <guid>https://blog.checo.cc/en/posts/Security/1.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">An eval() engine enabled by default: code execution in gray-matter front matter (CVE-2026-78847)</source>
      <description>gray-matter ships a JavaScript front matter engine built on eval(): any document starting with ---js executes arbitrary code, and passing the language option does not stop it. Includes a verified PoC, mitigations that actually work, and the CVE-2026-78847 disclosure.</description>
      <category>Security</category>
      <pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>gray-matter is the most widely used front matter parser in the npm ecosystem, with 6.8 million weekly downloads. Inside <code>lib/engines.js</code> it registers a JavaScript engine implemented with <code>eval()</code>. If a Markdown document starts with `</p>
]]></content:encoded>
    </item>
    <item>
      <title>Shrinking EC2 Windows EBS Root and Data Volumes Safely</title>
      <link>https://blog.checo.cc/en/posts/AWS/ec2-windows-ebs-shrink.html</link>
      <guid>https://blog.checo.cc/en/posts/AWS/ec2-windows-ebs-shrink.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Shrinking EC2 Windows EBS Root and Data Volumes Safely</source>
      <description>EBS volumes cannot be shrunk directly. This guide covers online data-volume migration, cold cloning of a Windows root volume, bcdboot boot repair, and NTFS permission validation.</description>
      <category>AWS</category>
      <category>Windows</category>
      <pubDate>Fri, 17 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Amazon EBS supports increasing a volume size, but it does not support shrinking one directly. For a data volume, create a smaller volume and copy the files to it. A Windows root volume, or a data volume containing continuously written files such as SQL Server databases, should be handled offline after stopping the instance.</p>
<p>This example uses Windows Server 2012 R2. The original root and data volumes are both 100 GB gp3 volumes, and the target size is 50 GB each.</p>
<p>Create an AMI before starting, test the procedure in a non-production environment, and schedule the root-volume migration during a maintenance window. Stopping an instance can lose instance-store data and an automatically assigned public IP address (an Elastic IP is not affected).</p>
<!-- more -->
<p>AWS documentation: <a href="https://docs.amazonaws.cn/ebs/latest/userguide/ebs-modify-volume.html#elastic-volumes-limitations" target="_blank" rel="noopener noreferrer">EBS volume modification limitations</a></p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160042887.png" alt="Disk Management before migration" tabindex="0" loading="lazy"><figcaption>Disk Management before migration</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160436450.png" alt="C drive admin-only test file" tabindex="0" loading="lazy"><figcaption>C drive admin-only test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160534971.png" alt="C drive everyone-read test file" tabindex="0" loading="lazy"><figcaption>C drive everyone-read test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160042880.png" alt="D drive admin-only test file" tabindex="0" loading="lazy"><figcaption>D drive admin-only test file</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717160328481.png" alt="D drive everyone-read test file" tabindex="0" loading="lazy"><figcaption>D drive everyone-read test file</figcaption></figure>
<h2>1. Migrate the data volume (D: to a new 50 GB volume)</h2>
<p>The data volume can be copied online, without downtime.</p>
<div id="_1-create-and-attach-the-new-ebs-volume" style="scroll-margin-top: 5rem"></div>
<h3>1.1 Create and attach the new EBS volume</h3>
<p>Create a 50 GB EBS volume in the same Availability Zone as the instance and attach it. In Windows Disk Management, bring it online, initialize it with the same partition style as the source (MBR or GPT), create a simple NTFS volume, and assign drive letter <code>E:</code>.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165313509.png" alt="Initialize the new data volume" tabindex="0" loading="lazy"><figcaption>Initialize the new data volume</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165358388.png" alt="New volume initialized as E:" tabindex="0" loading="lazy"><figcaption>New volume initialized as E:</figcaption></figure>
<div id="_2-copy-the-data-with-robocopy" style="scroll-margin-top: 5rem"></div>
<h3>1.2 Copy the data with robocopy</h3>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">robocopy D:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> E</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:\ /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">MIR</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">COPYALL</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">R</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">W</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">LOG</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">:C:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">robocopy</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-d.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">log</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><ul>
<li><code>/MIR</code>: mirror the directory tree.</li>
<li><code>/COPYALL</code>: equivalent to <code>/COPY:DATSOU</code>; copies data, attributes, timestamps, NTFS security, owner, and auditing information.</li>
<li><code>/R:1 /W:1</code>: retry once and wait one second.</li>
<li><code>/LOG</code>: write a log for review.</li>
</ul>
<div id="_3-verify-the-data-volume" style="scroll-margin-top: 5rem"></div>
<h3>1.3 Verify the data volume</h3>
<p>Check the log, permissions, and sample files:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">type C:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">robocopy</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-d.</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">log</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">findstr</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">i</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "FAILED"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">icacls E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">\*</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">dir E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">type E:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">PermTest</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">admin</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-only.txt</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Confirm that the copy completed without failed files and that representative NTFS permissions match the source volume.</p>
<div id="_4-swap-the-drive-letter-online" style="scroll-margin-top: 5rem"></div>
<h3>1.4 Swap the drive letter online</h3>
<p>In Disk Management, change the original <code>D:</code> volume to a temporary letter such as <code>X:</code>, then change the new <code>E:</code> volume to <code>D:</code>. Verify that applications can access <code>D:</code> normally.</p>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WmiObject</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_LogicalDisk </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">-</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">Filter </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"DeviceID='D:'"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | Select Size, FreeSpace</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Keep the original volume offline until validation is complete. Then detach it from EC2 and delete it only after confirming that the new volume is healthy.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717165913224.png" alt="Change the drive letter" tabindex="0" loading="lazy"><figcaption>Change the drive letter</figcaption></figure>
<h2>2. Migrate the system volume (C: to a new 50 GB volume)</h2>
<p>System files are locked while Windows is running, so the root volume must be cloned offline from a helper instance.</p>
<div id="_1-record-the-original-instance-information" style="scroll-margin-top: 5rem"></div>
<h3>2.1 Record the original instance information</h3>
<p>Record the original instance Availability Zone, instance ID, root volume ID, root device name, and partition style before making changes.</p>
<div id="_2-prepare-the-helper-instance" style="scroll-margin-top: 5rem"></div>
<h3>2.2 Prepare the helper instance</h3>
<p>Launch a Windows Server helper instance in the same Availability Zone and install DiskGenius (the free edition is sufficient): <a href="https://www.diskgenius.cn/download/downloadURL.php?Name=DG_64" target="_blank" rel="noopener noreferrer">DiskGenius download</a>.</p>
<div id="_3-stop-the-original-instance-and-detach-the-root-volume" style="scroll-margin-top: 5rem"></div>
<h3>2.3 Stop the original instance and detach the root volume</h3>
<p>Stop the original instance, wait for the <code>Stopped</code> state, and detach its root volume.</p>
<div id="_4-create-a-new-50-gb-volume" style="scroll-margin-top: 5rem"></div>
<h3>2.4 Create a new 50 GB volume</h3>
<p>Create a new 50 GB gp3 volume in the same Availability Zone as the helper and original instances.</p>
<div id="_5-attach-the-original-and-new-volumes-to-the-helper" style="scroll-margin-top: 5rem"></div>
<h3>2.5 Attach the original and new volumes to the helper</h3>
<p>Attach both the original 100 GB root volume and the empty 50 GB volume to the helper instance. In Disk Management, bring the original volume online but cancel the initialization wizard for the new volume. Do not format or partition the target; DiskGenius will write the cloned disk layout.</p>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174240967.png" alt="Two volumes attached to the helper instance" tabindex="0" loading="lazy"><figcaption>Two volumes attached to the helper instance</figcaption></figure>
<div id="_6-clone-the-disk-with-diskgenius" style="scroll-margin-top: 5rem"></div>
<h3>2.6 Clone the disk with DiskGenius</h3>
<ol>
<li>Confirm that the helper system disk, the original root disk (including System Reserved and <code>C:</code>), and the empty target disk are visible.</li>
<li>Choose <strong>Tools → Clone Disk</strong>.</li>
<li>Select the original root disk as the source and the 50 GB volume as the target.</li>
<li>Because the target is smaller, choose <strong>Copy files</strong> rather than sector-by-sector or filesystem-structure cloning.</li>
<li>Adjust the partition boundaries if DiskGenius allocates excessive space to System Reserved. Leave enough space for the Windows partition.</li>
<li>Start the task and choose <strong>Execute after locking</strong>.</li>
</ol>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174304647.png" alt="DiskGenius main window" tabindex="0" loading="lazy"><figcaption>DiskGenius main window</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174504656.png" alt="Select the source disk" tabindex="0" loading="lazy"><figcaption>Select the source disk</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174521885.png" alt="Select the target disk" tabindex="0" loading="lazy"><figcaption>Select the target disk</figcaption></figure>
<figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717174843108.png" alt="Execute after locking" tabindex="0" loading="lazy"><figcaption>Execute after locking</figcaption></figure>
<div id="_7-rebuild-the-boot-files" style="scroll-margin-top: 5rem"></div>
<h3>2.7 Rebuild the boot files</h3>
<p>After file-level cloning, the disk signature changes and the BCD partition references may be invalid. Windows can then fail with <code>0xc0000225 winload.exe</code>. Bring the new volume online and assign drive letters in Disk Management.</p>
<p>If the disk has a System Reserved partition (for example <code>F:</code>) and the Windows partition is <code>G:</code>, run:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdboot G:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Windows</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">s</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> F: /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">f</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> BIOS</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">l</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> en</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">us</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If there is only one partition (<code>G:</code>), run:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">bcdboot G:\</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">Windows</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">s</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> G: /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">f</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> BIOS</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> /</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">l</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> en</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">-</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">us</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Confirm that the command reports that the boot files were successfully created. Then mark the boot partition active. Replace the disk and partition numbers with the values shown by <code>list disk</code> and <code>list partition</code>:</p>
<div class="language-cmd line-numbers-mode" data-highlighter="shiki" data-ext="cmd" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-cmd"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">diskpart</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">list disk</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">select</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> disk </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">2</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">list partition</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">select</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> partition </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">active</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">exit</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><figure><img src="/assets/posts/ec2-windows-ebs-shrink/file-20260717185122474.png" alt="New volume online after cloning" tabindex="0" loading="lazy"><figcaption>New volume online after cloning</figcaption></figure>
<div id="_8-attach-the-new-volume-as-the-original-instance-root" style="scroll-margin-top: 5rem"></div>
<h3>2.8 Attach the new volume as the original instance root</h3>
<p>Detach both volumes from the helper instance. Attach the 50 GB clone to the original instance as <code>/dev/sda1</code>, the root-device position.</p>
<div id="_9-start-the-original-instance-and-verify" style="scroll-margin-top: 5rem"></div>
<h3>2.9 Start the original instance and verify</h3>
<p>Start the instance. Connect over RDP and confirm that Windows boots normally and that the system disk is the expected size.</p>
<h2>3. Final validation</h2>
<div class="language-powershell line-numbers-mode" data-highlighter="shiki" data-ext="powershell" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-powershell"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">Get-WmiObject</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> Win32_LogicalDisk |</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  Select DeviceID,</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">N</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'SizeGB'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">E</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">math</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]::Round($_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.Size</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">GB</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)}},</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    @</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">N</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">'FreeGB'</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">;</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">E</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">{[</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">math</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">]::Round($_</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">.FreeSpace</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">GB</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">1</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)}}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">systeminfo | findstr </span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">i </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"boot"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="are-ntfs-permissions-preserved" style="scroll-margin-top: 5rem"></div>
<h2>4. Are NTFS permissions preserved?</h2>
<ul>
<li><strong>Data volume:</strong> <code>/COPYALL</code> preserves DACL, SACL, owner, and auditing data. Compare the result with <code>icacls</code>.</li>
<li><strong>Root volume:</strong> DiskGenius copies the NTFS file system, including permission metadata in <code>$MFT</code> and <code>$Secure</code>.</li>
</ul>
<p>No additional permission migration tool is required. Always verify representative administrator-only and everyone-read files before deleting the original volumes.</p>
<h2>References</h2>
<ol>
<li><a href="https://docs.amazonaws.cn/ebs/latest/userguide/ebs-modify-volume.html#elastic-volumes-limitations" target="_blank" rel="noopener noreferrer">AWS EBS volume modification limitations</a></li>
<li><a href="https://docs.amazonaws.cn/AWSEC2/latest/WindowsGuide/ebs-detaching-volume.html" target="_blank" rel="noopener noreferrer">AWS detaching an EBS volume</a></li>
<li><a href="https://diskgenius.com/manual/clone-disk.php" target="_blank" rel="noopener noreferrer">DiskGenius Clone Disk</a></li>
<li><a href="https://blog.csdn.net/lpwmm/article/details/159769397" target="_blank" rel="noopener noreferrer">EC2 Windows EBS volume shrinking in practice (CSDN)</a></li>
</ol>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/posts/ec2-windows-ebs-shrink/file-20260717160042887.png" type="image/png"/>
    </item>
    <item>
      <title>VPS Benchmark Script Collection</title>
      <link>https://blog.checo.cc/en/posts/VPS/3.html</link>
      <guid>https://blog.checo.cc/en/posts/VPS/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">VPS Benchmark Script Collection</source>
      <description>A practical VPS benchmarking index covering CPU, disk, network, streaming access, IP reputation, and return routes, with safety notes for remote scripts.</description>
      <category>VPS</category>
      <category>DevOps</category>
      <pubDate>Fri, 26 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Run a baseline after buying a VPS before deciding whether it is suitable for hosting, proxying, storage, or production services. This index groups the most useful tools by test target.</p>
<!-- more -->
<div id="one-shot-benchmarks" style="scroll-margin-top: 5rem"></div>
<h2>1. One-shot benchmarks</h2>
<div id="nodequality" style="scroll-margin-top: 5rem"></div>
<h3>1.1 NodeQuality</h3>
<p>NodeQuality is the simplest all-in-one option. It covers CPU, disk, network, IP quality, streaming access, and route information:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/xykt/NodeQuality/main/NodeQuality.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><div id="yabs-bench-sh-and-superbench" style="scroll-margin-top: 5rem"></div>
<h3>1.2 YABS, <a href="http://bench.sh" target="_blank" rel="noopener noreferrer">bench.sh</a>, and SuperBench</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> yabs.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wget</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -qO-</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> bench.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">wget</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -qO-</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/spiritLHLS/superbench/main/superbench.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>These scripts run several tests at once and may write heavily to disk. Avoid business hours on production hosts.</p>
<div id="component-tests" style="scroll-margin-top: 5rem"></div>
<h2>2. Component tests</h2>
<div id="cpu" style="scroll-margin-top: 5rem"></div>
<h3>2.1 CPU</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Run the official Linux CLI after downloading Geekbench</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./geekbench6</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># UnixBench</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> clone</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://github.com/kdlucas/byte-unixbench.git</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">cd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> byte-unixbench/UnixBench</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x26;&#x26; </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">make</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x26;&#x26; </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./Run</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="disk" style="scroll-margin-top: 5rem"></div>
<h3>2.2 Disk</h3>
<p><code>fio</code> is better suited than <code>dd</code> for comparing IOPS and queue depth. Do not run long random-write tests directly against a production disk.</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sudo</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> apt</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> install</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -y</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fio</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">fio</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --name=randread</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --filename=/tmp/fio.test</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --size=1G</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --bs=4k</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2"> \</span></span>
<span class="line"><span style="--shiki-light:#986801;--shiki-dark:#D19A66">  --rw=randread</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --ioengine=libaio</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --direct=1</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --runtime=60</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --time_based</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="network-streaming-and-ip-quality" style="scroll-margin-top: 5rem"></div>
<h3>2.3 Network, streaming, and IP quality</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">speedtest</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/i-abc/speed-test/main/speedtest.sh)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">iperf3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -c</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">server_i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">p> </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">-t</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 30</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> &#x3C;(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/xykt/IPQuality/main/ip.sh)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="return-routes" style="scroll-margin-top: 5rem"></div>
<h3>2.4 Return routes</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -fsSL</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">sh</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> nxtrace.org/nt/install.sh</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">bash</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">nexttrace</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> &#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">target_i</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">p></span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="recommended-workflow" style="scroll-margin-top: 5rem"></div>
<h2>3. Recommended workflow</h2>
<p>Start with NodeQuality, then repeat with YABS, IPQuality, a streaming check, and backtrace when needed. Record the instance type, region, test time, disk type, and network limits so results remain comparable.</p>
<div id="safety-notes" style="scroll-margin-top: 5rem"></div>
<h2>4. Safety notes</h2>
<ul>
<li>Read remote scripts before running them; do not blindly use <code>curl | bash</code> on production hosts.</li>
<li>Disk tests can create substantial writes. Use a temporary file, never a business data path.</li>
<li>Public iperf3 servers are variable; treat their results as approximate.</li>
<li>Do not publish public IPs, complete routes, or secrets with benchmark logs.</li>
<li>Old <code>bash.icu</code>, <code>ilemonra.in</code>, and <code>check.unlock.moe</code> links are no longer reliable; use project repositories.</li>
</ul>
<p>| Target | Recommended tools |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>VPS Backup Design: Database Dumps + rsync</title>
      <link>https://blog.checo.cc/en/posts/VPS/4.html</link>
      <guid>https://blog.checo.cc/en/posts/VPS/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">VPS Backup Design: Database Dumps + rsync</source>
      <description>A VPS backup design combining MySQL/PostgreSQL logical dumps with rsync synchronization, scheduled jobs, retention, and recovery verification.</description>
      <category>VPS</category>
      <category>DevOps</category>
      <pubDate>Wed, 08 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Synchronizing container directories alone is not a complete backup. Databases need consistent logical exports, while configuration, certificates, and attachments are good candidates for incremental <code>rsync</code> synchronization.</p>
<!-- more -->
<div id="layers" style="scroll-margin-top: 5rem"></div>
<h2>1. Layers</h2>
<p>| Layer | Method | Contents |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Updating Hermes Desktop from a Fork</title>
      <link>https://blog.checo.cc/en/posts/AI/8.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/8.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Updating Hermes Desktop from a Fork</source>
      <description>Update a source-installed Hermes Desktop fork from upstream main when no new release exists, using fetch, rebase, dependency installation, and doctor checks.</description>
      <category>AI</category>
      <category>Developer Tools</category>
      <pubDate>Wed, 01 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Hermes Desktop updates from GitHub release tags, not every new commit on upstream <code>main</code>. When a fork needs to test newer code early, synchronize the source checkout manually.</p>
<!-- more -->
<h2>Confirm the situation</h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">cd</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/hermes-agent</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> log</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --oneline</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -1</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> describe</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --tags</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --always</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> remote</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -v</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Compare the latest release with upstream <code>main</code>. If the release is unchanged but <code>main</code> moved forward, automatic updating is behaving as designed.</p>
<h2>Workflow</h2>
<div id="_1-back-up-configuration-and-inspect-the-workspace" style="scroll-margin-top: 5rem"></div>
<h3>Back up configuration and inspect the workspace</h3>
<p>Back up configuration and inspect local changes:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">cp</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/config.yaml</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> ~/.hermes/config.yaml.bak.</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">$(</span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">date</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> +%Y%m%d_%H%M%S</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> status</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --short</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Handle local changes first. Generated build output should not be edited or committed manually; commit valuable source changes to your own branch before synchronizing.</p>
<div id="_2-fetch-upstream" style="scroll-margin-top: 5rem"></div>
<h3>Fetch upstream</h3>
<p>Fetch the official repository, not just your fork:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> fetch</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p><code>origin</code> normally points to your fork, while <code>upstream</code> points to the official repository. Running only <code>git pull origin main</code> may leave you on outdated fork code.</p>
<div id="_3-merge-or-rebase" style="scroll-margin-top: 5rem"></div>
<h3>Merge or rebase</h3>
<p>If the fork has no additional commits:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> merge</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream/main</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --ff-only</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>If the fork has its own commits, rebase instead:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> rebase</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> upstream/main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Resolve conflicts, stage the files, and run <code>git rebase --continue</code>.</p>
<div id="_4-update-the-virtual-environment-and-verify" style="scroll-margin-top: 5rem"></div>
<h3>Update the virtual environment and verify</h3>
<p>Install the editable package and verify it:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/pip3</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> install</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> .</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/python3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -m</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> hermes_cli.main</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --version</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">./venv/bin/python3</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -m</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> hermes_cli.main</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> doctor</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Restart Hermes Desktop after the checks pass; an already-running process will not load the new source automatically.</p>
<h2>Key conclusions</h2>
<ul>
<li>No new release means no automatic desktop update; that is expected.</li>
<li><code>fetch upstream</code> plus merge/rebase is the core fork-sync workflow.</li>
<li>User configuration, skills, and sessions are separate from the source checkout, but should still be backed up.</li>
<li>Extra commits may appear in <code>git describe</code> while the release version remains unchanged.</li>
<li>Pin a known-good commit and keep a rollback point; <code>git reflog</code> can recover the pre-rebase state.</li>
</ul>
]]></content:encoded>
    </item>
    <item>
      <title>Codex CLI Sandboxing: Seatbelt, Bubblewrap, Landlock, and Docker</title>
      <link>https://blog.checo.cc/en/posts/AI/9.html</link>
      <guid>https://blog.checo.cc/en/posts/AI/9.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Codex CLI Sandboxing: Seatbelt, Bubblewrap, Landlock, and Docker</source>
      <description>A source-oriented explanation of Codex CLI sandboxing across macOS Seatbelt, Linux Bubblewrap/Landlock/seccomp, Windows Restricted Token, and Docker Desktop.</description>
      <category>AI</category>
      <category>Security Research</category>
      <pubDate>Mon, 13 Jul 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Codex CLI's <code>read-only</code>, <code>workspace-write</code>, and <code>danger-full-access</code> modes are policy settings. The actual isolation is enforced by platform backends. This article connects the source-level view with the common macOS and Linux sandbox primitives.</p>
<!-- more -->
<div id="architecture" style="scroll-margin-top: 5rem"></div>
<h2>1. Architecture</h2>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Command request</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Approval policy</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Sandbox type</span></span>
<span class="line"><span>  ↓</span></span>
<span class="line"><span>Seatbelt / Bubblewrap + seccomp / Restricted Token</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Approval answers whether an action needs confirmation; sandboxing limits what an approved process can touch.</p>
<div id="macos-seatbelt" style="scroll-margin-top: 5rem"></div>
<h2>2. macOS Seatbelt</h2>
<p>The macOS backend loads an SBPL profile through <code>sandbox-exec</code>. A profile starts from denied capabilities and adds exceptions for the workspace, temporary directories, interpreters, and network policy.</p>
<ul>
<li><code>read-only</code> does not allow workspace writes.</li>
<li><code>workspace-write</code> opens the workspace and explicit <code>writable_roots</code>.</li>
<li>Network access is a separate policy; write access does not imply network access.</li>
<li>Child processes generally inherit the process restriction.</li>
</ul>
<div id="linux-backends" style="scroll-margin-top: 5rem"></div>
<h2>3. Linux backends</h2>
<p>Bubblewrap builds the process filesystem view with read-only system mounts and writable workspace bindings. seccomp-BPF filters system calls; it is not a path permission system. Landlock provides path-oriented kernel access control and can restrict opening, writing, executing, and deleting files, subject to kernel support.</p>
<p><code>no_new_privs</code> prevents setuid and file capabilities from granting additional privilege and is an important companion to seccomp and Landlock.</p>
<div id="windows-restricted-token" style="scroll-margin-top: 5rem"></div>
<h2>4. Windows Restricted Token</h2>
<p>The Windows backend uses a Restricted Token together with system ACLs and child-process rules. It does not map one-to-one to macOS profiles or Linux namespaces, so it should not be understood only as a directory read/write model.</p>
<div id="how-it-differs-from-docker" style="scroll-margin-top: 5rem"></div>
<h2>5. How it differs from Docker</h2>
<p>Docker Desktop on macOS normally runs Linux containers inside a Linux VM provided by Apple Virtualization.framework. Container isolation happens inside that VM and is a different layer from Seatbelt restrictions applied to a host process.</p>
<p>| Mechanism | Main boundary | Typical capability |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Cloudflare Cache Rules Configuration and Hit Verification</title>
      <link>https://blog.checo.cc/en/posts/DevOps/3.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Cloudflare Cache Rules Configuration and Hit Verification</source>
      <description>The blog is proxied through Cloudflare to a GitHub Pages origin. Configure a Cache Rule to cache build artifacts, images, icons, and fonts at the edge to speed up delivery and reduce origin fetches.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Fri, 05 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>The blog domain is proxied through Cloudflare with GitHub Pages as the origin. To improve static asset delivery and reduce redundant origin fetches, a Cache Rule was configured in the Cloudflare Dashboard to cache build artifacts, images, icons, and fonts at the edge.</p>
<!-- more -->
<div id="configuration-location" style="scroll-margin-top: 5rem"></div>
<h2>1. Configuration Location</h2>
<p>Cloudflare Dashboard path:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Caching -> Cache Rules</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><div id="design-strategy" style="scroll-margin-top: 5rem"></div>
<h2>2. Design Strategy</h2>
<p>The goal is <strong>not</strong> to cache the entire site HTML. Instead, prioritize caching long-lived static resources like CSS, JS, images, and favicon. VuePress build assets typically include content hashes, making them ideal for long Edge TTLs. HTML pages are left uncached to avoid stale content after updates.</p>
<div id="final-rule" style="scroll-margin-top: 5rem"></div>
<h2>3. Final Rule</h2>
<p>Match expression:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>(http.host eq "blog.example.com" and</span></span>
<span class="line"><span> (starts_with(http.request.uri.path, "/assets/") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".css") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".js") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".mjs") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".png") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".jpg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".jpeg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".gif") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".webp") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".svg") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".ico") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".woff") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".woff2") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".ttf") or</span></span>
<span class="line"><span>  ends_with(http.request.uri.path, ".otf")))</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Rule action:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Eligible for cache</span></span>
<span class="line"><span>Edge TTL: Ignore cache-control header and use this TTL</span></span>
<span class="line"><span>TTL: 1 month</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>Browser TTL is not overridden separately to avoid prolonged browser caching that could complicate debugging after updates.</p>
<div id="issue-matches-regex-not-available" style="scroll-margin-top: 5rem"></div>
<h2>4. Issue: <code>matches</code> Regex Not Available</h2>
<p>Initially used a regex expression:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>http.request.uri.path matches "^/(assets/|.*\\.(css|js|mjs|png|jpg|jpeg|gif|webp|svg|ico|woff2?|ttf|otf)$)"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Deployment failed with:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>not entitled: the use of operator Matches is not allowed,</span></span>
<span class="line"><span>a Business plan or a WAF Advanced plan is required</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>The Cloudflare Free plan doesn't support the <code>matches</code> regex operator. The fix was to decompose the regex into a combination of <code>starts_with</code> and <code>ends_with</code> functions, which are available on all plans.</p>
<div id="verification" style="scroll-margin-top: 5rem"></div>
<h2>5. Verification</h2>
<p>Check cache hit via response headers:</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -I</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://blog.example.com/favicon.ico</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>First request:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>cf-cache-status: REVALIDATED</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Second request:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>cf-cache-status: HIT</span></span>
<span class="line"><span>age: 9</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p><code>HIT</code> means the request was served from a Cloudflare edge cache. <code>age</code> is the number of seconds the cached object has lived on the edge node.</p>
<div id="monitoring-cache-hit-rate" style="scroll-margin-top: 5rem"></div>
<h2>6. Monitoring Cache Hit Rate</h2>
<p>View overall metrics in the Cloudflare Dashboard:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Caching -> Overview</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Key metrics:</p>
<ul>
<li>Cache Analytics</li>
<li>Cache hit ratio</li>
<li>Requests by cache status</li>
<li>Bandwidth saved</li>
</ul>
<p>Filter by hostname for blog-specific traffic:</p>
<div class="language-text line-numbers-mode" data-highlighter="shiki" data-ext="text" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-text"><span class="line"><span>Domain -> Analytics -> HTTP Traffic -> Filter by hostname</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><div id="future-considerations" style="scroll-margin-top: 5rem"></div>
<h2>7. Future Considerations</h2>
<p>The current rule can be kept long-term. If HTML caching is desired later, consider:</p>
<ul>
<li>Refresh delay after homepage/article updates</li>
<li>Automatic Cloudflare Cache Purge after GitHub Actions deployment</li>
<li>Shorter TTL for <code>text/html</code> responses</li>
<li>Priority ordering between Cache Rules and Page Rules</li>
</ul>
<p>For now, static-only caching is the safer approach.</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating VuePress Blog to Cloudflare Pages with Blue-Green Deployment</title>
      <link>https://blog.checo.cc/en/posts/DevOps/4.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Migrating VuePress Blog to Cloudflare Pages with Blue-Green Deployment</source>
      <description>Migrate the blog from GitHub Pages to Cloudflare Pages using a blue-green deployment strategy. Eliminate the middle layer for faster edge delivery, with CI/CD config and zero-downtime DNS switch.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Tue, 23 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>The blog was originally hosted on GitHub Pages, accessed through Cloudflare CDN. This migration moves build output directly to Cloudflare Pages, eliminating the GitHub Pages middle layer for faster edge delivery and better cache control. A blue-green deployment strategy ensures zero-downtime migration.</p>
<!-- more -->
<div id="project-info" style="scroll-margin-top: 5rem"></div>
<h2>1. Project Info</h2>
<p>| Item | Value |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Three VuePress slimsearch Search Box Fixes</title>
      <link>https://blog.checo.cc/en/posts/DevOps/5.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Three VuePress slimsearch Search Box Fixes</source>
      <description>Switch the blog search from default search to the slimsearch plugin, trim the number of search results, and fix accidental Enter-key navigation with a Pinyin IME. Root cause, fix, and verification for each.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>This round I did three things to the blog search box: switched from the default <code>search: true</code> to the slimsearch plugin, reined in the number of search results, and fixed an accidental navigation on Enter with a Pinyin IME. Below is each issue, its root cause, the fix, and the pitfalls I hit.</p>
<!-- more -->
<p>The stack is VuePress 2 rc.30 + vuepress-theme-hope rc.107 + <code>@vuepress/plugin-slimsearch@2.0.0-rc.130</code> + slimsearch 2.3.0, bilingual (zh-CN at <code>/</code>, en-US at <code>/en/</code>).</p>
<h2>1. customFields formatter crash (split is not a function)</h2>
<div id="symptom" style="scroll-margin-top: 5rem"></div>
<h3>1.1 Symptom</h3>
<p>After enabling slimsearch with <code>customFields</code> (categories/tags), searching threw this in the console:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>n[f.value].split is not a function</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>No results came back at all.</p>
<div id="root-cause" style="scroll-margin-top: 5rem"></div>
<h3>1.2 Root cause</h3>
<p><code>@vuepress/plugin-slimsearch</code> merges the <code>customFields</code> <code>formatter</code> with the default locale on the node side via <code>getFullLocaleConfig</code> / <code>deepAssign</code>. When you write it as an object:</p>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">formatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  "/"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">  "/en/"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><code>deepAssign</code> treats this <strong>string</strong> as an enumerable object and iterates it, so each character index becomes a key and the value becomes a single character. <code>&quot;Category: $content&quot;</code> ends up mangled into <code>{0:&quot;C&quot;, 1:&quot;a&quot;, ...}</code>. The client then calls <code>.split(&quot;$content&quot;)</code> on it and throws <code>split is not a function</code>.</p>
<p>This is not a config mistake; it's a bug in how the plugin + <code>@vuepress/helper</code> locale merge handles <strong>string values</strong>.</p>
<div id="fix" style="scroll-margin-top: 5rem"></div>
<h3>1.3 Fix</h3>
<p>In <code>theme.ts</code>, replace <code>search: true</code> with an explicit slimsearch config and write the formatter as an <strong>explicit string</strong> object (to bypass the mangled merge path):</p>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">slimsearch</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  indexContent</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">true</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">// changed to false later, see section 3</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  customFields</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: [</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">      getter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">=></span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B"> page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">frontmatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E06C75">category</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      formatter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/en/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Category: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    {</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">      getter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> (</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">) </span><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">=></span><span style="--shiki-light:#383A42;--shiki-dark:#E5C07B"> page</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E5C07B">frontmatter</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">.</span><span style="--shiki-light:#C18401;--shiki-dark:#E06C75">tag</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">      formatter</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> {</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Tag: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">        "/en/"</span><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">:</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "Tag: $content"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">,</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">      },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">    },</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">  ],</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">},</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The formatter is a <code>Record&lt;string,string&gt;</code> (locale -&gt; string); <code>$content</code> is replaced with the getter's return value. The client <code>SearchResult</code> component picks the string for the current routeLocale, then <code>split(&quot;$content&quot;)</code> to stitch the prefix and suffix.</p>
<div id="verification" style="scroll-margin-top: 5rem"></div>
<h3>1.4 Verification</h3>
<p>Searching <code>certificate</code> / <code>DevOps</code> on the English site works, the customField shows &quot;Tag: ...&quot; / &quot;Category: ...&quot;, no console error.</p>
<h2>2. Too many search results</h2>
<div id="symptom-1" style="scroll-margin-top: 5rem"></div>
<h3>2.1 Symptom</h3>
<p>A single query returned a flood: <code>the</code> -&gt; 31 pages / 438 lines, <code>certificate</code> -&gt; 3 pages / 35 lines.</p>
<div id="root-cause-1" style="scroll-margin-top: 5rem"></div>
<h3>2.2 Root cause</h3>
<p><code>indexContent: true</code> indexes the <strong>entire body</strong>. The slimsearch <code>SearchResult</code> component lists <strong>all matching paragraphs</strong> for each hit page, and the render loop <code>n.map(...)</code> in the source has no cap. So every paragraph containing the word gets rendered.</p>
<p>theme-hope passes through <code>SlimSearchPluginOptions</code> directly and <strong>does not expose</strong> <code>combineWith</code> / per-page hit cap / prefix / fuzzy, the native slimsearch options (<code>SlimSearchPluginOptions</code> only has <code>indexContent</code>/<code>sortStrategy</code>/<code>indexOptions</code>(tokenize/processTerm)/<code>customFields</code>/<code>filter</code>, etc.). There's no middle ground of &quot;searchable body but few results&quot;.</p>
<div id="fix-1" style="scroll-margin-top: 5rem"></div>
<h3>2.3 Fix</h3>
<div class="language-ts line-numbers-mode" data-highlighter="shiki" data-ext="ts" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-ts"><span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">slimsearch</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: {</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#E06C75">  indexContent</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">: </span><span style="--shiki-light:#986801;--shiki-dark:#D19A66">false</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">, </span><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">// only index title, headings, excerpt, categories/tags</span></span>
<span class="line"><span style="--shiki-light:#0184BC;--shiki-dark:#ABB2BF">  ...</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="measured-comparison-english-en" style="scroll-margin-top: 5rem"></div>
<h3>2.4 Measured comparison (English /en/)</h3>
<p>| Query | <code>indexContent:true</code> | <code>indexContent:false</code> |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Migrating Yuque Notes to Local Markdown</title>
      <link>https://blog.checo.cc/en/posts/DevOps/6.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/6.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Migrating Yuque Notes to Local Markdown</source>
      <description>Use yuque-dl to bulk-export hundreds of Yuque documents with images to local Markdown, integrate with an Obsidian knowledge base, and contribute a batch-download-all feature back via a PR.</description>
      <category>DevOps</category>
      <category>Blog</category>
      <pubDate>Thu, 25 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>For data safety, offline access, and integration with a local knowledge base, I needed to bulk-export Yuque notes to local Markdown. I ended up using <code>yuque-dl</code> to pull hundreds of documents plus images in one pass, and along the way contributed a &quot;download all knowledge bases at once&quot; feature back to the tool via a PR.</p>
<!-- more -->
<div id="background" style="scroll-margin-top: 5rem"></div>
<h2>1. Background</h2>
<p>Yuque is Alibaba's online knowledge-management tool, with notes stored in the cloud. My Yuque workspace held 27 private knowledge bases and 360+ documents, all of which needed to be exported as local Markdown.</p>
<div id="comparing-options" style="scroll-margin-top: 5rem"></div>
<h2>2. Comparing options</h2>
<p>| Option | Tool | Best for | Pros | Cons |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>RustDesk Remote Connection Failure — Disabling UDP Investigation and Fix</title>
      <link>https://blog.checo.cc/en/posts/Mac/3.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/3.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">RustDesk Remote Connection Failure — Disabling UDP Investigation and Fix</source>
      <description>RustDesk remote desktop server on a Mac mini fails or times out while the process runs normally. As the only remote access method, this means total loss of access. Full troubleshooting from port to config.</description>
      <category>macOS</category>
      <category>DevOps</category>
      <pubDate>Fri, 19 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A Mac mini runs RustDesk as a remote desktop server with a self-hosted ID/relay server. When connecting remotely from outside, the connection failed or timed out, while the RustDesk process was running locally. Since RustDesk was the only remote access method (no SSH, no other remote desktop), this was equivalent to a complete loss of remote access — a high-priority incident.</p>
<!-- more -->
<div id="investigation" style="scroll-margin-top: 5rem"></div>
<h2>1. Investigation</h2>
<div id="_1-confirm-rustdesk-process-status" style="scroll-margin-top: 5rem"></div>
<h3>1.1 Confirm RustDesk Process Status</h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">pgrep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -x</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> RustDesk</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Outputs PID — RustDesk is running</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>Process is healthy, ruling out crashes or startup failures.</p>
<div id="_2-locate-configuration-files" style="scroll-margin-top: 5rem"></div>
<h3>1.2 Locate Configuration Files</h3>
<p>RustDesk config directory on macOS:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>~/Library/Preferences/com.carriez.RustDesk/</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><p>Key files:</p>
<p>| File | Purpose |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>macOS SMB Auto-Reconnect: Never Lose Shared Mounts After Sleep/Network Drop</title>
      <link>https://blog.checo.cc/en/posts/Mac/4.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/4.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">macOS SMB Auto-Reconnect: Never Lose Shared Mounts After Sleep/Network Drop</source>
      <description>SMB-mounted Windows PC drives and NAS on a Mac mini silently drop after sleep/reboot/disconnect and never auto-recover. Implement auto-reconnect via LaunchAgent and a reconnect script, no manual remounting needed.</description>
      <category>macOS</category>
      <category>Automation</category>
      <pubDate>Mon, 22 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>A Mac mini mounts Windows PC drives (C/D/E) and a NAS via SMB. The core pain point: after macOS sleep, reboot, or network disconnection, SMB mounts drop silently and never auto-recover — requiring manual Finder reconnection every time. This article documents a complete auto-reconnect solution.</p>
<!-- more -->
<div id="why-the-old-approach-failed" style="scroll-margin-top: 5rem"></div>
<h2>1. Why the Old Approach Failed</h2>
<p>Two separate LaunchAgents existed, each managing different mounts, with these problems:</p>
<ol>
<li><strong>RunAtLoad only fires once</strong> — doesn't re-trigger after sleep wake</li>
<li><strong>No network state detection</strong> — can't sense network recovery</li>
<li><strong>No retry mechanism</strong> — runs before network is ready, fails silently</li>
</ol>
<div id="new-architecture" style="scroll-margin-top: 5rem"></div>
<h2>2. New Architecture</h2>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>┌─────────────────────────────────────────────────┐</span></span>
<span class="line"><span>│  com.checo.smb-auto (LaunchAgent)               │</span></span>
<span class="line"><span>│  KeepAlive=true → auto-restart on crash         │</span></span>
<span class="line"><span>│  RunAtLoad=true → start on login                │</span></span>
<span class="line"><span>└──────────────┬──────────────────────────────────┘</span></span>
<span class="line"><span>               │</span></span>
<span class="line"><span>    ┌──────────▼──────────┐</span></span>
<span class="line"><span>    │  smb-watcher.sh     │  Background daemon</span></span>
<span class="line"><span>    │  (always running)   │</span></span>
<span class="line"><span>    │                     │</span></span>
<span class="line"><span>    │  Gateway Ping       │  Check every 2 min</span></span>
<span class="line"><span>    │  offline→online     │  Trigger --force remount</span></span>
<span class="line"><span>    │                     │</span></span>
<span class="line"><span>    │  Mount Integrity    │  Missing→auto-remount</span></span>
<span class="line"><span>    └──────────┬──────────┘</span></span>
<span class="line"><span>               │ calls</span></span>
<span class="line"><span>    ┌──────────▼──────────┐</span></span>
<span class="line"><span>    │  smb-mount.sh       │  Unified mount script</span></span>
<span class="line"><span>    │  (supports --force) │</span></span>
<span class="line"><span>    └─────────────────────┘</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><div id="implementation-details" style="scroll-margin-top: 5rem"></div>
<h2>3. Implementation Details</h2>
<div id="_1-unified-mount-script-bin-smb-mount-sh" style="scroll-margin-top: 5rem"></div>
<h3>3.1 Unified Mount Script <code>~/bin/smb-mount.sh</code></h3>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">#!/bin/bash</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Unified SMB auto-mount script</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Usage: smb-mount.sh [--force]</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">FORCE</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">0</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">[[ </span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2"> ==</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "--force"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> ]] &#x26;&#x26; </span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">FORCE</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">1</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Share definition table: IP|user|password|share|display_name</span></span>
<span class="line"><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">SHARES</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">(</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|C|Win-C"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|D|Win-D"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|administrator|PASSWORD|E|Win-E"</span></span>
<span class="line"><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">    "192.168.x.x|NAS_USER|NAS_PASS|share|NAS"</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">)</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p><strong>Mount detection key function:</strong></p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">is_mounted</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">() {</span></span>
<span class="line"><span style="--shiki-light:#A626A4;--shiki-dark:#C678DD">    local</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> ip</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$1</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75"> share</span><span style="--shiki-light:#383A42;--shiki-dark:#56B6C2">=</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span><span style="--shiki-light:#383A42;--shiki-light-font-style:inherit;--shiki-dark:#E06C75;--shiki-dark-font-style:italic">$2</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">    # macOS mount output: //user@IP/share on /Volumes/...</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic">    # ⚠️ Must use //.*@IP pattern due to username prefix</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">    mount</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "smbfs"</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF"> | </span><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">grep</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -q</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "//.*@</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$ip</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/</span><span style="--shiki-light:#E45649;--shiki-dark:#E06C75">$share</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "</span></span>
<span class="line"><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">}</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><blockquote>
<p><strong>Gotcha:</strong> macOS <code>mount</code> output for SMB includes a username prefix: <code>//administrator@192.168.x.x/C on /Volumes/...</code>. Using <code>//192.168.x.x/C</code> as a pattern will always return false.</p>
</blockquote>
<p><strong>Mount method — osascript (Finder way):</strong></p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">osascript</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -e</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "tell application </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">Finder</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> to mount volume </span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">smb://user:pass@IP/share</span><span style="--shiki-light:#0184BC;--shiki-dark:#56B6C2">\"</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">"</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><blockquote>
<p><strong>Why not <code>mount -t smbfs</code>?</strong> <code>mount_smbfs</code> requires root. Sudo-mounted volumes belong to root, causing Permission denied for regular users. osascript mounts via Finder with correct permissions.</p>
</blockquote>
<p><strong>Finder mount path naming convention:</strong></p>
<p>| Mount Order | Path |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Planet Coaster Mac Crash Fix: Missing steam_appid.txt</title>
      <link>https://blog.checo.cc/en/posts/Mac/5.html</link>
      <guid>https://blog.checo.cc/en/posts/Mac/5.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Planet Coaster Mac Crash Fix: Missing steam_appid.txt</source>
      <description>Planet Coaster crashes on launch via Rosetta 2 on Apple Silicon. Root cause is not a compatibility issue but a missing steam_appid.txt causing SteamAPI initialization to fail.</description>
      <category>macOS</category>
      <category>Gaming</category>
      <pubDate>Sun, 14 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<p>Running Planet Coaster on an Apple Silicon Mac via Rosetta 2 crashed on launch. The root cause was not a Rosetta compatibility issue, but a missing <code>steam_appid.txt</code> in the game directory causing SteamAPI initialization to fail.</p>
<!-- more -->
<div id="crash-symptom" style="scroll-margin-top: 5rem"></div>
<h2>1. Crash Symptom</h2>
<p>The game crashed immediately on launch. Crash report:</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code"><code class="language-"><span class="line"><span>Exception Type: EXC_BAD_INSTRUCTION (SIGILL)</span></span>
<span class="line"><span>Code Type: X86-64 (Translated)</span></span>
<span class="line"><span>Triggered by Thread: 8 Main</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>The crash occurred during main-thread initialization, with Lua-related strings appearing in registers.</p>
<div id="environment-check" style="scroll-margin-top: 5rem"></div>
<h2>2. Environment Check</h2>
<p>| Item | Result |<br>
|</p>
]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting iStoreOS IPv6 in NDP Relay Mode</title>
      <link>https://blog.checo.cc/en/posts/DevOps/7.html</link>
      <guid>https://blog.checo.cc/en/posts/DevOps/7.html</guid>
      <source url="https://blog.checo.cc/en/rss.xml">Troubleshooting iStoreOS IPv6 in NDP Relay Mode</source>
      <description>A Mac has an IPv6 address but cannot ping public IPv6. Layer-by-layer investigation traces it to iStoreOS&amp;apos;s unstable NDP Relay mode. Flipping one OpenWrt config line from relay to server fixes it.</description>
      <category>Networking</category>
      <pubDate>Sun, 28 Jun 2026 00:00:00 GMT</pubDate>
      <content:encoded><![CDATA[
<figure><img src="/assets/images/posts/istoreos-ipv6-topology-gpt-image-2.png" alt="IPv6 NDP Relay troubleshooting and server-mode fix topology" tabindex="0" loading="lazy"><figcaption>IPv6 NDP Relay troubleshooting and server-mode fix topology</figcaption></figure>
<p>The Mac had an IPv6 address but couldn't ping any public IPv6 address. It had always worked, then one day it just stopped, and rebooting the router didn't help. It turned out to be iStoreOS's unstable NDP Relay mode — flipping one line of config from relay to server fixed it. This post walks through the full layer-by-layer investigation down to the root cause.</p>
<!-- more -->
<p>Public IPv6 addresses are masked. Subnet IDs 8e0 and 8e1 remain to distinguish WAN and LAN. Replace xxxx with the actual address before running commands; link-local addresses such as fe80::1 are unchanged.</p>
<div id="environment" style="scroll-margin-top: 5rem"></div>
<h2>1. Environment</h2>
<p>| Item | Value |<br>
|</p>
]]></content:encoded>
      <enclosure url="https://blog.checo.cc/assets/images/posts/istoreos-ipv6-topology-gpt-image-2.png" type="image/png"/>
    </item>
  </channel>
</rss>