forked from lcp0578/cheat-sheets
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
## OA开发笔记 | ||
- [文件转pdf](file2pdf.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## file2pdf | ||
- jdk | ||
- 下载地址:https://www.oracle.com/technetwork/java/javase/downloads/index.html | ||
- 安装: | ||
|
||
rpm -ivh jdk-11_linux-x64_bin.rpm | ||
- openoffice(依赖jdk) | ||
- unoconv | ||
- 下载rpm包:http://www.rpmfind.net/linux/rpm2html/search.php?query=unoconv | ||
- 安装rpm | ||
- gotenberg服务 | ||
- 项目地址:https://github.com/thecodingmachine/gotenberg | ||
- [配置文件示例](gotenberg.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# The port the application will listen to. | ||
port: 3000 | ||
|
||
logs: | ||
# Accepted values, in order of severity: DEBUG, INFO, WARN, ERROR, FATAL, PANIC. | ||
# Messages at and above the selected level will be logged. | ||
level: "DEBUG" | ||
|
||
# Accepted values: text, json. | ||
# When a TTY is not attached, the output will be in the defined format. | ||
formatter: "json" | ||
|
||
# You don't like a library which is used for a conversion? You want to handle a new file type? | ||
# You may provide here your own implementation! | ||
commands: | ||
|
||
# Some libraries like unoconv cannot perform concurrent conversions. That's why the API does only one conversion at a time. | ||
# If your current implementation uses libraries which are able to perform concurrent conversions, you may | ||
# change this value to false. | ||
lock: true | ||
|
||
# Unlike others commands' templates, you have access to FilesPaths instead of FilePath: it gathers all PDF files which should be merged. | ||
merge: | ||
template: "pdftk {{ range $filePath := .FilesPaths }} {{ $filePath }} {{ end }} cat output {{ .ResultFilePath }}" | ||
interpreter: "/bin/sh -c" | ||
timeout: 300 | ||
|
||
# You may add more commands (or less, or even none). | ||
conversions: | ||
|
||
# The command template: you have access to FilePath and ResultFilePath variables. | ||
- template: "markdown-pdf {{ .FilePath }} -o {{ .ResultFilePath }}" | ||
# The binary which will call the command. | ||
interpreter: "/bin/sh -c" | ||
# Duration in seconds after which the command will be killed if it has not finished. | ||
timeout: 300 | ||
# Files with the following extensions will be converted by the current command. | ||
extensions: | ||
- ".md" | ||
|
||
- template: "xvfb-run -e /dev/stdout wkhtmltopdf {{ .FilePath }} {{ .ResultFilePath }}" | ||
interpreter: "/bin/sh -c" | ||
timeout: 300 | ||
extensions: | ||
- ".html" | ||
- ".htm" | ||
|
||
- template: "unoconv --format pdf --output \"{{ .ResultFilePath }}\" \"{{ .FilePath }}\"" | ||
interpreter: "/bin/sh -c" | ||
timeout: 300 | ||
extensions: | ||
- ".doc" | ||
- ".docx" | ||
- ".odt" | ||
- ".xls" | ||
- ".xlsx" | ||
- ".ods" | ||
- ".ppt" | ||
- ".pptx" | ||
- ".odp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
## install fonts 安装字体 | ||
- jdk | ||
- 下载地址:https://www.oracle.com/technetwork/java/javase/downloads/index.html | ||
- 安装: | ||
|
||
rpm -ivh jdk-11_linux-x64_bin.rpm | ||
- openoffice(依赖jdk) | ||
- unoconv | ||
- 下载rpm包:http://www.rpmfind.net/linux/rpm2html/search.php?query=unoconv | ||
- 安装rpm | ||
- gotenberg服务 | ||
- 项目地址:https://github.com/thecodingmachine/gotenberg | ||
- [配置文件示例](gotenberg.yml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
## exit code 退出码 | ||
|
||
| 退出码的值|含义| 例子| 注释| | ||
|-----|-------|-------|-------| | ||
|1 |通用错误|`let "var1 = 1/0"`| 各种各样的错误都可能使用这个退出码, 比如"除0错误"| | ||
|2|shell内建命令使用错误(Bash文档上有说明)|| 很少看到, 通常情况下退出码都为1| | ||
|126|命令调用不能执行| |程序或命令的权限是不可执行的| | ||
|127|"command not found"| |估计是$PATH不对, 或者是拼写错误| | ||
|128|exit 的参数错误|exit 3.14159 |exit只能以整数作为参数, 范围是0 - 255(见脚注)| | ||
|128+n|信号"n"的致命错误|kill -9 |脚本的$PPID $? 返回137(128 + 9)| | ||
|130|用Control-C来结束脚本||Control-C是信号2的致命错误, (130 = 128 + 2, 见上边)| | ||
|255*|超出范围的退出状态|exit -1 |exit命令只能够接受范围是0 - 255的整数作为参数| |