<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>印象日志</title>
        <link>https://yxlog.com</link>
        <description>A rookie's blog</description>
        <lastBuildDate>Thu, 12 Mar 2026 04:46:25 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>en-US</language>
        <copyright>All rights reserved 2026</copyright>
        <item>
            <title><![CDATA[ AssppWeb： iOS 多区玩家神器，跨区应用无缝下载]]></title>
            <link>https://yxlog.com/selfhost-assppweb</link>
            <guid isPermaLink="false">https://yxlog.com/selfhost-assppweb</guid>
            <pubDate>Tue, 24 Feb 2026 08:14:00 GMT</pubDate>
            <description><![CDATA[对于拥有多个 Apple ID（中区、美区、日区等）的 iOS 玩家来说，频繁在 App Store 切换账号是一个极其痛苦的过程。[**AssppWeb**](https://github.com/lakr233/assppweb) 是一款开源的 Web 工具，允许你云端托管多个 Apple 账号，通过网页直接获取、下载并一键安装全球 App，甚至支持下载历史版本。

本教程将带你从零开始，利用 Docker 和 Nginx 搭建一个私有的、安全的跨区应用管理中心。

---

> **安全预警**
> 
> 在开始之前，请务必阅读以下...]]></description>
            <content:encoded><![CDATA[对于拥有多个 Apple ID（中区、美区、日区等）的 iOS 玩家来说，频繁在 App Store 切换账号是一个极其痛苦的过程。[**AssppWeb**](https://github.com/lakr233/assppweb) 是一款开源的 Web 工具，允许你云端托管多个 Apple 账号，通过网页直接获取、下载并一键安装全球 App，甚至支持下载历史版本。

本教程将带你从零开始，利用 Docker 和 Nginx 搭建一个私有的、安全的跨区应用管理中心。

---

> **安全预警**
> 
> 在开始之前，请务必阅读以下声明：严禁盲目信任任何网络上的公共服务器。虽然技术上后端无法读取你的加密流量，但恶意主机可以通过修改前端代码，在数据加密前拦截你的 Apple ID 凭据。

> **为了您的账号安全，强烈建议：**
> 1. **必须自建**：仅使用自己托管的实例。
> 2. **必须使用 HTTPS**：保护传输过程中的账号隐私。

---

## 一、 使用 Docker-Compose 极速部署

自建服务是保障安全的唯一途径。通过 Docker，你可以实现一键环境隔离部署。

### 1. 创建部署目录

在服务器上创建文件夹并进入：

```bash
mkdir asspp && cd asspp
```

### 2. 编写 `compose.yml`

创建配置文件：

```yaml
services:
  asspp:
    image: ghcr.io/lakr233/assppweb:latest
    ports:
      - "58080:8080"
    volumes:
      - ./data:/data
    environment:
      - DATA_DIR=/data
      - PORT=8080
    restart: unless-stopped
    logging:
      driver: "json-file"
      options:
        max-size: "128m"
        max-file: "5"
```

### 3. 启动容器

```bash
docker compose up -d
```

此时，服务已在 `58080` 端口运行。

---

## 二、 配置 Nginx 反向代理与 HTTPS

为了确保安全和 iOS PWA 特性的正常运行，**HTTPS 是必选项**。

### Nginx 配置示例 (`asspp.conf`)

将以下配置添加至你的 Nginx 站点配置中，并将 `yourdomain.com` 替换为你的实际域名：

```nginx
server {
    listen 80;
    server_name yourdomain.com;
    return 301 https://$host$request_uri; # 强制跳转 HTTPS
}

server {
    listen 443 ssl;
    http2 on;
    server_name yourdomain.com;

    # SSL 证书路径
    ssl_certificate /etc/nginx/ssl/yourdomain.com.crt;
    ssl_certificate_key /etc/nginx/ssl/yourdomain.com.key;

    location / {
        proxy_pass http://127.0.0.1:58080;
        proxy_http_version 1.1;
        
        # 必须：支持 WebSocket (用于实时下载进度显示)
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        client_max_body_size 200m; # 允许上传大文件
    }
}
```

---

## 三、 iOS 进阶体验：安装为“网页 App”

AssppWeb 完美支持 PWA。将其安装到桌面后，你将获得原生 App 般的丝滑体验：

1. **Safari 访问**：在 iPhone 的 Safari 浏览器打开你的域名。
2. **添加到主屏幕**：点击底部的 **“分享”** 按钮（方框向上箭头），选择 **“添加到主屏幕”**。
3. **独立运行**：现在你可以点击桌面的 Asspp 图标。它没有浏览器地址栏，支持独立缓存，是你真正的“私人 App Store”。

---

## 四、 核心功能玩法：告别切号

### 1. 托管多区账号

在 **“账号 (Accounts)”** 页面，把你的中、美、日等各区账号全部添加进去。AssppWeb 会安全地管理这些 Session。

### 2. 跨区域无感下载

* **随意切区**：在搜索栏直接选择目标市场（如 Japan），搜索 App。
* **一键获取**：选择相应账号进行购买、下载。
* **安装 App**：下载完成后点击 **“安装 (Install)”**。你的 iPhone 会直接弹出原生安装确认框，点击确定即可。

**最强大的地方在于：** 你的系统 App Store 可以一直挂着你的主账号，而下载其他区的 App 全程在 Asspp 网页端完成。]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[ASBP： 回归博客的初衷，专注写作，简单分享]]></title>
            <link>https://yxlog.com/asbp</link>
            <guid isPermaLink="false">https://yxlog.com/asbp</guid>
            <pubDate>Tue, 16 Dec 2025 02:13:00 GMT</pubDate>
            <description><![CDATA[你是否也在寻找一个**简单、纯粹**的博客程序？不想要复杂的功能，但又需要完整的内容管理和后台控制？今天，我来向大家介绍我新开发的开源博客平台——**ASBP**（A Simple Blogging Platform）。

## 🎯 为什么需要又一个博客平台？

现有的博客平台要么功能过于臃肿，要么定制性不足。作为内容创作者，我们真正需要的是：
- 一个干净、专注的写作环境
- 完整的后台管理功能
- 现代化的技术栈
- 简单的部署流程

ASBP 正是为此而生。

## ✨ 核心特性

### 📝 完整的内容管理
- ...]]></description>
            <content:encoded><![CDATA[你是否也在寻找一个**简单、纯粹**的博客程序？不想要复杂的功能，但又需要完整的内容管理和后台控制？今天，我来向大家介绍我新开发的开源博客平台——**ASBP**（A Simple Blogging Platform）。

## 🎯 为什么需要又一个博客平台？

现有的博客平台要么功能过于臃肿，要么定制性不足。作为内容创作者，我们真正需要的是：
- 一个干净、专注的写作环境
- 完整的后台管理功能
- 现代化的技术栈
- 简单的部署流程

ASBP 正是为此而生。

## ✨ 核心特性

### 📝 完整的内容管理
- **公开博客**：支持文章、评论、标签系统
- **管理后台**：文章、评论、媒体、标签、站点设置一站式管理
- **Markdown 支持**：完整的 GFM 语法，写作体验流畅

### 🚀 现代化技术栈
- **Next.js 16**：使用最新的 App Router 和 RSC
- **React 19 + TypeScript**：类型安全，开发高效
- **PostgreSQL + Drizzle ORM**：强大的数据库支持
- **Tailwind CSS v4**：简洁美观的界面设计

## 💻 快速上手

只需几步，你就可以拥有自己的博客：

```bash
# 1. 克隆项目
git clone https://github.com/uvexz/asbp.git

# 2. 安装依赖
npm install

# 3. 配置环境变量
cp .env.example .env.local

# 4. 初始化数据库
npm run db:push

# 5. 启动！
npm run dev
```

访问 `http://localhost:3000` 即可看到你的博客，访问 `/admin` 进入管理后台。

## 🌐 轻松部署

ASBP 支持多种部署方式：
- **Vercel**（推荐，一键部署）
- **Deno Deploy**
- **Render** 或其他 PaaS 平台

只需配置几个环境变量，你的博客就准备就绪了！

## 🔧 可扩展性

虽然追求简单，但 ASBP 也提供了必要的扩展性：
- **S3 兼容存储**：支持 AWS S3、Cloudflare R2、MinIO 等
- **邮件服务**：集成 Resend 发送通知邮件
- **完全开源**：基于 WTFPL 协议，自由修改和分发

## 🎨 界面预览

简洁的管理后台，直观的操作界面：

![](https://boost.jpgcdn.com/c2.jpgcdn.com/2025/12/16/eN49.png)

## 📈 适合谁使用？

- **个人博主**：想要一个干净、专注的写作平台
- **技术爱好者**：喜欢现代化的技术栈，易于定制
- **内容创作者**：需要完整的评论管理和审核功能
- **开源贡献者**：希望参与到一个活跃的开源项目中

## 🚀 立即尝试

如果你厌倦了臃肿的 CMS，或者想要一个可以完全控制的博客平台，ASBP 可能正是你需要的。

**项目地址**：[https://github.com/uvexz/asbp](https://github.com/uvexz/asbp)

欢迎大家 Star、Fork 和贡献代码！如果你在使用的过程中遇到任何问题，或者有新的功能建议，欢迎在 GitHub 上提交 Issue。

让我们一起打造更好的博客体验！✨

---

**ASBP** — 回归博客的初衷：专注写作，简单分享。

*注：ASBP 使用 WTFPL 协议，你可以自由地做任何你想做的事情。*]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[ASCS：一个用 AI 搓出来的开源评论系统]]></title>
            <link>https://yxlog.com/ascs</link>
            <guid isPermaLink="false">https://yxlog.com/ascs</guid>
            <pubDate>Mon, 15 Dec 2025 02:31:00 GMT</pubDate>
            <description><![CDATA[这两天，我使用 AI Coding 了一个小项目，想在这里分享给大家。它叫 ASCS — A Simple Comment System “一个简单的评论系统”。

## 为什么要做这个？

起因很简单，我一直想要一个属于自己的、能完全掌控的评论系统。市面上有很多选择，但它们要么过于臃肿，要么需要付费，要么就是界面风格我不喜欢。所以，我没有做太多复杂的计划，就是想用 AI 跟着感觉，看看能做出个什么东西。整个过程可以说是非常 “Vibe-driven” 的开发体验。

## ASCS 是什么样子的？

我的核心理念就是“简洁”和“现代”。...]]></description>
            <content:encoded><![CDATA[这两天，我使用 AI Coding 了一个小项目，想在这里分享给大家。它叫 ASCS — A Simple Comment System “一个简单的评论系统”。

## 为什么要做这个？

起因很简单，我一直想要一个属于自己的、能完全掌控的评论系统。市面上有很多选择，但它们要么过于臃肿，要么需要付费，要么就是界面风格我不喜欢。所以，我没有做太多复杂的计划，就是想用 AI 跟着感觉，看看能做出个什么东西。整个过程可以说是非常 “Vibe-driven” 的开发体验。

## ASCS 是什么样子的？

我的核心理念就是“简洁”和“现代”。

技术栈：我用了目前很流行的 Next.js 15、TypeScript、Prisma，UI 方面则选择了 shadcn/ui 搭配 Tailwind CSS。

这一套组合下来，开发体验非常流畅，最终的成品界面也干净利落，您可以在本文下方评论栏进行预览。

![ASCS](https://boost.jpgcdn.com/t3.jpgcdn.com/2025/09/11/WRmW.png)

## 主要特性一览

**快速集成** 这是我最看重的一点。你不需要懂很多复杂的东西，只需要在你的网页里加上一个 `<div>` 和一个 `<script>` 标签，评论区就出来了。

**现代化的界面和体验** 得益于 shadcn/ui，ASCS 的界面在桌面和移动端上看起来都很舒服。它支持 Markdown，并且有实时预览功能，用户体验很好。

**独立的管理后台** 你可以自己部署，数据完全属于你。后台可以让你管理所有接入的网站和评论，审核、删除都非常方便。第一次启动时，系统还会引导你创建管理员账号。

**实用的通知系统** 当你的文章有了新评论或者评论被人回复时，你能通过邮件或 Telegram 收到通知，不用再频繁地登录后台查看。

**AI 反垃圾评论** 为了解决最烦人的垃圾评论问题，我集成了 AI 检测功能。它可以自动识别并拦截大部分垃圾信息，可疑的评论则会进入待审核列表，大大减轻了管理负担。

## 快速上手

整个项目是开源的，我选择了非常自由的 WTFPL 许可证，你可以随意使用、修改。

你可以去我的 GitHub 仓库查看源代码： [uvexz/ascs](https://github.com/uvexz/ascs)

部署起来也非常简单：

- 克隆仓库
- 安装依赖 (pnpm install)
- 配置你的数据库等环境变量
- 启动！

具体的步骤在 README.md 文件里有详细说明。

## 最后

希望这个小项目能对你有帮助。如果你有任何想法或者建议，欢迎在 GitHub 上提 Issue 或 PR！]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[[AD] 闲置 VPS 挂机赚钱 | 已提现超过 100 USD]]></title>
            <link>https://yxlog.com/vps-gua-ji</link>
            <guid isPermaLink="false">https://yxlog.com/vps-gua-ji</guid>
            <pubDate>Wed, 10 Dec 2025 02:29:00 GMT</pubDate>
            <description><![CDATA[闲置 VPS 挂机销售流量赚钱， ~~通过以下链接注册赠送 5USD，即只要再挂满 5USD 便可提现 10USD，~~ 可通过 USDT(TRC20) 提现至 Crypto 钱包。

- [https://traffmonetizer.com/?aff=793646](https://traffmonetizer.com/?aff=793646)

> 根据 TM 最新的政策， 新注册账号未赠送 5 USD。

还有一个 Repocket，注册送 5U，满 20U 10USD 提现。

> Repocket 更新了它的提现政策，满 10...]]></description>
            <content:encoded><![CDATA[闲置 VPS 挂机销售流量赚钱， ~~通过以下链接注册赠送 5USD，即只要再挂满 5USD 便可提现 10USD，~~ 可通过 USDT(TRC20) 提现至 Crypto 钱包。

- [https://traffmonetizer.com/?aff=793646](https://traffmonetizer.com/?aff=793646)

> 根据 TM 最新的政策， 新注册账号未赠送 5 USD。

还有一个 Repocket，注册送 5U，满 20U 10USD 提现。

> Repocket 更新了它的提现政策，满 10 刀即可通过 Paypal、Wise 提现。

- [https://link.repocket.co/BTrB](https://link.repocket.co/BTrB)

## Traffmonetizer 挂机方法

1/ 安装 Docker

```
curl -L get.docker.com | bash
```

2/ 运行 CLI

普通 VPS：

```
docker run -d --restart always -i --name tm traffmonetizer/cli_v2:latest start accept --token [TOKEN]
```

基于 ARM 平台的 VPS：

```
docker run -d --restart always -i --name tm traffmonetizer/cli_v2:arm64v8 start accept --token [TOKEN]
```

其中 `[TOKEN]` 注册后在网页获取：

![](https://jpg.sevencdn.com/bs3.jpgcom.com/2023/01/26/7c56ae33756e685018e798d462684178.png)

## Repocket 挂机方法

```
docker run --name repocket -e RP_EMAIL=[注册邮箱] -e RP_API_KEY=[Sell Internet页面里的 API key] -d --restart=always repocket/repocket:latest
```

* * *

博主的提现记录：

### Traffmonetizer

![](https://jpg.sevencdn.com/e4.jpgcdn.com/2024/05/06/432f19afdfb2cecbc1559f8bf7b39752.png)

### Repocket

![](https://jpg.sevencdn.com/e4.jpgcdn.com/2024/06/25/Nynt.png)
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[免费公共 DNS 服务器大全 | Free Public DNS Server List]]></title>
            <link>https://yxlog.com/public-dns-list</link>
            <guid isPermaLink="false">https://yxlog.com/public-dns-list</guid>
            <pubDate>Sat, 04 Oct 2025 18:09:00 GMT</pubDate>
            <description><![CDATA[收集全球公共 DNS 服务器 IP，我们不提供 DNS，只做 DNS 的搬运工。

## 备注

博主使用的 DNS 列表：

| 主 DNS | 备 DNS |
|---|---|
| 180.184.1.1 | 119.29.29.29 |

👍 为推荐使用

## 墙内 DNS 服务器

**⚪ 火山引擎**

由字节跳动火山引擎提供的公共免费 DNS，暂未提供 DOT、DOH。

主 DNS | 备 DNS
---|---
👍 180.184.1.1 | 180.184.2.2

**⚪ 腾讯 DN...]]></description>
            <content:encoded><![CDATA[收集全球公共 DNS 服务器 IP，我们不提供 DNS，只做 DNS 的搬运工。

## 备注

博主使用的 DNS 列表：

| 主 DNS | 备 DNS |
|---|---|
| 180.184.1.1 | 119.29.29.29 |

👍 为推荐使用

## 墙内 DNS 服务器

**⚪ 火山引擎**

由字节跳动火山引擎提供的公共免费 DNS，暂未提供 DOT、DOH。

主 DNS | 备 DNS
---|---
👍 180.184.1.1 | 180.184.2.2

**⚪ 腾讯 DNS (DNSPod)**

由 DNSPod 提供的公共免费 DNS，后来 DNSPod 被腾讯(Tencent)收购，现在属于腾讯公司所有，稳定性和连通性也是不错的，经测试国外也可以使用。

主 DNS | IPv6
---|---
👍 119.29.29.29 | 2402:4e00::

DOH | DOT
---|---
`https://doh.pub/dns-query` | dot.pub

**⚪ 阿里 DNS (Alidns)**

这组 DNS 是由阿里巴巴提供的，国内连通性还是不错的，国外部分地区连通性不是特别好，具体可以测试一下。

主 DNS | 备 DNS
---|---
👍 223.5.5.5 | 223.6.6.6
2400:3200::1 | 2400:3200:baba::1

DOH | DOT
---|---
`https://dns.alidns.com/dns-query` | dns.alidns.com

**⚪ 114DNS**

南京信风运营的免费公共 DNS。

主 DNS | 备 DNS
---|---
114.114.114.114 | 114.114.115.115

**⚪ CNNIC DNS**

是由中国互联网信息中心 CNNIC 提供的免费公共 DNS。

主 DNS | 备 DNS
---|---
1.2.4.8 | 210.2.4.8
2001:dc7:1000::1 |

**⚪ OneDNS**

北京微步在线科技有限公司提供的 DNS 服务，提供纯净版和广告、有害信息拦截版 DNS。
纯净版 | 备 DNS
---|---
117.50.10.10 | 117.50.20.20

拦截版 | 备 DNS
---|---
117.50.11.11 | 117.50.22.22

**⚪ 清华大学 TUNA 协会 DNS 服务器**

IPV4 DNS | IPV6 DNS
---|---
101.6.6.6 | 2001:da8::666


## 墙外 DNS 服务器

**⚪ Google Public DNS**

Google 提供的公共免费 DNS，应该是最流行的公共 DNS 了，不过国内主 DNS 可能无法正常使用。

主 DNS | 备 DNS
---|---
8.8.8.8 | 👍 8.8.4.4
2001:4860:4860::8888 | 2001:4860:4860::8844

DOH | DOT
---|---
`https://dns.google/dns-query` | dns.google

**⚪ Cloudflare DNS**

Cloudflare DNS 是 Cloudflare 与 APNIC 联合推出的号称全球最快的 DNS 服务。APNIC 是一个管理亚太与大洋洲地区 IP 地址分配的非盈利性组织，1.1.1.1 归 APNIC 所有，现在交给 Cloudflare 来提供 DNS 服务。

主 DNS | 备 DNS
---|---
1.1.1.1 | 👍 1.0.0.1
2606:4700:4700::1111 | 2606:4700:4700::1001

**⚪ Quad9 DNS**

IBM 发起的 Quad9 提供的公共免费 DNS.

主 DNS | 备 DNS
---|---
9.9.9.9 | 149.112.112.112
2620:fe::fe | 2620:fe::9

**⚪ OpenDNS**

OpenDNS 是由老牌通信设备商 Cisco 提供的公共免费 DNS 服务。

主 DNS | 备 DNS
---|---
208.67.222.222 | 208.67.220.220
2620:0:ccc::2 | 2620:0:ccd::2

**⚪ TWNIC Quad101**

台湾 TWNIC 提供的 DNS，速度不错。

主 DNS | 备 DNS
---|---
101.101.101.101 | 101.102.103.104
2001:de4::101 | 2001:de4::102

**⚪ Freenom World DNS**

.tk .ga 等免费域名提供商提供的 DNS，在香港有服务器速度不错。

主 DNS | 备 DNS
---|---
80.80.80.80 | 80.80.81.81

---

大部分参考至 [1](https://dns.icoa.cn/)]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[Mastodon 数据库升级实战：从 PostgreSQL 12 到 14 全记录]]></title>
            <link>https://yxlog.com/mastodon-db-upgrade</link>
            <guid isPermaLink="false">https://yxlog.com/mastodon-db-upgrade</guid>
            <pubDate>Sun, 01 Jun 2025 19:05:00 GMT</pubDate>
            <description><![CDATA[在今日拉取 `glitch-soc/mastodon:edge` 时，发现 Mastodon 最新版本对数据库的要求提升至至少 PostgreSQL 13，而我的部署环境中一直依赖 Docker Compose ，使用的是 PostgreSQL 12。为了保证后续更新不出问题，冲了一波版本升级。

下面是数据库升级的详细过程：

> 以下 `dc` 均为 `docker compse` 的简写

## 修改 docker-compose 配置

首先，给 `db` 服务添加 volume：

```yaml
db:
  volum...]]></description>
            <content:encoded><![CDATA[在今日拉取 `glitch-soc/mastodon:edge` 时，发现 Mastodon 最新版本对数据库的要求提升至至少 PostgreSQL 13，而我的部署环境中一直依赖 Docker Compose ，使用的是 PostgreSQL 12。为了保证后续更新不出问题，冲了一波版本升级。

下面是数据库升级的详细过程：

> 以下 `dc` 均为 `docker compse` 的简写

## 修改 docker-compose 配置

首先，给 `db` 服务添加 volume：

```yaml
db:
  volumes:
    - ./postgres:/var/lib/postgresql/data
    - ./dumps:/dumps
```

## 单独重启数据库

```bash
dc down
dc up -d db
```

## 进入数据库导出

```bash
docker exec -it mastodon-db-1 bash
pg_dump -U mastodon -F c -Z 5 mastodon > /dumps/mastodon.dump
```

## 启动 PostgreSQL 14 并创建用户

```bash
docker run --name postgres14 \
  -v /var/www/mastodon/postgres14:/var/lib/postgresql/data \
  -e POSTGRES_PASSWORD=your_admin_password \
  --rm -d postgres:14-alpine

docker exec -it postgres14 psql -U postgres

CREATE USER mastodon WITH PASSWORD 'your_mastodon_password' CREATEDB;

\q

docker stop postgres14
```

## 处理旧数据库

```bash
mv postgres postgres12
```

## 修改 docker-compose 为 pg14 配置

```yaml
db:
  image: postgres:14-alpine
  volumes:
    - ./postgres14:/var/lib/postgresql/data
    - ./dumps:/dumps
```

## 重启 db 并导入数据

```bash
dc up -d db

docker exec -it mastodon-db-1 bash

createdb -U mastodon -T template0 mastodon

pg_restore -U mastodon -d mastodon < /dumps/mastodon.dump

exit
```

## 重启 Mastodon 应用

```bash
dc down && dc up -d

dc run --rm web bundle exec rails db:migrate

dc down && dc up -d
```

至此，PostgreSQL 升级完成， Mastodon 已可正常运行。

* * *

总结：

- 升级前务必须做好数据备份
- 数据库升级可借助 `pg_dump` -> `pg_restore` 完成
- 这种操作对于使用 Docker 部署的项目非常方便

如果你的 Mastodon 环境还使用旧版 PostgreSQL，进行升级是很有必要的。
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[使 Windows Terminal 变得更易用（好看）]]></title>
            <link>https://yxlog.com/better-windows-terminal</link>
            <guid isPermaLink="false">https://yxlog.com/better-windows-terminal</guid>
            <pubDate>Thu, 13 Mar 2025 13:05:00 GMT</pubDate>
            <description><![CDATA[## 准备工作

右键开始菜单，选择 `终端管理员`，运行

```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

开启执行远程命令的权限。

## 个性化

在 wt(Windows Terminal) 设置面板中左下角 `打开 JSON 文件`，然后找到 defaults 关键字并在后面花括号里追加以下代码：

```
//亚克力毛玻璃效果
"useAcrylic": true,
//亚克力毛玻璃效果透明度
"acrylicOpacity": 0.2,...]]></description>
            <content:encoded><![CDATA[## 准备工作

右键开始菜单，选择 `终端管理员`，运行

```
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
```

开启执行远程命令的权限。

## 个性化

在 wt(Windows Terminal) 设置面板中左下角 `打开 JSON 文件`，然后找到 defaults 关键字并在后面花括号里追加以下代码：

```
//亚克力毛玻璃效果
"useAcrylic": true,
//亚克力毛玻璃效果透明度
"acrylicOpacity": 0.2,
//背景壁纸
"backgroundImage": "C:/Users/XXX/Pictures/Saved Pictures/wt.jpeg",
//背景壁纸透明度
"backgroundImageOpacity": 0.4,
"fontFace": "JetBrainsMono Nerd Font Mono",
"fontSize": 14
```

## oh-my-posh

微软商店下载 oh-my-posh，下载安装完成后会自动配置；

此时在 wt 里输入 `notepad $PROFILE` 用记事本打开该配置文件，打开后添加以下代码：

```
oh-my-posh init pwsh --config $env:POSH_THEMES_PATH\montys.omp.json | Invoke-Expression

cls
```

若提示文件不存在，则执行 `echo $PROFILE` 查看文件位置，并新建。

安装 Nerd 字体解决 oh-my-posh 字体图标不显示，推荐安装 JetBrainsMono：

- [https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/JetBrainsMono.zip](https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/JetBrainsMono.zip)

![](https://boost.jpgcdn.com/b2.jpgcdn.com/2025/03/13/ivfl.png)

本文转载自 [1](https://www.barryi.me/posts/wt.html)]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[榨干 ORACLE ARM 5/ 安装 Windows]]></title>
            <link>https://yxlog.com/better-use-oracle-arm-machine-5</link>
            <guid isPermaLink="false">https://yxlog.com/better-use-oracle-arm-machine-5</guid>
            <pubDate>Thu, 30 Jan 2025 23:03:00 GMT</pubDate>
            <description><![CDATA[> 不建议，具有删号的风险、具有变砖的风险。不适合不会救砖的同学。

![](https://jpg.sevencdn.com/e4.jpgcdn.com/2024/11/28/iYoj.png)

## 准备工作

登录 OCI 后台，设置一下实例【传输中加密】为【已禁用】

![](https://jpg.sevencdn.com/b2.jpgcdn.com/2024/11/28/ipnZ.png)

安装依赖

```
apt install curl wget -y
```

## 安装 Windows

1、...]]></description>
            <content:encoded><![CDATA[> 不建议，具有删号的风险、具有变砖的风险。不适合不会救砖的同学。

![](https://jpg.sevencdn.com/e4.jpgcdn.com/2024/11/28/iYoj.png)

## 准备工作

登录 OCI 后台，设置一下实例【传输中加密】为【已禁用】

![](https://jpg.sevencdn.com/b2.jpgcdn.com/2024/11/28/ipnZ.png)

安装依赖

```
apt install curl wget -y
```

## 安装 Windows

1、DD 的方式，大概历时 15 分钟

```
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh && bash reinstall.sh dd --img https://r2.hotdog.eu.org/win11-arm-with-pagefile-15g.xz
```

默认用户名：administrator 密码：123@@@

2、ISO 方式，大概历时30+ 分钟

```
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh

bash reinstall.sh windows \
  --image-name='Windows 11 enterprise ltsc 2024' \
  --iso 'https://drive.massgrave.dev/en-us_windows_11_iot_enterprise_ltsc_2024_arm64_dvd_ec517836.iso'
```

过程可以自定义密码（推荐），否则默认密码 123@@@

3、开始运行脚本解包

- 这个过程，大概是 5-6 分钟
- 这个过程，还是可以 ping 通机器的，在 cloudshell 里是可以看见过程的
- 装载 Windows（iso或者是dd包）及驱动等
- 后会自动重启

4、开始配置 Windows

- 这个过程 iso 方式是 10-25 分钟，dd 方式是 2-5 分钟；
- 这个过程，是 ping 不通机器的
- 这个过程在控制台（cloudshell）界面，会提示 `ConvertPages：failed to find range xxxxx` 无需理会，静静等待
- 等待（iso方式是10-25分钟，dd方式是2-5分钟）的过程中，可以尝试去 [https://tcp.ping.pe](https://tcp.ping.pe) 测试服务器的 `ip:3389`，能 tcping 通，代表安装成功
- 如果 iso 方式超过 50 分钟，dd 方式超过 20 分钟还不通，可以准备救砖了。

5、使用 RDP 连接

6、激活 Windows，自行操作

* * *

如何救砖： [甲骨文云Cloud Shell ARM 救砖](https://godess.us.kg/index.php/2024/11/12/%e7%94%b2%e9%aa%a8%e6%96%87%e4%ba%91cloud-shell-arm-%e6%95%91%e7%a0%96/)

本文参考了： [1](https://www.nodeseek.com/post-168004-1) [2](https://telegra.ph/OracleArmWindows-10-02) [3](https://t.me/reinstall_os) 等
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[榨干 ORACLE ARM 4/ 搭建远程桌面环境]]></title>
            <link>https://yxlog.com/better-use-oracle-arm-machine-4</link>
            <guid isPermaLink="false">https://yxlog.com/better-use-oracle-arm-machine-4</guid>
            <pubDate>Sun, 19 Jan 2025 19:24:00 GMT</pubDate>
            <description><![CDATA[![](https://jpg.sevencdn.com/b2.jpgcdn.com/2023/10/27/2f91b55cb649738f0138b53cdc54d40d.png)

Kasm 是一种基于浏览器的远程桌面环境，可以在 VPS（虚拟专用服务器）上进行安装和部署。安装 Kasm 远程桌面环境在以下几个方面带来了好处：

1. 跨平台访问：Kasm 远程桌面环境可以通过浏览器访问，无论是使用 Windows、Mac 还是 Linux 操作系统，都可以轻松地远程访问 VPS。这使得用户可以在任何设备上访问和使用 VPS，提高了灵活性和便...]]></description>
            <content:encoded><![CDATA[![](https://jpg.sevencdn.com/b2.jpgcdn.com/2023/10/27/2f91b55cb649738f0138b53cdc54d40d.png)

Kasm 是一种基于浏览器的远程桌面环境，可以在 VPS（虚拟专用服务器）上进行安装和部署。安装 Kasm 远程桌面环境在以下几个方面带来了好处：

1. 跨平台访问：Kasm 远程桌面环境可以通过浏览器访问，无论是使用 Windows、Mac 还是 Linux 操作系统，都可以轻松地远程访问 VPS。这使得用户可以在任何设备上访问和使用 VPS，提高了灵活性和便利性。
2. 安全性：Kasm 远程桌面环境提供了强大的安全性功能。它使用了多层身份验证和加密技术，确保用户的远程连接和数据传输的安全性。此外，Kasm 还提供了会话隔离和容器化技术，使得每个用户的会话都是独立的，防止恶意软件和攻击者对系统的入侵。
3. 资源优化：通过在 VPS 上安装 Kasm 远程桌面环境，可以实现资源的优化和共享。多个用户可以同时使用同一台 VPS，而不会因为资源的竞争而导致性能下降。这对于需要共享资源的团队和组织来说非常有用，可以提高工作效率和资源利用率。
4. 管理简化：Kasm 远程桌面环境提供了集中化的管理界面，管理员可以轻松地管理和监控用户的远程会话。管理员可以控制用户的访问权限、分配资源和监控系统性能，从而简化了系统管理和维护的工作。
5. 可扩展性：Kasm 远程桌面环境具有良好的可扩展性。它可以根据用户的需求进行灵活的扩展和定制，可以添加新的功能和插件，以满足不同用户的需求。这使得 Kasm 成为一个适用于各种场景和规模的远程桌面解决方案。

## 安装 Kasm Workspace

在 VPS 上安装 Kasm 的步骤如下：

### 1\. 检查系统要求：

- 操作系统：确保你的 Arm VPS 运行的是支持的操作系统，如 Ubuntu 18.04/20.04/22.04 (amd64/arm64)、Debian 10/11/12 (amd64/arm64)、CentOS 7/8/9 (amd64/arm64)、Oracle Linux 7/8/9 (amd64/arm64) 或 Raspberry Pi OS (Debian) 10/11/12 (arm64) \[2\]。
- 资源要求：确保你的 VPS 符合最低要求，包括至少 2 个核心、4GB 内存和 50GB SSD 存储空间。
- 交换分区：为了提高终端用户会话的稳定性，建议创建一个交换分区。你可以在安装过程中创建交换分区，或者如果已经有一个交换分区，则可以跳过此检查。
- 安装了 Docker & Compose，可通过 `curl -Ls get.docker.com | bash` 自动安装。

### 2\. 下载并安装 Kasm

下载 Kasm 的安装文件：

**ARM64**

```bash
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.14.0.3a7abb.tar.gz
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_service_images_arm64_1.14.0.3a7abb.tar.gz
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_workspace_images_arm64_1.14.0.3a7abb.tar.gz
```

**AMD64**

```bash
cd /tmp
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_1.14.0.3a7abb.tar.gz
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_service_images_amd64_1.14.0.3a7abb.tar.gz
curl -O https://kasm-static-content.s3.amazonaws.com/kasm_release_workspace_images_amd64_1.14.0.3a7abb.tar.gz
```

最新版本的下载链接及安装方式可在 [Kasm 官方文档](https://www.kasmweb.com/docs/latest/install/single_server_install.html) 查看。

解压下载的文件：

```bash
tar -xf kasm_release_1.14.0.3a7abb.tar.gz
```

运行安装脚本来安装 Kasm：

```
bash kasm_release/install.sh --offline-workspaces /tmp/kasm_release_workspace_images_arm64_1.14.0.3a7abb.tar.gz --offline-service /tmp/kasm_release_service_images_arm64_1.14.0.3a7abb.tar.gz
```

可选：默认端口为 `443`，可通过 `-L 8443` 来更换默认端口。

耐心等待 10~20 分钟即可安装完成，安装完毕后会显示后台登陆密码，访问 `https://ip:端口` 使用默认密码登录即可。

```bash
Kasm UI Login Credentials

------------------------------------
  username: admin@kasm.local
  password: [hidden]
------------------------------------
  username: user@kasm.local
  password: [hidden]
------------------------------------
```

### 3\. 安装可信 SSL 证书（可选）

Kasm 证书放在 `/opt/kasm/current/certs` 文件夹，把 `kasm_nginx.crt` & `kasm_nginx.key` 替换为您申请的证书即可，重启生效： `/opt/kasm/bin/start`

![](https://jpg.sevencdn.com/e4.jpgcdn.com/2023/10/27/e3843f33708fa6fa8af4c9d26b927cf3.png)

本文参考了 [1](https://hostloc.com/forum.php?mod=viewthread&tid=1218549&page=1#pid14625150)、 [2](https://community.hetzner.com/tutorials/install-kasm-workspaces)。
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[自建 Docker Hub 镜像]]></title>
            <link>https://yxlog.com/docker-mirror</link>
            <guid isPermaLink="false">https://yxlog.com/docker-mirror</guid>
            <pubDate>Tue, 23 Jul 2024 15:06:00 GMT</pubDate>
            <description><![CDATA[仅提供思路

## 使用第三方程序

* GHProxy: https://github.com/WJQSERVER-STUDIO/ghproxy
* Docker-Proxy: https://github.com/dqzboy/Docker-Proxy

## 使用 Nginx

```json
server {
    listen 443 ssl;
    server_name 域名;

    ssl_certificate 证书地址;
    ssl_certificate_key 密钥地址;

    s...]]></description>
            <content:encoded><![CDATA[仅提供思路

## 使用第三方程序

* GHProxy: https://github.com/WJQSERVER-STUDIO/ghproxy
* Docker-Proxy: https://github.com/dqzboy/Docker-Proxy

## 使用 Nginx

```json
server {
    listen 443 ssl;
    server_name 域名;

    ssl_certificate 证书地址;
    ssl_certificate_key 密钥地址;

    ssl_session_timeout 24h;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;

    location / {
        proxy_pass https://registry-1.docker.io;  # Docker Hub 的官方镜像仓库
        proxy_set_header Host registry-1.docker.io;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;

        # 关闭缓存
        proxy_buffering off;

        # 转发认证相关的头部
        proxy_set_header Authorization $http_authorization;
        proxy_pass_header  Authorization;

        # 对 upstream 状态码检查，实现 error_page 错误重定向
        proxy_intercept_errors on;
        # error_page 指令默认只检查了第一次后端返回的状态码，开启后可以跟随多次重定向。
        recursive_error_pages on;
        # 根据状态码执行对应操作，以下为301、302、307状态码都会触发
        error_page 301 302 307 = @handle_redirect;

    }
    location @handle_redirect {
        resolver 1.1.1.1;
        set $saved_redirect_location '$upstream_http_location';
        proxy_pass $saved_redirect_location;
    }
}
```

## 使用 Cloudflare Worker

```js
import HTML from './docker.html';

export default {
    async fetch(request) {
        const url = new URL(request.url);
        const path = url.pathname;
        const originalHost = request.headers.get("host");
        const registryHost = "registry-1.docker.io";

        if (path.startsWith("/v2/")) {
        const headers = new Headers(request.headers);
        headers.set("host", registryHost);

        const registryUrl = `https://${registryHost}${path}`;
        const registryRequest = new Request(registryUrl, {
            method: request.method,
            headers: headers,
            body: request.body,
            // redirect: "manual",
            redirect: "follow",
        });

        const registryResponse = await fetch(registryRequest);

        console.log(registryResponse.status);

        const responseHeaders = new Headers(registryResponse.headers);
        responseHeaders.set("access-control-allow-origin", originalHost);
        responseHeaders.set("access-control-allow-headers", "Authorization");
        return new Response(registryResponse.body, {
            status: registryResponse.status,
            statusText: registryResponse.statusText,
            headers: responseHeaders,
        });
        } else {
        return new Response(HTML.replace(/{{host}}/g, originalHost), {
            status: 200,
            headers: {
            "content-type": "text/html"
            }
        });
        }
    }
}
```

另新建一个名为 docker.html 的文件，内容如下

```js
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <title>Mirror Usage</title>
        <style>
        html {
        height: 100%;
        }
        body {
        font-family: "Roboto", "Helvetica", "Arial", sans-serif;
        font-size: 16px;
        color: #333;
        margin: 0;
        padding: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;

        }
        .container {
            margin: 0 auto;
            max-width: 600px;
        }

        .header {
            background-color: #438cf8;
            color: white;
            padding: 10px;
            display: flex;
            align-items: center;
        }

        h1 {
            font-size: 24px;
            margin: 0;
            padding: 0;
        }

        .content {
            padding: 32px;
        }

        .footer {
            background-color: #f2f2f2;
            padding: 10px;
            text-align: center;
            font-size: 14px;
        }
        </style>
    </head>
    <body>
        <div class="header">
        <h1>Mirror Usage</h1>
        </div>
        <div class="container">
        <div class="content">
            <p>镜像加速说明</p>
            <p>
            为了加速镜像拉取,你可以使用以下命令设置registery mirror:
            </p>
            <pre>
            sudo tee /etc/docker/daemon.json &lt;&lt;EOF
            {
                "registry-mirrors": ["https://{{host}}"]
            }
            EOF
            </pre>
            </br>
            <p>
            为了避免 Worker 用量耗尽,你可以手动 pull 镜像然后 re-tag 之后 push 至本地镜像仓库:
            </p>
            <pre>
            docker pull {{host}}/library/alpine:latest # 拉取 library 镜像
            docker pull {{host}}/coredns/coredns:latest # 拉取 library 镜像
            </pre>
        </div>
        </div>
        <div class="footer">
        <p>Powered by Cloudflare Workers</p>
        </div>
    </body>
</html>
```

## 使用其他爱好者提供的镜像

博主提供

- [https://www.7ed.net/gitmirror/docker.html](https://www.7ed.net/gitmirror/docker.html)

网络搜集

- docker.1panel.live
- hub.rat.dev
- dockerhub.icu
- docker.m.daocloud.io]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[榨干 Oracle ARM 3/ 生小鸡]]></title>
            <link>https://yxlog.com/better-use-oracle-arm-machine-3</link>
            <guid isPermaLink="false">https://yxlog.com/better-use-oracle-arm-machine-3</guid>
            <pubDate>Mon, 18 Mar 2024 00:15:00 GMT</pubDate>
            <description><![CDATA[> 唧唧复唧唧，鸡鸡生小鸡

> 🤷🏻‍♂️ 要是因为开小鸡导致 Oracle Cloud 账号被封，可不能怪博主提供的文章啊。

下面介绍如何通过安装 PVE7 来使 Oracle ARM VPS 开 LXC 小鸡，建议资源拉满，直接上 4C24G200G。为避免安装过程出错，最好不分配 IPV6 地址。

* * *

**1/** 首先网络重装 ARM 鸡至 Debian 11：

```BASH
# 建议修改下方 “#3Y!fxLXt9N6*GWo” 密码
bash <(wget --no-check-certific...]]></description>
            <content:encoded><![CDATA[> 唧唧复唧唧，鸡鸡生小鸡

> 🤷🏻‍♂️ 要是因为开小鸡导致 Oracle Cloud 账号被封，可不能怪博主提供的文章啊。

下面介绍如何通过安装 PVE7 来使 Oracle ARM VPS 开 LXC 小鸡，建议资源拉满，直接上 4C24G200G。为避免安装过程出错，最好不分配 IPV6 地址。

* * *

**1/** 首先网络重装 ARM 鸡至 Debian 11：

```BASH
# 建议修改下方 “#3Y!fxLXt9N6*GWo” 密码
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p "#3Y!fxLXt9N6*GWo"
```

**2/** 安装依赖

```BASH
apt update
apt install vim git curl wget python3-dev python3-setuptools bison flex autoconf libtool swig gettext gnupg screen -y
```

**3/** 编辑 hosts

编辑 `/etc/hosts`，只保留以下两行

```BASH
127.0.0.1 localhost
公网IP 主机名.proxmox.com 主机名
# 例如 139.185.25.0 debian.proxmox.com debian
# 公网IP 可以通过 curl ip.sb 查看
```

**4/** 修改安装源

```BASH
rm /etc/apt/sources.list.d/*.list
cp /etc/apt/sources.list /etc/apt/sources.list.old
rm /etc/apt/sources.list
```

```BASH
echo "# Raspberry Pi Bullseye Repoo
deb http://archive.raspberrypi.org/debian/ bullseye main

# Pimox7 Repo
deb https://raw.githubusercontent.com/pimox/pimox7/master/ dev/

# Debian Rep0
deb http://deb.debian.org/debian bullseye main contrib non-free

# Security Updated
deb http://security.debian.org/debian-security bullseye-security main contrib non-free" > /etc/apt/sources.list
```

```BASH
curl https://raw.githubusercontent.com/pimox/pimox7/master/KEY.gpg | apt-key add -
curl http://archive.raspberrypi.org/debian/raspberrypi.gpg.key | apt-key add -
```

```BASH
screen
# 为避免网络中断导致安装失败，这里使用 screen，回车即可
apt update
apt install proxmox-ve -y
```

安装中途会有弹窗，默认选项即可，期间 VPS 会断开连接，稍等几分钟即可安装完毕，浏览器输入 [https://ip:8006](https://ip:8006) 打开 PVE 后台面板。

**5/** 重新编译安装 AppArmor

```BASH
git clone https://gitlab.com/apparmor/apparmor.git
cd apparmor

export PYTHONPATH=$(realpath libraries/libapparmor/swig/python)
export PYTHON=/usr/bin/python3
export PYTHON_VERSION=3
export PYTHON_VERSIONS=python3

cd ./libraries/libapparmor
./autogen.sh
./configure --prefix=/usr --with-perl --with-python
make
make install

cd ../../binutils/
make
make install

cd ../parser/
make
make install

cd ../utils/
make
make install
```

**6/** 配置虚拟 Bridge 网卡

在 `/etc/network/interfaces` 文件最下方新增以下内容

```BASH
auto vmbr0
#private sub network
iface vmbr0 inet static
	address 10.10.10.1/24
	bridge-ports none
	bridge-stp off
	bridge-fd 0

	post-up echo 1 > /proc/sys/net/ipv4/ip_forward
	post-up iptables -t nat -A POSTROUTING -s '10.10.10.0/24' -o enp0s3 -j MASQUERADE
	post-down iptables -t nat -D POSTROUTING -s '10.10.10.0/24' -o enp0s3 -j MASQUERADE

# enp0s3 是甲骨文 Arm 鸡默认网卡名称，若有变动相应更改
```

`/etc/init.d/networking restart` 重启网络，更新配置。

**7/** 下载小鸡镜像

由于适用于 Arm 的系统镜像较少， PVE 自带模板也不支持 Arm，可以在下方地址找到一些系统的镜像：

[Linux Containers](https://images.linuxcontainers.org/images/)

PVE LXC 镜像存放于 `/var/lib/vz/template/cache`

```BASH
# 下载 debian
wget -O "/var/lib/vz/template/cache/debian-bullseye.tar.xz" https://images.linuxcontainers.org/images/debian/bullseye/arm64/cloud/20240317_05%3A24/rootfs.tar.xz

# 下载 ubuntu
wget -O "/var/lib/vz/template/cache/ubuntu-focal.tar.xz" https://images.linuxcontainers.org/images/ubuntu/focal/arm64/cloud/20240317_08%3A11/rootfs.tar.xz

# 下载 rockylinux
wget -O "/var/lib/vz/template/cache/rockylinux-8.tar.xz" https://images.linuxcontainers.org/images/rockylinux/8/arm64/cloud/20240318_02%3A06/rootfs.tar.xz

# 下载 alpine
wget -O "/var/lib/vz/template/cache/alpine-3-19.tar.xz" https://images.linuxcontainers.org/images/alpine/3.19/arm64/cloud/20240317_13%3A00/rootfs.tar.xz

# 以上镜像博主未测试能否开机，请自行探索。
```

**8/** 开小鸡

登录 PVE 后台，在右上角点击 **创建CT**

![Untitled.png](https://s2.loli.net/2022/10/15/Fdr5PtM1GgEbZ8T.png)

![Untitled 1.png](https://s2.loli.net/2022/10/15/JegqcRfK2GnUok4.png)

输入 root 用户密码 - 选择系统镜像 - 磁盘、CPU、内存按需填写，网络部分按下方填写：

- 桥接：选择 `vmbr0`
- IPV4： `10.10.10.100/24` （建议内网 IP 最后一位与 CT ID 一致，这里必须有一个 /24，虽然没卵用）
- 网关： `10.10.10.1`

然后点击创建即可。

**9/** 配置小鸡

由于这些镜像均为纯净版镜像，纯净到连 SSH 都没内置，首先将小鸡开机，并进入 **控制台**，使用设置的 root 密码登录：

![Untitled 2.png](https://s2.loli.net/2022/10/15/CeHSq145osZXzhM.png)

更新系统，并安装 `openssh`

```BASH
# centos-based system, like rockylinux,almalinux
yum update
yum -y install openssh-server
systemctl restart sshd

# debian-based system, like ubuntu
apt update
apt -y install openssh-server
systemctl restart sshd

# alpine
apk update
apk add openssh-server
/etc/init.d/sshd restart
```

编辑 `/etc/ssh/sshd_config` 文件中 `PermitRootLogin` 行，去掉前面的 `#` 并将后面改成 `yes`，并重启 sshd。

![Untitled 3.png](https://s2.loli.net/2022/10/15/NWKGxLoOQdVsZS1.png)

切换到母鸡终端，尝试用 `ssh root@10.10.10.100` 进行登录，能成功登上去就 OK 了

![Untitled 4.png](https://s2.loli.net/2022/10/15/nAVSFGI2CkuYq6m.png)

**10/** 配置端口转发

将以下代码保存至母鸡 `nat.sh`

```BASH
# 使用方法: bash nat.sh $(lxc-ls)

# 小鸡的端口转发规则 ssh 22 http 80 10<N>00:10<N>20
# ID 对应 IP 101: 10122 10180 10100:10120
#-------------------------------------------------------------#
input_id()
{
id=101
echo -e "测试默认 ID: \033[41;37m ${id} \033[0m 可以修改设置其他 ID; "
read -p "请输入 NAT 小鸡的 ID 号(按回车不修改): " -t 30 new
if [[ ! -z "${new}" ]]; then
id="${new}"
fi
nat_port
iptables -t nat -nvL PREROUTING
echo -e ":: PVE NAT 批量端口转发设置脚本: \033[41;37m bash nat.sh $(lxc-ls) \033[0m \n 使用参考: https://262235.xyz/index.php/archives/714/"
}
# 以 id 为 ip 设置端口转发
nat_port()
{
iptables -t nat -I PREROUTING -p tcp -m tcp --dport ${id}22 -j DNAT --to-destination 10.10.10.${id}:22
iptables -t nat -I PREROUTING -p tcp -m tcp --dport ${id}80 -j DNAT --to-destination 10.10.10.${id}:80
iptables -t nat -A PREROUTING -p tcp -m multiport --dport ${id}00:${id}20 -j DNAT --to-destination 10.10.10.${id}
}

# 手工输入 id，input_id 调用 nat 端口转发
if [ $# -eq 0 ];
then
input_id
exit
fi

# 遍历参数 批量设置 nat 端口转发
for arg in $*
do
id=$arg
nat_port
done

# 查看 nat PREROUTING 端口映射规则
iptables -t nat -nvL PREROUTING

# 清空 nat PREROUTING 端口映射规则
# iptables -t nat -F PREROUTING
```

通过 `bash nat.sh $(lxc-ls)` 可为所有小鸡配置端口转发，例如小鸡 ID 为 **101**：

- 公网IP: **101** 22 转发至小鸡 22 端口
- 公网IP: **101** 80 转发至小鸡 80 端口
- 公网IP: **101** 01~ **101** 20 转发至小鸡 10101~10120 端口

现在测试通过本地终端访问 `公网IP:10122` 是否能连接：

![Untitled 5.png](https://s2.loli.net/2022/10/15/J2F938Eyvm17IRN.png)

—

本文内容主要参考于 [1](https://blog.ln.cn/%E6%95%99%E7%A8%8B/%E7%94%B2%E9%AA%A8%E6%96%87-ARM-%E5%AE%89%E8%A3%85PVE%E5%BC%80LXC%E5%B0%8F%E9%B8%A1%E5%AE%8C%E6%95%B4%E6%95%99%E7%A8%8B.html)，并根据 [2](https://nbyx.xyz/?p=1261)、 [3](https://lala.im/3252.html) 及 PVE 官方文档进行了补充。
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[单 PHP 文件获取 Bing 每日图片]]></title>
            <link>https://yxlog.com/get-bing-daily-images</link>
            <guid isPermaLink="false">https://yxlog.com/get-bing-daily-images</guid>
            <pubDate>Fri, 10 Nov 2023 05:06:00 GMT</pubDate>
            <description><![CDATA[![](https://7ed.net/bing/api)

代码如下：

```
<?php
// 判断是否随机调用
$gettimebase = isset($_GET['day']) ? $_GET['day'] : '';
if (isset($_GET['rand']) && $_GET['rand'] === 'false') {
    $gettime = empty($gettimebase) ? 0 : $gettimebase;
} else {
    // 若不为随机调用则判断是否指定日期
    $ge...]]></description>
            <content:encoded><![CDATA[![](https://7ed.net/bing/api)

代码如下：

```
<?php
// 判断是否随机调用
$gettimebase = isset($_GET['day']) ? $_GET['day'] : '';
if (isset($_GET['rand']) && $_GET['rand'] === 'false') {
    $gettime = empty($gettimebase) ? 0 : $gettimebase;
} else {
    // 若不为随机调用则判断是否指定日期
    $gettime = empty($gettimebase) ? rand(-1, 7) : $gettimebase;
}

// 获取 Bing Json 信息
$mkt = isset($_GET['cn']) && $_GET['cn'] === 'true' ? 'zh-CN' : 'en-US';
$json_string = file_get_contents("https://www.bing.com/HPImageArchive.aspx?format=js&idx=$gettime&n=1&mkt=$mkt");

// 转换为 PHP 数组
$data = json_decode($json_string);

// 提取基础 URL
$imgurlbase = "https://www4.bing.com{$data->images[0]->urlbase}";

// 判断是否指定图片大小
$imgsizebase = isset($_GET['size']) ? $_GET['size'] : '';
$imgsize = empty($imgsizebase) ? "1920x1080" : $imgsizebase;

// 建立完整 URL
$imgurl = "{$imgurlbase}_{$imgsize}.jpg";

// 获取其他信息
$imgtime = $data->images[0]->startdate;
$imgtitle = $data->images[0]->title;
$imglink = $data->images[0]->copyrightlink;

// 判断是否只获取图片信息
if (isset($_GET['info']) && $_GET['info'] === 'true') {
    echo "{title:$imgtitle,url:$imgurl,link:$imglink,time:$imgtime}";
} else {
    // 若不是则跳转 URL
    ob_start();
    header("Location: $imgurl");
    ob_end_flush();
}
?>

```

将代码保存为 `bing.php` 并上传至您的主机，访问 `yourdomain.com/bing.php` 即可。

默认的参数为： `rand=true`，`day=0`，`size=1920x1080`，`info=false`，`cn=false`

例如，随机获取大小 320x240 的图片则可以引用：

```html
yourdomain.com/bing.php?rand=true&size=320x240
```

* * *

部署至 Vercel：

将 bing.php 存入 api 文件夹，并新建 `vercel.json`

```json
{
  "functions": {
    "api/*.php": {
      "runtime": "vercel-php@0.6.0"
    }
  },
  "routes": [
  	{ "src": "/bing/api(.*)","dest": "api/bing.php", "headers": { "Access-Control-Allow-Origin": "*" }}
  ]
}
```

整体目录如下：

```
- 项目文件夹
  - api
    - bing.php
  - vercel.json
  - index.html //可选
```

在项目文件夹内部署 `vc --prod`

访问 `random.vercel.app/bing/api` 即可
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[一键更换 Linux 软件源]]></title>
            <link>https://yxlog.com/one-click-linuxmirrors</link>
            <guid isPermaLink="false">https://yxlog.com/one-click-linuxmirrors</guid>
            <pubDate>Sun, 05 Nov 2023 15:00:00 GMT</pubDate>
            <description><![CDATA[LinuxMirrors 是一个完全开源的非盈利项目，它能一键更换 Linux 系统软件源，支持基于 `Debian`、 `RedHat`、 `OpenCloudOS`、 `openEuler`、 `openSUSE`、 `Arch Linux` 的发行版和及其部分衍生版本，理论支持所有架构的环境。

## 使用方法

先使用 `sudo -i` 或 `su root` 切换为 `root` 用户权限。

**国内使用**

```bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh...]]></description>
            <content:encoded><![CDATA[LinuxMirrors 是一个完全开源的非盈利项目，它能一键更换 Linux 系统软件源，支持基于 `Debian`、 `RedHat`、 `OpenCloudOS`、 `openEuler`、 `openSUSE`、 `Arch Linux` 的发行版和及其部分衍生版本，理论支持所有架构的环境。

## 使用方法

先使用 `sudo -i` 或 `su root` 切换为 `root` 用户权限。

**国内使用**

```bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh)
```

或使用 Gitee 源

```bash
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
```

**国内教育网使用**

```bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --edu
```

**海外使用**

```bash
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --abroad
```

或使用 Github 源

```bash
bash <(curl -sSL https://raw.githubusercontent.com/SuperManito/LinuxMirrors/main/ChangeMirrors.sh) --abroad
```

**其他**

若显示 Curl Command not found，可复制 `https://linuxmirrors.cn/main.sh` 源码，保存为本地文件 `main.sh`，再执行 `bash main.sh`。

本文参考至 [LinuxMirrors 官网](https://linuxmirrors.cn/use/)。]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[在 PaaS 平台持久化地部署您的 Ghost 博客]]></title>
            <link>https://yxlog.com/custom-paas-ghost</link>
            <guid isPermaLink="false">https://yxlog.com/custom-paas-ghost</guid>
            <pubDate>Sun, 08 Oct 2023 08:08:00 GMT</pubDate>
            <description><![CDATA[> 本文仅提供思路，具体实现建议自行研究

在 Zeabur、Northflank、Fly.io 等支持 Docker 部署的 PaaS 平台部署的 Ghost 博客，在重启时总是会丢失您上传的内容，可通过部署 S3 储存插件、使用第三方数据库规避。

## 0/ 准备工作

1. 注册 Docker Hub： [https://hub.docker.com/signup](https://hub.docker.com/signup)
2. 注册 Cloudflare R2 作为储存： [https://www.cloudflare.com...]]></description>
            <content:encoded><![CDATA[> 本文仅提供思路，具体实现建议自行研究

在 Zeabur、Northflank、Fly.io 等支持 Docker 部署的 PaaS 平台部署的 Ghost 博客，在重启时总是会丢失您上传的内容，可通过部署 S3 储存插件、使用第三方数据库规避。

## 0/ 准备工作

1. 注册 Docker Hub： [https://hub.docker.com/signup](https://hub.docker.com/signup)
2. 注册 Cloudflare R2 作为储存： [https://www.cloudflare.com/zh-cn/developer-platform/r2/](https://www.cloudflare.com/zh-cn/developer-platform/r2/)
3. 注册 TiDB Cloud 作为数据库： [https://www.pingcap.com/tidb-serverless/](https://www.pingcap.com/tidb-serverless/)

## 1/ 自定义 Dockerfile

在本地文件夹中新建 `Dockerfile`：

```
FROM node:20-alpine as build
RUN apk add git
RUN git clone https://github.com/laosb/ghos3.git s3
RUN git clone https://github.com/uvexz/ghost-theme-lite lite
RUN cd s3 && npm install && npm run build

FROM ghost:5-alpine
COPY --from=build s3 content/adapters/storage/s3
COPY --from=build lite content/themes/lite
RUN chown -R node:node content \
    && chmod 1777 -R content

EXPOSE 2368
CMD ["node", "current/index.js"]
```

您可以把 `lite` 主题换成您喜欢的主题。

本地安装 Docker 并登录

- [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)

```
docker login -u 用户名 -p 密码
```

本地编译

```
docker build -t 用户名/ghost:5 .
```

推送

```
docker push 用户名/ghost:5
```

## 在 PaaS 平台上使用

在支持 Docker 的 PaaS 上使用您自定义的库 `用户名/ghost:5`

`ENV` 按如下填入

```
[env]
  url="https://[YOURS]"
  database__client="mysql"
  database__connection__password="[YOURS]"
  database__connection__host="[YOURS].prod.aws.tidbcloud.com"
  database__connection__user="[YOURS].root"
  database__connection__port="4000"
  database__connection__database="ghost"
  database__connection__ssl__rejectUnauthorized=true
  database__connection__ssl__secureProtocol="TLSv1_2_method"
  storage__active="s3"
  storage__s3__assetHost="https://[YOURS].r2.dev"
  storage__s3__acl="private"
  storage__s3__endpoint="https://[YOURS].r2.cloudflarestorage.com"
  storage__s3__region="auto"
  storage__s3__bucket="[YOURS]"
  storage__s3__accessKeyId="[YOURS]"
  storage__s3__secretAccessKey="[YOURS]"
```

部署即可。
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[自建 Gotosocial | 一个 ActivityPub 联邦社交网络程序]]></title>
            <link>https://yxlog.com/self-hosted-gotosocial</link>
            <guid isPermaLink="false">https://yxlog.com/self-hosted-gotosocial</guid>
            <pubDate>Thu, 21 Sep 2023 23:15:00 GMT</pubDate>
            <description><![CDATA[[GoToSocial](https://github.com/superseriousbusiness/gotosocial) 是一个十分轻量（轻量到甚至没有用户界面，需要使用第三方程序登录、兼容 Mastodon 应用进行使用）的 ActivityPub 联邦社交网络程序，自建 GoToSocial 可以避免您的信息因为所在实例倒闭、不可抗力等原因化为乌有。

---

## 一、使用：

### 修改个人信息

访问 `https://social.example.com/settings` 使用账号密码登录即可进行修改

##...]]></description>
            <content:encoded><![CDATA[[GoToSocial](https://github.com/superseriousbusiness/gotosocial) 是一个十分轻量（轻量到甚至没有用户界面，需要使用第三方程序登录、兼容 Mastodon 应用进行使用）的 ActivityPub 联邦社交网络程序，自建 GoToSocial 可以避免您的信息因为所在实例倒闭、不可抗力等原因化为乌有。

---

## 一、使用：

### 修改个人信息

访问 `https://social.example.com/settings` 使用账号密码登录即可进行修改

### 发布推文

通过第三方 APP 进行发布、浏览、关注等操作，可以使用 Mastodon 的客户端进行：

- Phanpy推荐: [https://phanpy.social/](https://phanpy.social/)
- ELK: [https://elk.zone/](https://elk.zone/)
- 更多推荐 APP： [https://joinmastodon.org/apps](https://joinmastodon.org/apps)

## 二、搭建教程：

- 1/ 自有 VPS 安装
- 2/ Fly.io 免费安装（推荐）

### 1/ 自有 VPS 安装

安装 Docker

```
curl -L get.docker.com | bash
```

创建安装目录

```bash
mkdir -p /var/www/gotosocial/data && cd /var/www/gotosocial
```

配置 `docker-compose.yaml` 文件

```
nano docker-compose.yaml
```

修改下方 `social.example.com` 为您自己的域名，并粘贴进去

```
version: "3.3"

services:
  gotosocial:
    image: superseriousbusiness/gotosocial:latest
    container_name: gotosocial
    user: 1000:1000
    networks:
      - gotosocial
    environment:
      GTS_HOST: social.example.com
      GTS_DB_TYPE: sqlite
      GTS_DB_ADDRESS: /gotosocial/storage/sqlite.db
      GTS_LETSENCRYPT_ENABLED: "false"
    ports:
      - "127.0.0.1:8080:8080"
    volumes:
      - ./data:/gotosocial/storage
    restart: "always"

networks:
  gotosocial:
    ipam:
      driver: default
```

运行

```
docker compose up -d
```

创建用户

```
docker exec -it gotosocial /gotosocial/gotosocial admin account create --username YOUR_USERNAME --email YOUR@EMAIL.COM --password 'SOME_VERY_GOOD_PASSWD'
```

设置管理员

```
docker exec -it gotosocial /gotosocial/gotosocial admin account promote --username YOUR_USERNAME
```

安装 Nginx

```
# 以 Debian/Ubuntu 为例

apt install -y lsb-release ca-certificates apt-transport-https curl gnupg dpkg

curl -sS https://n.wtf/public.key | gpg --dearmor > /usr/share/keyrings/n.wtf.gpg

echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/n.wtf.gpg] https://mirror-cdn.xtom.com/sb/nginx/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/n.wtf.list

apt update

apt install nginx-extras -y
```

安装 ACME.SH

```
curl -L get.acme.sh | bash
```

**重启终端**，创建 Nginx 配置文件

```
nano /etc/nginx/conf.d/gotosocial.conf
```

粘贴下方内容

```
server {
  listen 80;
  listen [::]:80;
  server_name social.example.com;
  root /var/www/gotosocial;
  location /.well-known/acme-challenge/ { allow all; }
  location / { return 301 https://$host$request_uri; }
}
```

重启 Nginx `nginx -s reload`，将域名指向 VPS 的 IP 地址，生成 SSL 证书
```
acme.sh --issue -d social.example.com -w /var/www/gotosocial --server letsencrypt
```

生成的证书大致如下

```
[Thu 12 Nov 2020 07:16:28 AM EST] Your cert is in  /root/.acme.sh/social.example.com/social.example.com.cer
[Thu 12 Nov 2020 07:16:28 AM EST] Your cert key is in  /root/.acme.sh/social.example.com/social.example.com.key
[Thu 12 Nov 2020 07:16:30 AM EST] The intermediate CA cert is in  /root/.acme.sh/social.example.com/ca.cer
[Thu 12 Nov 2020 07:16:30 AM EST] And the full chain certs is there:  /root/.acme.sh/social.example.com/fullchain.cer
```

我们需要其中的

```
/root/.acme.sh/social.example.com/fullchain.cer
/root/.acme.sh/social.example.com/social.example.com.key
```

再次编辑 Nginx 配置文件

```
nano /etc/nginx/conf.d/gotosocial.conf
```

按下方内容粘贴

```
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

server {
  listen 80;
  listen [::]:80;
  server_name social.example.com;
  root /var/www/gotosocial;
  location /.well-known/acme-challenge/ { allow all; }
  location / { return 301 https://$host$request_uri; }
}

server {
  listen 443 ssl http2;
  listen [::]:443 ssl http2;
  server_name social.example.com;

  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers on;
  ssl_session_cache shared:SSL:10m;
  ssl_session_tickets off;

  ssl_certificate /root/.acme.sh/social.example.com/fullchain.cer;
  ssl_certificate_key /root/.acme.sh/social.example.com/social.example.com.key;

  keepalive_timeout    70;
  sendfile             on;
  client_max_body_size 80m;

  root /var/www/gotosocial;

  gzip on;
  gzip_disable "msie6";
  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml image/x-icon;

  location / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $host;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header X-Forwarded-Proto $scheme;
  }
```

重启 Nginx `nginx -s reload`，现在即可访问您的 Gotosocial 了。

### 2/ 在 Fly.io 免费安装

准备：

- [注册 Fly.io 账号](https://fly.io/app/sign-up)，并绑卡（避免滥用）；
- [注册 Cloudflare 并启用 R2](https://dash.cloudflare.com/sign-up/r2)，启用 R2 需要绑卡。新建一个储存桶并创建一个 API 令牌。
- [注册 Yugabyte 账号](https://cloud.yugabyte.com/signup)，并创建数据库，地区选择 `tokyo`，创建过程记得保存用户名及密码，等创建成功后点右上角 `connect` 按钮选择 `Connect to your Application` \- `Parameters` 获取连接信息，我们需要其中的 `Host` `Port` `Database`。

安装 flyctl

```
# Linux
curl -L https://fly.io/install.sh | sh

# macOS
curl -L https://fly.io/install.sh | sh

# Windows，需要开启 RemoteSigned: 管理员运行 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
powershell -Command "iwr https://fly.io/install.ps1 -useb | iex"
```

登录

```
flyctl auth login

# 若登录失败使用
# flyctl auth login -i
# 输入账号密码进行登录
```

创建安装目录

```
mkdir ~/gotosocial && cd gotosocial
```

创建 APP

```
flyctl launch --name YOURAPPNAME --image=superseriousbusiness/gotosocial:latest --region nrt --no-deploy
```

创建储存卷，1G 足矣
```
flyctl volumes create social_data --region nrt --size 1
```

编辑当前目录下的 `fly.toml` 配置文件，按下方配置（下方配置文件内容已按照 fly.io v2 部署平台进行相应的修订）

```
app = "yjksocial"
primary_region = "nrt"

[build]
  image = "superseriousbusiness/gotosocial:latest"

[env]
  GTS_HOST = "social.example.com"
  GTS_DB_TYPE = "postgres"
  GTS_DB_PORT = 5433
  GTS_DB_ADDRESS = "之前记录的数据库 Host"
  GTS_DB_USER = "admin"
  GTS_DB_PASSWORD = "之前记录的数据库用户密码"
  GTS_DB_DATABASE = "yugabyte"
  GTS_DB_TLS_MODE = "enable"
  GTS_LETSENCRYPT_ENABLED = "false"
  GTS_STORAGE_BACKEND = "s3"
  GTS_STORAGE_S3_ENDPOINT = "Cloudflare R2 API 地址，记得去掉 “/仓库名”"
  GTS_STORAGE_S3_ACCESS_KEY = "Cloudflare R2 API ACCESS KEY"
  GTS_STORAGE_S3_SECRET_KEY = "Cloudflare R2 API SECRET KEY"
  GTS_STORAGE_S3_BUCKET = "Cloudflare R2 仓库名"
  GTS_STORAGE_S3_PROXY = true

[mounts]
  source="social_data"
  destination="/gotosocial/storage"

[http_service]
  internal_port = 8080
  force_https = true
  auto_stop_machines = false
  auto_start_machines = true
  min_machines_running = 1
  processes = ["app"]
```

启动 APP

```
flyctl deploy
```

能成功访问 `https://YOURAPPNAME.fly.dev` 则代表部署成功。

绑定域名，将您的域名 `CNMAE` 至 `YOURAPPNAME.fly.dev`，然后运行

```
flyctl certs add social.example.com
```

等待几分钟即可。

创建用户及设置管理员

```
# 在 fly.toml 文件目录执行
flyctl ssh console
```

```
# 创建用户
/gotosocial/gotosocial admin account create --username YOUR_USERNAME --email YOUR@EMAIL.COM --password 'SOME_VERY_GOOD_PASSWD'

# 设置管理员
/gotosocial/gotosocial admin account promote --username YOUR_USERNAME
```]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[导出 Authy 储存的 TOTP tokens | 备份 Authy]]></title>
            <link>https://yxlog.com/authy-backup</link>
            <guid isPermaLink="false">https://yxlog.com/authy-backup</guid>
            <pubDate>Wed, 12 Jul 2023 12:05:00 GMT</pubDate>
            <description><![CDATA[## 准备

1. Linux/MacOS(intel)/Windows WSL 机器一台
2. Authy 应用处于登录状态

## 下载

访问以下连接，下载 `authy-export`

- [https://github.com/alexzorin/authy/releases](https://github.com/alexzorin/authy/releases)

大陆地区加速下载：

- MacOS(intel): [https://hub.gitmirror.com/https://github.com/al...]]></description>
            <content:encoded><![CDATA[## 准备

1. Linux/MacOS(intel)/Windows WSL 机器一台
2. Authy 应用处于登录状态

## 下载

访问以下连接，下载 `authy-export`

- [https://github.com/alexzorin/authy/releases](https://github.com/alexzorin/authy/releases)

大陆地区加速下载：

- MacOS(intel): [https://hub.gitmirror.com/https://github.com/alexzorin/authy/releases/download/v0.3.1/authy-export-darwin-amd64](https://hub.gitmirror.com/https://github.com/alexzorin/authy/releases/download/v0.3.1/authy-export-darwin-amd64)
- Linux/Windows WSL: [https://hub.gitmirror.com/https://github.com/alexzorin/authy/releases/download/v0.3.1/authy-export-linux-amd64](https://hub.gitmirror.com/https://github.com/alexzorin/authy/releases/download/v0.3.1/authy-export-linux-amd64)

## 使用

打开终端，运行 `./authy-export-linux-amd64` 或 `./authy-export-darwin-amd64`

1. 输入 Authy 注册电话国家区号，不加 `+`，例如 `1`, `86`
2. 输入 Authy 注册电话号码， 例如 `8008208820`
3. 打开现有 Authy 应用，授权登录
4. 输入备份密码

即可得到您现有的 TOTP code：

```
otpauth://totp/Google:xxxxxx@gmail.com?digits=6&secret=xxxxxx
......
```

[![](https://jpg.sevencdn.com/bs3.jpgcom.com/2023/06/28/1f924a1c6204b58c25c6a6bb23d39a9c.png)](https://jpg.sevencdn.com/bs3.jpgcom.com/2023/06/28/1f924a1c6204b58c25c6a6bb23d39a9c.png)

备份成功后记得删除 `~/authy-go.json` 文件。]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[一些 Git 命令]]></title>
            <link>https://yxlog.com/git-commands</link>
            <guid isPermaLink="false">https://yxlog.com/git-commands</guid>
            <pubDate>Fri, 28 Oct 2022 10:25:00 GMT</pubDate>
            <description><![CDATA[初始化一个新的 git 仓库

```
git init
```

为 Git 全局配置默认名称及邮箱

```
git config --global user.name <your-name>
git config --global user.email <your-email>
```

**克隆一个仓库**

```
git clone <repository-url>
```

加一个文件到暂存区:

```
git add <file>
```

**将所有文件添加到暂存区**

```...]]></description>
            <content:encoded><![CDATA[初始化一个新的 git 仓库

```
git init
```

为 Git 全局配置默认名称及邮箱

```
git config --global user.name <your-name>
git config --global user.email <your-email>
```

**克隆一个仓库**

```
git clone <repository-url>
```

加一个文件到暂存区:

```
git add <file>
```

**将所有文件添加到暂存区**

```
git add.
```

检查未暂存的更改

```
git diff
```

**提交暂存区的更改**

```
git commit -m "Message"
```

将暂存区重置为最后一次提交

```
git reset
```

检查工作目录和暂存区的状态

```
git status
```

从索引和工作目录中删除文件

```
git rm <file>
```

列出提交历史

```
git log
```

检查提交的元数据和内容更改

```
git show <commit-hash>
```

列出所有本地分支

```
git branch
```

创建一个新分支

```
git branch <branch-name>
```

重命名当前分支

```
git branch -m <new-branch-name>
```

删除一个分支

```
git branch -d <branch-name>
```

切换到另一个分支

```
git checkout <branch-name>
```

合并指定分支到当前分支

```
git merge <branch-name>
```

**添加远程仓库**

```
git remote add <name> <repository-url>
```

**将提交的更改推送到远程存储库**

```
git push <remote> <branch>
```

**从远程存储库下载内容**

```
git pull <remote>
```

清理不必要的文件并优化本地存储库

```
git gc
```

临时删除未提交的更改并保存以供以后使用

```
git stash
```

重新应用以前隐藏的更改

```
git stash apply
```
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[榨干 Oracle ARM 2/ 安装 Mastodon]]></title>
            <link>https://yxlog.com/better-use-oracle-arm-machine-2</link>
            <guid isPermaLink="false">https://yxlog.com/better-use-oracle-arm-machine-2</guid>
            <pubDate>Sat, 15 Oct 2022 22:05:00 GMT</pubDate>
            <description><![CDATA[> 本文成文时间较久，内容与现行版本可能出现差异，请谨慎参考

甲骨文免费的 ARM 4C24G 的机器只用来搭梯子就大材小用了，这里结合博主自身的体验，说说如何榨干它。

以下均基于 Debian 11 root 用户 。

## Pre-install

安装 Docker、Nginx 请查看系列 1

[榨干 Orcale ARM 1/ Gitlab](/better-use-oracle-arm-machine-1)

## 安装 Mastodon

新建文件夹

```bash
mkdir -p /var/ww...]]></description>
            <content:encoded><![CDATA[> 本文成文时间较久，内容与现行版本可能出现差异，请谨慎参考

甲骨文免费的 ARM 4C24G 的机器只用来搭梯子就大材小用了，这里结合博主自身的体验，说说如何榨干它。

以下均基于 Debian 11 root 用户 。

## Pre-install

安装 Docker、Nginx 请查看系列 1

[榨干 Orcale ARM 1/ Gitlab](/better-use-oracle-arm-machine-1)

## 安装 Mastodon

新建文件夹

```bash
mkdir -p /var/www/mastodon && cd /var/www/mastodon
```

编辑 docker-compose.yml

```bash
vim docker-compose.yml
```

将下方代码粘贴进去，按 Esc，输入 :wq 保存退出

```yaml
version: '3'
services:
  db:
    restart: always
    image: postgres:12.5-alpine
    shm_size: 256mb
    networks:
      - internal_network
    healthcheck:
      test: ["CMD", "pg_isready", "-U", "postgres"]
    volumes:
      - ./postgres:/var/lib/postgresql/data

  redis:
    restart: always
    image: redis:6-alpine
    networks:
      - internal_network
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
    volumes:
      - ./redis:/data

#  es:
#    image: kubesphere/elasticsearch-oss:6.7.0-1-arm64
#    environment:
#      - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
#      - "cluster.name=es-mastodon"
#      - "discovery.type=single-node"
#      - "bootstrap.memory_lock=true"
#    networks:
#      - internal_network
#    healthcheck:
#      test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
#    volumes:
#      - ./elasticsearch:/usr/share/elasticsearch/data
#    ulimits:
#      memlock:
#        soft: -1
#        hard: -1
#    restart: unless-stopped

  web:
    image: plusminusio/mastodon:latest-arm64
    restart: always
    env_file: .env.production
    command: bash -c "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"
    networks:
      - external_network
      - internal_network
    healthcheck:
      test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:3000/health || exit 1"]
    ports:
      - "127.0.0.1:3000:3000"
    depends_on:
      - db
      - redis
#      - es
    volumes:
      - ./public/system:/mastodon/public/system

  streaming:
    image: plusminusio/mastodon:latest-arm64
    restart: always
    env_file: .env.production
    command: node ./streaming
    networks:
      - external_network
      - internal_network
    healthcheck:
      test: ["CMD-SHELL", "wget -q --spider --proxy=off localhost:4000/api/v1/streaming/health || exit 1"]
    ports:
      - "127.0.0.1:4000:4000"
    depends_on:
      - db
      - redis

  sidekiq:
    image: plusminusio/mastodon:latest-arm64
    restart: always
    env_file: .env.production
    command: bundle exec sidekiq
    depends_on:
      - db
      - redis
    networks:
      - external_network
      - internal_network
    volumes:
      - ./public/system:/mastodon/public/system

networks:
  external_network:
  internal_network:
    internal: true
```

配置数据库

```bash
docker run --name postgres12 -v /var/www/mastodon/postgres:/var/lib/postgresql/data -e   POSTGRES_PASSWORD=设置数据库管理员密码 --rm -d postgres:12.5-alpine
```

检查 postgres 文件夹，应该出现 postgres 相关的多个文件，不是空文件夹。

然后执行

```bash
docker exec -it postgres12 psql -U postgres
```

输入

```bash
CREATE USER mastodon WITH PASSWORD '数据库密码（最好和数据库管理员密码不一样）' CREATEDB;
```

创建 mastodon 用户，然后停止 docker

```bash
docker stop postgres12
```

配置 .env.production

```bash
# 回到 mastodon 文件夹
cd /var/www/mastodon

# 生成文件
touch .env.production

# 配置文件
dc run --rm web bundle exec rake mastodon:setup
```

01. 输入域名
02. Enable single user mode? 否
03. Using Docker to run Mastodon? 是
04. postsql 用户名、数据库名填 mastodon ，密码部分填刚刚设置的数据库密码
05. redis 部分都直接回车
06. Store uploaded files on the cloud? 这个可填否，如有需要可配置 S3。
07. Send e-mails from localhost? 否。然后填入邮件服务设置，推荐使用 [Mailazy](https://mailazy.com/)， **具体配置可参照下方**。
08. This configuration will be written to .env.production Save configuration? 是
09. 然后会出现 .env.production 配置， **复制下来，先存到电脑里，等会用**。
10. 然后会要你建立数据库和编译，都选是。最后建立管理员账号。

成功之后，编辑 .env.production 文件，复制上方保存的配置信息，按 Esc，输入 :wq 保存退出

```bash
vim .env.production
```

S3 及 SMTP 信息大致如下

```bash
S3_ENABLED=true
S3_PROTOCOL=https
S3_REGION=fr-par
S3_ENDPOINT=https://s3.fr-par.scw.cloud
S3_HOSTNAME=[hidden].s3.fr-par.scw.cloud
S3_BUCKET=[hidden]
AWS_ACCESS_KEY_ID=[hidden]
AWS_SECRET_ACCESS_KEY=[hidden]
S3_ALIAS_HOST=[hidden]
SMTP_SERVER=smtp.mailazy.com
SMTP_PORT=587
SMTP_LOGIN=[hidden]
SMTP_PASSWORD=[hidden]
SMTP_AUTH_METHOD=plain # 该配置仅代表可用于 mailazy，若为其他服务商请做相应更改
SMTP_OPENSSL_VERIFY_MODE=none # 该配置仅代表可用于 mailazy，若为其他服务商请做相应更改
SMTP_FROM_ADDRESS=mastodon@[hidden]
```

运行

```bash
dc up -d
```

为相应文件夹赋权

```bash
chown 991:991 -R ./public
chown -R 70:70 ./postgres

# 关闭
dc down

# 再次启动
dc up -d
```

查看运行详情

```bash
dc ps

NAME                   COMMAND                  SERVICE             STATUS              PORTS
mastodon-db-1          "docker-entrypoint.s…"   db                  running (healthy)
mastodon-redis-1       "docker-entrypoint.s…"   redis               running (healthy)
mastodon-sidekiq-1     "/usr/bin/tini -- bu…"   sidekiq             running             4000/tcp
mastodon-streaming-1   "/usr/bin/tini -- no…"   streaming           running (healthy)   127.0.0.1:4000->4000/tcp
mastodon-web-1         "/usr/bin/tini -- ba…"   web                 running (healthy)   127.0.0.1:3000->3000/tcp

# 当状态均为 healthy 的时候即代表成功运行
```

配置 Nginx

创建配置文件

```bash
vim /etc/nginx/conf.d/mastodon.conf
```

复制下方 http 配置信息以申请 SSL 证书，按 Esc，输入 :wq 保存退出

```bash
server {
  listen 80;
  # 若配置了 IPV6，删除下方的井号
  # listen [::]:80;
  server_name mastodon.im.sb;
  root /var/www/mastodon/public;
  location /.well-known/acme-challenge/ { allow all; }
  location / { return 301 https://$host$request_uri; }
}

# 将 mastodon.im.sb 替换成您自己的域名
```

重载 Nginx

```bash
nginx -t
# 确保配置文件无异常
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful

# 重载
nginx -s reload
```

**将您的域名 A 记录及 AAAA 记录（若有）指向服务器 IP**，然后申请域名证书

```bash
acme.sh --issue -d mastodon.im.sb -w /var/www/mastodon/public --server letsencrypt

# 可选，申请 ECC 证书
acme.sh --issue -d mastodon.im.sb -w /var/www/mastodon/public -k ec-256 --server letsencrypt

# 将 mastodon.im.sb 替换成您自己的域名
```

再次编辑配置文件

```bash
vim /etc/nginx/conf.d/mastodon.conf
```

复制下方完整配置信息，按 Esc，输入 :wq 保存退出

```bash
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

upstream backend {
    server 127.0.0.1:3000 fail_timeout=0;
}

upstream streaming {
    server 127.0.0.1:4000 fail_timeout=0;
}

server {
  listen 80;
  # 若配置了 IPV6，删除下方的井号
  # listen [::]:80;
  server_name mastodon.im.sb;
  root /var/www/html;
  location /.well-known/acme-challenge/ { allow all; }
  location / { return 301 https://$host$request_uri; }
}

server {
  listen 443 ssl http2;
  # 若配置了 IPV6，删除下方的井号
  # listen [::]:443 ssl http2;
  server_name mastodon.im.sb;

  ssl_certificate  /root/.acme.sh/mastodon.im.sb/fullchain.cer;
  ssl_certificate_key /root/.acme.sh/mastodon.im.sb/mastodon.im.sb.key;
  # 如果申请的有 ECC 证书，删除下方两行的井号
  # ssl_certificate  /root/.acme.sh/mastodon.im.sb_ecc/fullchain.cer;
  # ssl_certificate_key /root/.acme.sh/mastodon.im.sb_ecc/mastodon.im.sb.key;

  ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  ssl_ciphers TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers off;
  ssl_ecdh_curve X25519:secp384r1;

  ssl_session_cache shared:MASTODON:10m;
  ssl_session_timeout 1d;
  ssl_session_tickets off;

  ssl_stapling on;
  ssl_stapling_verify on;
  resolver 1.1.1.1 8.8.8.8 119.29.29.29 valid=300s;
  resolver_timeout 5s;

  root /var/www/mastodon/public;

  gzip on;
  gzip_disable "msie6";
  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 6;
  gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

  add_header Strict-Transport-Security "max-age=31536000" always;

  keepalive_timeout    70;
  sendfile             on;
  client_max_body_size 80m;

  location / {
    try_files $uri @proxy;
  }

  location ~ ^/(emoji|packs|system/accounts/avatars|system/media_attachments/files) {
    add_header Cache-Control "public, max-age=31536000, immutable";
    add_header Strict-Transport-Security "max-age=31536000" always;
    try_files $uri @proxy;
  }

  location /sw.js {
    add_header Cache-Control "public, max-age=0";
    add_header Strict-Transport-Security "max-age=31536000" always;
    try_files $uri @proxy;
  }

  location @proxy {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Proxy "";
    proxy_pass_header Server;

    proxy_pass http://backend;
    proxy_buffering on;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    add_header X-Cached $upstream_cache_status;
    add_header Strict-Transport-Security "max-age=31536000" always;

    tcp_nodelay on;
  }

  location /api/v1/streaming {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header Proxy "";

    proxy_pass http://streaming;
    proxy_buffering off;
    proxy_redirect off;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;

    tcp_nodelay on;
  }

  error_page 403 404 500 501 502 503 504 /500.html;
}

# 将 mastodon.im.sb 替换成您自己的域名
```

重载 Nginx

```bash
nginx -t
# 确保配置文件无异常
# nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
# nginx: configuration file /etc/nginx/nginx.conf test is successful

# 重载
nginx -s reload
```

现在访问您的域名即可访问 Mastodon。

> 👉 参考了 [此篇文章](https://pullopen.github.io/%E5%9F%BA%E7%A1%80%E6%90%AD%E5%BB%BA/2020/10/19/Mastodon-on-Docker.html)。
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[榨干 Oracle ARM 1/ 安装 Gitlab]]></title>
            <link>https://yxlog.com/better-use-oracle-arm-machine-1</link>
            <guid isPermaLink="false">https://yxlog.com/better-use-oracle-arm-machine-1</guid>
            <pubDate>Sat, 15 Oct 2022 15:08:00 GMT</pubDate>
            <description><![CDATA[> 本文成文时间较久，内容与现行版本可能出现差异，请谨慎参考

骨文免费的 ARM 4C24G 的机器只用来搭梯子就大材小用了，这里结合博主自身的体验，说说如何榨干它。

以下均基于 Debian 11 root 用户 。

## 安装 Docker 及 Compose

第一步，先安装 Docker 及 Docker-Compose

安装依赖

```bash
apt-get update && apt-get install ca-certificates curl wget vim gnupg lsb-release -...]]></description>
            <content:encoded><![CDATA[> 本文成文时间较久，内容与现行版本可能出现差异，请谨慎参考

骨文免费的 ARM 4C24G 的机器只用来搭梯子就大材小用了，这里结合博主自身的体验，说说如何榨干它。

以下均基于 Debian 11 root 用户 。

## 安装 Docker 及 Compose

第一步，先安装 Docker 及 Docker-Compose

安装依赖

```bash
apt-get update && apt-get install ca-certificates curl wget vim gnupg lsb-release -y
```

下载 GPG Key

```bash
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

```

更新 apt source

```bash
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
```

安装 Docker Engine

```bash
apt-get update && apt-get install docker-ce docker-ce-cli containerd.io -y

## 可选，用 d 代替 docker 命令
ln -s /usr/bin/docker /usr/bin/d
```

安装 Docker Compose

```bash
wget -O /usr/local/bin/docker-compose "https://github.com/docker/compose/releases/download/v2.3.3/docker-compose-linux-aarch64"

chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

## 可选，可用 dc 代替 docker-compose 命令
ln -s /usr/local/bin/docker-compose /usr/bin/dc
```

查看是否安装成功

```bash
d -v
# Docker version 20.10.13, build a224086
dc -v
# Docker Compose version v2.3.3
```

> 💡 以下我均用 dc 代替 docker-compose 命令。

## 安装 Nginx 及 acme.sh

安装 GPG Key

```bash
curl https://nginx.org/keys/nginx_signing.key | gpg --dearmor | tee /usr/share/keyrings/nginx-archive-keyring.gpg >/dev/null
```

更新 apt source

```bash
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/mainline/debian `lsb_release -cs` nginx" | tee /etc/apt/sources.list.d/nginx.list

# 提权
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | tee /etc/apt/preferences.d/99nginx
```

安装 Nginx

```bash
apt update && apt install nginx -y
```

安装 acme.sh

```bash
curl -L get.acme.sh | bash

# 重启终端，重新登录 SSH
```

## 安装 Gitlab

新建文件夹

```bash
mkdir -p /var/www/gitlab && cd /var/www/gitlab
```

编辑 docker-compose.yml

```bash
vim docker-compose.yml
```

将下方代码粘贴进去，按 Esc，输入 :wq 保存退出

```yaml
version: '3.6'
services:
  web:
    image: 'yrzr/gitlab-ce-arm64v8:latest'
    hostname: 'git.im.sb'
    restart: unless-stopped
    environment:
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'http://git.im.sb'
        gitlab_rails['gitlab_shell_ssh_port'] = 3022
        gitlab_rails['time_zone'] = 'Asia/Shanghai'
        gitlab_rails['gitlab_ssh_host'] = 'git.im.sb'
    ports:
      - '3080:80'
      - '3022:22'
    volumes:
      - './config:/etc/gitlab'
      - './logs:/var/log/gitlab'
      - './data:/var/opt/gitlab'
  runner:
    restart: always
    volumes:
      - './runner-config:/etc/gitlab-runner'
      - '/var/run/docker.sock:/var/run/docker.sock'
    image: 'gitlab/gitlab-runner:latest'

# 以上所有 git.im.sb 均修改为您自己的域名
```

运行

```bash
dc up -d

# 查看运行详情
dc ps

NAME                COMMAND                  SERVICE             STATUS              PORTS
gitlab-runner-1     "/usr/bin/dumb-init …"   runner              running
gitlab-web-1        "/assets/wrapper"        web                 running (healthy)   0.0.0.0:3022->22/tcp, 0.0.0.0:3080->80/tcp, :::3022->22/tcp, :::3080->80/tcp

# 当 gitlab-web-1 状态为 healthy 的时候即代表成功运行，访问 ip:3080 即可进入 Gitlab 首页
```

查看默认 root 密码

```bash
cat config/initial_root_password

# WARNING: This value is valid only in the following conditions
#          1. If provided manually (either via `GITLAB_ROOT_PASSWORD` environment variable or via `gitlab_rails['initial_root_password']` setting in `gitlab.rb`, it was provided before database was seeded for the first time (usually, the first reconfigure run).
#          2. Password hasn't been changed manually, either via UI or via command line.
#
#          If the password shown here doesn't work, you must reset the admin password following https://docs.gitlab.com/ee/security/reset_user_password.html#reset-your-root-password.

Password: [Hidden]

# NOTE: This file will be automatically deleted in the first reconfigure run after 24 hours.
```

以用户名 root 及上方 Password 密码即可登陆 Gitlab。

> 配置 Runner、HTTPS 待更......

* * *

安装 Mastodon 可查看系列 2

[榨干 Orcale ARM 2/ Mastodon](/better-use-oracle-arm-machine-2)
]]></content:encoded>
            <author>YJK</author>
        </item>
        <item>
            <title><![CDATA[一些强大的 Shell 命令]]></title>
            <link>https://yxlog.com/shell-codes</link>
            <guid isPermaLink="false">https://yxlog.com/shell-codes</guid>
            <pubDate>Fri, 16 Sep 2022 09:16:00 GMT</pubDate>
            <description><![CDATA[![](https://raw.sevencdn.com/imagehosted/images/master/2019/07/20190731113653.png)

在阅读以下部分前，强烈建议读者打开一个 shell 实验，这些都不是 shell 教科书里的大路货哦：）

### !$

`!$` 是一个特殊的环境变量，它代表了上一个命令的最后一个字符串。如：你可能会这样：

```
$mkdir mydir
$mv mydir yourdir
$cd yourdir

```

可以改成：

```
$mkdir ...]]></description>
            <content:encoded><![CDATA[![](https://raw.sevencdn.com/imagehosted/images/master/2019/07/20190731113653.png)

在阅读以下部分前，强烈建议读者打开一个 shell 实验，这些都不是 shell 教科书里的大路货哦：）

### !$

`!$` 是一个特殊的环境变量，它代表了上一个命令的最后一个字符串。如：你可能会这样：

```
$mkdir mydir
$mv mydir yourdir
$cd yourdir

```

可以改成：

```
$mkdir mydir
$mv !$ yourdir
$cd !$

```

### sudo !!

以 root 的身份执行上一条命令 。

场景举例：比如 Ubuntu 里用 `apt-get` 安装软件包的时候是需要 root 身份的，我们经常会忘记在 `apt-get` 前加 `sudo`。每次不得不加上 `sudo` 再重新键入这行命令，这时可以很方便的用 `sudo !!` 完事。

（注：在 shell 下，有时候你会输入很长的命令，你可以使用 `!xxx` 来重复最近的一次命令，比如，你以前输入过 `vi /where/the/file/is` 下次你可以使用 `!vi` 重得上次最近一次的 vi 命令。）

### cd –

回到上一次的目录 。

场景举例：当前目录为 `/home/a`，用 `cd ../b` 切换到 `/home/b`。这时可以通过反复执行 `cd –` 命令在 `/home/a` 和 `/home/b` 之间来回方便的切换。

（注： `cd ~` 是回到自己的 Home 目录， `cd ~user`，是进入某个用户的 Home 目录）

### `ALT+.` or `<ESC> .`

热建 `alt+.` 或 `esc+.` 可以把上次命令行的参数给重复出来。

### oldnew

替换前一条命令里的部分字符串。

场景： `echo "wanderful"`，其实是想输出 `echo "wonderful"`。只需要 `^a^o` 就行了，对很长的命令的错误拼写有很大的帮助。（注：也可以使用 `!!:gs/old/new`）

### du -s \* \| sort -n \| tail

列出当前目录里最大的10个文件。

### :w !sudo tee %

在 vi 中保存一个只有 root 可以写的文件

### date -d@1234567890

时间截转时间

### \> file.txt

创建一个空文件，比 touch 短。

### mtr coolshell.cn

`mtr` 命令比 `traceroute` 要好。

### 在命令行前加空格，该命令不会进入 history 里。

### echo "ls -l" \| at midnight

在某个时间运行某个命令。

### ps aux \| sort -nk +4 \| tail

列出头十个最耗内存的进程

### man ascii

显示 ascii 码表。

场景：忘记 ascii 码表的时候还需要 Google 么？尤其在天朝网络如此“顺畅”的情况下，就更麻烦在GWF多应用一次规则了，直接用本地的 `man ascii` 吧。

### ctrl-x e

快速启动你的默认编辑器（由变量 $EDITOR 设置）。

### netstat –tlnp

列出本机进程监听的端口号。

（注：netstat -anop 可以显示侦听在这个端口号的进程）

### ssh user@server bash < /path/to/local/script.sh

在远程机器上运行一段脚本。这条命令最大的好处就是不用把脚本拷到远程机器上。

### ssh user@host cat /path/to/remotefile \| diff /path/to/localfile -

比较一个远程文件和一个本地文件

### curl ifconfig.me

当你的机器在内网的时候，可以通过这个命令查看外网的IP。

### lsof –i

实时查看本机网络服务的活动状态。

### vim scp://username@host//path/to/somefile

Vim 一个远程文件

全文转载自 [1](https://coolshell.cn/articles/8619.html)
]]></content:encoded>
            <author>YJK</author>
        </item>
    </channel>
</rss>