Skip to content

Commit

Permalink
2024-12-14 14:21:23
Browse files Browse the repository at this point in the history
  • Loading branch information
JQiue committed Dec 14, 2024
1 parent 99b8d34 commit a8c5cb0
Show file tree
Hide file tree
Showing 14 changed files with 6,114 additions and 4,899 deletions.
10 changes: 4 additions & 6 deletions docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import { defineUserConfig } from 'vuepress';
import { viteBundler } from '@vuepress/bundler-vite';
import { MeiliSearchPlugin } from 'vuepress-plugin-meilisearch2';
import theme from './theme.ts';
import theme from './theme.js';

const app = defineUserConfig({
bundler: viteBundler(),
theme,
base: '/',
dest: './dist',
Expand All @@ -16,15 +14,15 @@ const app = defineUserConfig({
description: '每一个想要学习的念头,都有可能是未来的你在向你求救',
},
},
shouldPrefetch: false,
plugins: [
MeiliSearchPlugin({
host: 'https://search.jinqiu.wang',
apiKey:
'b172d836e622bd80787992d0ad189cca8bd1735fe9ca767e8c8340b0cdfd6638',
index: 'jinqiu-wang',
'a0c876c569b64568373f8488c81eafb04d157b9d5203da647fac4c0417a3d6f5',
indexUid: 'jinqiu-wang',
}),
],
shouldPrefetch: false,
});

