First commit on Mac Mini server
@@ -3,4 +3,10 @@ title = 'Home Page'
|
||||
draft = false
|
||||
+++
|
||||
|
||||
{{< typeit
|
||||
tag=h3
|
||||
lifeLike=true
|
||||
>}}
|
||||
Welcome to my website! I'm really happy you stopped by.
|
||||
{{< /typeit >}}
|
||||
# This is My Page
|
||||
6
content/en/notes/_index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
+++
|
||||
title = 'Notes'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
Personal notes, may not be readable.
|
||||
7
content/en/notes/coding/_index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
+++
|
||||
title = 'Coding'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
|
||||
7
content/en/notes/coding/cheat_sheet/_index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
+++
|
||||
title = 'Cheat Sheets'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
Here’s a cheat sheet of some programming languages, tools, and libraries that I use often—but somehow always forget.
|
||||
BIN
content/en/notes/coding/cheat_sheet/c/feature.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
5
content/en/notes/coding/cheat_sheet/c/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'C'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/en/notes/coding/cheat_sheet/cpp/feature.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
5
content/en/notes/coding/cheat_sheet/cpp/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'C++'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/en/notes/coding/cheat_sheet/feature.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
content/en/notes/coding/cheat_sheet/git/feature.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
14
content/en/notes/coding/cheat_sheet/git/index.md
Normal file
@@ -0,0 +1,14 @@
|
||||
+++
|
||||
title = 'Git'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
## submodule
|
||||
|
||||
|
||||
## Commit
|
||||
1. Add date and time in commit messages:
|
||||
``` bash
|
||||
git commit -m "$(date '+%Y-%m-%d %H:%M:%S')"
|
||||
```
|
||||
BIN
content/en/notes/coding/cheat_sheet/python/feature.png
Normal file
|
After Width: | Height: | Size: 447 KiB |
5
content/en/notes/coding/cheat_sheet/python/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'Python'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/en/notes/coding/feature.jpg
Normal file
|
After Width: | Height: | Size: 925 KiB |
19
content/en/projects/_index.md
Normal file
@@ -0,0 +1,19 @@
|
||||
+++
|
||||
title = 'Projects'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
This is the Projects page, where I keep track of all my personal and collaborative work.
|
||||
|
||||
I use several tags to describe the status and nature of each project:
|
||||
|
||||
- `Private`/ `Public`: Private projects won’t reveal too many details, but I’ll still document the process, to-do lists, and partial results. For Public projects, I aim to share as much as possible — from design to implementation.
|
||||
|
||||
- `Idea`, `Ongoing`, `Improving`, `Archived`: These tags indicate the current state of a project — whether it’s just a thought, actively being developed, being refined, or no longer maintained.
|
||||
|
||||
- `Original`, `Reproduce`: Original means the project was initiated and designed by me. Reproduce refers to work based on existing ideas, papers, or open-source projects — typically with modifications or improvements.
|
||||
|
||||
- `<Tags with other topic>`: Some projects are interdisciplinary. Additional tags will be added to reflect relevant topics, but each project will be placed under the one category it’s most closely related to.
|
||||
|
||||
|
||||
6
content/en/projects/embedded/_index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
+++
|
||||
title = 'Fancy Things on Boards'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
weight = 90
|
||||
+++
|
||||
BIN
content/en/projects/embedded/feature.png
Normal file
|
After Width: | Height: | Size: 950 KiB |
31
content/en/projects/self_host/_index.md
Normal file
@@ -0,0 +1,31 @@
|
||||
+++
|
||||
title = 'Self-host Projects'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
weight = 90
|
||||
+++
|
||||
|
||||
I’ve recently been exploring the world of self-hosted solutions, and it’s nothing short of amazing. There are some great collections out there that showcase powerful, privacy-respecting tools you can run on your own hardware:
|
||||
- [A collection on GitHub](https://github.com/awesome-selfhosted/awesome-selfhosted)
|
||||
- [selfh.st](https://selfh.st/)
|
||||
|
||||
## ❓ Why Self-Host?
|
||||
|
||||
I enjoy automating tasks and making my life smarter with scripts and small tools. Having control over the services I use, running them on my own hardware, and customizing everything to suit my needs—it’s both empowering and educational.
|
||||
|
||||
|
||||
<!-- ## 🧠 My Home Lab Vision
|
||||
|
||||
I’m currently running some of my own projects on lightweight setups, but I have a bigger plan in mind: a dedicated, used physical server. That will take more time and energy to set up properly, so I’ve decided to gamify the process. -->
|
||||
|
||||
<!-- 🎯 Goal: Once I’ve built 10 great and interesting projects, with at least 3 generating income, I’ll reward myself by setting up a real home lab server.
|
||||
|
||||
Projects:
|
||||
🟩⬜⬜⬜⬜⬜⬜⬜⬜⬜ (1/10)
|
||||
Income Goals:
|
||||
⬜⬜⬜ (0/3) -->
|
||||
|
||||
I’ll use this space to document the projects I build and share what I learn along the way.
|
||||
|
||||
|
||||
## List
|
||||
BIN
content/en/projects/self_host/feature.png
Normal file
|
After Width: | Height: | Size: 967 KiB |
@@ -0,0 +1,81 @@
|
||||
+++
|
||||
title = 'Website Setup'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["My First Server in Room"]
|
||||
series_order = 1
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
I don't have a public IP, so my solution is SSH tunnel + reverse Proxy on cloud server.
|
||||
|
||||
## 🍎Mac Mini Side
|
||||
As a server, my Mac won't sleep, so change the setting firstly.
|
||||
```
|
||||
sudo systemsetup -setcomputersleep Never # never sleep
|
||||
sudo systemsetup -setdisplaysleep 10 # display will sleep in 10 min
|
||||
```
|
||||
|
||||
Use autossh to avoid timeout:
|
||||
```
|
||||
brew install autossh
|
||||
```
|
||||
|
||||
Add the configuration below in `~/.ssh/config`, Mac Mini will send package per 30 seconds to keep the connection alive.
|
||||
```
|
||||
Host <ip address>
|
||||
ServerAliveInterval 30
|
||||
ServerAliveCountMax 5
|
||||
TCPKeepAlive yes
|
||||
```
|
||||
|
||||
Build the connection:
|
||||
```
|
||||
autossh -M 0 -f -N \
|
||||
-i ~/.ssh/id_ed25519 \
|
||||
-o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" \
|
||||
-R 0.0.0.0:9000:localhost:1313 \
|
||||
root@<ip address>
|
||||
```
|
||||
```
|
||||
autossh -M 0 -f -N -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -R 0.0.0.0:9000:localhost:1313 user@<your.server.com>
|
||||
```
|
||||
|
||||
A watchdog script to try reconnection when the network lost(add to LaunchAgent):
|
||||
```
|
||||
#!/bin/bash
|
||||
while true; do
|
||||
ping -c 1 <ip address> > /dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
pkill -f autossh
|
||||
autossh -M 0 -f -N -R 0.0.0.0:9000:localhost:1313 <ip address>
|
||||
fi
|
||||
sleep 60
|
||||
done
|
||||
```
|
||||
|
||||
|
||||
## 💻Server Side
|
||||
Install and config the Nginx, for me the config file in `/etc/nginx/sites-available`:
|
||||
```
|
||||
server {
|
||||
listen 80;
|
||||
server_name www.<your domain> <your domain>;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:9000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
To obtain a security certificate, use the certbot:
|
||||
```
|
||||
sudo apt update
|
||||
sudo apt install certbot python3-certbot-nginx
|
||||
sudo certbot --nginx -d swangnice.cn
|
||||
```
|
||||
|
||||
|
||||
33
content/en/projects/self_host/mac_mini_m4/02_nas.md
Normal file
@@ -0,0 +1,33 @@
|
||||
+++
|
||||
title = 'NAS: Network Attachment Storage'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["My First Server in Room"]
|
||||
series_order = 2
|
||||
weight = 20
|
||||
+++
|
||||
|
||||
## Hardware
|
||||
I went with the UNITEK 3373BBK for one of my drive enclosures—and honestly, it wasn’t the best decision.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Still, none of the other options really fit my expectations either. One day, I might just go all-in and make my own enclosure—design the PCB, write the firmware, the whole deal. Maybe not today… but someday.
|
||||
|
||||
|
||||
```
|
||||
diskutil list
|
||||
```
|
||||
|
||||
Solution: HFS+ + SMB3.0, 客户端设置“延迟加载目录”或“按需索引”
|
||||
|
||||
```diskutil list```
|
||||
|
||||
```
|
||||
sudo smartctl -a /dev/disk2
|
||||
```
|
||||
|
||||
```brew install smartmontools```
|
||||
|
||||
43
content/en/projects/self_host/mac_mini_m4/03_gitea.md
Normal file
@@ -0,0 +1,43 @@
|
||||
+++
|
||||
title = 'My Own Code Vault: Gitea on Mac Mini'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["My First Server in Room"]
|
||||
series_order = 3
|
||||
weight = 30
|
||||
+++
|
||||
|
||||
Install dependence of gitea:
|
||||
```
|
||||
brew install git
|
||||
brew install gitea
|
||||
```
|
||||
|
||||
Start the configuration page of Gitea:
|
||||
```
|
||||
gitea web
|
||||
```
|
||||
|
||||
Install MySQL:
|
||||
```
|
||||
brew install mysql
|
||||
brew services start mysql
|
||||
```
|
||||
|
||||
Login MySQL and create the database and user:
|
||||
```
|
||||
mysql -u root
|
||||
```
|
||||
Then, execute:
|
||||
```
|
||||
CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
CREATE USER 'gitea'@'localhost' IDENTIFIED BY '<yourpassword>';
|
||||
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
```
|
||||
|
||||
|
||||
CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
|
||||
CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'gitea';
|
||||
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost';
|
||||
FLUSH PRIVILEGES;
|
||||
13
content/en/projects/self_host/mac_mini_m4/_index.md
Normal file
@@ -0,0 +1,13 @@
|
||||
+++
|
||||
title = 'My First Server in Room: Mac Mini + SSD Enclosure'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
tags = ["Public", "Ongoing", "Original", "AI"]
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
For my first physical server in my life, I got an Mac Mini with M4 and an HDD enclosure.
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
content/en/projects/self_host/mac_mini_m4/feature.png
Normal file
|
After Width: | Height: | Size: 118 KiB |
15
content/en/projects/self_host/stock_bot/01_todo.md
Normal file
@@ -0,0 +1,15 @@
|
||||
+++
|
||||
title = 'TODO List'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["StockBot"]
|
||||
series_order = 1
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
## Short-term TODO
|
||||
- 🚧 The Initial Policy implement (Parameterizing transaction variables)
|
||||
- ⬜️ The evaluate & logger script
|
||||
- ⬜ The automatic scripts with Email Sender deployed on the Server
|
||||
- ⬜ Web UI, will not be too complex just a simple one to synchronous my account for customized policy
|
||||
- ⬜️ Implement RL algorithms
|
||||
10
content/en/projects/self_host/stock_bot/02_results.md
Normal file
@@ -0,0 +1,10 @@
|
||||
+++
|
||||
title = 'Showcases'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["StockBot"]
|
||||
series_order = 2
|
||||
weight = 20
|
||||
+++
|
||||
|
||||
This section will feature occasional showcases of my technical achievements—focused purely on the engineering side, not the income.
|
||||
20
content/en/projects/self_host/stock_bot/_index.md
Normal file
@@ -0,0 +1,20 @@
|
||||
+++
|
||||
title = 'StockBot'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
tags = ["Private", "Ongoing", "Original", "AI"]
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
This is a bot that assists in making daily index fund trading decisions.
|
||||
|
||||
## Introduction
|
||||
|
||||
This project was inspired by my mother. Over the course of ten years, she watched my father struggle in the stock market. From those hard lessons, she developed her own strategy—one that focuses on the predictable fluctuations in index fund values. Armed with nothing more than paper, a pen, and a calculator, she’s been able to achieve steady profits.
|
||||
|
||||
I believe there’s even more potential here.
|
||||
|
||||
By digitizing her process and gradually introducing quantifiable algorithms, I hope to both increase efficiency and explore new edges for profitability. My strategy might cause others' losses, so this project is private permanently.
|
||||
|
||||
## List
|
||||
Here, I’ll keep track of the to-do list and showcase the results as the project evolves. I’ll also highlight some interesting technical insights along the way.
|
||||
BIN
content/en/projects/self_host/stock_bot/feature.png
Normal file
|
After Width: | Height: | Size: 86 KiB |
@@ -3,4 +3,17 @@ title = '主页'
|
||||
draft = false
|
||||
+++
|
||||
|
||||
# 这是我的主页
|
||||
{{< typeit
|
||||
tag=h3
|
||||
lifeLike=true
|
||||
>}}
|
||||
欢迎来到我的网页!希望可以在这里找到您需要的!
|
||||
{{< /typeit >}}
|
||||
|
||||
我是一名刚毕业的大学生。
|
||||
|
||||
我的兴趣涵盖机器人 🤖、嵌入式系统 📟 以及摄影 📸。
|
||||
|
||||
在这里,我将分享我的想法、笔记、项目,还有一些有趣的内容。敬请关注!
|
||||
|
||||
## 目录
|
||||
7
content/zh/notes/_index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
+++
|
||||
title = 'Notes'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
Personal notes, may not be readable.
|
||||
个人笔记, 不保证可读性
|
||||
5
content/zh/notes/coding/_index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'Coding'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
8
content/zh/notes/coding/cheat_sheet/_index.md
Normal file
@@ -0,0 +1,8 @@
|
||||
+++
|
||||
title = 'Cheat Sheets'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
记录一些我的常用指令
|
||||
|
||||
BIN
content/zh/notes/coding/cheat_sheet/c/feature.png
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
5
content/zh/notes/coding/cheat_sheet/c/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'C'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/zh/notes/coding/cheat_sheet/cpp/feature.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
5
content/zh/notes/coding/cheat_sheet/cpp/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'C++'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/zh/notes/coding/cheat_sheet/feature.png
Normal file
|
After Width: | Height: | Size: 1.3 MiB |
BIN
content/zh/notes/coding/cheat_sheet/git/feature.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
11
content/zh/notes/coding/cheat_sheet/git/index.md
Normal file
@@ -0,0 +1,11 @@
|
||||
+++
|
||||
title = 'Git'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
## Commit
|
||||
1. Add date and time in commit messages:
|
||||
``` bash
|
||||
git commit -m "$(date '+%Y-%m-%d %H:%M:%S')"
|
||||
```
|
||||
BIN
content/zh/notes/coding/cheat_sheet/python/feature.png
Normal file
|
After Width: | Height: | Size: 447 KiB |
5
content/zh/notes/coding/cheat_sheet/python/index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'Python'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/zh/notes/coding/feature.jpg
Normal file
|
After Width: | Height: | Size: 925 KiB |
9
content/zh/projects/_index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
+++
|
||||
title = 'Projects'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
|
||||
This is projects page. I will list my projects here. Here are several tags here to describe the status of my projects:
|
||||
|
||||
- `private`/ `public`: I won't show too many details of my private, but I will record the process, to-do list and part of results on this site.
|
||||
5
content/zh/projects/self_host/_index.md
Normal file
@@ -0,0 +1,5 @@
|
||||
+++
|
||||
title = 'Self-host Projects'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
+++
|
||||
BIN
content/zh/projects/self_host/feature.png
Normal file
|
After Width: | Height: | Size: 967 KiB |
14
content/zh/projects/self_host/stock_bot/01_todo.md
Normal file
@@ -0,0 +1,14 @@
|
||||
+++
|
||||
title = 'TODO List'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["StockBot"]
|
||||
series_order = 1
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
## Short-term TODO
|
||||
- 🚧 The Initial Policy implement
|
||||
- ⬜️ The evaluate & logger script
|
||||
- ⬜️ The automatic scripts with Email Sender deployed on the Server
|
||||
- ⬜️ Implement RL
|
||||
10
content/zh/projects/self_host/stock_bot/02_results.md
Normal file
@@ -0,0 +1,10 @@
|
||||
+++
|
||||
title = 'Showcases'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
series = ["StockBot"]
|
||||
series_order = 2
|
||||
weight = 20
|
||||
+++
|
||||
|
||||
This section will feature occasional showcases of my technical achievements—focused purely on the engineering side, not the income.
|
||||
20
content/zh/projects/self_host/stock_bot/_index.md
Normal file
@@ -0,0 +1,20 @@
|
||||
+++
|
||||
title = 'StockBot'
|
||||
date = 2024-09-20T04:17:50Z
|
||||
draft = false
|
||||
tags = ["Private", "Ongoing", "Original", "AI"]
|
||||
weight = 10
|
||||
+++
|
||||
|
||||
This is a bot that assists in making daily index fund trading decisions.
|
||||
|
||||
## Introduction
|
||||
|
||||
This project was inspired by my mother. Over the course of ten years, she watched my father struggle in the stock market. From those hard lessons, she developed her own strategy—one that focuses on the predictable fluctuations in index fund values. Armed with nothing more than paper, a pen, and a calculator, she’s been able to achieve steady profits.
|
||||
|
||||
I believe there’s even more potential here.
|
||||
|
||||
By digitizing her process and gradually introducing quantifiable algorithms, I hope to both increase efficiency and explore new edges for profitability. My strategy might cause others' losses, so this project is private permanently.
|
||||
|
||||
## List
|
||||
Here, I’ll keep track of the to-do list and showcase the results as the project evolves. I’ll also highlight some interesting technical insights along the way.
|
||||
BIN
content/zh/projects/self_host/stock_bot/feature.png
Normal file
|
After Width: | Height: | Size: 86 KiB |