Skip to content

Commit

Permalink
适配手机termux编译本书成功
Browse files Browse the repository at this point in the history
  • Loading branch information
bubifengyun committed Sep 5, 2022
2 parents d56dae9 + 8951dcc commit 82ae9a1
Show file tree
Hide file tree
Showing 14 changed files with 329 additions and 29 deletions.
Empty file removed .nojekyll
Empty file.
6 changes: 3 additions & 3 deletions _output.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ bookdown::gitbook:
facebook: no
bookdown::pdf_book:
keep_tex: yes
dev: cairo_pdf
dev: pdf
latex_engine: xelatex
citation_package: biblatex
template: latex/template.tex
pandoc_args: ["--listings", "--top-level-division=chapter", "--wrap=preserve"]
quote_footer: ["\\VA{", "}{}"]
# md_extensions: -smart
# output_extensions: -smart
#bookdown::epub_book:
#stylesheet: css/style.css
bookdown::epub_book:
stylesheet: css/style.css
125 changes: 125 additions & 0 deletions bib/packages.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
@Manual{R-base,
title = {R: A Language and Environment for Statistical Computing},
author = {{R Core Team}},
organization = {R Foundation for Statistical Computing},
address = {Vienna, Austria},
year = {2022},
url = {https://www.R-project.org/},
}

@Manual{R-bookdown,
title = {bookdown: Authoring Books and Technical Documents with R Markdown},
author = {Yihui Xie},
year = {2022},
note = {R package version 0.28},
url = {https://CRAN.R-project.org/package=bookdown},
}

@Manual{R-DT,
title = {DT: A Wrapper of the JavaScript Library DataTables},
author = {Yihui Xie and Joe Cheng and Xianying Tan},
year = {2022},
note = {R package version 0.24},
url = {https://github.com/rstudio/DT},
}

@Manual{R-htmlwidgets,
title = {htmlwidgets: HTML Widgets for R},
author = {Ramnath Vaidyanathan and Yihui Xie and JJ Allaire and Joe Cheng and Carson Sievert and Kenton Russell},
year = {2021},
note = {R package version 1.5.4},
url = {https://github.com/ramnathv/htmlwidgets},
}

@Manual{R-knitr,
title = {knitr: A General-Purpose Package for Dynamic Report Generation in R},
author = {Yihui Xie},
year = {2022},
note = {R package version 1.40},
url = {https://yihui.org/knitr/},
}

@Manual{R-magick,
title = {magick: Advanced Graphics and Image-Processing in R},
author = {Jeroen Ooms},
year = {2021},
note = {R package version 2.7.3},
url = {https://CRAN.R-project.org/package=magick},
}

@Manual{R-miniUI,
title = {miniUI: Shiny UI Widgets for Small Screens},
author = {Joe Cheng},
year = {2018},
note = {R package version 0.1.1.1},
url = {https://CRAN.R-project.org/package=miniUI},
}

@Manual{R-rmarkdown,
title = {rmarkdown: Dynamic Documents for R},
author = {JJ Allaire and Yihui Xie and Jonathan McPherson and Javier Luraschi and Kevin Ushey and Aron Atkins and Hadley Wickham and Joe Cheng and Winston Chang and Richard Iannone},
year = {2022},
note = {R package version 2.16},
url = {https://CRAN.R-project.org/package=rmarkdown},
}

@Manual{R-webshot,
title = {webshot: Take Screenshots of Web Pages},
author = {Winston Chang},
year = {2022},
note = {R package version 0.5.3},
url = {https://CRAN.R-project.org/package=webshot},
}

@Book{bookdown2016,
title = {bookdown: Authoring Books and Technical Documents with {R} Markdown},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2016},
note = {ISBN 978-1138700109},
url = {https://bookdown.org/yihui/bookdown},
}

@Book{knitr2015,
title = {Dynamic Documents with {R} and knitr},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2015},
edition = {2nd},
note = {ISBN 978-1498716963},
url = {https://yihui.org/knitr/},
}

@InCollection{knitr2014,
booktitle = {Implementing Reproducible Computational Research},
editor = {Victoria Stodden and Friedrich Leisch and Roger D. Peng},
title = {knitr: A Comprehensive Tool for Reproducible Research in {R}},
author = {Yihui Xie},
publisher = {Chapman and Hall/CRC},
year = {2014},
note = {ISBN 978-1466561595},
url = {http://www.crcpress.com/product/isbn/9781466561595},
}

@Book{rmarkdown2018,
title = {R Markdown: The Definitive Guide},
author = {Yihui Xie and J.J. Allaire and Garrett Grolemund},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2018},
note = {ISBN 9781138359338},
url = {https://bookdown.org/yihui/rmarkdown},
}

@Book{rmarkdown2020,
title = {R Markdown Cookbook},
author = {Yihui Xie and Christophe Dervieux and Emily Riederer},
publisher = {Chapman and Hall/CRC},
address = {Boca Raton, Florida},
year = {2020},
note = {ISBN 9780367563837},
url = {https://bookdown.org/yihui/rmarkdown-cookbook},
}

2 changes: 2 additions & 0 deletions rmd/302-install-deepin.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ $ sudo apt-get install software-properties-common

前面电脑分区导致硬盘容量缺失,应该是 MacOS 系统的问题,通过[CSDN一篇博客](https://blog.csdn.net/pku_Coder/article/details/76864653)的方法,顺利解决了硬盘问题。

其实,苹果系统存在的几个问题,比如硬盘容量丢失,或者无法连接网络等。这些通过图形界面操作异常的问题,常常可以通过命令行解决。


> 用磁盘工具直接分区,随便分个大小,格式选择默认的os x扩展,然后点击分区,过一会 会显示分区成功,这时候你看你原来丢失的100g回来了,在你刚刚新分的盘里了。这时候点击减号把这个分区抹去就行了~
>
Expand Down
23 changes: 7 additions & 16 deletions rmd/303-install-software.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,11 @@ $ sudo snap install --dangerous scrcpy-snap/*

### 第二种安装方法

在这个之前,还需要提前安装 [`adb`](https://developer.android.com/studio/releases/platform-tools.html),下载解压缩在 */opt/android-platform-tools/*文件夹,并创建adb的超链接。
在这个之前,还需要提前安装 [`adb`](https://developer.android.google.cn/studio/releases/platform-tools.html),下载解压缩在 */opt/android-platform-tools/*文件夹,并创建adb的超链接。

```bash
$ wget https://dl.google.com/android/repository/platform-tools_r29.0.2-linux.zip
$ unzip platform-tools_r29.0.2-linux.zip
$ wget https://dl.google.com/android/repository/platform-tools_r31.0.3-linux.zip
$ unzip platform-tools_r31.0.3-linux.zip
$ sudo cp -r platform-tools /opt/android-platform-tools
$ sudo ln -s /opt/android-platform-tools/adb /usr/local/bin/
```
Expand All @@ -201,29 +201,20 @@ $ sudo apt install ffmpeg libsdl2-2.0.0
# client build dependencies
$ sudo apt install make gcc pkg-config meson ninja-build \
libavcodec-dev libavformat-dev libavutil-dev \
libsdl2-dev
libsdl2-dev libavdevice-dev

# server build dependencies
$ sudo apt install openjdk-8-jdk

# 下载最新源码保存为 scrcpy.zip
# wget https://gitee.com/mirrors/scrcpy/repository/archive/v1.10?format=zip -O scrcpy.zip
# unzip scrcpy.zip

# 其实也可直接使用 git clone 复制
# 下载最新源码保存为 scrcpy.zip (因为github经常登录不上,采用了gitee的镜像。也可以使用https://hub.fastgit.org/Genymobile/scrcpy.git)
$ git clone https://gitee.com/mirrors/scrcpy.git
$ cd scrcpy
$ wget https://github.com/Genymobile/scrcpy/releases/download/v1.10/scrcpy-server-v1.10.jar \
-O scrcpy-server.jar
$ meson x --buildtype release --strip -Db_lto=true -Dprebuilt_server=scrcpy-server.jar
$ cd x
$ ninja
$ sudo ninja install
$ sudo ./install_release.sh
```

### 使用方法

数据线连上手机,弹出窗口里选择打开USB调试,在电脑终端输入
数据线连上手机,弹出窗口里选择打开USB调试,选择传输文件(MTP)。在电脑终端输入

```bash
$ scrcpy -f # 全屏显示,更多用法请查看官网
Expand Down
Empty file removed rmd/402-admin-network.Rmd
Empty file.
7 changes: 6 additions & 1 deletion rmd/404-cups.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ CUPS实际上是一个集成的服务。包括了前端接收打印命令的相

## Linux 使用得力DE-620K针式打印机

组装打印机啥的就不说了,本办公室正好新进了这台打印机。
组装打印机啥的就不说了,本办公室正好新进了这台打印机。


## 使用打印机的办法

官网不提供Linux版本的驱动,怎么安装相关驱动来使用打印机呢?
33 changes: 32 additions & 1 deletion rmd/405-web-server.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,37 @@

解压缩后,内有中文的安装教程,非常详细,这里就不赘述了。本人的安装方式见[这篇博客](https://my.oschina.net/bubifengyun/blog/3161820)

最好提及一下如何使用 PHP,Python 和 R 语言如何连接达梦数据库。

## 学习vue 笔记

最好提及一下如何使用 PHP,Python 和 R 语言如何连接达梦数据库。
### 安装npm

最开始不知道怎么安装npm,用的系统自带的,版本太低了,安装效果很差。总是出问题。于是[官网](https://nodejs.org/en/)下载安装最新版的npm

```bash
$ VERSION=v16.3.0
$ DISTRO=linux-x64
$ sudo mkdir -p /usr/local/lib/nodejs
$ sudo tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs
$ sudo ln -s /usr/local/lib/nodejs/node-v16.3.0-linux-x64/bin/node /usr/local/bin/
$ sudo ln -s /usr/local/lib/nodejs/node-v16.3.0-linux-x64/bin/npm /usr/local/bin/
```

接着安装 `vue-cli`

```bash
$ sudo npm install -g @vue/cli
$ sudo npm install -g @vue/cli-service-global
```

创建自己的项目,`chenzj`

```bash
$ vue create chenzj
```

## PHP 搭建网站

https://blog.csdn.net/q297896911/article/details/80646536
https://www.liquidweb.com/kb/install-lamp-stack-centos-7/
Empty file removed rmd/408-nfs.Rmd
Empty file.
Empty file removed rmd/503-selinux.Rmd
Empty file.
31 changes: 24 additions & 7 deletions rmd/802-appendix-makebook.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,38 @@

### Linux 下使用

下面以深度操作系统15.5版本为例说明。安装过程中,请确保当前 `rstudio` 的版本高于 1.0.0, `texlive` 为2015年后的版本, `pandoc` 的版本高于 2.0.0。
下面以深度操作系统 20.2 版本为例说明。

参考[官网](https://mirrors.tuna.tsinghua.edu.cn/CRAN/)安装最新版R语言。

```{.bash numbers=none}
$ sudo apt-get install r-base r-base-dev \
rstudio texlive-full pandoc make
$ sudo apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
```

如果不能满足,请参考相关软件官网,下载最新版本。我的[博客](https://my.oschina.net/bubifengyun/blog/1936119)记录了如何安装最新版 texlive,有需要的可以去看看。[pandoc官网](https://github.com/jgm/pandoc/blob/master/INSTALL.md)有其安装教程。R 语言的安装方法[官网镜像](https://mirrors.tuna.tsinghua.edu.cn/CRAN/)也可找到,这里就不赘述了,有问题可以邮件联系。
安装稳定版的源,把源`deb http://cloud.r-project.org/bin/linux/debian buster-cran40/`写入到 */etc/apt/sources.list* 文件。并更新。

```{.bash}
$ sudo su
# echo "deb http://cloud.r-project.org/bin/linux/debian buster-cran40/" >> /etc/apt/sources.list
# exit
$ sudo apt-get update
```

安装过程中,请确保当前 `rstudio` 的版本高于 1.0.0, `texlive` 为2015年后的版本, `pandoc` 的版本高于 2.0.0。

```{.bash numbers=none}
$ sudo apt-get install r-base r-base-dev \
libcurl4-openssl-dev libxt-dev libssl-dev libmagick++-dev libgit2-dev pandoc make
```

曾经在 Lubuntu 下试着安装过。一般先安装 `make`,运行命令,仍旧出错,提示没有`RScript`,接着安装`r-base r-base-dev`。再接着,`sudo make`还是出错。最后是`pandoc`版本问题了。由于 Lubuntu 版本太老,没能更新好。总结一下,
下面是安装`TinyTex`,关于`TinyTex`的详细介绍,见[谢益辉的文章](https://yihui.name/tinytex/)

```{.bash numbers=none}
$ sudo apt-get install make r-base r-base-dev -y
$ sudo make
$ curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh
```

如果`TinyTex`不能满足,请参考相关软件官网,下载最新版本的texlive。我的[博客](https://my.oschina.net/bubifengyun/blog/1936119)记录了如何安装最新版 texlive,有需要的可以去看看。[pandoc官网](https://github.com/jgm/pandoc/blob/master/INSTALL.md)有其安装教程。R 语言的安装方法[官网镜像](https://mirrors.tuna.tsinghua.edu.cn/CRAN/)也可找到,这里就不赘述了,有问题可以邮件联系。

第一次编译,可能需要安装很多软件,请静静等待。后面,直接运行下面这条语句,实现编译。

```{.bash numbers=none}
Expand Down
2 changes: 1 addition & 1 deletion rmd/810-appendix-deepin-intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ initrd 分 image-initrd 及 cpio-initrd 两种。

转载网页:

- http://wiki.deepin.org/wiki/DEEPIN_%E6%A1%8C%E9%9D%A2%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E6%A6%82%E8%BF%B0
- https://wiki.deepin.org/zh/Deepin%E5%AE%89%E8%A3%85%E6%8C%87%E5%8D%97/%E7%B3%BB%E7%BB%9F%E5%90%AF%E5%8A%A8%E5%92%8C%E5%BC%95%E5%AF%BC/DEEPIN_%E6%A1%8C%E9%9D%A2%E7%B3%BB%E7%BB%9F%E5%AE%89%E8%A3%85%E6%A6%82%E8%BF%B0
2 changes: 2 additions & 0 deletions rmd/899-appendix-history.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
- 2018-12-04 家庭事务繁多,今年到此为止,明年开春后再更新。
- 2020-01-13 今年继续一月一章吧。争取2020年草稿完成。
- 2020-07-16 停滞了很长时间,要抓紧时间了,今年写的太少了。
- 2021-07-28 学习机器人操作,得以有空来做。
- 2022-04-05 清明节有空,更新一点.
- 2022-09-05 适配手机,在Termux下,成功编译本书。
Loading

0 comments on commit 82ae9a1

Please sign in to comment.