diff --git a/.gitignore b/.gitignore index 83948575..e3e2b4c2 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,7 @@ hs_err_pid* # maven plugin temp files .flattened-pom.xml package-lock.json - +pnpm-lock.yaml # ------------------------------- javascript ------------------------------- # dependencies @@ -50,12 +50,10 @@ yarn-error.log* bundle*.js book.pdf - # ------------------------------- intellij ------------------------------- .idea *.iml - # ------------------------------- eclipse ------------------------------- .classpath .project diff --git a/README.md b/README.md index 64679b5b..b5e9a3de 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
@@ -110,17 +110,16 @@ - [linux-command](https://github.com/jaywcjlove/linux-command) - **社区网站** - [Linux 中国](https://linux.cn/) - 各种资讯、文章、技术 - - [实验楼](https://www.shiyanlou.com/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。 + - [LabEx 中国](https://labex.io/) - 免费提供了 Linux 在线环境,不用在自己机子上装系统也可以学习 Linux,超方便实用。 - [鸟哥的 linux 私房菜](http://linux.vbird.org/) - 非常适合 Linux 入门初学者看的教程。 - [Linux 公社](http://www.linuxidc.com/) - Linux 相关的新闻、教程、主题、壁纸都有。 - [Linux Today](http://www.linuxde.net) - Linux 新闻资讯发布,Linux 职业技术学习!。 - **知识相关** - [Linux 思维导图整理](http://www.jianshu.com/p/59f759207862) - [Linux 初学者进阶学习资源整理](http://www.jianshu.com/p/fe2a790b41eb) - - [Linux 基础入门(新版)](https://www.shiyanlou.com/courses/1) + - [Linux 快速入门(动手实验)](https://labex.io/zh/courses/quick-start-with-linux) - [【译】Linux 概念架构的理解](http://www.jianshu.com/p/c5ae8f061cfe) [En](http://oss.org.cn/ossdocs/linux/kernel/a1/index.html) - [Linux 守护进程的启动方法](http://www.ruanyifeng.com/blog/2016/02/linux-daemon.html) - - [Linux 编程之内存映射](https://www.shiyanlou.com/questions/2992) - [Linux 知识点小结](https://blog.huachao.me/2016/1/Linux%E7%9F%A5%E8%AF%86%E7%82%B9%E5%B0%8F%E7%BB%93/) - [10 大白帽黑客专用的 Linux 操作系统](https://linux.cn/article-6971-1.html) - **软件工具** diff --git a/codes/linux/soft/fastdfs-install.sh b/codes/linux/soft/fastdfs-install.sh index a7db9e44..95cfb009 100644 --- a/codes/linux/soft/fastdfs-install.sh +++ b/codes/linux/soft/fastdfs-install.sh @@ -59,7 +59,7 @@ yum install -y git gcc gcc-c++ make automake autoconf libtool pcre pcre-devel zl mkdir -p ${path} path=/opt/fdfs mkdir -p ${path}/libfastcommon -curl -o ${path}/libfastcommon.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/libfastcommon.zip +curl -o ${path}/libfastcommon.zip http://dunwu.test.upcdn.net/soft/fdfs/libfastcommon.zip if [[ ! -f ${path}/libfastcommon.zip ]]; then printf "${RED}[Error]install libfastcommon failed,exit. ${RESET}\n" exit 1 @@ -73,7 +73,7 @@ chmod +x -R ${path}/libfastcommon/*.sh printf "${GREEN}>>>>>>>>> install fastdfs${RESET}" mkdir -p ${path}/fastdfs -curl -o ${path}/fastdfs.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs.zip +curl -o ${path}/fastdfs.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs.zip if [[ ! -f ${path}/fastdfs.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs failed,exit. ${RESET}\n" fi @@ -84,7 +84,7 @@ chmod +x -R ${path}/fastdfs/*.sh printf "${GREEN}>>>>>>>>> install fastdfs-nginx-module${RESET}\n" mkdir -p ${path}/fastdfs-nginx-module -curl -o ${path}/fastdfs-nginx-module.zip https://raw.githubusercontent.com/dunwu/images/dev/soft/fdfs/fastdfs-nginx-module.zip +curl -o ${path}/fastdfs-nginx-module.zip http://dunwu.test.upcdn.net/soft/fdfs/fastdfs-nginx-module.zip if [[ ! -f ${path}/fastdfs-nginx-module.zip ]]; then printf "${RED}>>>>>>>>> install fastdfs-nginx-module failed,exit. ${RESET}\n" fi diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index f0c20a76..24645b9f 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -15,7 +15,7 @@ module.exports = { }, }, themeConfig: { - logo: 'images/dunwu-logo-100.png', + logo: '/images/dunwu-logo-100.png', repo: 'dunwu/linux-tutorial', repoLabel: 'Github', docsDir: 'docs', diff --git a/docs/README.md b/docs/README.md index 2d5f349d..8cf2000b 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,6 +1,6 @@ --- home: true -heroImage: https://raw.githubusercontent.com/dunwu/images/dev/common/dunwu-logo.png +heroImage: https://raw.githubusercontent.com/dunwu/images/master/common/dunwu-logo.png heroText: LINUX-TUTORIAL tagline: 📚 linux-tutorial 是一个 Linux 教程。 actionLink: / diff --git a/docs/docker/README.md b/docs/docker/README.md index 8653d515..7434bbcb 100644 --- a/docs/docker/README.md +++ b/docs/docker/README.md @@ -2,10 +2,10 @@ ## 📖 内容 -- [Docker 快速入门](docker/docker-quickstart.md) -- [Dockerfile 最佳实践](docker/docker-dockerfile.md) -- [Docker Cheat Sheet](docker/docker-cheat-sheet.md) -- [Kubernetes 应用指南](docker/kubernetes.md) +- [Docker 快速入门](docker-quickstart.md) +- [Dockerfile 最佳实践](docker-dockerfile.md) +- [Docker Cheat Sheet](docker-cheat-sheet.md) +- [Kubernetes 应用指南](kubernetes.md) ## 📚 资料 diff --git a/docs/docker/docker-quickstart.md b/docs/docker/docker-quickstart.md index f231afbc..4c5434fb 100644 --- a/docs/docker/docker-quickstart.md +++ b/docs/docker/docker-quickstart.md @@ -31,7 +31,7 @@ Docker 将应用程序与该程序的依赖,打包在一个文件里面。运 - **更轻松的迁移** - 由于 `Docker` 确保了执行环境的一致性,使得应用的迁移更加容易。`Docker` 可以在很多平台上运行,无论是物理机、虚拟机、公有云、私有云,甚至是笔记本,其运行结果是一致的。因此用户可以很轻易的将在一个平台上运行的应用,迁移到另一个平台上,而不用担心运行环境的变化导致应用无法正常运行的情况。 - **更轻松的维护和扩展** - `Docker` 使用的分层存储以及镜像的技术,使得应用重复部分的复用更为容易,也使得应用的维护更新更加简单,基于基础镜像进一步扩展镜像也变得非常简单。此外,`Docker` 团队同各个开源项目团队一起维护了一大批高质量的 [官方镜像](https://hub.docker.com/search/?type=image&image_filter=official),既可以直接在生产环境使用,又可以作为基础进一步定制,大大的降低了应用服务的镜像制作成本。 - + ### Docker 的主要用途 diff --git a/docs/docker/kubernetes.md b/docs/docker/kubernetes.md index d600ea91..82daee1c 100644 --- a/docs/docker/kubernetes.md +++ b/docs/docker/kubernetes.md @@ -49,7 +49,7 @@ Kubernetes 主要由以下几个核心组件组成: K8S 包含若干抽象用来表示系统状态,包括:已部署的容器化应用和负载、与它们相关的网络和磁盘资源以及有关集群正在运行的其他操作的信息。 - + - `Pod` - K8S 使用 Pod 来管理容器,每个 Pod 可以包含一个或多个紧密关联的容器。Pod 是一组紧密关联的容器集合,它们共享 PID、IPC、Network 和 UTS namespace,是 K8S 调度的基本单位。Pod 内的多个容器共享网络和文件系统,可以通过进程间通信和文件共享这种简单高效的方式组合完成服务。 - `Node` - Node 是 Pod 真正运行的主机,可以是物理机,也可以是虚拟机。为了管理 Pod,每个 Node 节点上至少要运行 container runtime(比如 docker 或者 rkt)、`kubelet` 和 `kube-proxy` 服务。 diff --git a/docs/linux/cli/linux-cli-dir.md b/docs/linux/cli/linux-cli-dir.md index d013dad0..16f82d4a 100644 --- a/docs/linux/cli/linux-cli-dir.md +++ b/docs/linux/cli/linux-cli-dir.md @@ -8,7 +8,7 @@ linux 目录结构是树形结构,其根目录是 `/` 。一张思维导图说明各个目录的作用: - + ### 1.2. Linux 文件属性 @@ -18,7 +18,7 @@ Linux 系统是一种典型的多用户系统,不同的用户处于不同的 ```bash $ ls -l total 64 -dr-xr-xr-x 2 root root 4096 Dec 14 2012 bin +drwxr-xr-x 2 root root 4096 Dec 14 2012 bin dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot ``` @@ -35,7 +35,7 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot 每个文件的属性由左边第一部分的 10 个字符来确定(如下图)。 - + 从左至右用 0-9 这些数字来表示。 @@ -47,12 +47,27 @@ dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot - 第 2、5、8 位表示写权限,如果用"w"字符表示,则有写权限,如果用"-"字符表示没有写权限。 - 第 3、6、9 位表示可执行权限,如果用"x"字符表示,则有执行权限,如果用"-"字符表示,则没有执行权限。 +```bash +d rwx r-x r-x +↑ ↑↑↑ ↑↑↑ ↑↑↑ +│ │││ │││ │││-其他用户执行权限 (x/-) +│ │││ │││ │└─ 其他用户写权限 (w/-) +│ │││ │││ └── 其他用户读权限 (r/-) +│ │││ ││└──── 属组用户执行权限 (x/-) +│ │││ │└───── 属组用户写权限 (w/-) +│ │││ └────── 属组用户读权限 (r/-) +│ ││└──────── 属主用户执行权限 (x/-) +│ │└───────── 属主用户写权限 (w/-) +│ └────────── 属主用户读权限 (r/-) +└──────────── 文件类型 (该文件是目录) +``` + #### 1.2.1. Linux 文件属主和属组 ```bash $ ls -l total 64 -dr-xr-xr-x 2 root root 4096 Dec 14 2012 bin +drwxr-xr-x 2 root root 4096 Dec 14 2012 bin dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot ``` diff --git a/docs/linux/ops/crontab.md b/docs/linux/ops/crontab.md index 8713136b..25d27650 100644 --- a/docs/linux/ops/crontab.md +++ b/docs/linux/ops/crontab.md @@ -65,7 +65,7 @@ crontab 要执行的定时任务都被保存在 `/etc/crontab` 文件中。 crontab 的文件格式如下: - + #### 标准字段 diff --git a/docs/linux/ops/samba.md b/docs/linux/ops/samba.md index 71358f9a..19fe6d9f 100644 --- a/docs/linux/ops/samba.md +++ b/docs/linux/ops/samba.md @@ -149,7 +149,7 @@ Windows: 访问:`\\<你的ip>\<你的共享路径>` : - + Mac: diff --git a/docs/linux/ops/vim.md b/docs/linux/ops/vim.md index 2f6d3942..ece7522d 100644 --- a/docs/linux/ops/vim.md +++ b/docs/linux/ops/vim.md @@ -308,33 +308,33 @@ Vim 是从 vi 发展出来的一个文本编辑器。代码补完、编译及错 此外,[这里](http://blog.ngedit.com/vi-vim-cheat-sheet-sch.gif)还有简体中文版。 - + ### 3.2. 入门版 基本操作的入门版。[原版出处](https://github.com/ahrencode/Miscellaneous)还有 keynote 版本可供 DIY 以及其他相关有用的 cheatsheet。 - + ### 3.3. 进阶版 下图是 300DPI 的超清大图,另外[查看原文](http://michael.peopleofhonoronly.com/vim/)还有更多版本:黑白,低分辨率,色盲等 - + ### 3.4. 增强版 下图是一个更新时间较新的现代版,含有的信息也更丰富。[原文链接](http://vimcheatsheet.com/) - + ### 3.5. 文字版 [原文链接](http://tnerual.eriogerg.free.fr/vimqrc.pdf) - + - + ## 4. 资料 diff --git a/docs/linux/soft/gitlab-ops.md b/docs/linux/soft/gitlab-ops.md index ff942ad5..3d5e564f 100644 --- a/docs/linux/soft/gitlab-ops.md +++ b/docs/linux/soft/gitlab-ops.md @@ -8,7 +8,7 @@ 进入官方下载地址:https://about.gitlab.com/install/ ,如下图,选择合适的版本。 - + 以 CentOS7 为例: @@ -70,7 +70,7 @@ docker run -d \ gitlab/gitlab-ce ``` - + ### 自签名证书 @@ -175,7 +175,7 @@ sudo gitlab-runner register URL 和令牌信息在 Gitlab 的 Runner 管理页面获取: - + ``` Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com ) @@ -292,11 +292,11 @@ sudo gitlab-ctl restart ### 创建项目 - + 输入项目信息,点击 Create project 按钮,在 Gitlab 创建项目。 - + ### 克隆项目到本地 diff --git a/docs/linux/soft/jdk-install.md b/docs/linux/soft/jdk-install.md index 4eed355c..594ec498 100644 --- a/docs/linux/soft/jdk-install.md +++ b/docs/linux/soft/jdk-install.md @@ -22,13 +22,13 @@ a. 进入 [Java 官网下载页面](https://www.oracle.com/technetwork/java/java b. 选择需要的版本: - + c. 选择对应操作系统的安装包: Windows 系统选择 exe 安装包;Mac 系统选择 dmp 安装包;Linux 系统选择 tar.gz 压缩包(RedHat 发行版可以安装 rpm 包)。 - + (2)运行安装包,按提示逐步安装 @@ -97,7 +97,7 @@ $ tar -zxf jdk-8u162-linux-x64.tar.gz (3)配置系统环境变量 -执行 `/etc/profile` 命令,添加以下内容: +执行 `vi /etc/profile` 命令,添加以下内容: ```bash # JDK 的根路径 diff --git a/docs/linux/soft/jenkins-ops.md b/docs/linux/soft/jenkins-ops.md index 6a000268..3ed2e485 100644 --- a/docs/linux/soft/jenkins-ops.md +++ b/docs/linux/soft/jenkins-ops.md @@ -17,11 +17,11 @@ Jenkins 支持各种运行方式,可通过系统包、Docker 或者通过一 CI(Continuous integration,中文意思是持续集成)是一种软件开发时间。持续集成强调开发人员提交了新代码之后,立刻进行构建、(单元)测试。根据测试结果,我们可以确定新代码和原有代码能否正确地集成在一起。借用网络图片对 CI 加以理解。 - + CD(Continuous Delivery, 中文意思持续交付)是在持续集成的基础上,将集成后的代码部署到更贴近真实运行环境(类生产环境)中。比如,我们完成单元测试后,可以把代码部署到连接数据库的 Staging 环境中更多的测试。如果代码没有问题,可以继续手动部署到生产环境。下图反应的是 CI/CD 的大概工作模式。 - + ## Jenkins 安装 @@ -98,7 +98,7 @@ Jenkins 是一个强大的 CI 工具,虽然本身使用 Java 开发,但也 General 是构建任务的一些基本配置。名称,描述之类的。 - + 重要配置项: @@ -111,7 +111,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Source Code Management**,即源码管理,就是配置你代码的存放位置。 - + - **Git:** 支持主流的 Github 和 Gitlab 代码仓库。因我们的研发团队使用的是 gitlab,所以下面我只会对该项进行介绍。 - **Repository URL**:仓库地址。 @@ -124,7 +124,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Triggers**,即构建触发器,用于构建任务的触发器。 - + 配置说明: @@ -138,7 +138,7 @@ General 是构建任务的一些基本配置。名称,描述之类的。 **Build Environment**,即构建环境,配置构建前的一些准备工作,如指定构建工具。 - + ### Build @@ -146,7 +146,7 @@ Build,即构建。 点击下图中的 Add build step 按钮,会弹出一个构建任务菜单,可以根据实际需要来选择。 - + 【说明】 @@ -162,11 +162,11 @@ Build,即构建。 **Post-build Actions**,即构建后操作,用于构建完本项目的一些后续操作,比如生成相应的代码测试报告。 - + - + - + 个人较常用的配置: @@ -182,13 +182,13 @@ Build,即构建。 ### 开始构建 - + 如上图所示,一切配置好后,即可点击 **Build Now** 开始构建。 ### 构建结果 - + - **构建状态** - **Successful 蓝色**:构建完成,并且被认为是稳定的。 diff --git a/docs/linux/soft/maven-install.md b/docs/linux/soft/maven-install.md index 5b41c115..1ea46d0e 100644 --- a/docs/linux/soft/maven-install.md +++ b/docs/linux/soft/maven-install.md @@ -32,7 +32,7 @@ ``` # MAVEN 的根路径 export MAVEN_HOME=/opt/maven/apache-maven-3.5.2 -export PATH=\$MAVEN_HOME/bin:\$PATH +export PATH=$MAVEN_HOME/bin:$PATH ``` 执行 `source /etc/profile` ,立即生效 diff --git a/docs/linux/soft/nexus-ops.md b/docs/linux/soft/nexus-ops.md index 4f9df168..c68af2ab 100644 --- a/docs/linux/soft/nexus-ops.md +++ b/docs/linux/soft/nexus-ops.md @@ -14,7 +14,7 @@ 进入[官方下载地址](https://www.sonatype.com/download-oss-sonatype),选择合适版本下载。 - + 本人将 Nexus 部署在 Linux 机器,所以选用的是 Unix 版本。 @@ -69,7 +69,7 @@ Usage: ./nexus {start|stop|run|run-redirect|status|restart|force-reload} Nexus 的默认启动端口为 `8081`,启动成功后,在浏览器中访问 `http://