synchronization
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
2025-08-25 16:02:49 +08:00
commit d12a206210
28 changed files with 877 additions and 0 deletions

83
.drone.yml Normal file
View File

@@ -0,0 +1,83 @@
# kubectl create secret generic build-node-secret \
# --from-literal=HOST="" \
# --from-file=KEY=./*.pem \
# --from-literal=PORT="22" \
# --from-literal=PATH="" \
# --namespace=drone
kind: pipeline
type: kubernetes
name: MD BUILD
trigger:
event:
include:
- custom
workspace:
base: /drone/
path: /drone/System
steps:
- name: 编译文档正文
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:ubuntu-22.04
pull: if-not-exists
commands:
- ./builder.sh
- rm -rf ./builder.sh
- name: 生产环境部署
image: appleboy/drone-scp
pull: if-not-exists
settings:
host:
from_secret: HOST
key:
from_secret: KEY
port:
from_secret: PORT
target:
from_secret: PATH
user: root
source: ../System
overwrite: true
- name: 重启生产博客组件
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:ubuntu-22.04
volumes:
- name: kubectl
path: /usr/local/bin
- name: config
path: /root/.kube
commands:
- /usr/local/bin/kubectl -n blog rollout restart deployment blog
volumes:
- name: kubectl
host:
path: /usr/local/bin
type: File
- name: config
host:
path: /root/.kube
---
kind: secret
name: HOST
get:
path: build-node-secret
name: HOST
---
kind: secret
name: KEY
get:
path: build-node-secret
name: KEY
---
kind: secret
name: PORT
get:
path: build-node-secret
name: PORT
---
kind: secret
name: PATH
get:
path: build-node-secret
name: PATH

28
.gitignore vendored Normal file
View File

@@ -0,0 +1,28 @@
# ---> macOS
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

View File

@@ -0,0 +1,21 @@
> 本文作者:丁辉
# MAC安装Drone客户端
1. 使用 Homebrew 安装 Drone命令
```bash
brew tap drone/drone
brew install drone
```
2. 使用命令触发 Drone 构建
```bash
curl -X POST \
-H "Authorization: Bearer $YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
https://your.drone.instance/api/repos/用户/仓库名/builds
```

View File

