Skip to content

Commit

Permalink
update OA
Browse files Browse the repository at this point in the history
  • Loading branch information
lcp0578 committed Sep 30, 2018
1 parent 48e6474 commit b37d586
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,7 @@
49. [hadoop](src/hadoop/README.md) hadoop分布式计算平台
50. [TCP/IP](src/TCPIP/README.md) TCP/IP协议相关
- [MQTT](src/TCPIP/MQTT/README.md) 消息队列遥测传输协议
51. [Docker](src/Docker/README.md) Docker相关
51. [Docker](src/Docker/README.md) Docker相关
52. [OA](src/OA/README.md)
- [file2pdf](src/OA/file2pdf.md) 文件转PDF
- [install fonts](src/OA/install_fonts.md)安装中文字体
2 changes: 2 additions & 0 deletions src/OA/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## OA开发笔记
- [文件转pdf](file2pdf.md)
13 changes: 13 additions & 0 deletions src/OA/file2pdf.md
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)
60 changes: 60 additions & 0 deletions src/OA/gotenberg.yml
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"
13 changes: 13 additions & 0 deletions src/OA/install_fonts.md
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)
12 changes: 12 additions & 0 deletions src/Shell/exit_code.md
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的整数作为参数|

0 comments on commit b37d586

Please sign in to comment.