2025-08-05 13:24:21

This commit is contained in:
swangnice
2025-08-05 13:24:21 +08:00
parent 64eed4e7ce
commit 8a920994bf
268 changed files with 8347 additions and 15561 deletions

View File

@@ -104,9 +104,19 @@ sudo systemsetup -setdisplaysleep 10 # display will sleep in 10 min
<description>&lt;p&gt;Install dependence of gitea:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew install git
brew install gitea
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Start the configuration page of Gitea:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;gitea web
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Install MySQL:&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 class=&#34;relative group&#34;&gt;The database
&lt;div id=&#34;the-database&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#the-database&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Install MySQL:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;brew install mysql
brew services start mysql
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Login MySQL and create the database and user:&lt;/p&gt;
@@ -116,10 +126,105 @@ brew services start mysql
CREATE USER &amp;#39;gitea&amp;#39;@&amp;#39;localhost&amp;#39; IDENTIFIED BY &amp;#39;&amp;lt;yourpassword&amp;gt;&amp;#39;;
GRANT ALL PRIVILEGES ON gitea.* TO &amp;#39;gitea&amp;#39;@&amp;#39;localhost&amp;#39;;
FLUSH PRIVILEGES;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
CREATE USER &amp;lsquo;gitea&amp;rsquo;@&amp;rsquo;localhost&amp;rsquo; IDENTIFIED BY &amp;lsquo;gitea&amp;rsquo;;
GRANT ALL PRIVILEGES ON gitea.* TO &amp;lsquo;gitea&amp;rsquo;@&amp;rsquo;localhost&amp;rsquo;;
FLUSH PRIVILEGES;&lt;/p&gt;</description>
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 class=&#34;relative group&#34;&gt;Config the Gitea
&lt;div id=&#34;config-the-gitea&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#config-the-gitea&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Start the configuration page of Gitea:&lt;/p&gt;</description>
</item>
<item>
<title>MCU Benchmark</title>
<link>http://localhost:1313/projects/self_host/mac_mini_m4/04_mcu_markbench/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/projects/self_host/mac_mini_m4/04_mcu_markbench/</guid>
<description>&lt;a id=&#34;gitea-557b8590fb1ca3d7d5e6d0761887bbe0&#34; target=&#34;_blank&#34; href=&#34;https://code.swangnice.cn/swangnice/mcu-benchmark&#34; class=&#34;cursor-pointer&#34;&gt;
&lt;div
class=&#34;w-full md:w-auto pt-3 p-5 border border-neutral-200 dark:border-neutral-700 border rounded-md shadow-2xl&#34;&gt;
&lt;div class=&#34;flex items-center&#34;&gt;
&lt;span class=&#34;text-2xl text-neutral-800 dark:text-neutral&#34; style=&#34;margin-right:10px;&#34;&gt;
&lt;span class=&#34;relative block icon&#34;&gt;
&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; xml:space=&#34;preserve&#34; viewBox=&#34;5.67 143.05 628.65 387.55&#34;&gt;&lt;path fill=&#34;currentColor&#34; d=&#34;M115.912 143.075c-6.462 0-13.762.525-22.012 2.325-8.7 1.8-33.5 7.4-53.8 26.9C-4.9 212.4 6.6 276.2 8 285.8c1.7 11.7 6.9 44.2 31.7 72.5 45.8 56.1 144.4 54.8 144.4 54.8s12.1 28.9 30.6 55.5c25 33.1 50.7 58.9 75.7 62 63 0 188.9-.1 188.9-.1s12 .1 28.3-10.3c14-8.5 26.5-23.4 26.5-23.4S547 483 565 451.5c5.5-9.7 10.1-19.1 14.1-28 0 0 55.2-117.1 55.2-231.1-1.1-34.5-9.6-40.6-11.6-42.6-4.1-4.1-9.6-4-9.6-4s-117.2 6.6-177.9 8c-13.267.3-26.433.597-39.5.697l.1 117.002s57.4 24.202 83.1 40.102c3.7 2.3 10.2 6.798 12.9 14.398 2.1 6.1 2 13.101-1 19.301l-61 126.9c-6.2 12.7-21.4 18.1-33.9 12l-126.9-61c-12.5-6-17.9-21.2-11.8-33.8l61-126.9c6-12.5 21.2-17.9 33.8-11.8a5290.322 5290.322 0 0 0 27 12.954c0-36.449-.1-109.053-.1-109.053-29 .4-89.2-2.201-89.2-2.201s-141.4-7.1-156.8-8.5c-4.9-.3-10.525-.825-16.988-.825zm12.188 48.026s7.1 59.399 15.7 94.199c7.2 29.2 24.8 77.7 24.8 77.7s-26.1-3.1-43-9.1c-25.9-8.5-36.9-18.7-36.9-18.7S69.6 321.8 60 295.4c-16.5-44.2-1.4-71.2-1.4-71.2s8.4-22.5 38.5-30c13.8-3.7 31-3.1 31-3.1z&#34;/&gt;&lt;path fill=&#34;currentColor&#34; d=&#34;M326.8 380.1c-8.2.1-15.4 5.8-17.3 13.8-1.9 8 2 16.3 9.1 20 7.7 4 17.5 1.8 22.7-5.4 5.1-7.1 4.3-16.9-1.8-23.1l24-49.1c1.5.1 3.7.2 6.2-.5 4.1-.9 7.1-3.6 7.1-3.6 4.2 1.8 8.6 3.8 13.2 6.1 4.8 2.4 9.3 4.9 13.4 7.3.9.5 1.8 1.1 2.8 1.9 1.6 1.3 3.4 3.1 4.7 5.5 1.9 5.5-1.9 14.9-1.9 14.9-2.3 7.6-18.4 40.6-18.4 40.6-8.1-.2-15.3 5-17.7 12.5-2.6 8.1 1.1 17.3 8.9 21.3 7.8 4 17.4 1.7 22.5-5.3 5-6.8 4.6-16.3-1.1-22.6 1.9-3.7 3.7-7.4 5.6-11.3 5-10.4 13.5-30.4 13.5-30.4.9-1.7 5.7-10.3 2.7-21.3-2.5-11.4-12.6-16.7-12.6-16.7-12.2-7.9-29.2-15.2-29.2-15.2s0-4.1-1.1-7.1c-1.1-3.1-2.8-5.1-3.9-6.3 4.7-9.7 9.4-19.3 14.1-29-4.1-2-8.1-4-12.2-6.1-4.8 9.8-9.7 19.7-14.5 29.5-6.7-.1-12.9 3.5-16.1 9.4-3.4 6.3-2.7 14.1 1.9 19.8l-24.6 50.4z&#34;/&gt;&lt;/svg&gt;
&lt;/span&gt;
&lt;/span&gt;
&lt;div
id=&#34;gitea-557b8590fb1ca3d7d5e6d0761887bbe0-full_name&#34;
class=&#34;m-0 font-bold text-xl text-neutral-800 decoration-primary-500 hover:underline hover:underline-offset-2 dark:text-neutral&#34;&gt;
swangnice/mcu-benchmark
&lt;/div&gt;
&lt;/div&gt;
&lt;p id=&#34;gitea-557b8590fb1ca3d7d5e6d0761887bbe0-description&#34; class=&#34;m-0 mt-2 text-md text-neutral-800 dark:text-neutral&#34;&gt;
A markbench of MCUs to help to you choose the right one.
&lt;/p&gt;</description>
</item>
<item>
<title>My Own PDF Shelf: pdfding on Mac Mini</title>
<link>http://localhost:1313/projects/self_host/mac_mini_m4/05_pdf_shelf/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/projects/self_host/mac_mini_m4/05_pdf_shelf/</guid>
<description>&lt;p&gt;PDFding is a self-hosted PDF library management system, which is perfect for managing my personal PDF collection. It allows me to organize, search, and read PDFs directly from my Mac Mini. Later I will list a contents of my PDF library, if you need any of them, just email me. No commercial use, please.&lt;/p&gt;
&lt;h2 class=&#34;relative group&#34;&gt;Install Docker and Prepare Directories
&lt;div id=&#34;install-docker-and-prepare-directories&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#install-docker-and-prepare-directories&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Download &lt;a href=&#34;https://www.docker.com/products/docker-desktop/&#34; target=&#34;_blank&#34;&gt;Docker Desktop&lt;/a&gt;, and install it.&lt;/p&gt;</description>
</item>
<item>
<title>My Own Photo Server: Immich on Mac Mini</title>
<link>http://localhost:1313/projects/self_host/mac_mini_m4/06_photo_server/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/projects/self_host/mac_mini_m4/06_photo_server/</guid>
<description>&lt;p&gt;Immich is a self-hosted photo and video management solution that allows you to organize, share, and access your media files from anywhere. It provides features like automatic backups, facial recognition, and easy sharing options.&lt;/p&gt;
&lt;h2 class=&#34;relative group&#34;&gt;Installation
&lt;div id=&#34;installation&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#installation&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Follow the official &lt;a href=&#34;https://immich.app/docs/overview/quick-start&#34; target=&#34;_blank&#34;&gt;Immich installation guide&lt;/a&gt; for detailed instructions. Below is a quick overview of the steps to get started.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;cd &amp;lt;where you like&amp;gt;
mkdir ./immich-app
cd ./immich-app
wget -O docker-compose.yml https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
wget -O .env https://github.com/immich-app/immich/releases/latest/download/example.env
cp example.env .env
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Edit the &lt;code&gt;.env&lt;/code&gt; file to set your desired configuration options, such as database settings and server URLs. Make sure to set the &lt;code&gt;APP_URL&lt;/code&gt; to your server&amp;rsquo;s URL.&lt;/p&gt;</description>
</item>
@@ -143,42 +248,6 @@ FLUSH PRIVILEGES;&lt;/p&gt;</description>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://localhost:1313/notes/coding/cheat_sheet/cpp/feature.png" />
</item>
<item>
<title>Git</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/git/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/notes/coding/cheat_sheet/git/</guid>
<description>&lt;h2 class=&#34;relative group&#34;&gt;submodule
&lt;div id=&#34;submodule&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#submodule&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;h2 class=&#34;relative group&#34;&gt;Commit
&lt;div id=&#34;commit&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#commit&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Add date and time in commit messages:&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git commit -m &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;date &lt;span class=&#34;s1&#34;&gt;&amp;#39;+%Y-%m-%d %H:%M:%S&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://localhost:1313/notes/coding/cheat_sheet/git/feature.png" />
</item>
<item>
<title>Python</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/python/</link>