Compare commits

..

17 Commits

Author SHA1 Message Date
7c7f25bf9f released v1.17.0 2022-11-07 18:06:02 +08:00
2dde0c4408 doc: Update npm.md. 2022-11-07 17:40:08 +08:00
a2d7cd6e7b doc: Update npm.md. 2022-11-07 17:36:13 +08:00
10366e3317 doc: update nginx.md. 2022-11-07 16:59:00 +08:00
4bf8a55bf3 chore: add matlab logo. 2022-11-07 16:16:37 +08:00
0101ef71d0 doc: update quickreference.md. 2022-11-07 16:11:49 +08:00
aa38a0e765 doc: update css.md. 2022-11-07 16:04:39 +08:00
4a1eb6964d doc: update yum.md. 2022-11-07 11:40:32 +08:00
f6ff51be15 doc: update cargo.md. 2022-11-07 11:40:13 +08:00
6c89718254 doc: update docker.md. 2022-11-07 09:41:57 +08:00
8c79a648a4 feat: add yum.md cheatsheet. 2022-11-07 01:15:13 +08:00
f021d73b77 doc: update README.md 2022-11-06 23:39:00 +08:00
c060c36559 doc: update curl.md. 2022-11-06 23:25:58 +08:00
39aa2c4387 feat: add xcode.md cheatsheet. 2022-11-06 23:18:12 +08:00
aeca8351bd doc: update ffmpeg.md (#18) 2022-11-06 23:02:37 +08:00
d7d6b0d447 doc: update ffmpeg.md (#18) 2022-11-06 22:49:56 +08:00
4d69a0ef24 doc: update ansible.md (#23) 2022-11-06 22:18:16 +08:00
16 changed files with 951 additions and 147 deletions

View File

@ -19,6 +19,7 @@ Quick Reference
坑已挖,需要您的参与完善和贡献!🙏 坑已挖,需要您的参与完善和贡献!🙏
<!--rehype:style=padding-bottom: 23px;--> <!--rehype:style=padding-bottom: 23px;-->
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0/var(\-\-bg\-opacity));&class=contributing tag&data-lang=RedHad&data-info=👆看看还缺点儿什么?-->
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192/var(\-\-bg\-opacity));&class=contributing--> [CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192/var(\-\-bg\-opacity));&class=contributing-->
[Django](./docs/djiango.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing tag&data-lang=Python--> [Django](./docs/djiango.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing tag&data-lang=Python-->
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));&class=contributing--> [FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));&class=contributing-->
@ -32,12 +33,14 @@ Quick Reference
[C](./docs/c.md)<!--rehype:style=background: rgb(92 107 192/var(\-\-bg\-opacity));--> [C](./docs/c.md)<!--rehype:style=background: rgb(92 107 192/var(\-\-bg\-opacity));-->
[Docker](./docs/docker.md)<!--rehype:style=background: rgb(72 143 223/var(\-\-bg\-opacity));--> [Docker](./docs/docker.md)<!--rehype:style=background: rgb(72 143 223/var(\-\-bg\-opacity));-->
[Dockerfile](./docs/dockerfile.md)<!--rehype:style=background: rgb(0 72 153/var(\-\-bg\-opacity));&class=tag&data-lang=Docker--> [Dockerfile](./docs/dockerfile.md)<!--rehype:style=background: rgb(0 72 153/var(\-\-bg\-opacity));&class=tag&data-lang=Docker-->
[Django](./docs/djiango.md)<!--rehype:style=background: rgb(12 75 51/var(\-\-bg\-opacity));&class=contributing tag&data-lang=Python-->
[Golang](./docs/golang.md)<!--rehype:style=background: rgb(39 160 193/var(\-\-bg\-opacity));--> [Golang](./docs/golang.md)<!--rehype:style=background: rgb(39 160 193/var(\-\-bg\-opacity));-->
[INI](./docs/ini.md)<!--rehype:style=background: rgb(57 59 60/var(\-\-bg\-opacity));--> [INI](./docs/ini.md)<!--rehype:style=background: rgb(57 59 60/var(\-\-bg\-opacity));-->
[JSON](./docs/json.md)<!--rehype:style=background: rgb(57 59 60/var(\-\-bg\-opacity));--> [JSON](./docs/json.md)<!--rehype:style=background: rgb(57 59 60/var(\-\-bg\-opacity));-->
[Java](./docs/java.md)<!--rehype:style=background: rgb(211 55 49/var(\-\-bg\-opacity));&class=contributing&data-info=👆看看还缺点儿什么?--> [Java](./docs/java.md)<!--rehype:style=background: rgb(211 55 49/var(\-\-bg\-opacity));&class=contributing&data-info=👆看看还缺点儿什么?-->
[Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));--> [Markdown](./docs/markdown.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));-->
[MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));&class=tag&data-lang=SQL--> [MySQL](./docs/mysql.md)<!--rehype:style=background: rgb(103 61 156/var(\-\-bg\-opacity));&class=tag&data-lang=SQL-->
[MATLAB](./docs/matlab.md)<!--rehype:style=background: rgb(0 118 168/var(\-\-bg\-opacity));&class=contributing-->
[Python](./docs/python.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));--> [Python](./docs/python.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));-->
[Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71/var(\-\-bg\-opacity));--> [Rust](./docs/rust.md)<!--rehype:style=background: rgb(71 71 71/var(\-\-bg\-opacity));-->
[Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));--> [Swift](./docs/swift.md)<!--rehype:style=background: rgb(240 81 57/var(\-\-bg\-opacity));-->
@ -62,6 +65,7 @@ Quick Reference
[RegEx](./docs/regex.md)<!--rehype:style=background: rgb(149 36 155/var(\-\-bg\-opacity));--> [RegEx](./docs/regex.md)<!--rehype:style=background: rgb(149 36 155/var(\-\-bg\-opacity));-->
[TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198/var(\-\-bg\-opacity));--> [TypeScript](./docs/typescript.md)<!--rehype:style=background: rgb(49 120 198/var(\-\-bg\-opacity));-->
[Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131/var(\-\-bg\-opacity));--> [Vue 2](./docs/vue2.md)<!--rehype:style=background: rgb(64 184 131/var(\-\-bg\-opacity));-->
[Vue 3 ](./docs/vue.md)<!--rehype:style=background: rgb(64 184 131/var(\-\-bg\-opacity));&class=contributing-->
<!--rehype:class=home-card--> <!--rehype:class=home-card-->
## Nodejs ## Nodejs
@ -72,35 +76,38 @@ Quick Reference
[Lerna](./docs/lerna.md)<!--rehype:style=background: rgb(192 132 252/var(\-\-bg\-opacity));--> [Lerna](./docs/lerna.md)<!--rehype:style=background: rgb(192 132 252/var(\-\-bg\-opacity));-->
[npm](./docs/npm.md)<!--rehype:style=background: rgb(203 2 0/var(\-\-bg\-opacity));--> [npm](./docs/npm.md)<!--rehype:style=background: rgb(203 2 0/var(\-\-bg\-opacity));-->
[package.json](./docs/package.json.md)<!--rehype:style=background: rgb(132 132 132/var(\-\-bg\-opacity));--> [package.json](./docs/package.json.md)<!--rehype:style=background: rgb(132 132 132/var(\-\-bg\-opacity));-->
[Yarn](./docs/yarn.md)<!--rehype:style=background: rgb(64 184 131/var(\-\-bg\-opacity));--> [Yarn](./docs/yarn.md)<!--rehype:style=background: rgb(33 136 182/var(\-\-bg\-opacity));-->
<!--rehype:class=home-card--> <!--rehype:class=home-card-->
## 工具 ## 工具
[Emacs](./docs/emacs.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));--> [Emacs](./docs/emacs.md)<!--rehype:style=background: rgb(98 36 134/var(\-\-bg\-opacity));-->
[Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));--> [Gmail](./docs/gmail.md)<!--rehype:style=background: rgb(234 67 54/var(\-\-bg\-opacity));-->
[nginx](./docs/nginx.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));--> [nginx](./docs/nginx.md)<!--rehype:style=background: rgb(0 153 0/var(\-\-bg\-opacity));-->
[Semver](./docs/semver.md)<!--rehype:style=background: rgb(106 111 141/var(\-\-bg\-opacity));--> [Semver](./docs/semver.md)<!--rehype:style=background: rgb(106 111 141/var(\-\-bg\-opacity));-->
[Sketch](./docs/sketch.md)<!--rehype:style=background: rgb(223 148 0/var(\-\-bg\-opacity));--> [Sketch](./docs/sketch.md)<!--rehype:style=background: rgb(223 148 0/var(\-\-bg\-opacity));-->
[Sublime Text](./docs/sublime-text.md)<!--rehype:style=background: rgb(223 148 0/var(\-\-bg\-opacity));--> [Sublime Text](./docs/sublime-text.md)<!--rehype:style=background: rgb(223 148 0/var(\-\-bg\-opacity));-->
[VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230/var(\-\-bg\-opacity));--> [VSCode](./docs/vscode.md)<!--rehype:style=background: rgb(91 163 230/var(\-\-bg\-opacity));-->
[Vim](./docs/vim.md)<!--rehype:style=background: rgb(9 150 8/var(\-\-bg\-opacity));--> [Vim](./docs/vim.md)<!--rehype:style=background: rgb(9 150 8/var(\-\-bg\-opacity));-->
[WebStorm](./docs/webstorm.md)<!--rehype:style=background: rgb(91 163 230/var(\-\-bg\-opacity));--> [WebStorm](./docs/webstorm.md)<!--rehype:style=background: rgb(32 148 220/var(\-\-bg\-opacity));-->
[XPath](./docs/xpath.md)<!--rehype:style=background: rgb(91 163 230/var(\-\-bg\-opacity));--> [XPath](./docs/xpath.md)<!--rehype:style=background: rgb(91 163 230/var(\-\-bg\-opacity));-->
[Xcode](./docs/xcode.md)<!--rehype:style=background: rgb(24 151 233/var(\-\-bg\-opacity));-->
<!--rehype:class=home-card--> <!--rehype:class=home-card-->
## Linux 命令 ## Linux 命令
[Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(99 99 99/var(\-\-bg\-opacity));&class=contributing&data-info=👆看看还缺点儿什么?--> [Ansible](./docs/ansible.md)<!--rehype:style=background: rgb(238 0 0/var(\-\-bg\-opacity));&class=contributing tag&data-lang=RedHad&data-info=👆看看还缺点儿什么?-->
[Awk](./docs/awk.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Awk](./docs/awk.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));&class=tag&data-lang=C/C++--> [Conan](./docs/conan.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));&class=tag&data-lang=C/C++-->
[Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71/var(\-\-bg\-opacity));&class=tag&data-lang=Rust--> [Cargo](./docs/cargo.md)<!--rehype:style=background: rgb(71 71 71/var(\-\-bg\-opacity));&class=tag&data-lang=Rust-->
[Curl](./docs/curl.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Curl](./docs/curl.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Chmod](./docs/chmod.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68/var(\-\-bg\-opacity));--> [Cron](./docs/cron.md)<!--rehype:style=background: rgb(239 68 68/var(\-\-bg\-opacity));-->
[CMake](./docs/cmake.md)<!--rehype:style=background: rgb(92 107 192/var(\-\-bg\-opacity));&class=contributing-->
[Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62/var(\-\-bg\-opacity));--> [Git](./docs/git.md)<!--rehype:style=background: rgb(215 89 62/var(\-\-bg\-opacity));-->
[Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Grep](./docs/grep.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Find](./docs/find.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[FFmpeg](./docs/ffmpeg.md)<!--rehype:style=background: rgb(0 193 9/var(\-\-bg\-opacity));&class=contributing-->
[Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Htop](./docs/htop.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[Home Brew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87/var(\-\-bg\-opacity));--> [Home Brew](./docs/homebrew.md)<!--rehype:style=background: rgb(252 185 87/var(\-\-bg\-opacity));-->
[Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Netstat](./docs/netstat.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
@ -109,6 +116,7 @@ Quick Reference
[Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));--> [Sed](./docs/sed.md)<!--rehype:style=background: rgb(16 185 129/var(\-\-bg\-opacity));-->
[SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99/var(\-\-bg\-opacity));--> [SSH](./docs/ssh.md)<!--rehype:style=background: rgb(99 99 99/var(\-\-bg\-opacity));-->
[Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99/var(\-\-bg\-opacity));--> [Screen](./docs/screen.md)<!--rehype:style=background: rgb(99 99 99/var(\-\-bg\-opacity));-->
[YUM](./docs/yum.md)<!--rehype:style=background: rgb(86 86 123/var(\-\-bg\-opacity));-->
<!--rehype:class=home-card--> <!--rehype:class=home-card-->
## 其它 ## 其它

View File

@ -48,7 +48,7 @@ bar.example.com
检查Inventory是否生效 检查Inventory是否生效
```shell ```shell
ansible all --list-hosts $ ansible all --list-hosts
``` ```
ping所有目标 ping所有目标
@ -363,4 +363,5 @@ $ ansible-pull -U <repository> [options]
另见 另见
--- ---
[Getting started with Ansible](https://docs.ansible.com/ansible/latest/getting_started/index.html) [Getting started with Ansible](https://docs.ansible.com/ansible/latest/getting_started/index.html)
[Introduction to ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html) [Introduction to ad hoc commands](https://docs.ansible.com/ansible/latest/user_guide/intro_adhoc.html)
[Ansible cheatsheet](https://github.com/luckylittle/ansible-cheatsheet/blob/master/ansible-cheatsheet.txt)

View File

@ -36,6 +36,32 @@ $ curl -sSf https://static.rust-lang.org/rustup.sh | sh
`cargo clippy --all-targets -- --D warnings` | Linter 检查错误 `cargo clippy --all-targets -- --D warnings` | Linter 检查错误
`cargo tarpaulin --ignore-tests` | 检查代码覆盖率 `cargo tarpaulin --ignore-tests` | 检查代码覆盖率
### 切换源
<!--rehype:wrap-class=col-span-2&style=background:#e91e63;--->
```bash
$ touch ~/.cargo/config # 添加配置文件
$ vim ~/.cargo/config # 编辑配置文件
```
配置文件 `config` 内容
```toml
[source.crates-io]
registry = "https://github.com/rust-lang/crates.io-index"
replace-with = 'tuna' # 👈 如果需要提交包注释配置源
[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
# registry = "git://mirrors.ustc.edu.cn/crates.io-index"
```
💥 注意切换源需要删除缓存目录
```bash
$ rm -rf ~/.cargo/.package-cache # ⚠️ 删除缓存目录内容
```
### 创建新项目 ### 创建新项目
<!--rehype:wrap-class=row-span-3--> <!--rehype:wrap-class=row-span-3-->
@ -43,6 +69,8 @@ $ curl -sSf https://static.rust-lang.org/rustup.sh | sh
$ cargo new hello_world --bin $ cargo new hello_world --bin
``` ```
---
- `--bin` 正在制作一个二进制程序 - `--bin` 正在制作一个二进制程序
- `--lib` 正在创建一个库(lib) - `--lib` 正在创建一个库(lib)
@ -167,7 +195,7 @@ edition = '2015'
# `source` 表下,就是存储有关要更换的来源名称 # `source` 表下,就是存储有关要更换的来源名称
[source] [source]
# 在`source` 表格之下的,可为一定数量的有关来源名称. 示例下面就# 定义了一个新源, 叫 `my-awesome-source` 其内容来自本地 # `vendor`目录 ,其相对于包含`.cargo/config`文件的目录 # 在`source` 表格之下的,可为一定数量的有关来源名称. 示例下面就定义了一个新源, 叫 `my-awesome-source`,其内容来自本地`vendor`目录 ,其相对于包含 `.cargo/config` 文件的目录
[source.my-awesome-source] [source.my-awesome-source]
directory = "vendor" directory = "vendor"
@ -177,7 +205,7 @@ git = "https://example.com/path/to/repo"
# tag = "v1.0.1" # tag = "v1.0.1"
# rev = "313f44e8" # rev = "313f44e8"
# The crates.io 默认源 在"crates-io"名称下, 且在这里我们使用 `replace-with` 字段指明 默认源更换成"my-awesome-source"源 # crates.io 默认源 在"crates-io"名称下,且在这里我们使用 `replace-with` 字段指明 默认源更换成"my-awesome-source"源
[source.crates-io] [source.crates-io]
replace-with = "my-awesome-source" replace-with = "my-awesome-source"
``` ```
@ -199,7 +227,7 @@ directory = "path/to/vendor"
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
更换源的配置通过完成 `.cargo/config`下面为全套可用字段 更换源的配置通过完成 `.cargo/config`上面是全套可用字段
包相关命令 包相关命令
--- ---

View File

@ -1374,10 +1374,11 @@ a[href^="http"]:empty::before {
} }
``` ```
如果你的 `<a>` 标签里面没有内容,将 `href` 的值作为内容展示 如果 `<a>` 标签里面没有内容,将 `href` 的值作为内容展示
### 使用 :root 表示灵活类型 ### 使用 :root 表示灵活类型
<!--rehype:wrap-class=row-span-2-->
响应式布局中的字体大小应该能够根据每个视口进行调整,您可以使用 `:root` 根据视口高度和宽度计算字体大小 响应式布局中的字体大小应该能够根据每个视口进行调整,您可以使用 `:root` 根据视口高度和宽度计算字体大小
@ -1387,7 +1388,7 @@ a[href^="http"]:empty::before {
} }
``` ```
现在您可以根据 `:root` 计算的值使用根 `em` 单位: 您可以根据 `:root` 计算的值使用根 `em` 单位:
```css ```css
body { body {
@ -1395,6 +1396,19 @@ body {
} }
``` ```
### 类似 contenteditable 的样式
```css
div {
-webkit-user-modify:
read-write-plaintext-only;
}
```
<!--rehype:className=wrap-text -->
通过样式来控制一个元素 `div` 是否可以编辑
另见 另见
--------- ---------

View File

@ -228,3 +228,58 @@ curl "https://{foo,bar}.com/file_[1-4].webp" --output "#1_#2.webp"
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
下载一系列文件(输出`foo_file1.webp``foo_file2.webp…bar_file1_webp`等) 下载一系列文件(输出`foo_file1.webp``foo_file2.webp…bar_file1_webp`等)
### 将输出重定向到文件
<!--rehype:wrap-class=col-span-3-->
```bash
$ curl http://url/file > file
```
### 基本认证
<!--rehype:wrap-class=col-span-3-->
```bash
$ curl --user username:password http://example.com/
$ curl -u username:password http://example.com/
```
### 写入文件而不是标准输出
<!--rehype:wrap-class=col-span-2-->
```bash
$ curl -o file http://url/file
$ curl --output file http://url/file
```
### 下载头信息
```bash
$ curl -I url
# 显示头信息
```
### 将输出写入名为远程文件的文件
<!--rehype:wrap-class=col-span-2-->
```bash
$ curl -o file http://url/file
$ curl --output file http://url/file
```
### 执行远程脚本
<!--rehype:wrap-class=col-span-2-->
```bash
$ curl -s http://url/myscript.sh
```
### 配置文件
<!--rehype:wrap-class=col-span-2-->
```bash
curl -K file
# 从文件中读取配置
curl --config file
$HOME/.curlrc # 类 UNIX 系统中的默认配置文件
```

View File

@ -134,6 +134,7 @@ Docker 镜像
<!--rehype:body-class=cols-2--> <!--rehype:body-class=cols-2-->
### 操控 ### 操控
<!--rehype:wrap-class=row-span-2-->
| `Example` | Description | | `Example` | Description |
|-----------|-----------| |-----------|-----------|
@ -159,6 +160,12 @@ $ docker build -f myOtherDockerfile .
$ curl example.com/remote/Dockerfile | docker build -f - . $ curl example.com/remote/Dockerfile | docker build -f - .
``` ```
### 删除 \<none> 镜像
```bash
$ docker rmi -f $(docker images | grep "none" | awk '{print $3}')
```
Docker 网络 Docker 网络
---- ----
<!--rehype:body-class=cols-2--> <!--rehype:body-class=cols-2-->

View File

@ -7,6 +7,7 @@ FFmpeg 参考
--- ---
### 安装 ### 安装
<!--rehype:wrap-class=row-span-2-->
Linux Linux
@ -22,6 +23,7 @@ $ brew install ffmpeg
``` ```
### 示例 ### 示例
<!--rehype:wrap-class=row-span-2-->
mp4 转 avi: mp4 转 avi:
@ -35,40 +37,86 @@ webm 转 mp4:
$ ffmpeg -i movie.webm movie.mp4 $ ffmpeg -i movie.webm movie.mp4
``` ```
### 常用开关 ### 全局选项
:- | -
:- | -
`-y` | 覆盖输出文件
`-n` | 不要覆盖输出文件
### 主要选项
:- | -
:- | -
`-f fmt` | 强制输入或输出文件格式
`-i fName` | 输入文件名,未指定显示内容流的摘要
`-c codecName` | 指定编解码器 [输入或输出]
`-fs Nbytes` | 以 Nbytes 指定最大输出文件大小
### 基础参数
:- | -
:- | -
`-codecs` | 列出可用编码
`-formats` | 列出支持的格式
`-protocols` | 列出支持的协议
`-i input.mp4` | 指定输入文件
`-c:v libx264` | 指定视频编码
`-c:a aac` | 指定音频编码
`-vcodec libx264` | 旧写法
`-acodec aac` | 旧写法
`-fs SIZE` | 指定文件大小
### 视频参数
<!--rehype:wrap-class=col-span-2 row-span-2-->
:- | -
:- | -
`-b bRate` | 设置视频比特率(单位 kbit/s)
`-fixaspect` | 固定纵横比
`-bt tolerance` | 设置视频比特率容差(单位 kbit/s)
`-maxrate bRate` | 设置最大视频比特率容差(单位 kbit/s)
`-minrate bRate` | 设置最小视频比特率容差(单位 kbit/s)
`-bufsize size` | 设置速率控制缓冲区大小(以 kByte 为单位)
`-sameq` | 使用与源相同的视频质量(意味着 VBR)
`-newvideo` | 将新的视频流添加到当前输出流
`-aspect RATIO` | 纵横比(4:3、16:9 或 1.25)
`-r RATE` | 每秒帧率
`-s WIDTHxHEIGHT` | 帧大小
`-vn` | 没有视频
### 码率设置
```bash ```bash
-codecs # 列出编解码器 -b:v 1M # 视频比特率(1M = 1Mbit/s)
-c:v # 视频编解码器(-vcodec)-'copy'复制流 -b:a 1M # 音频比特率(1M = 1Mbit/s)
-c:a # 音频编解码器(-acodec)
-fs SIZE # 限制文件大小(字节)
``` ```
### 音频 ### 尺寸规格
```bash :- | - | - | -
-aq QUALITY # 音频质量(特定于编解码器) :- | - | - | -
-ar 44100 # 音频采样率 (Hz) `K``k` | 103 | 1000 字节 | 千字节 Kilobytes
-ac 1 # 音频通道1=单声道2=立体声) `M` | 106 | 1000000 字节 | 兆字节 Megabytes
-an # 没有音频 `G` | 109 | 1000000000 | 千兆字节 Gigabytes
-vol N # 音量256=正常) `Ki` | 210 | 1024 | 千字节 Kibibyte
``` `Mi` | 220 | 1048576 | 兆字节 Mebibyte
`Gi` | 230 | 1073741824 | Gibibyte
### 比特率
```bash ### 音频参数
-b:v 1M # 视频比特率1M = 1Mbit/s <!--rehype:wrap-class=col-span-2-->
-b:a 1M # 音频比特率
```
#### 视频 :- | -
:- | -
```bash `-ab bRate` | 设置音频比特率(单位 kbit/s)
-aspect RATIO # 纵横比4:3、16:9 或 1.25 `-aframes N` | 设置要录制的音频帧数 [-frames:a 的别名]
-r RATE # 每秒帧率 `-aq q` | 设置音频质量(特定于编解码器VBR) [-q:a 的别名]
-s WIDTHxHEIGHT # 帧大小 `-an` | 禁用录音
-vn # 没有视频 `-acodec codec` | 设置音频编解码器。[-codec:a 的别名] 使用 'copy' 复制流。
``` `-vol` | 以 256 的倍数更改音频音量,其中 256 = 100%(正常)音量。例如 512 = 200%
`-newaudio` | 将新的音频流添加到当前输出流
`-alang code` | 设置当前音频流的 ISO 639 语言代码(3 个字母)
视频编辑 视频编辑
--- ---
@ -116,7 +164,7 @@ $ ffmpeg -i input.avi -r 24 output.avi
$ ffmpeg -r 1 -i input.m2v -r 24 output.avi $ ffmpeg -r 1 -i input.m2v -r 24 output.avi
``` ```
将输入文件的帧速率仅对原始格式有效强制为 1 fps将输出文件的帧速率强制为 24 fps 将输入文件的帧速率(仅对原始格式有效)强制为 1 fps将输出文件的帧速率强制为 24 fps
### 剪切视频部分 ### 剪切视频部分
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2-->
@ -188,7 +236,7 @@ $ ffmpeg -i file.mp4 -vn -acodec copy output.aac
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
`-vn`无视频`-acodec copy` 结合起来。请注意,输出文件扩展名必须与输入文件中的音频编解码器匹配,`-acodec copy` 才能工作。 `-vn`(无视频)`-acodec copy` 结合起来。请注意,输出文件扩展名必须与输入文件中的音频编解码器匹配,`-acodec copy` 才能工作。
### 创建缩略图 ### 创建缩略图
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
@ -259,7 +307,7 @@ $ ffmpeg -i input.mov -itsoffset 3 -i input.mov -map 0:v -map 1:a -codec:a copy
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
将视频延迟 3 秒即将音频提前 3 秒 将视频延迟 3 秒(即将音频提前 3 秒)
```bash ```bash
$ ffmpeg -i input.mov -itsoffset 3 -i input.mov -map 1:v -map 0:a -codec:a copy -codec:v copy output.mov $ ffmpeg -i input.mov -itsoffset 3 -i input.mov -map 1:v -map 0:a -codec:a copy -codec:v copy output.mov
@ -283,7 +331,7 @@ $ ffmpeg -i video.mp4 image%d.jpg
``` ```
### 转换为 Gif ### 转换为 Gif
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2 row-span-3-->
```bash ```bash
$ ffmpeg -ss 2 -t 28 -i input.mp4 -vf "fps=10,scale=1080:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif $ ffmpeg -ss 2 -t 28 -i input.mp4 -vf "fps=10,scale=1080:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
@ -308,8 +356,23 @@ $ ffmpeg -i input.mov -codec:v copy -an output.mov
``` ```
<!--rehype:className=wrap-text --> <!--rehype:className=wrap-text -->
### 将输入文件转码为 DVD PAL 格式
```bash
$ ffmpeg -y -threads 8 -i inFile -target pal-dvd -ac 2 -aspect 16:9 -acodec mp2 -ab 224000 -vf pad=0:­0:0:0 outFile
```
<!--rehype:className=wrap-text -->
### 转换为灰度
```bash
$ ffmpeg -y -i inFile -flags gray outFile
```
### 字幕 ### 字幕
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2 row-span-2-->
将字幕写入视频 将字幕写入视频
@ -322,9 +385,24 @@ $ ffmpeg -i input.mov -filter:v 'subtitles=subtitles.srt' -codec:a copy output.m
```bash ```bash
$ ffmpeg -i input.mov -filter:v "subtitles=subtitles.srt:force_style='FontName=Menlo Bold,Fontsize=18'" -codec:a copy output.mov $ ffmpeg -i input.mov -filter:v "subtitles=subtitles.srt:force_style='FontName=Menlo Bold,Fontsize=18'" -codec:a copy output.mov
``` ```
<!--rehype:className=wrap-text -->
### 制造 1 分钟的音频噪音
```bash
$ ffmpeg -ar 48000 -t 60 -f s16le -acodec pcm_s16le -i /dev/u­random -ab 64K -f mp2 -acodec mp2 -y noise.mp2
```
<!--rehype:className=wrap-text -->
### 从视频中提取图像
```bash
$ ffmpeg -i foo.avi -r 1 -s WxH -f image2 outFil­e%0­3d.png
```
<!--rehype:className=wrap-text -->
### 音量 ### 音量
<!--rehype:wrap-class=col-span-2--> <!--rehype:wrap-class=col-span-2 row-span-2-->
将音量减半 将音量减半
@ -338,10 +416,89 @@ $ ffmpeg -i input.mov -codec:v copy -filter:a 'volume=0.5' output.mov
$ ffmpeg -i input.mov -codec:v copy -filter:a 'volume=2' output.mov $ ffmpeg -i input.mov -codec:v copy -filter:a 'volume=2' output.mov
``` ```
### 将图像文件转换为其他格式
```bash
$ ffmpeg -i foo012­2.png foo.tiff
```
pgm, ppm, pam, pgmyuv, jpeg, gif, png, tiff, sgi
### 将图像转换为 AVI 文件
```bash
$ ffmpeg -f image2 -i foo-%0­3d.jpeg -r 12 -s WxH foo.avi
```
<!--rehype:className=wrap-text -->
### 将 WAV 文件转换为 MP3
```bash
$ ffmpeg -i source­_so­ng.wav -vn -ar 44100 -ac 2 -ab 192 -f mp3 final_­son­g.mp3
```
<!--rehype:className=wrap-text -->
### 从视频中提取音频,将其转码为 MP3
```bash
$ ffmpeg -i source.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3
```
<!--rehype:className=wrap-text -->
### 将 .avi 转换为 .flv
```bash
$ ffmpeg -i source.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv output.flv
```
<!--rehype:className=wrap-text -->
### 将图片附加到 mp3
```bash
$ ffmpeg -i input.mp3 -i cover.png -c copy -metad­ata:s:v title=­"­Album cover" -metad­ata:s:v commen­t="Cover (Front­)" out.mp3
```
<!--rehype:className=wrap-text -->
### 将视频与声音文件混合
```bash
$ ffmpeg -i song.wav -i source­_vi­deo.avi outvid­eo.mpg
```
<!--rehype:className=wrap-text -->
### 编写带有 ID3v2.3 页眉和 ID3v1 页脚的 mp3
```bash
$ ffmpeg -i inFile -id3v2­_ve­rsion 3 -write­_id3v1 1 outFil­e.mp3
```
<!--rehype:className=wrap-text -->
### 连接输入文件
```bash
$ cat inFile1 inFile2 | ffmpeg -f mpeg -i - -vcodec copy -acodec copy outFil­e.mpg
```
<!--rehype:className=wrap-text -->
### 使用比特率和 mp3 音频的编解码器对剪辑进行编码
```bash
$ ffmpeg -i clip.avi -vcodec libxvid -b 800000 -acodec libmp3lame -ab 128 new-cl­ip.avi
```
<!--rehype:className=wrap-text -->
### 将音频流与来自不同文件的视频流合并
```bash
$ ffmpeg -i audioS.mp4 -i videoS.mp4 -c copy -map 0:a -map 1:v outFil­e.mp4
```
<!--rehype:className=wrap-text -->
另见 另见
--- ---
- [FFmpeg 官网地址](https://ffmpeg.org/) _(ffmpeg.org)_ - [FFmpeg 官网地址](https://ffmpeg.org/) _(ffmpeg.org)_
- [FFmpeg Cheat Sheet](https://lzone.de/cheat-sheet/ffmpeg) _(lzone.de)_ - [FFmpeg Cheat Sheet](https://lzone.de/cheat-sheet/ffmpeg) _(lzone.de)_
- [FFmpeg Cheat Sheet](https://devhints.io/ffmpeg) _(devhints.io)_ - [FFmpeg Cheat Sheet](https://devhints.io/ffmpeg) _(devhints.io)_
- [FFmpeg Cheat Sheet](https://github.com/yuanqing/ffmpeg-cheatsheet) _(github.com)_ - [FFmpeg Cheat Sheet](https://github.com/yuanqing/ffmpeg-cheatsheet) _(github.com)_
- [FFmpeg Cheat Sheet](https://cheatography.com/thetartankilt/cheat-sheets/ffmpeg/) _(cheatography.com)_

View File

@ -1,7 +1,7 @@
NGINX 备忘清单 NGINX 备忘清单
=== ===
这个 nginx 快速参考备忘单显示了它的常用命和配置使用清单。 这个 [nginx](https://nginx.org/en/) 快速参考备忘单显示了它的常用命和配置使用清单。
入门 入门
---- ----

View File

@ -1,7 +1,7 @@
npm 备忘清单 npm 备忘清单
=== ===
这个 npm 快速参考备忘单显示了它的常用命令使用清单 这个 [npm](https://www.npmjs.com/) 快速参考备忘单显示了它的常用命令使用清单
常用命令 常用命令
---- ----
@ -67,112 +67,94 @@ npm 备忘清单
### 缓存 cache ### 缓存 cache
```bash ```bash
npm cache add <package-spec> # 将指定的包添加到本地缓存 $ npm cache add <package-spec> # 将指定的包添加到本地缓存
npm cache clean [<key>] # 删除缓存文件夹中的所有数据 $ npm cache clean [<key>] # 删除缓存文件夹中的所有数据
npm cache ls [<name>@<version>] $ npm cache ls [<name>@<version>]
npm cache verify # 验证缓存文件夹的内容,垃圾收集任何不需要的数据, $ npm cache verify # 验证缓存文件夹的内容,垃圾收集任何不需要的数据,
# 并验证缓存索引和所有缓存数据的完整性 # 并验证缓存索引和所有缓存数据的完整性
``` ```
用于添加、列出或清理 npm 缓存文件夹 用于添加、列出或清理 [npm](https://www.npmjs.com/) 缓存文件夹
### 更新 ### 更新
| 命令 | 描述 | 命令 | 描述
| --- | --- | :- | -
| `npm version <version>` | 要更改 `package.json` 中的版本号 | `npm version <version>` | 要更改 `package.json` 中的版本号
| `npm update` | 更新生产包 | `npm update` | 更新生产包
| `npm update --dev` | 更新开发包 | `npm update --dev` | 更新开发包
| `npm update -g` | 更新全局包 | `npm update -g` | 更新全局包
| `npm update lodash` | 更新 `lodash` | `npm update lodash` | 更新 `lodash`
### 杂项功能 ### 杂项功能
<!--rehype:wrap-class=row-span-2--> <!--rehype:wrap-class=row-span-2-->
将某人添加为所有者
```bash ```bash
npm owner add USERNAME PACKAGENAME # 将某人添加为所有者
``` $ npm owner add USERNAME PACKAGENAME
# 列出包
列出包 $ npm ls
# 向安装旧版本软件包的用户添加警告(弃用)
```bash $ npm deprecate PACKAGE@"< 0.2.0" "critical bug fixed in v0.2.0"
npm ls # 更新所有包或选定的包
``` $ npm update [-g] PACKAGE
# 检查过时的包
向安装旧版本软件包的用户添加警告(弃用) $ npm outdated [PACKAGE]
```bash
npm deprecate PACKAGE@"< 0.2.0" "critical bug fixed in v0.2.0"
```
更新所有包或选定的包
```bash
npm update [-g] PACKAGE
```
检查过时的包
```bash
npm outdated [PACKAGE]
```
### 更改包裹可见性
将公共包设为私有
```bash
npm access restricted <package-name>
```
公开私有包
```bash
npm access public <package-name>
```
授予私有包访问权限
```bash
npm owner add <user> <your-package-name>
```
### 要将包转移到 npm 用户帐户
```bash
npm owner add <their-username> <package-name>
# 新维护者接受邀请
npm owner rm <your-username> <package-name>
```
写入启用了双因素身份验证
```bash
npm owner add <their-username> <package-name> --otp=123456
``` ```
### 取消发布包 ### 取消发布包
```bash ```bash
npm unpublish <package-name> -f $ npm unpublish <package-name> -f
# 取消指定版本 # 取消指定版本
npm unpublish <package-name>@<version> $ npm unpublish <package-name>@<version>
``` ```
注意:如果您取消发布整个包,则必须在 24 小时后才能发布该包的任何新版本 注意:如果您取消发布整个包,则必须在 24 小时后才能发布该包的任何新版本
### 更改包裹可见性
```bash
# 将公共包设为私有
$ npm access restricted <package-name>
# 公开私有包
$ npm access public <package-name>
# 授予私有包访问权限
$ npm owner add <user> <your-package-name>
```
### 要将包转移到 npm 用户帐户
```bash
# 新维护者接受邀请
$ npm owner add <their-username> <package-name>
# 删除维护者
$ npm owner rm <your-username> <package-name>
# 写入启用了双因素身份验证
$ npm owner add <their-username> <package-name> --otp=123456
```
### 发布包 npmjs.org ### 发布包 npmjs.org
```bash ```bash
npm publish $ npm publish
# 第一次需要指定公开参数 # 第一次需要指定公开参数
npm publish --access public $ npm publish --access public
``` ```
发布公开包,到 npmjs.org 发布公开包,到 [npmjs.org](https://docs.npmjs.com)
### 使用 nrm 切换 registry
```bash
$ npm install -g nrm # 安装 nrm 包
# 查看 registry 列表
$ nrm ls
# 将注册表切换到 cnpm
$ nrm use cnpm
```
配置 配置
--- ---
@ -188,15 +170,27 @@ npm publish --access public
### 配置内容 ### 配置内容
<!--rehype:wrap-class=col-span-2-->
```ini ```ini
# last modified: 01 Jan 2016 # last modified: 01 Jan 2016
; Set a new registry for a scoped package ; Set a new registry for a scoped package
@myscope:registry=https://registry.npmmirror.com @myscope:registry=https://registry.npmmirror.com
``` ```
<!--rehype:className=wrap-text -->
注释使用 `#`, `;` 放置到一行的开头`.npmrc` 文件由指定此注释语法的 [`npm/ini`](https://github.com/npm/ini) 解析 注释使用 `#`, `;` 放置到一行的开头 [`.npmrc`](https://docs.npmjs.com/cli/v8/configuring-npm/npmrc) 文件由指定此注释语法的 [`npm/ini`](https://github.com/npm/ini) 解析
### registry
:- | :-
:- | :-
`npm` | https://registry.npmjs.org/
`yarn` | https://registry.yarnpkg.com/
`tencent` | https://mirrors.cloud.tencent.com/npm/
`cnpm` | https://r.cnpmjs.org/
`taobao` | https://registry.npmmirror.com/
`npmMirror` | https://skimdb.npmjs.com/registry/
### `.npmignore` ### `.npmignore`
@ -223,7 +217,7 @@ npm publish --access public
$ npm install -g <package-name> --registry=https://registry.npmmirror.com $ npm install -g <package-name> --registry=https://registry.npmmirror.com
``` ```
将配置放置在 `.npmrc` 全局配置文件中,或者在项目的根目录中。 将配置放置在 [`.npmrc`](https://docs.npmjs.com/cli/v8/configuring-npm/npmrc) 全局配置文件中,或者在项目的根目录中。
```ini ```ini
; registry=https://registry.npmjs.org/ ; registry=https://registry.npmjs.org/
@ -241,7 +235,7 @@ registry=https://registry.npmmirror.com
替换 npm 仓库地址为 npmmirror(淘宝) 镜像地址 替换 npm 仓库地址为 npmmirror(淘宝) 镜像地址
```bash ```bash
npm config set registry https://registry.npmmirror.com $ npm config set registry https://registry.npmmirror.com
``` ```
请参阅:[npmmirror 中国镜像站](https://npmmirror.com/) 请参阅:[npmmirror 中国镜像站](https://npmmirror.com/)

View File

@ -29,7 +29,7 @@ HTML 存放在仓库根目录下的 `dist` 目录中,将 `dist/index.html` 静
### 介绍 ### 介绍
在备忘清单采用 `HTML 注释语法`,标识网站布局和一些样式,目的是为了在 `GitHub` 中也是正常毫无瑕疵的预览 `Markdown` 在备忘清单采用 `HTML 注释语法`,标识网站布局和一些样式,目的是为了在 `GitHub` 中也是正常毫无瑕疵的预览 [`Markdown`](./markdown.md)
```markdown ```markdown
### 卡片标题 ### 卡片标题
@ -45,7 +45,7 @@ HTML 存放在仓库根目录下的 `dist` 目录中,将 `dist/index.html` 静
### 注释语法介绍 ### 注释语法介绍
<!--rehype:wrap-class=row-span-3&style=color:black;background-color: #d7a100;--> <!--rehype:wrap-class=row-span-3&style=color:black;background-color: #d7a100;-->
- 在某个 Markdown 语法下方或者后面,添加 HTML注释 - 在某个 [`Markdown`](./markdown.md) 语法下方或者后面,添加 HTML注释
-`<!--rehype:` 开始,`-->` 结束,包裹参数内容 -`<!--rehype:` 开始,`-->` 结束,包裹参数内容
- 内容采用 URL 参数的字符拼接方式 - 内容采用 URL 参数的字符拼接方式
@ -78,7 +78,7 @@ HTML 存放在仓库根目录下的 `dist` 目录中,将 `dist/index.html` 静
---- | ---- ---- | ----
`body-style` | 包裹所有卡片`外壳`的样式 `body-style` | 包裹所有卡片`外壳`的样式
`body-class` | 用于卡片栏布局,添加`类` `body-class` | 用于卡片栏布局,添加`类`
`wrap-style` | 卡片栏添加 CSS 样式 `wrap-style` | 卡片栏添加 [CSS](./css.md) 样式
`wrap-class` | 用于卡片占位,添加`类` `wrap-class` | 用于卡片占位,添加`类`
### 文字颜色 ### 文字颜色
@ -135,7 +135,7 @@ export const Student = (
); );
``` ```
上面 `{1,4-5}` 行代码高亮,下面是 `Markdown` 代码示例 上面 `{1,4-5}` 行代码高亮,下面是 [`Markdown`](./markdown.md) 代码示例
```markdown ```markdown
```jsx {1,4-5} ```jsx {1,4-5}
@ -258,7 +258,7 @@ const school = <div>学校</div>;
<b>这里是你的 HTML 代码</b> <b>这里是你的 HTML 代码</b>
``` ```
上面的 `markdown` 代码在 `meta` 位置添加 `preview` 标识HTML 代码将被执行预览 上面的 [`markdown`](./markdown.md) 代码在 `meta` 位置添加 `preview` 标识,[HTML](./html.md) 代码将被执行预览
### KaTeX 数学渲染 ### KaTeX 数学渲染
@ -267,7 +267,7 @@ c = \pm\sqrt{a^2 + b^2}
L = \frac{1}{2} \rho v^2 S C_L L = \frac{1}{2} \rho v^2 S C_L
``` ```
上面示例 `Markdown` 代码源码 上面示例 [`Markdown`](./markdown.md) 代码源码
```markdown {1} ```markdown {1}
```KaTeX ```KaTeX
@ -275,7 +275,7 @@ L = \frac{1}{2} \rho v^2 S C_L
L = \frac{1}{2} \rho v^2 S C_L L = \frac{1}{2} \rho v^2 S C_L
``` ```
还可以单行展示 `KaTeX:c = \pm\sqrt{a^2 + b^2}`,需要标记 \`KaTeX:数学公式\` 将被显示成数学公式,这是基于 [KaTeX](https://katex.org/) 生成 还可以单行展示 `KaTeX:c = \pm\sqrt{a^2 + b^2}`,需要标记 <code>\`KaTeX:数学公式\`</code> 将被显示成数学公式,这是基于 [KaTeX](https://katex.org/) 生成
布局 布局
--- ---
@ -368,7 +368,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### H3 Title 1 ### H3 Title 1
@ -393,7 +393,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1
@ -441,7 +441,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1
@ -465,7 +465,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1
@ -489,7 +489,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1
@ -513,7 +513,7 @@ H2 部分
╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈┈┈┈┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1
@ -537,7 +537,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
H2 部分 H2 部分
@ -568,7 +568,7 @@ H2 部分
╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯ ╰┈┈┈╯
``` ```
上面布局效果 Markdown 源码: 上面布局效果 [Markdown](./markdown.md) 源码:
```markdown ```markdown
### Title 1 ### Title 1

107
docs/xcode.md Normal file
View File

@ -0,0 +1,107 @@
Xcode 备忘清单
====
这个 Xcode 快速参考备忘单显示了它的键盘快捷键和命令。
Xcode
---
### 搜索
快捷键 | 描述
:---- | ----
`Cmd + F` | 在文件中查找
`Cmd + Option + F` | 在文件中查找和替换
`Cmd + Shift + F` | 在项目中查找
`Cmd + Option + Shift + F` | 在项目中查找和替换
<!--rehype:className=shortcuts-->
### 选项卡
快捷键 | 描述
:---- | ----
`Cmd + T` | 新选项卡
`Cmd + }` | 上一个选项卡
`Cmd + {` | 下一个选项卡
<!--rehype:className=shortcuts-->
### 导航
<!--rehype:wrap-class=row-span-2-->
快捷键 | 描述
:---- | ----
`Cmd + Shift + O` | 快速打开
`Cmd + J` | 专注于编辑
`Cmd + Ctrl + UP` | 下一个对手
`Cmd + Ctrl + DOWN` | 上一个对手
`Cmd + Ctrl + RIGHT` | 下一个最近的文件
`Cmd + Ctrl + LEFT` | 上一个 最近的文件
`Cmd + click` | 符号的定义
`Cmd + L` | 去线
`Cmd + Option + LEFT` | 折叠部分
`Cmd + Option + RIGHT` | 展开部分
<!--rehype:className=shortcuts-->
### 调试
快捷键 | 描述
:---- | ----
`Cmd + Shift + Y` | 切换调试区域
`Cmd + '` | 下一期
`Cmd + "` | 上一期
`Cmd + \` | 添加/删除断点
`Cmd + Y` | 活动/非活动断点
`Cmd + K` | 清除控制台
<!--rehype:className=shortcuts-->
### 导航器(左侧面板)
快捷键 | 描述
:---- | ----
`Cmd + 0` | 显示隐藏
`Cmd + 1-8` | 切换标签
`Option + click` | 打开助理编辑器
`Shift + Option + click` | 决定在哪里打开
`double click` | 在新窗口中打开
<!--rehype:className=shortcuts-->
### 编辑
快捷键 | 描述
:---- | ----
`Cmd + Option + ENTER` | 显示助理编辑器
`Cmd + ENTER` | 隐藏助理编辑器
`Ctrl + SPACE or ESC` | 切换完成
`Cmd + ]` | 缩进部分
`Cmd + [` | 突出部分
`Ctrl + i` | 修复缩进
`Cmd + /` | 评论/取消评论
`Cmd + Option + [` | 向上移动队列
`Cmd + Option + ]` | 下移线
<!--rehype:className=shortcuts-->
### 实用程序(右面板)
快捷键 | 描述
:---- | ----
`Cmd + Option + 0` | 显示隐藏
`Cmd + Option + 1-9` | 转到选项卡
<!--rehype:className=shortcuts-->
### 调试和运行
快捷键 | 描述
:---- | ----
`Cmd + B` | 建造
`Cmd + R` | 运行
`Cmd + .` | 停止
`Cmd + Shift + B` | 分析
`Cmd + U` | 测试
`Cmd + Shift + K` | 清理
<!--rehype:className=shortcuts-->

423
docs/yum.md Normal file
View File

@ -0,0 +1,423 @@
YUM 备忘清单
===
这个 YUM 快速参考备忘单显示了它的常用命令使用清单。
YUM 清单查询
---
### 介绍
yum`Y`ellow dog `U`pdater, `M`odified是一个在 `Fedora``RedHat` 以及 SUSE 中的 `Shell` 前端软件包管理器
```bash
$ yum [options] [command] [package ...]
```
----
- [YUM 官方网站](http://yum.baseurl.org/) _(yum.baseurl.org)_
- [Fedora 中的 Yum 文档](https://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/ch-yum.html) _(fedoraproject.org)_
- [CentOS 中的 Yum 文档](http://wiki.centos.org/PackageManagement/Yum/) _(wiki.centos.org)_
- [Scientific Linux 中的 Yum 文档](https://www.scientificlinux.org/documentation/faq/yum.apt.repo) _(scientificlinux.org)_
### YUM 查询
子命令描述和任务
#### help
显示 yum 命令和选项
```bash
yum help
```
显示 yum 子命令和选项
### 单独的包
<!--rehype:wrap-class=row-span-3-->
#### list
列出存储库中的包名称
```bash
# 列出存储库中的包名称
yum list available
# 列出所有可用的包
yum list installed
# 列出所有已安装的包
yum list all
# 列出已安装和可用的软件包
yum list kernel
```
#### info
列出已安装和可用的内核包
```bash
# 列出有关 `vsftpd` 软件包的信息
$ yum info vsftpd
```
#### deplist
显示包的依赖项
```bash
$ yum deplist nfs-utils
```
列出依赖项和提供它们的包
#### provides
```bash
# 查找提供查询文件的包
$ yum provides “*bin/top”
# 显示包含 README.top 文件的包
$ yum provides “*/README.top”
```
#### search
```bash
# 查找名称或描述中带有 samba 的软件包
$ yum search samba
```
#### updateinfo
```bash
# 获取有关可用软件包更新的信息
$ yum updateinfo security
```
获取有关可用 security 更新的信息
### 包组
#### grouplist
列出已安装和可用软件包组的名称
#### groupinfo
```bash
# 查看 Web 服务器组中的包
$ yum groupinfo "Web Server"
```
#### check-update
查询存储库以获取可用的软件包更新
### 管理 YUM 存储库
<!--rehype:wrap-class=row-span-2-->
#### repolist
显示启用的软件存储库
#### repoinfo
显示有关启用的 `yum` 存储库的信息 *
```bash
$ yum repoinfo rhel-7-server-rpms
```
请参阅有关 rhel-7-server-rpms 存储库的信息
#### repo-pkgs
使用特定存储库中的包 *
```bash
# 列出来自 my-rpms 存储库的软件包
$ yum repo-pkgs my-rpms list
# 从 my-rpms repo 安装所有软件包
$ yum repo-pkgs my-rpms install
# 从 my-rpms 存储库中删除所有软件包
$ yum repo-pkgs my-rpms remove
```
#### makecache
下载 `yum` 存储库数据到缓存
### 故障排除和维护 YUM
<!--rehype:wrap-class=row-span-2-->
#### check
检查本地 RPM 数据库是否有问题(运行了很长时间)
#### history
```bash
# 列出所有 yum 安装、更新和清理操作
$ yum history list
# 显示 yum info 3 的详细信息
$ yum history info 3
# 撤消事务 3 中的 yum 操作
$ yum history undo 3
# 重做事务 3 中撤消的 yum 操作
$ yum history redo 3
```
#### clean
```bash
# 删除缓存中保存的包
$ yum clean packages
# 从缓存中清除所有包和元数据
$ yum clean all
```
清除缓存的包数据
#### fssnapshot
列出 LVM 快照(帮助在包更新后回滚)
#### fs
```bash
# 列出启用的文件系统过滤器
$ yum fs filters
# 过滤所有正在安装的文档(小心!)
$ yum fs documentation
```
对文件系统采取行动(防止在最小系统上安装 doc 或语言文件)非常有用!
### 使用 YUM 管理语言包
#### langavailable
列出已安装的语言 *
#### langinfo
```bash
# 列出与西班牙语相关的软件包
$ yum langinfo es
```
#### langinstall
```bash
# 安装与西班牙语相关的软件包
$ yum langinstall es
```
#### langlist
列出已安装的语言 *
#### langremove
```bash
# 删除与西班牙语相关的软件包
$ yum langremove es
```
### 使用 YUM 安装、删除和升级软件包
<!--rehype:wrap-class=row-span-2-->
#### install
```bash
# 安装 vsftpd 包
$ yum install vsftpd
```
#### update
```bash
# 使用可用更新更新所有软件包
$ yum update
# 更新 httpd 包(如果可用)
$ yum update httpd
# 应用与安全相关的包更新
$ yum update --security
```
#### update-to
将一个或所有软件包更新到特定版本
#### upgrade
```bash
$ yum -y upgrade
```
更新包考虑过时,只升级所有包,不升级软件和系统内核
#### localinstall
```bash
# 从本地文件、http 或 ftp 安装包
$ yum localinstall abc-1-1.i686.rpm
# 从本地目录安装 abc 包
$ yum localinstall http://myrepo/abc-1-1.i686.rpm
```
<!--rehype:className=wrap-text-->
从 FTP 站点安装 abc
#### downgrade
将软件包降级到早期版本
```bash
$ yum downgrade abc
```
将 abc 包降级到早期版本
#### reinstall
```bash
# 重新安装 util-linux以替换任何已删除的文件
$ yum reinstall util-linux
```
#### swap
```bash
# 删除 ftp 包并安装 lftp 包
$ yum swap ftp lftp
```
#### erase/remove
```bash
# 删除 vsftpd 包和依赖
$ yum remove vsftpd
```
#### autoremove
```bash
# 删除 httpd 和其他不需要的包
$ yum autoremove httpd
```
#### groupinstall
```bash
# 安装 Web 服务器包
$ yum groupinstall "Web server"
```
### 更多 YUM 相关命令(安装 yum-utils 软件包)
#### find-repos-of-install
查找包来自哪个存储库
#### needs-restarting
查找已更新且需要重启的进程
#### repoclosure
从存储库中获取未满足的依赖项列表
#### repoquery
查询远程仓库和本地 `RPM` 数据库
```bash
# 显示依赖包
$ repoquery --requires --resolve bash
```
#### reposync
`yum` 存储库同步到本地目录
```bash
# 从 repo 获取包
$ reposync -r rhel-atomic-host-beta-rpms
```
#### repotrack
下载一个包及其所有依赖项
#### show-installed
列出已安装的 RPM 包和统计信息
#### verifytree
检查本地 yum 存储库的一致性
#### yum-complete-transaction
尝试完成未完成的 yum 交易
#### yumdb
检查或更改 yum 数据库
#### yumdownloader
```bash
# 使用本地源离线安装 net-tools 工具包
$ yumdownloader net-tools.x86_64
# 使用 destdir 参数设置下载的目标目录
$ yumdownloader net-tools.x86_64 --destdir=/usr/local/bin/
# 使用 resolve 参数解决依赖关系并下载所需的安装包
$ yumdownloader net-tools.x86_64 --resolve --destdir=/usr/local/bin/
```
<!--rehype:className=wrap-text-->
从 repo 下载一个包到当前目录
### 不同 YUM 命令的常用选项
```bash
yum --disableplugin=langpacks info vsftpd
# 显示与正在运行的进程相关的包
yum --enableplugin=ps ps
yum install docker \
--enablerepo=rhel-7-server-extras-rpm
yum list available --disablerepo=epel
# 下载 vsftpd 包到缓存
yum install --downloadonly vsftpd
```
---
:- | -
:- | -
`-y` | 如果出现提示,假设是
`--assumeno` | 如果提示,则假设否
`-q` | 不产生任何输出
`-v` | 产生额外的调试输出
`--noplugins` | 运行命令而不加载任何 yum 插件
`--disableplugin=` | 禁用单个命令的特定插件
`--enableplugin=` | 启用已安装但当前已禁用的插件
`--enablerepo=` | 为单个命令启用当前禁用的 repo通配符可以
`--disablerepo=` | 为单个命令禁用当前启用的 repo通配符可以
`--downloadonly` | 下载到 `/var/cache/yum/arch/prod/repo/packages/`,但不要安装
`--filter-???=` | 代替???与vendors, rpm-groups, arches 和其他人一起过滤输出
`--changelog` | 显示包的变更日志信息
<!--rehype:className=style-list-->
另见
---
- [YUM 官方网站](http://yum.baseurl.org/) _(yum.baseurl.org)_
- [YUM 备忘清单(适用于红帽 RedHad 企业 Linux)](https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf) _(access.redhat.com)_
- [用 yum 管理软件包](http://prefetch.net/articles/yum.html) _(prefetch.net)_
- [Fedora 中的 Yum 文档](https://docs.fedoraproject.org/en-US/Fedora/15/html/Deployment_Guide/ch-yum.html) _(fedoraproject.org)_
- [CentOS 中的 Yum 文档](http://wiki.centos.org/PackageManagement/Yum/) _(wiki.centos.org)_
- [Scientific Linux 中的 Yum 文档](https://www.scientificlinux.org/documentation/faq/yum.apt.repo) _(scientificlinux.org)_

View File

@ -1,6 +1,6 @@
{ {
"name": "@wcj/reference", "name": "@wcj/reference",
"version": "1.16.0", "version": "1.17.0",
"description": "为开发人员分享快速参考备忘单(主要是方便自己)。", "description": "为开发人员分享快速参考备忘单(主要是方便自己)。",
"author": "jaywcjlove", "author": "jaywcjlove",
"license": "MIT", "license": "MIT",

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em" viewBox="0 0 170 155">
<path fill="currentColor" d="M114.011719,0 C114.031753,0 114.051781,9.66838127e-05 114.071803,0.00028991369 L113.950625,0 C114.100589,0 114.249952,0.00491257692 114.398738,0.0147015257 C114.496091,0.0180986001 114.59346,0.0264563127 114.690679,0.0370869506 C114.763187,0.0481571338 114.835494,0.0572318789 114.907669,0.067464417 C114.971991,0.0739091229 115.036007,0.0841522806 115.099959,0.0953775501 C115.24595,0.122450074 115.39156,0.152173631 115.536656,0.18662408 C115.540798,0.188498498 115.544794,0.189486731 115.54879,0.190478791 C119.122197,1.04453486 122.383831,4.76737051 125.66002,10.8263087 C134.504866,26.8199813 143.233527,58.3720491 155.079417,90.6337197 C159.654754,102.628081 164.55935,114.497108 169.788199,126.226944 L169.804687,126.261915 C169.561883,126.036533 169.320725,125.810778 169.080287,125.584766 C157.868517,115.075569 148.22195,104.663526 137.239023,104.2475 C132.658523,104.354002 127.856902,106.798464 122.838279,110.852094 C115.884496,116.808357 108.801576,125.883622 101.371385,134.204547 C98.5874924,137.56095 95.5963582,140.611013 92.6231575,143.258032 C88.7439115,146.854737 84.755953,149.885794 80.6318234,151.86198 C77.8565289,153.320564 75.5138817,154.09239 73.9252344,154.03711 C73.9252344,154.03711 73.6050703,153.13142 73.0221211,151.57669 C72.3047411,149.730047 71.5034539,147.651723 70.6255994,145.430214 C66.7152626,135.747112 59.8767348,120.415838 53.1632895,113.088875 C51.6852935,111.572994 50.1641478,110.359882 48.6081822,109.545946 C44.005418,107.866712 38.8723879,108.38614 34.6886719,110.979493 L0.055,86.396 L48.3332422,66.8904688 L48.6560848,66.4654629 C53.451559,60.1199079 58.8698811,54.2694715 64.8303516,49.0016797 L64.5185432,49.2785154 C64.6217228,49.1857698 64.7250601,49.0931917 64.8285547,49.0007813 C68.8310937,46.8777734 76.3510156,48.0304688 90.1177734,30.9287109 C90.3414762,30.6490748 90.5626216,30.370121 90.781262,30.0919051 C92.8016022,27.5154524 94.6118072,25.0027302 96.2508432,22.5981511 L96.5028669,22.2275882 C105.052639,9.58238289 108.828956,0 113.950625,0 L113.994,0.001 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

3
scripts/assets/xcode.svg Normal file
View File

@ -0,0 +1,3 @@
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill="currentColor" height="1em" width="1em">
<path d="M19.06 5.333c.452-.194.774-.258 1.097-.194.516.13.774.516.968.71.194.387.903.774 1.226.839.258.064.71-.645 1.033-1.29.322-.582.516-1.356.451-1.55-.064-.193-.968-.58-1.161-.58-.13 0-.388.129-.84.064-.45-.064-.903-.58-1.16-.968-.453-.645-1.098-1.032-1.679-1.355C18.35.686 17.64.493 16.93.364 15.898.105 14.865-.088 13.833.04c-.58.064-1.29.129-1.807.323-.065 0-.194.193-.065.193s.581.065.581.065-.58.129-.58.258c0 .13.064.13.129.13.064 0 1.484-.065 2.065 0 .645.128 1.355.45 1.807 1.225.774 1.42.451 2.775.258 3.227-.968 2.13-8.648 15.23-9.035 16.133-.387.903-.516 1.484.581 2.065s1.678.322 2-.065c.388-.516 7.034-17.165 9.293-18.262zm-3.614 8.711h1.549c1.032 0 1.226.517 1.226.71.065.516-.194 1.162-1.226 1.162h-.968l.774 1.29c.452.775.258 1.162 0 1.42-.387.387-1.226.387-1.677-.452l-.904-1.548c-.645 1.42-1.29 2.968-2.065 4.775h4.001c1.936 0 3.55-1.613 3.55-3.55V6.56c-.065-.13-.194-.065-.259 0-.387.451-1.484 2-4 7.485zm-9.809 8.002h-.322a4.186 4.186 0 0 1-4.195-4.194V7.01a4.186 4.186 0 0 1 4.195-4.195h9.357c-.194-.194-.968-.516-1.742-.452-.323 0-.968.13-1.356-.129-.387-.322-.322-.516-.903-.516H4.928A4.764 4.764 0 0 0 .152 6.494V18.24c0 2.646 2.13 4.775 4.453 4.71.645 0 .839-.516 1.032-.903zm14.778-15.1v10.906a4.186 4.186 0 0 1-4.194 4.194h-4.324s-.387 1.033.839 1.033h3.872a4.764 4.764 0 0 0 4.775-4.776V8.817c.065-.903-.71-1.484-.968-1.871zM1.83 7.01v10.84c0 1.937 1.613 3.55 3.55 3.55h.58c0-.065.774-1.42 2.452-4.26.194-.386.452-.773.71-1.225h-4.71c-.581 0-.904-.387-.969-.71-.129-.516.194-1.162.904-1.162h2.387l3.034-5.291s-.71-1.29-.904-1.613c-.258-.452-.129-.904.13-1.162.386-.387 1.032-.58 1.677.452l.258.387.258-.387c.58-.84.968-.775 1.29-.71.517.129.84.71.388 1.613l-4.001 6.711h1.355c.452-.774.904-1.548 1.355-2.387-.064-.323-.129-.71-.064-1.033.064-.516.323-.968.645-1.355l.387.645c1.227-2.13 2.13-3.936 2.388-4.646.13-.387.323-1.162.13-1.807H5.38a3.54 3.54 0 0 0-3.55 3.55zm2.775 10.776c0-.064.774-1.42.774-1.42 1.227-.322 1.807.452 1.872.517 0 0-.84 1.484-1.097 1.742s-.581.323-.904.258c-.516-.129-.839-.645-.645-1.097z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -671,7 +671,7 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after {
} }
.wrap.h3body-exist .wrap-header.h3wrap { .wrap.h3body-exist .wrap-header.h3wrap {
flex: initial; flex: 1;
} }
.wrap.h3body-exist > .h3wrap-body { .wrap.h3body-exist > .h3wrap-body {
@ -735,6 +735,10 @@ body:not(.home) .h2wrap-body > .wrap:hover .h3wrap > h3 a::after {
border-radius: 0 0 0.5rem 0.5rem; border-radius: 0 0 0.5rem 0.5rem;
} }
.wrap-header.h3wrap > .wrap-body :not(:first-child):last-child {
border-radius: 0 0 0.5rem 0.5rem;
}
.wrap-header.h3wrap > .wrap-body { .wrap-header.h3wrap > .wrap-body {
z-index: 0; z-index: 0;
display: flex; display: flex;