Jekyll2025-02-08T08:33:40+00:00https://attawit.me/feed.xmlActivate Windows 10 11 Office 2021 using VLK2023-07-28T00:00:00+00:002023-07-28T00:00:00+00:00https://attawit.me/posts/activate-win-10-11-office-2021<!--more--> <h2 id="activate-windows-10--11">Activate Windows 10 / 11</h2> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>slmgr /ipk &lt;license-key&gt; slmgr /skms &lt;kms.server.host&gt; slmgr /ato </code></pre></div></div> <h2 id="activate-office-2021">Activate Office 2021</h2> <div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>if exist "%ProgramFiles(x86)%" cd /d %ProgramFiles(x86)%\Microsoft Office\Office16 if exist "%ProgramFiles%" cd /d %ProgramFiles%\Microsoft Office\Office16 for /f %x in ('dir /b ..\root\Licenses16\ProPlus2021VL_KMS*.xrm-ms') do cscript ospp.vbs /inslic:"..\root\Licenses16\%x" cscript ospp.vbs /setprt:1688 cscript ospp.vbs /unpkey:6F7TH &gt;nul cscript ospp.vbs /inpkey:&lt;license-key&gt; cscript ospp.vbs /sethst:&lt;kms.server.host&gt; cscript ospp.vbs /act </code></pre></div></div>BackupPC Setup2022-12-31T00:00:00+00:002022-12-31T00:00:00+00:00https://attawit.me/posts/backuppc-setup<!--more--> <h2 id="prerequisites">Prerequisites</h2> <p>Set config as follow:</p> <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$Conf</span><span class="o">{</span>RsyncSshArgs<span class="o">}</span> <span class="o">=</span> <span class="o">[</span> <span class="s1">'-e'</span>, <span class="s1">'$sshPath -l backuppc'</span> <span class="o">]</span><span class="p">;</span> <span class="nv">$Conf</span><span class="o">{</span>RsyncClientPath<span class="o">}</span> <span class="o">=</span> <span class="s1">'sudo /usr/bin/rsync'</span><span class="p">;</span> <span class="nv">$Conf</span><span class="o">{</span>BackupFilesExclude<span class="o">}</span> <span class="o">=</span> <span class="o">{</span> <span class="s1">'*'</span> <span class="o">=&gt;</span> <span class="o">[</span><span class="s1">'/proc'</span><span class="o">]</span> <span class="o">}</span><span class="p">;</span> <span class="nv">$Conf</span><span class="o">{</span>WakeupSchedule<span class="o">}</span> <span class="o">=</span> <span class="o">[</span>23]<span class="p">;</span> <span class="nv">$Conf</span><span class="o">{</span>PingMaxMsec<span class="o">}</span> <span class="o">=</span> 200<span class="p">;</span> </code></pre></div></div> <h2 id="assumption">Assumption</h2> <ul> <li>BackupPC Server Public Key: <code class="highlighter-rouge">ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzk3XD+iMc/jtmhPcYXNWAuOi9DqZba9YYVwkgCXQci backuppc@5c61980493e6</code></li> <li>Client IP: <code class="highlighter-rouge">10.0.2.45</code></li> <li>Rsync dir on Client Machine: <code class="highlighter-rouge">/usr/bin/rsync</code></li> </ul> <h2 id="on-client-machine">On Client Machine</h2> <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">sudo </span>useradd <span class="nt">-d</span> /home/backuppc backuppc <span class="nb">sudo mkdir</span> <span class="nt">-p</span> /home/backuppc/.ssh <span class="nb">sudo chown </span>backuppc:backuppc /home/backuppc/.ssh <span class="nb">sudo chmod </span>700 /home/backuppc/.ssh <span class="nb">sudo touch</span> /home/backuppc/.ssh/authorized_keys <span class="nb">sudo chown </span>backuppc:backuppc /home/backuppc/.ssh/authorized_keys <span class="nb">sudo chmod </span>600 /home/backuppc/.ssh/authorized_keys <span class="nb">echo</span> <span class="s2">"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIBzk3XD+iMc/jtmhPcYXNWAuOi9DqZba9YYVwkgCXQci backuppc@5c61980493e6"</span> | <span class="nb">sudo tee</span> <span class="nt">-a</span> /home/backuppc/.ssh/authorized_keys <span class="nb">sudo </span>visudo <span class="c"># inside visudo</span> backuppc <span class="nv">ALL</span><span class="o">=</span>NOPASSWD: /usr/bin/rsync </code></pre></div></div> <h2 id="on-unraid-machine">On UNRAID Machine</h2> <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>docker <span class="nb">exec</span> <span class="nt">-it</span> backuppc bash <span class="c"># inside docker bash</span> su - backuppc <span class="nt">-s</span> /bin/bash <span class="c"># inside su bash</span> <span class="c"># NOTE: ensure to add known host during this step</span> ssh <span class="nt">-l</span> backuppc 10.0.2.45 <span class="nb">whoami</span> </code></pre></div></div> <h2 id="on-backuppc-webui">On BackupPC WebUI</h2> <p>Add host 10.0.2.45 with user backuppc</p> <h2 id="references">References</h2> <ul> <li><a href="https://wiki.networksecuritytoolkit.org/index.php/HowTo_BackupPC_SSH_Key_Authentication_Setup_For_rsync_Transfer">https://wiki.networksecuritytoolkit.org/index.php/HowTo_BackupPC_SSH_Key_Authentication_Setup_For_rsync_Transfer</a></li> <li><a href="https://www.backupcentral.com/forum/16/255329/setup_of_rsync_via_ssh_with_unprivileged_user_backuppc">https://www.backupcentral.com/forum/16/255329/setup_of_rsync_via_ssh_with_unprivileged_user_backuppc</a></li> </ul>Mac Drain Battery While Asleep2021-10-31T00:00:00+00:002021-10-31T00:00:00+00:00https://attawit.me/posts/mac-drain-battery-while-asleep<!--more--> <p>My macbook is warm and drain battery over the night. So I investigate what happens.</p> <p>It appears that the router cannot keep the Wi-Fi connection alive which causes mac to keep waking up every 2 minutes.</p> <p>I start investigation using <code class="highlighter-rouge">pmset -g log</code> which print out the useful log on sleep and wake events of the mac.</p> <p>Here I found mac tries to wake itself up trying to perform TCP keepalive.</p> <pre><code class="language-log">2021-10-31 11:54:59 +0700 Assertions PID 211(mDNSResponder) Created MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd000083b7 [System: DeclUser kDisp] 2021-10-31 11:54:59 +0700 Assertions PID 211(mDNSResponder) Released MaintenanceWake "mDNSResponder:maintenance" 00:00:00 id:0x0xd000083b7 [System: PrevIdle DeclUser kDisp] 2021-10-31 11:54:59 +0700 Assertions PID 114(apsd) Released ApplePushServiceTask "com.apple.apsd-connectinguser-push.apple.com" 00:01:16 id:0x0xb000083b2 [System: PrevIdle DeclUser kDisp] 2021-10-31 11:55:02 +0700 Assertions PID 84(powerd) Created InternalPreventSleep "PM configd - Wait for Device enumeration" 00:00:00 id:0x0xd000083bf [System: PrevIdle DeclUser kDisp] 2021-10-31 11:55:02 +0700 DarkWake DarkWake from Deep Idle [CDN] : due to EC.ARPT/Maintenance Using BATT (Charge:33%) 69 secs 2021-10-31 11:55:02 +0700 WakeDetails DriverReason:WLC_E_PFN_NET_FOUND - DriverDetails:00020000210000000000000000000000000000003800000000000000000 DriverReason:ARPT - DriverDetails: 2021-10-31 11:55:02 +0700 HibernateStats hibmode=3 standbydelaylow=10800 standbydelayhigh=86400785 2021-10-31 11:55:02 +0700 WakeTime WakeTime: 3.934 sec . . . 2021-10-31 11:57:15 +0700 DarkWake DarkWake from Deep Idle [CDN] : due to EC.RTC/Maintenance Using BATT (Charge:33%) 11 secs 2021-10-31 11:57:15 +0700 HibernateStats hibmode=3 standbydelaylow=10800 standbydelayhigh=86400786 2021-10-31 11:57:15 +0700 WakeTime WakeTime: 1.899 sec </code></pre> <h2 id="the-solutions">The Solutions</h2> <p>There are many options to solve the problem.</p> <ol> <li>replace the router to newer model or</li> <li>simply disable tcpkeepalive <code class="highlighter-rouge">pmset -b tcpkeepalive 0</code> or</li> <li>turn off wifi and bluetooth (yes, bluetooth as well) before put the mac to sleep</li> </ol> <p>One of the solution will work. It just a matter of what solution suits you best. I choose to turn off wifi and bluetooth since I only face this problem when I face the faulty router (not my home router).</p>Secure Debian 10 Installation2020-05-01T00:00:00+00:002020-05-01T00:00:00+00:00https://attawit.me/posts/secure-debian-10-installation<!--more--> <p>This page is a redirect page.</p> <p>Please visit <a href="https://medium.com/@atton16/secure-debian-10-installation-debian-buster-1b26583cc5c6">this link</a> view the content.</p>Kubernetes HA Cluster Setup2020-04-17T00:00:00+00:002020-04-17T00:00:00+00:00https://attawit.me/posts/kubernetes-ha-cluster-setup<!--more--> <p>This page is a redirect page.</p> <p>Please visit <a href="https://satin-cousin-037.notion.site/Kubernetes-HA-Cluster-Setup-Instructions-4299c360b1964d678bf707bf1726f783">this link</a> view the content.</p>Stage of Artificial Intelligence2019-06-07T00:00:00+00:002019-06-07T00:00:00+00:00https://attawit.me/posts/stage-of-artificial-intelligence<!--more--> <p>This page is a redirect page.</p> <p>Please visit <a href="https://docs.google.com/presentation/d/1ObWnnH-GOwCeRzurHwErkkingT55emGJUhRcarfpWE8/edit?usp=sharing">this link</a> view the content.</p>