app.onWatched = (app: any) => {
Expand Down
6 changes: 3 additions & 3 deletions docs/.vuepress/sidebar.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import { sidebar } from 'vuepress-theme-hope';

export const zh = sidebar({
'/about': 'structure',
'/': ['about'],
'/composition/': 'structure',
'/operating-system/': ['', 'windows', 'linux'],
'/compiler/': 'structure',
'/network/': 'structure',
'/ds-algorithm/': 'structure',
'/database/': ['', 'sql', 'nosql'],
'/ai/': 'structure',
'/c/': 'structure',
'/java/': 'structure',
Expand Down Expand Up @@ -40,8 +42,6 @@ export const zh = sidebar({
'practice',
],
'/rust/': 'structure',
'/ds-algorithm/': 'structure',
'/database/': ['', 'sql', 'nosql'],
'/html-css/': [
'',
'elements',
Expand Down
71 changes: 25 additions & 46 deletions docs/.vuepress/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,13 @@ const theme = hopeTheme({
docsRepo: 'https://github.com/JQiue/jqiue-notes',
docsDir: 'docs',
docsBranch: 'master',
pageInfo: [
'Author',
'Original',
'Date',
'Category',
'Tag',
'ReadingTime',
'PageView',
],
locales: {
'/': {
navbar: navbar.zh,
sidebar: sidebar.zh,
blog: {
intro: 'about.html',
avatar: '/avatar.png',
articleInfo: [
'Author',
'Original',
'Date',
'Category',
'Tag',
'ReadingTime',
'PageView',
],
medias: {
QQ: 'http://wpa.qq.com/msgrd?v=3&uin=861947542&site=qq&menu=yes',
Email: 'mailto:jqiue@foxmail.com',
Expand All @@ -64,28 +46,18 @@ const theme = hopeTheme({
'/sundry/interview': '123456',
},
},
plugins: {
blog: {},
comment: {
provider: 'Waline',
serverURL:
process.env.NODE_ENV == 'production'
? 'https://waline.jinqiu.wang'
: 'http://127.0.0.1:8360',
reaction: true,
},
mdEnhance: {
katex: true,
demo: true,
align: true,
sup: true,
sub: true,
tasklist: true,
codetabs: true,
echarts: true,
tabs: true,
},
shiki: {
markdown: {
demo: true,
align: true,
sup: true,
sub: true,
tasklist: true,
codeTabs: true,
math: true,
echarts: true,
tabs: true,
highlighter: {
type: 'shiki',
langs: [
'js',
'properties',
Expand All @@ -107,27 +79,34 @@ const theme = hopeTheme({
'tex',
'python',
'kotlin',
'scss',
],
themes: {
light: 'one-light',
dark: 'one-dark-pro',
},
},
},
plugins: {
blog: true,
comment: {
provider: 'Waline',
serverURL:
process.env.WALINE_ENV == 'production'
? 'https://waline.jinqiu.wang'
: 'http://127.0.0.1:8360',
reaction: true,
},
pwa: {
favicon: '/favicon.ico',
themeColor: '#5c92d1',
cacheHTML: true,
maxSize: 40000,
apple: {
icon: '/assets/icon/appleIcon152.png',
statusBarColor: 'black',
},
msTile: {
image: '/assets/icon/msIcon144.png',
color: '#ffffff',
},
manifest: {
id: '/',
id: 'jn',
scope: '/',
start_url: '/',
},
Expand Down
8 changes: 4 additions & 4 deletions docs/js/quality.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ date: 2019-04-12

```js
//
let maxCount = 10;
let tableTitle = '啦啦啦';
let maxCount = 10;
let tableTitle = '啦啦啦';
// 不好
let setConut = 10;
let getTitle = '啦啦啦';
let setConut = 10;
let getTitle = '啦啦啦';
```

当 const 仅限常量而不是引用时全部大写,用下划线分割单词
Expand Down
61 changes: 42 additions & 19 deletions docs/operating-system/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,42 @@ title: Linux
article: false
---

Linux 是一种免费开源的类 Unix 操作系统,使用了 UNIX 设计哲学,支持多任务多用户,性能稳定可靠,没有统一的桌面环境,常见的有 GNOME、KDE、XFCE 等,与 Unix 兼容性好。在服务器上 Linux 使用率极高,也支持在个人电脑和嵌入式设备上使用。提供虚拟化能力强,在云计算场景中广泛应用。安全性好,病毒几乎没有针对性,适合网络服务器
Linux 是一种自由开源的类 Unix 操作系统,它具有以下核心特性:

- 多用户多任务支持
- 优秀的系统稳定性和可靠性
- 强大的网络功能和安全特性
- 丰富的开发工具和程序库
- 良好的硬件兼容性
- 活跃的社区支持

主要应用场景:

- 服务器系统
- 个人桌面系统
- 嵌入式设备
- 云计算平台
- 科学计算

Linux 系统主要由以下部分组成:

1. Linux 内核 - 系统核心
2. GNU 工具集 - 基础命令工具
3. 桌面环境 - 图形界面(如 GNOME、KDE)
4. 应用程序 - 各类应用软件

## 发行版

Linux 发行版是指基于 Linux 内核开发的完整操作系统,它们会额外打包一些应用软件并提供生态支持,主要的 Linux 发行版有:

+ Debian:非常成熟稳定,用于种服务器及工作站
+ Ubuntu:基于 Debian 开发,桌面版用户体验好,很受个人用户欢迎
+ CentOS:免费版本 RHEL,与企业 Linux 流通性好,也常用于服务器
+ Fedora:源自 Red Hat,重视开放源代码,内置最新软件版本
+ SUSE:来自德国,适用于企业 server 和工作站
+ Arch Linux: Rolling 发行版,源代码最新但需自行配置
+ Gentoo:源代码编译性能优化,但安装配置难度大
+ Deepin:基于 Debian 开发的中文系統,注重视觉交互
- Debian:非常成熟稳定,用于各种服务器及工作站
- Ubuntu:基于 Debian 开发,桌面版用户体验好,很受个人用户欢迎
- CentOS:免费版本 RHEL,与企业 Linux 流通性好,也常用于服务器
- Fedora:源自 Red Hat,重视开放源代码,内置最新软件版本
- SUSE:来自德国,适用于企业 server 和工作站
- Arch Linux: Rolling 发行版,源代码最新但需自行配置
- Gentoo:源代码编译性能优化,但安装配置难度大
- Deepin:基于 Debian 开发的中文系統,注重视觉交互

### Ubuntu

Expand Down Expand Up @@ -216,7 +238,7 @@ Windows 存在盘符的概念,而 Linux 则不存在,只有一个根目录
+ `mv <file1> <file2>`:移动`file1``file2`,会将`file2`覆盖掉,因此不再有`file2`
+ `rm <file>`:删除文件,没有任何提示,最好添加`-v`参数获得提示
+ `rm <folder>`:删除空目录,没有任何提示,最好添加`-v`获得提示,不能删除非空目录
+ `rm -rf <folder>`删除目录,最好添加`-v`获得提示
+ `rm -rf <folder>`递归删除目录,最好添加`-v`获得提示,此命令非常危险,不要轻易使用
+ `touch <file>`:创建空白文件

::: tip
Expand Down Expand Up @@ -446,11 +468,7 @@ root@VM-4-14-ubuntu:~# ps x

## 网络

+ `netstat`
+ `netstat -a`:列出所有端口
+ `netstat -at`:列出所有 TCP 端口
+ `netstat -au`:列出所有 UDP 端口
+ `netstat -ap`:列出所有端口并显示与程序相关的程序名和 PID
+ `netstat -atup`:列出所有 TCP 和 UDP 端口并显示与程序相关的程序名和 PID
+ `lsof -i`:列出打开文件
+ `fuser -n tcp 80`:查看 80 端口被哪个程序占用

Expand Down Expand Up @@ -517,17 +535,22 @@ sudo journalctl --vacuum-files=2
sudo systemctl restart systemd-journald
```

## 性能信息
## 系统监控与性能分析

### 系统基本信息

+ `lsb_release -a`:查看发行版本
+ `cat /proc/cpuinfo`:查看硬件配置

### 性能监控

+ `top`:实时查看进程变化,监控 Linux 系统状况
+ `uptime`:查看系统运行了多少时间
+ `free`:查看内存
+ `vmstat`:进程,内存,分页,块 IO,陷阱,磁盘和 cpu 活动的信息

## 系统信息
### 存储空间

+ `lsb_release -a`:查看发行版本
+ `cat /proc/cpuinfo`:查看硬件配置
+ `df` - 查看文件系统的空间使用情况,只能查看一级文件夹的大小、使用比例、档案系统以及挂载点
+ `df -h` - 查看文件系统的空间使用情况,以`1024`为单位
+ `du` - 可以查看文件以及文件夹的大小,会统计文件大小相加
Expand Down
24 changes: 24 additions & 0 deletions docs/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,30 @@ cargo clippy
cargo fix
```

## Release

如果想发布一个 crate 到 crate.io,那么 cargo-release 是一个很好的工具

```sh
# 执行一次发布演习
cargo release [major|minor|patch] --registry crates-io
# 执行一次真实的发布
cargo release [major|minor|patch] --registry crates-io --execute
```

在这之前,完全可以配合`git-cliff`做到发布自动生成日志,首先要在项目根目录中创建`release.toml`写下预发布钩子

```toml
pre-release-hook = [
"git",
"cliff",
"-o",
"CHANGELOG.md",
"--tag",
"{{version}}",
]
```

## Workspace

工作空间用于将代码拆分多个代码包,`Cargo.toml`有所不同,以`workspace`区域开始,同时指定二进制包的位置来添加成员
Expand Down
7 changes: 5 additions & 2 deletions docs/rust/libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ fn main() {

## Lettre

lettre 是一个功能强大的邮件库
Lettre 是一个功能强大的邮件库

## Reqwest

Expand Down Expand Up @@ -320,7 +320,6 @@ fn main() {
}
}
}

```

## Chrono
Expand Down Expand Up @@ -437,3 +436,7 @@ thiserror 主要解决以下问题:
+ 静态错误:与 anyhow 不同,thiserror 创建的是静态类型的错误,这意味着它们在编译时就确定了类型
+ 错误消息模板:thiserror 允许你为每种错误类型定义自定义的错误消息模板
+ 适合库级别使用:thiserror 当需要定义明确的错误类型

## Tonic

gRPC 的 Rust 实现,高性能,开源,为移动设备与 HTTP/2 准备的通用 RPC 框架
1 change: 0 additions & 1 deletion docs/sundry/ai-products.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
title: AI 产品
category: 知识分享
article: true
---

## 聊天 AI
Expand Down
34 changes: 34 additions & 0 deletions docs/sundry/escape-fold.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: 逃离羊圈
category: 知识分享
article: false
---

hy2 是一个比较好用的工具,在 Ubuntu 下:

```sh
curl -fsSL https://get.hy2.sh | bash
```

编辑配置文件,注意建议改掉端口号

```sh
vim /etc/hysteria/config.yaml
```

开始启动前一定要关掉 nginx,配置的域名 dns 一定要指向本机 ip,否则无法申请证书成功,启动如果没有问题,那么,便可以启动 nginx 反代并添加如下内容

```plain
# 不要添加到 http 块
stream {
server {
listen 443 udp;
listen [::]:443 udp;
listen 443;
listen [::]:443;
proxy_pass 127.0.0.1:1443;
}
}
```

客户端填上域名和服务器配置的密码开始逃离吧
8 changes: 8 additions & 0 deletions docs/sundry/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,14 @@ chore: 将表格中的查看详情改为详情
其他类型的 commit 和上面三个示例差不多,在此不再叙述
## 自动生成修改日志
```
cargo install git-cliff
git cliff --init
git cliff -o CHANGELOG.md
```
## 参考资料
+ GitHub 入门与实践
Loading

0 comments on commit a8c5cb0

Please sign in to comment.