@@ -0,0 +1,19 @@
> 本文作者:丁辉
# MAC控制外屏亮度
[MonitorControl仓库地址](https://github.com/MonitorControl/MonitorControl)
- 方法一, 命令安装
```bash
brew install MonitorControl
```
- 方法二, dmg 安装包安装
```bash
https://github.com/MonitorControl/MonitorControl/releases/download/v4.2.0/MonitorControl.4.2.0.dmg
```

View File

@@ -0,0 +1,16 @@
> 本文作者:丁辉
# MAC数据库开关
- 开启
```bash
/opt/homebrew/opt/mysql/support-files/mysql.server start
```
- 关闭
```bash
/opt/homebrew/opt/mysql/support-files/mysql.server stop
```

View File

@@ -0,0 +1,10 @@
> 本文作者:丁辉
# MAC浏览器无法访问不安全网站
键盘输入回车解决
```bash
thisisunsafe
```

View File

@@ -0,0 +1,42 @@
> 本文作者:丁辉
# Mac使用Kvm_Client连接华为服务器遇到的问题
## 第一步打开软件
> 准备 Java 环境才可以使用 kvm_client 连接
>
> [Java下载](https://www.java.com/zh-CN/)
下载 kvm_client_mac.zip 工具后、解压软件包、打开电脑终端进入 kvm_client_mac 解压好的目录
```bash
bash KVM.sh
```
### 问题一
```bash
Warning: the fonts "Times" and "Lucida Bright" are not available for the Java
```
[Times字体下载地址](http://legionfonts.com/fonts/times)
下载字体解压安装并重启软件(如果没有生效则重启 Java)
### 问题二
```
TSM AdjustCapsLockLEDForKeyTransitionHandling - _ISSetPhysicalKeyboardCapsLockLED Inhibit Exception in thread "Thread-2"
```
关闭 使用“中/英“键切换“ABC”输入法 即可
进入 MAC 设置页面
<img src="https://minio.offends.cn:9000/offends/images/kvm-mac1.png" style="zoom:25%;" />
关闭
<img src="https://minio.offends.cn:9000/offends/images/kvm-mac2.png" style="zoom:33%;" />

View File

@@ -0,0 +1,16 @@
> 本文作者:丁辉
# Mac删除权限被锁定的应用
打开终端,输入命令后将应用拖拽到终端
```bash
sudo rm -rf [应用路径]
```
> 如果报错Operation not permitted 则执行下一步命令,后再次执行删除命令
```bash
sudo /usr/bin/chflags -R noschg [应用路径]
```

View File

@@ -0,0 +1,23 @@
> 本文作者:丁辉
# Mac命令launchctl的使用
- 查找现有的服务
```bash
launchctl list
```
- 停止服务
```bash
launchctl stop [service-name]
```
- 载服务配置,防止其在未来自动启动
```
launchctl unload -w ~/Library/LaunchAgents/[service-name].plist
```

View File

@@ -0,0 +1,12 @@
> 本文作者:丁辉
# Mac安装Brew工具
[Homebrew官网](https://brew.sh/)
安装命令
```bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
```

View File

@@ -0,0 +1,136 @@
> 本文作者:丁辉
>
# 部署 Oh My Zsh
> 本文介绍如何安装"Oh My Zsh" 终端和 "zsh-autosuggestions" 自动补全工具
[Github项目地址](https://github.com/ohmyzsh/ohmyzsh)
[Homebrew官网](https://brew.sh/)
1. 打开 Mac 终端输入下载命令(下列三种方式都可以,建议使用 curl 因为 mac 一般自带哈哈)
| Method | Command |
| :-------: | :----------------------------------------------------------: |
| **curl** | `sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
| **wget** | `sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
| **fetch** | `sh -c "$(fetch -o - https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"` |
2. 启用插件
```bash
vi ~/.zshrc
```
3. 替换如下内容
> 原内容如下
>
> ```bash
> plugins=(git)
> ```
修改后
```bash
plugins=(
git
bundler
dotenv
macos
rake
rbenv
ruby
)
```
4. 重启终端查看效果
# 部署 zsh-autosuggestions
[Github项目地址](https://github.com/zsh-users/zsh-autosuggestions)
1. 克隆仓库
```bash
git clone https://github.com/zsh-users/zsh-autosuggestions.git ~/.oh-my-zsh/custom/plugins/zsh-autosuggestions
```
2. 修改配置文件
```bash
vim ~/.zshrc
```
3. 添加 `zsh-autosuggestions` 到 plugins=() 模块内
```bash
plugins=(
zsh-autosuggestions
)
```
4. 重启终端查看效果
# 更换主题
[主题展示](https://github.com/ohmyzsh/ohmyzsh/wiki/Themes)
1. 编辑配置文件
```bash
~/.zshrc
```
2. 找到 `ZSH_THEME` 配置
```bash
ZSH_THEME="agnoster"
```
# 安装字体
[Github项目地址](https://github.com/powerline/fonts)
1. 克隆仓库
```bash
git clone https://github.com/powerline/fonts.git --depth=1
```
2. 安装
```bash
cd fonts
./install.sh
```
3. 清除安装包
```bash
cd ..
rm -rf fonts
```
**更换字体**
1. Vscode更换字体
打开vscode > Settings > 搜索font > 找到`Terminal Integrated: Font Family`
填写字体(格式如下)
可以用 "," 来分隔多个字体
```bash
Go Mono for Powerline,Hack
```
2. Mac 默认终端更换字体
点击左上角终端 > 偏好设置 > 描述文件 > 更改字体 > 点击搜索添加
3. Item2 终端更换字体
点击左上角iTerm2 > Preferences > Profiles > Text > 勾选 Use built-in Powerline glyphs

View File

@@ -0,0 +1,36 @@
> 本文作者:丁辉
# Vscode配置特殊SSH协议
> 连接过老版本的服务器时有些服务器SSH会报错解决方法如下
打开 vscode ssh 配置文件
```bash
## START GITPOD INTEGRATION
## This section is managed by Gitpod. Any manual changes will be lost.
Include "gitpod/config"
## END GITPOD INTEGRATION
#普通
Host 192.168.1.1
HostName 192.168.1.1
User root
#带端口
Host 192.168.1.2
HostName 192.168.1.2
Port 22
User root
#特殊协议
Host 192.168.1.3
HostName 192.168.1.3
User root
Host *
KexAlgorithms +diffie-hellman-group-exchange-sha1
HostKeyAlgorithms +ssh-rsa
ProxyCommand nc -X connect -x 127.0.0.1:15732 %h %p
```

5
MacBook/软件记录.md Normal file
View File

@@ -0,0 +1,5 @@
> 本文作者:丁辉
# 软件记录
- SFTP [filezilla](https://filezilla-project.org/)

16
README.md Normal file
View File

@@ -0,0 +1,16 @@
*
> 本文作者:丁辉
# System
> 目录详情
| 文件夹名 | 内容 |
| :--------: | :----------------: |
| MacBook | MacBook系统文档 |
| Windows | Windows系统文档 |
| 云服务 | 云服务操作文档 |
| 开发语言GO | 开发语言GO学习文档 |
| 浏览器 | 浏览器使用文档 |

17
Windows/Windows优化.md Normal file
View File

@@ -0,0 +1,17 @@
> 本文作者:丁辉
# Windows优化
- 关闭系统休眠文件(文件清理)
```bash
powercfg -h off
```
> 开启
>
> ```bash
> powercfg -h on
> ```

View File

@@ -0,0 +1,17 @@
> 本文作者:丁辉
# Windows安装后需要准备些什么
1. 首先第一步我肯定选择激活我的系统哈哈
[Github开源工具地址](https://github.com/zbezj/HEU_KMS_Activator/releases)(作者说了仅供测试懂得都懂)
2. 第一步我肯定需要一个解压工具
[WinRaR工具下载地址](https://www.rarlab.com/download.htm)(这一款是我个人觉得最好用的)
3. 服务器远程连接工具
[Xshell和Xftp官网免费版下载](https://www.netsarang.com/en/free-for-home-school/)
> 我其实就是想找文档记住这俩网址哈哈哈哈,别的以后再写

View File

@@ -0,0 +1,24 @@
> 本文作者:丁辉
# Windows常用操作
## Windows如何添加解析和刷新DNS?
1. Windows添加解析, 编辑次文件
```bash
C:\Windows\System32\drivers\etc
```
2. 刷新DNS
```bash
ipconfig /flushdns
```
## windiws密钥Ssh文件位置在哪里?
```bash
C:\Users\Administrator\.ssh
```

View File

@@ -0,0 +1,22 @@
> 本文作者:丁辉
# Windows虚拟机无法开启虚拟化
1. 删除Hyper-V功能
- 按下 WIN+R 组合键打开"运行" > 输入 `appwiz.cpl` > 点击启用或关闭 Windows 功能 > 取消勾选Hyper-V > 确定
2. 修改 hypervisorlaunchtype
- 按下 WIN+R 组合键打开"运行" > 输入 `cmd` > 运行命令 `bcdedit /set hypervisorlaunchtype off`
> 执行这个命令后,系统将不再启动 Hypervisor这对于一些需要直接访问硬件而不受虚拟化层限制的应用程序可能很有用。请注意关闭 Hypervisor 可能会影响某些虚拟化相关的功能,如在虚拟机中运行其他虚拟化平台,因此在执行此操作之前,建议您了解其影响,并确保您知道为什么需要关闭 Hypervisor。如果不需要关闭 Hypervisor最好将其保持默认状态。
3. 重新启动计算机
一般在这样就可以结束了,如果不行的话就。。。
按下WIN+R组合键打开"运行" > 输入services.msc回车 > 按下键盘 hv > 找到HV主机服务右键属性 > 启动类型改为禁用 > 确定

View File

@@ -0,0 +1,21 @@
> 本文作者:丁辉
# 安装Windows11跳过联网过程
## 方法一
按下 Shift+F10 或者是 Fn+Shift+F10
```bash
OOBE\BYPASSNRO
```
按下回车,电脑进入重启,随后就会成功跳过
## 方法二
1. 在出现的命令提示符页面中输入 taskmgr 回车,打开任务管理器。
2. 点开【详细信息】。
3. 在【详细信息】选项卡中找到并右击【OOBENetworkConnectionFlow.exe】选择【结束进程树】。关闭窗口后即可进入创建本地账户页面。

View File

@@ -0,0 +1,12 @@
> 本文作者:丁辉
# 端口检测工具记录
国内测试
工具http://tool.chinaz.com/port
国外测试
工具https://www.yougetsignal.com/tools/open-ports/
国内外同时测试
工具http://port.ping.pe/

6
Windows/软件记录.md Normal file
View File

@@ -0,0 +1,6 @@
> 本文作者:丁辉
# 软件记录
- 抢票软件 [bypass官网](https://www.bypass.cn/)
- DDOS [High_Orbit_Ion_Cannon](https://en.wikipedia.org/wiki/High_Orbit_Ion_Cannon)

97
builder.sh Normal file
View File

@@ -0,0 +1,97 @@
#!/bin/bash
#############################################################################################
# 用途: 初始化文档脚本
# 作者: 丁辉
# 编写时间: 2024-07-30
#############################################################################################
# 定义函数信息
RED='\033[0;31m'
NC='\033[0m'
GREEN='\033[32m'
YELLOW='\033[33m'
TIME="+%Y-%m-%d %H:%M:%S"
function SEND_INFO() {
info=$1
echo -e "${GREEN}$(date "$TIME") INFO: $info${NC}"
}
function SEND_WARN() {
warn=$1
echo -e "${YELLOW}$(date "$TIME") WARN: $warn${NC}"
}
function SEND_ERROR() {
error=$1
echo -e "${RED}$(date "$TIME") ERROR: $error${NC}"
}
# 整理文档
function Clean_File() {
SEND_INFO "------------ 开始清理仓库内无关文件 ------------"
SEND_INFO "------------ Git 文件清理 ------------"
rm -rf .git
rm -rf .gitignore
rm -rf .drone.yml
rm -rf ./README.md
SEND_INFO "------------ 特殊文件/目录清理 ------------"
find . -type f ! \( -name "*.md" -o -name "builder.sh" \) -exec rm {} +
SEND_INFO "------------ 开始初始化文档 ------------"
SEND_INFO "------------ README.md 文件初始化 ------------"
# 清理第一行带有 * 号文件
for i in $(find ./ -type f -name "*.md"); do
if head -n 1 ${i} | grep -q '^*'; then
rm ${i}
fi
done
# 更改剩下的文件名称
for i in $(find ./ -type f -name "README.md"); do
path=$(echo $i | awk -F'/README.md' '{print $1}')
name=$(sed -n '3p' $i | awk '{print $2}')
mv $i ${path}/${name}.md
done
}
# 初始化 MD 文件
function Init_Docs() {
SEND_INFO "------------ 初始化文档正文 ------------"
for i in $(find ./ -type f -name "*.md" | sed 's|^./||'); do
DNAME=$(echo $i | awk -F '/' '{print "系统-"$1}')
MDNAME=$(echo $i | awk -F '/' '{print $(NF)}' | awk -F '.' '{print $1}')
sed -i "1i---\n\
title:\n\
keywords: admin-template,vue,element,后台模板\n\
cover: /img/block.png\n\
sticky:\n\
banner:\n\
type: img\n\
bgurl: /img/demo.png\n\
bannerText: \n\
author: Offends\n\
categories:\n\
toc: true\n\
single_column: true\n\
---\n" $i
sed -i "s#title:#title: $MDNAME#g" $i
sed -i "s#categories:#categories: $DNAME#g" $i
done
}
function Replace_Url() {
SEND_INFO "------------ 开始替换 Gitee 链接为 Blog 链接 ------------"
for i in $(grep -r 'https://gitee.com/offends/' . | awk -F ':' '{print $1}'); do
sed -i 's|https://gitee.com/offends/\(.*\)blob/main/\(.*\.md\)|https://blog.offends.cn/\1\2|g' $i || true
sed -i 's|\.md$|.html|g' $i || true
sed -i 's|\.md)$|.html)|g' $i || true
done
}
function All() {
SEND_INFO "开始构建......"
Clean_File
Init_Docs
Replace_Url
SEND_INFO "构建完成"
}
All

View File

@@ -0,0 +1,7 @@
> 本文作者:丁辉
# 云操作系统Sealos
> 记录一个有趣的云服务
[官方文档](https://sealos.io/) [官方中文文档](https://sealos.run/)

View File

@@ -0,0 +1,12 @@
> 本文作者:丁辉
# 阿里云域名在腾讯云使用
进入阿里云点击修改DNS 为如下修改DNS应查先看自己在腾讯云的DNS是某个完后再更换
```bash
henry.dnspod.net
peach.dnspod.net
```
等待腾讯云接入成功之后即可以在腾讯云上配置域名了,并且可以在腾讯云备案阿里的域名

View File

@@ -0,0 +1,93 @@
> 本文作者:丁辉
# Hexo添加看板娘
## 方法一
1. 安装 NPM 包
```bash
npm install --save hexo-helper-live2d
```
2. 下载模型
[小模型](https://github.com/EYHN/hexo-helper-live2d)
[大模型](https://github.com/summerscar/live2dDemo)
3. 改名模型目录名为 `live2d_models/` 在 Hexo 工作目录下
4. 编辑配置文件
```bash
vi _config.yml
```
内容如下
```yaml
live2d:
enable: true
scriptFrom: local # 主目录
pluginRootPath: live2d_models/ # 模型目录
pluginJsPath: lib/ # 脚本文件相对与插件根目录路径
pluginModelPath: assets/ # 模型文件相对与插件根目录路径
# scriptFrom: jsdelivr # jsdelivr CDN
# scriptFrom: unpkg # unpkg CDN
# scriptFrom: https://cdn.jsdelivr.net/npm/live2d-widget@3.x/lib/L2Dwidget.min.js # 你的自定义 url
tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中
debug: false # 调试, 是否在控制台输出日志
model:
use: live2d-widget-model-koharu # 对应的模型名称
# use: wanko # 博客根目录/live2d_models/ 下的目录名
# use: ./wives/wanko # 相对于博客根目录的路径
# use: https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json # 你的自定义 url
display:
position: left # 居右
width: 80 # 宽度
height: 120 # 高度
mobile:
show: true # 移动端是否显示
react:
opacity: 0.7 # 模型透明度
live2d:
enable: true # 是否启动
scriptFrom: local # 默认
pluginRootPath: live2dw/ # 插件在站点上的根目录(相对路径)
pluginJsPath: lib/ # 脚本文件相对与插件根目录路径
pluginModelPath: assets/ # 模型文件相对与插件根目录路径
tagMode: false # 标签模式, 是否仅替换 live2d tag标签而非插入到所有页面中
debug: false # 调试, 是否在控制台输出日志
model:
use: live2d-widget ## 模型文件
display:
position: right # 定位方向 left right top bottom
width: 150 # 小人宽度
height: 300 # 小人高度
hOffset: -15 # 向👇偏移
vOffset: -15 # 像👈偏移
mobile:
show: true # 手机端是否显示
react:
opacity: 0.7 # 模型透明度
作者:船过水无痕
链接https://juejin.cn/post/6925325394820202510
来源:稀土掘金
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
```
## 方法二
[Github仓库](https://github.com/stevenjoezhang/live2d-widget)
在 `<head>` 中加入
```bash
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css">
<script src="https://cdn.jsdelivr.net/gh/17lai/live2d-widget@latest/autoload.js"></script>
```

View File

@@ -0,0 +1,41 @@
> 本文作者:丁辉
# GO常用基础命令
- 根据当前项目的目录结构自动判断是否使用模块模式
```bash
go env -w GO111MODULE=auto
```
- 就可以初始化go.mod
```bash
go mod init 新模块名字
```
- 更新依赖版本,清理无用依赖,更新依赖的间接依赖,生成 go.sum 文件
```bash
go mod tidy
```
- 直接编译执行 go 文件
```bash
go run 文件.go
```
- 指定编译后文件名称
```bash
go build -o 新文件名 文件.go
```
- 格式化文件(自动调整文件内容格式)
```bash
gofmt -w 文件.go
```

View File

@@ -0,0 +1,25 @@
> 本文作者:丁辉
# GO开发环境准备
> 本人使用的 Mac 电脑所以写的跟 Windows 安装方法可能有些不同
[国内下载地址](https://studygolang.com/dl)
安装 SDK 环境
- 下载文件
```bash
wget https://studygolang.com/dl/golang/go1.21.0.darwin-arm64.pkg
```
>双击进行图形化界面安装
- 制作软连接
```bash
sudo ln -s /usr/local/go/bin/go /usr/local/bin
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin
```

View File

@@ -0,0 +1,20 @@
> 本文作者:丁辉
# 安装Google应用
## 安装插件
[APK Downloader](https://chrome.google.com/webstore/category/extensions) 下载APK文件插件
[身份验证器 ](https://chrome.google.com/webstore/detail/authenticator/bhghoamapcdpbohphigoooaddinpkbai?hl=zh-CN) 动态令牌插件
## 安卓下载Play-google应用
如果需要下载手机 Google 应用可以在电脑网页版点击进入需要下载的应用页面后,复制网址放在 APK 文件获取官网的输入框里下载
[Play-google商店](https://play.google.com/store/games?hl=en&gl=US)
[下载地址](https://apps.evozi.com/apk-downloader/?id=com.google.android.apps.authenticator2) APK文件获取网址