Home Page on SWangNice http://localhost:1313/ Recent content in Home Page on SWangNice Hugo -- gohugo.io en © 2025 SWang Fri, 20 Sep 2024 04:17:50 +0000 TODO List http://localhost:1313/projects/self_host/stock_bot/01_todo/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/projects/self_host/stock_bot/01_todo/ <h2 class="relative group">Short-term TODO <div id="short-term-todo" class="anchor"></div> <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"> <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#short-term-todo" aria-label="Anchor">#</a> </span> </h2> <ul> <li>🚧 The Initial Policy implement (Parameterizing transaction variables)</li> <li>⬜️ The evaluate &amp; logger script</li> <li>⬜ The automatic scripts with Email Sender deployed on the Server</li> <li>⬜ Web UI, will not be too complex just a simple one to synchronous my account for customized policy</li> <li>⬜️ Implement RL algorithms</li> </ul> Website Setup http://localhost:1313/projects/self_host/mac_mini_m4/01_website_hosting/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/projects/self_host/mac_mini_m4/01_website_hosting/ <p>I don&rsquo;t have a public IP, so my solution is SSH tunnel + reverse Proxy on cloud server.</p> <h2 class="relative group">🍎Mac Mini Side <div id="mac-mini-side" class="anchor"></div> <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"> <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#mac-mini-side" aria-label="Anchor">#</a> </span> </h2> <p>As a server, my Mac won&rsquo;t sleep, so change the setting firstly.</p> <pre tabindex="0"><code>sudo systemsetup -setcomputersleep Never # never sleep sudo systemsetup -setdisplaysleep 10 # display will sleep in 10 min </code></pre><p>Use autossh to avoid timeout:</p> <pre tabindex="0"><code>brew install autossh </code></pre><p>Add the configuration below in <code>~/.ssh/config</code>, Mac Mini will send package per 30 seconds to keep the connection alive.</p> NAS: Network Attachment Storage http://localhost:1313/projects/self_host/mac_mini_m4/02_nas/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/projects/self_host/mac_mini_m4/02_nas/ <h2 class="relative group">Hardware <div id="hardware" class="anchor"></div> <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"> <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#hardware" aria-label="Anchor">#</a> </span> </h2> <p>I went with the UNITEK 3373BBK for one of my drive enclosures—and honestly, it wasn’t the best decision.</p> <p>The first big letdown? The bandwidth tops out at just 5Gbps. That’s fine for basic tasks, but definitely underwhelming if you’re dealing with high-speed storage or large file transfers.</p> <p>Even worse, it doesn’t support S.M.A.R.T passthrough, which makes monitoring drive health a hassle. That was a big deal-breaker for me.</p> Showcases http://localhost:1313/projects/self_host/stock_bot/02_results/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/projects/self_host/stock_bot/02_results/ <p>This section will feature occasional showcases of my technical achievements—focused purely on the engineering side, not the income.</p> My Own Code Vault: Gitea on Mac Mini http://localhost:1313/projects/self_host/mac_mini_m4/03_gitea/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/projects/self_host/mac_mini_m4/03_gitea/ <p>Install dependence of gitea:</p> <pre tabindex="0"><code>brew install git brew install gitea </code></pre><p>Start the configuration page of Gitea:</p> <pre tabindex="0"><code>gitea web </code></pre><p>Install MySQL:</p> <pre tabindex="0"><code>brew install mysql brew services start mysql </code></pre><p>Login MySQL and create the database and user:</p> <pre tabindex="0"><code>mysql -u root </code></pre><p>Then, execute:</p> <pre tabindex="0"><code>CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER &#39;gitea&#39;@&#39;localhost&#39; IDENTIFIED BY &#39;&lt;yourpassword&gt;&#39;; GRANT ALL PRIVILEGES ON gitea.* TO &#39;gitea&#39;@&#39;localhost&#39;; FLUSH PRIVILEGES; </code></pre><p>CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; CREATE USER &lsquo;gitea&rsquo;@&rsquo;localhost&rsquo; IDENTIFIED BY &lsquo;gitea&rsquo;; GRANT ALL PRIVILEGES ON gitea.* TO &lsquo;gitea&rsquo;@&rsquo;localhost&rsquo;; FLUSH PRIVILEGES;</p> C http://localhost:1313/notes/coding/cheat_sheet/c/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/notes/coding/cheat_sheet/c/ C++ http://localhost:1313/notes/coding/cheat_sheet/cpp/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/notes/coding/cheat_sheet/cpp/ Git http://localhost:1313/notes/coding/cheat_sheet/git/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/notes/coding/cheat_sheet/git/ <h2 class="relative group">submodule <div id="submodule" class="anchor"></div> <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"> <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#submodule" aria-label="Anchor">#</a> </span> </h2> <h2 class="relative group">Commit <div id="commit" class="anchor"></div> <span class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100"> <a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700" style="text-decoration-line: none !important;" href="#commit" aria-label="Anchor">#</a> </span> </h2> <ol> <li>Add date and time in commit messages:</li> </ol> <div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">git commit -m <span class="s2">&#34;</span><span class="k">$(</span>date <span class="s1">&#39;+%Y-%m-%d %H:%M:%S&#39;</span><span class="k">)</span><span class="s2">&#34;</span> </span></span></code></pre></div> Python http://localhost:1313/notes/coding/cheat_sheet/python/ Fri, 20 Sep 2024 04:17:50 +0000 http://localhost:1313/notes/coding/cheat_sheet/python/