From ad95237a0b0ba135660a3c56cb5dc3f35d212fab Mon Sep 17 00:00:00 2001 From: Glofy Date: Thu, 18 Sep 2025 12:56:02 +1000 Subject: [PATCH 1/3] =?UTF-8?q?change=20folder=20guide=20to=20=E7=BE=A4?= =?UTF-8?q?=E5=8F=8B=E5=88=86=E4=BA=AB,=20add=20a=20new=20article?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/Hero.tsx | 2 +- .../HelloWorld.md" | 0 .../burnout-guide.mdx" | 0 .../index.mdx" | 2 +- .../raspberry-guide.md" | 310 ++++++++++++++++++ 5 files changed, 312 insertions(+), 2 deletions(-) rename app/docs/guide/HelloWorld.md => "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" (100%) rename app/docs/guide/burnout-guide.mdx => "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" (100%) rename app/docs/guide/index.mdx => "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" (98%) create mode 100644 "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" diff --git a/app/components/Hero.tsx b/app/components/Hero.tsx index b35bc89..d327053 100644 --- a/app/components/Hero.tsx +++ b/app/components/Hero.tsx @@ -25,7 +25,7 @@ export function Hero() { { title: "群友分享", desc: "群友写的捏", - href: "/docs/guide", + href: "/docs/群友分享", }, ]; diff --git a/app/docs/guide/HelloWorld.md "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" similarity index 100% rename from app/docs/guide/HelloWorld.md rename to "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" diff --git a/app/docs/guide/burnout-guide.mdx "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" similarity index 100% rename from app/docs/guide/burnout-guide.mdx rename to "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" diff --git a/app/docs/guide/index.mdx "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" similarity index 98% rename from app/docs/guide/index.mdx rename to "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" index 3d3e68a..15fb0db 100644 --- a/app/docs/guide/index.mdx +++ "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" @@ -1,5 +1,5 @@ --- -title: "Life & Wellness" +title: "群友分享" description: "程序员生活与心理健康指南 - 关注工作与生活的平衡" date: "2025-01-27" tags: diff --git "a/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" new file mode 100644 index 0000000..28197ec --- /dev/null +++ "b/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" @@ -0,0 +1,310 @@ +--- +title: 用闲置树莓派搭建一个Minecraft服务器 +description: "记录一下从0开始搭建一个树莓派minecraft服务器,并且使用FRP内网穿透到公网" +abbrlink: 52c73bb6 +date: 2025-08-05 18:53:40 +tags: +--- + +# 硬件准备工作 + +一台空闲的树莓派,一台有公网IP地址的VPS服务器 + +# 配置树莓派 + +安装树莓派OS镜像,配置用户名密码 +给树莓派通电 + +## 固定树莓派的静态IP + +打开路由器设置面板,找到DHCP静态IP分配,给树莓派固定一个IP +如果忘了也可以用指令查看树莓派的IP + +```shell +$ hostname -I # 示例输出:192.168.2.102 +``` + +## 开启VNC远程桌面 + +登录ssh开启设置面板 + +```shell +$ sudo raspi-config +``` + +1. 选择 **Interface Options** +2. 选择 **VNC** +3. **Would you like the VNC Server to be enabled?** 选择 **YES** + +打开自己电脑上的VNC软件,使用用户名密码登录虚拟桌面 + +## 安装java + +```sh +$ sudo -i # 临时获得管理员权限 +$ cd /usr/local +``` + +打开树莓派的浏览器 下载[jdk](https://www.oracle.com/java/technologies/downloads/#java21),此时文件会在`/home/<你的用户名>/Downloads/`目录下 + +```sh +$ mkdir java +$ mv /home/<你的用户名>/Downloads/* /usr/local/java/ +$ cd java +$ tar -zxvf jdk-21_linux-aarch64_bin.tar.gz +# 会输出一些日志 +``` + +配置环境变量 + +```sh +$ nano /etc/profile +``` + +在文件最后添加 + +```sh +# jdk版本号可能不同,注意辨别 +export JAVA_HOME=/usr/local/java/jdk-21.0.8 +export CLASSPATH=.:$JAVA_HOME/lib/ +export PATH=.:$JAVA_HOME/bin:$PATH +# 退出方法:Ctrl+O,Enter,Ctrl+X +``` + +重载文件 + +```sh +$ source /etc/profile +``` + +检查是否安装成功 + +```sh +$ java -version + +# 看见如下类似输出则表示成功 +java version "21.0.8" 2025-07-15 LTS +Java(TM) SE Runtime Environment (build 21.0.8+12-LTS-250) +Java HotSpot(TM) 64-Bit Server VM (build 21.0.8+12-LTS-250, mixed mode, sharing) +``` + +## 下载mc服务端 + +打开浏览器下载安装包,我用[fabric](https://fabricmc.net/use/server/)端 + +```sh +$ cd .. # 应该退回至/usr/local/ +$ mkdir minecraft +$ mv /home/<你的用户名>/Downloads/* /usr/local/minecraft +``` + +首次运行必定失败,因为没有同意eula协议 + +```sh +# 我的树莓派8G,这里配置4G内存 +# 注意安装包的名字,版本不同,名字必定不一样 +$ java -Xmx4G -jar fabric-server-mc.1.21.1-loader.0.17.0-launcher.1.1.0.jar +``` + +同意eula协议 + +```sh +$ nano eula.txt # 将其改为eula=true +$ # 退出方法:Ctrl+O,Enter,Ctrl+X +``` + +## 配置frp + +树莓派是arm架构,下载[frp](https://github.com/fatedier/frp/releases),本文编写的时候最新版本为0.63.0 + +```sh +$ cd .. # 当前的目录应该在/usr/local/java +$ wget https://github.com/fatedier/frp/releases/download/v0.63.0/frp_0.63.0_linux_arm64.tar.gz +# 会输出一些日志 +$ tar -zxvf frp_0.63.0_linux_arm64.tar.gz +# 会输出一些日志 +$ mv frp_0.63.0_linux_arm64 frp # 改个名字方便后续操作 +``` + +编辑配置信息 + +```sh +$ cd frp +$ nano frpc.toml # 这里frpc中的c代表client客户端 +``` + +编辑`frpc.toml` + +```toml +serverAddr = "VPS公网IP地址" +serverPort = 7000 # 默认值 +auth.method = "token" +auth.token = "设一个密码" + +[[proxies]] +name = "取一个服务名字" +type = "tcp" +localIP = "192.168.2.102" # 树莓派IP地址 +localPort = 25565 # mc开服默认值 +remotePort = 25565 # mc开服默认值 + +## 退出方法:Ctrl+O,Enter,Ctrl+X +``` + +## 安装tmux + +本文使用tmux实现,也有screen的用法,但是我喜欢tmux。 + +```shell +$ apt install tmux +``` + +# 配置VPS + +ssh登录邮件里的root账户 + +## 配置frp + +在VPS端安装[frp](https://github.com/fatedier/frp/releases) + +```shell +$ cd /usr/local +$ wget https://github.com/fatedier/frp/releases/download/v0.63.0/frp_0.63.0_linux_amd64.tar.gz +$ # 会输出一些日志 +$ tar -zxvf frp_0.63.0_linux_amd64.tar.gz +$ # 会输出一些日志 +$ mv frp_0.63.0_linux_amd64 frp # 改个名字方便后续操作 +``` + +编辑配置文件 + +```sh +$ cd frp +$ nano frps.toml # 这里frps中的s代表server服务端 +``` + +编辑`frps.toml` + +```toml +bindPort = 7000 +auth.method = "token" +auth.token = "和树莓派一样的密码" + +[webServer] # 开dashboard功能,不需要可以不配置 +addr = "127.0.0.1" # 不暴露在公网,可通过ssh隧道访问,要暴露在公网则为"0.0.0.0" +port = 7500 +user = "?" +password = "********" +``` + +## 后台运行frp + +同树莓派端操作 + +```sh +$ apt install tmux +``` + +开放frp监听的端口7000和mc服务器用到的端口25565 + +```shell +$ ufw allow 7000/tcp +$ ufw allow 25565/tcp +``` + +打开一个新窗口运行frp + +```sh +$ tmux new -s <服务名字> +$ cd /usr/local/frp +$ ./frps -c frps.toml +# Ctrl+B再按D,退出窗口 +``` + +重回窗口 + +```shell +$ tmux attach -t <服务名字> +``` + +检查功能是否开启,看到注释中的输出则正常运作 + +```sh +$ tmux ls +# frp: 1 windows (created 时间..) +$ ss -tlnp | grep 7000 +# 有输出则frp工作正常 +``` + +# 在树莓派中启动服务器 + +## 编写start脚本 + +```sh +$ cd /usr/local/minecraft +$ nano start.sh +``` + +将`start.sh`修改为如下 + +```sh +#!/bin/bash +java -Xmx4G -jar fabric-server-mc.1.21.1-loader.0.17.0-launcher.1.1.0.jar nogui +``` + +添加执行权限 + +```shell +$ chmod +x start.sh +``` + +## 运行frp和服务器 + +### 运行frp + +```sh +$ tmux new -s frp +$ cd /usr/local/frp +$ ./frpc -c frpc.toml +# Ctrl+B再按D,退出窗口 +``` + +### 运行服务器 + +```sh +$ tmux new -s mcserver +$ cd /usr/local/minecraft +$ ./start.sh +# Ctrl+B再按D,退出窗口 +``` + +检查功能是否开启,看到如下输出则正常运行 + +```sh +$ tmux ls +# frp: 1 windows (created 时间..) +# mcserver: 1 windows (created 时间..) +``` + +# (可选)配置域名 + +现在已经可以通过VPS的公网IP登录游戏进行游玩了 + +``` +?.?.?.?:25565 # VPS公网IP +``` + +如果有自己的域名,可以登录[cloudflare dashboard](https://dash.cloudflare.com/),在DNS中添加记录 +示例: +| | | +| :- | :- | +| 类型 | A | +| 名称(必需) | rasp | +| IPv4 地址(必需) | | +| 代理状态 | 仅DNS | + +就可以通过你的域名登录了 + +``` +rasp.<你的域名>:25565 +``` From d9dfcf79415c630e561c7407eba7712e6711af17 Mon Sep 17 00:00:00 2001 From: Glofy Date: Thu, 18 Sep 2025 13:34:15 +1000 Subject: [PATCH 2/3] =?UTF-8?q?change=20folder=20name=20=E7=BE=A4=E5=8F=8B?= =?UTF-8?q?=E5=88=86=E4=BA=AB=20back=20to=20English=20ver?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/docs-tree/route.ts | 8 +++++++- app/components/Hero.tsx | 2 +- .../docs/CommunityShare/HelloWorld.md | 0 .../docs/CommunityShare/burnout-guide.mdx | 0 .../index.mdx" => app/docs/CommunityShare/index.mdx | 0 .../docs/CommunityShare/raspberry-guide.md | 0 6 files changed, 8 insertions(+), 2 deletions(-) rename "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" => app/docs/CommunityShare/HelloWorld.md (100%) rename "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" => app/docs/CommunityShare/burnout-guide.mdx (100%) rename "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" => app/docs/CommunityShare/index.mdx (100%) rename "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" => app/docs/CommunityShare/raspberry-guide.md (100%) diff --git a/app/api/docs-tree/route.ts b/app/api/docs-tree/route.ts index a0e9c1d..c319dc6 100644 --- a/app/api/docs-tree/route.ts +++ b/app/api/docs-tree/route.ts @@ -53,7 +53,13 @@ function buildTree(root: string, maxDepth = 2, rel = ""): DirNode[] { if (e.name.startsWith(".") || e.name.startsWith("[")) continue; const abs = path.join(root, e.name); const nodeRel = rel ? `${rel}/${e.name}` : e.name; - const node: DirNode = { name: e.name, path: nodeRel }; + + let node: DirNode; + if (e.name !== "CommunityShare") { + node = { name: e.name, path: nodeRel }; + } else { + node = { name: "群友分享", path: nodeRel }; + } if (maxDepth > 1) node.children = buildTree(abs, maxDepth - 1, nodeRel); nodes.push(node); } diff --git a/app/components/Hero.tsx b/app/components/Hero.tsx index d327053..5f52295 100644 --- a/app/components/Hero.tsx +++ b/app/components/Hero.tsx @@ -25,7 +25,7 @@ export function Hero() { { title: "群友分享", desc: "群友写的捏", - href: "/docs/群友分享", + href: "/docs/CommunityShare", }, ]; diff --git "a/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" b/app/docs/CommunityShare/HelloWorld.md similarity index 100% rename from "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/HelloWorld.md" rename to app/docs/CommunityShare/HelloWorld.md diff --git "a/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" b/app/docs/CommunityShare/burnout-guide.mdx similarity index 100% rename from "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/burnout-guide.mdx" rename to app/docs/CommunityShare/burnout-guide.mdx diff --git "a/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" b/app/docs/CommunityShare/index.mdx similarity index 100% rename from "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/index.mdx" rename to app/docs/CommunityShare/index.mdx diff --git "a/app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" b/app/docs/CommunityShare/raspberry-guide.md similarity index 100% rename from "app/docs/\347\276\244\345\217\213\345\210\206\344\272\253/raspberry-guide.md" rename to app/docs/CommunityShare/raspberry-guide.md From 6b561fc3b0f2fb02561d9d39adf81351eb3c6080 Mon Sep 17 00:00:00 2001 From: Glofy Date: Thu, 18 Sep 2025 20:22:50 +1000 Subject: [PATCH 3/3] revert the hardcode commit, and reorganized categories under CommunityShare --- app/api/docs-tree/route.ts | 8 +-- app/docs/CommunityShare/Geek/index.mdx | 6 ++ .../{ => Geek}/raspberry-guide.md | 4 +- app/docs/CommunityShare/HelloWorld.md | 11 --- .../{ => MentalHealth}/burnout-guide.mdx | 0 .../CommunityShare/MentalHealth/index.mdx | 6 ++ app/docs/CommunityShare/index.mdx | 70 +++---------------- 7 files changed, 25 insertions(+), 80 deletions(-) create mode 100644 app/docs/CommunityShare/Geek/index.mdx rename app/docs/CommunityShare/{ => Geek}/raspberry-guide.md (97%) delete mode 100644 app/docs/CommunityShare/HelloWorld.md rename app/docs/CommunityShare/{ => MentalHealth}/burnout-guide.mdx (100%) create mode 100644 app/docs/CommunityShare/MentalHealth/index.mdx diff --git a/app/api/docs-tree/route.ts b/app/api/docs-tree/route.ts index c319dc6..a0e9c1d 100644 --- a/app/api/docs-tree/route.ts +++ b/app/api/docs-tree/route.ts @@ -53,13 +53,7 @@ function buildTree(root: string, maxDepth = 2, rel = ""): DirNode[] { if (e.name.startsWith(".") || e.name.startsWith("[")) continue; const abs = path.join(root, e.name); const nodeRel = rel ? `${rel}/${e.name}` : e.name; - - let node: DirNode; - if (e.name !== "CommunityShare") { - node = { name: e.name, path: nodeRel }; - } else { - node = { name: "群友分享", path: nodeRel }; - } + const node: DirNode = { name: e.name, path: nodeRel }; if (maxDepth > 1) node.children = buildTree(abs, maxDepth - 1, nodeRel); nodes.push(node); } diff --git a/app/docs/CommunityShare/Geek/index.mdx b/app/docs/CommunityShare/Geek/index.mdx new file mode 100644 index 0000000..5dca24b --- /dev/null +++ b/app/docs/CommunityShare/Geek/index.mdx @@ -0,0 +1,6 @@ +--- +title: "技术分享" +date: "2025-09-18" +--- + +欢迎来到技术分享板块! diff --git a/app/docs/CommunityShare/raspberry-guide.md b/app/docs/CommunityShare/Geek/raspberry-guide.md similarity index 97% rename from app/docs/CommunityShare/raspberry-guide.md rename to app/docs/CommunityShare/Geek/raspberry-guide.md index 28197ec..0b88297 100644 --- a/app/docs/CommunityShare/raspberry-guide.md +++ b/app/docs/CommunityShare/Geek/raspberry-guide.md @@ -1,11 +1,11 @@ --- title: 用闲置树莓派搭建一个Minecraft服务器 -description: "记录一下从0开始搭建一个树莓派minecraft服务器,并且使用FRP内网穿透到公网" -abbrlink: 52c73bb6 date: 2025-08-05 18:53:40 tags: --- +记录一下从0开始搭建一个树莓派minecraft服务器,并且使用FRP内网穿透到公网 + # 硬件准备工作 一台空闲的树莓派,一台有公网IP地址的VPS服务器 diff --git a/app/docs/CommunityShare/HelloWorld.md b/app/docs/CommunityShare/HelloWorld.md deleted file mode 100644 index b30a263..0000000 --- a/app/docs/CommunityShare/HelloWorld.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -title: Hello World -description: First page -date: "2025-09-11" -tags: - - intro ---- - -# Hello World - -这是内容正文。 diff --git a/app/docs/CommunityShare/burnout-guide.mdx b/app/docs/CommunityShare/MentalHealth/burnout-guide.mdx similarity index 100% rename from app/docs/CommunityShare/burnout-guide.mdx rename to app/docs/CommunityShare/MentalHealth/burnout-guide.mdx diff --git a/app/docs/CommunityShare/MentalHealth/index.mdx b/app/docs/CommunityShare/MentalHealth/index.mdx new file mode 100644 index 0000000..de6a8ce --- /dev/null +++ b/app/docs/CommunityShare/MentalHealth/index.mdx @@ -0,0 +1,6 @@ +--- +title: "心理健康" +date: "2025-09-18" +--- + +欢迎来到心理健康板块! diff --git a/app/docs/CommunityShare/index.mdx b/app/docs/CommunityShare/index.mdx index 15fb0db..6464b09 100644 --- a/app/docs/CommunityShare/index.mdx +++ b/app/docs/CommunityShare/index.mdx @@ -1,75 +1,25 @@ --- title: "群友分享" -description: "程序员生活与心理健康指南 - 关注工作与生活的平衡" -date: "2025-01-27" -tags: - - life - - wellness - - mental-health - - work-life-balance +date: "2025-09-18" --- -欢迎来到程序员生活与心理健康板块!这里我们关注技术工作者的身心健康,分享实用的生活建议和心理调适方法。 +欢迎来到群友分享板块!无论你是技术极客,还是热爱生活,都欢迎积极投稿! -## 板块内容 +一篇微不足道的文章或许可以帮助一个迷茫的陌生人~ -### 心理健康 +> 转载文章请先联系原作者获取授权,谢谢! -- [程序员 Burnout 自救指南](/docs/guide/burnout-guide) - 识别和应对职业倦怠 -- 压力管理技巧 -- 情绪调节方法 -- 职场人际关系 +## 心理健康 -### 工作与生活平衡 +- [程序员 Burnout 自救指南](/docs/CommunityShare/MentalHealth/burnout-guide) - 识别和应对职业倦怠 -- 时间管理策略 -- 工作效率提升 -- 远程工作适应 -- 职业发展规划 +## 技术分享 -### 身体健康 +- [用闲置树莓派搭建一个Minecraft服务器](/docs/CommunityShare/Geek/raspberry-guide) + +## 身体健康 - 久坐办公的解决方案 - 程序员健身指南 - 饮食与营养建议 - 睡眠质量改善 - -### 学习与成长 - -- 持续学习策略 -- 技能提升路径 -- 职业转型指导 -- 个人品牌建设 - -## 为什么需要这个板块? - -在快节奏的技术行业中,程序员们经常面临: - -- **高强度工作压力** - 项目deadline、技术更新、学习压力 -- **职业倦怠风险** - 长期加班、重复性工作、缺乏成就感 -- **身心健康问题** - 久坐、熬夜、缺乏运动、社交隔离 -- **职业发展困惑** - 技术路线选择、职业转型、工作与生活平衡 - -## 我们的目标 - -- 🧠 **心理健康** - 提供实用的心理调适方法和资源 -- 💪 **身体健康** - 关注程序员特有的健康问题 -- ⚖️ **工作平衡** - 帮助建立健康的工作与生活边界 -- 🌱 **持续成长** - 支持个人和职业的全面发展 -- 🤝 **社区支持** - 营造互相帮助、共同成长的环境 - -## 贡献指南 - -我们欢迎社区成员分享: - -- 个人经历和感悟 -- 实用的生活技巧 -- 心理健康资源 -- 工作与生活平衡的经验 -- 职业发展的思考 - ---- - -> 💡 **温馨提示**:如果你正在经历严重的心理健康问题,请及时寻求专业帮助。这个板块提供的是日常建议和社区支持,不能替代专业治疗。 - -_让我们一起关注身心健康,在技术路上走得更远更稳!_