Skip to content

Commit 4a158fa

Browse files
author
b59118
committedMay 28, 2020
add some docs
1 parent 1cfa3e1 commit 4a158fa

File tree

13 files changed

+737
-0
lines changed

13 files changed

+737
-0
lines changed
 

‎documents/centos.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
### vnc Server
2+
3+
4+
5+
- sudo yum install tigervnc-server
6+
7+
- sudo cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@.service
8+
- sudo vim /etc/systemd/system/vncserver@.service
9+
- sudo systemctl daemon-reload
10+
- sudo systemctl enable vncserver@:1.service
11+
- sudo vncpasswd ~/.vnc/paawd
12+
- sudo firewall-cmd --state
13+
- sudo firewall-cmd --zone=public --add-port=5901/tcp --permanent
14+
- sudo firewall-cmd --zone=public --add-port=6001/tcp --permanent
15+
- sudo firewall-cmd --reload
16+
- sudo firewall-cmd --list-all
17+
-
18+
19+
20+
21+
### Centos 关闭selinux 和防火墙
22+
23+
- vim /etc/selinux/config
24+
25+
- 查看防火墙状态
26+
27+
```
28+
firewall-cmd --state1
29+
```
30+
31+
停止firewall
32+
33+
```
34+
systemctl stop firewalld.service1
35+
```
36+
37+
禁止firewall开机启动
38+
39+
```
40+
systemctl disable firewalld.service
41+
```
42+
43+

‎documents/docker-compose.md

+333
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,333 @@
1+
1. 什么是Docker-Compose
2+
3+
Compose项目来源于之前的fig项目,使用python语言编写,与docker/swarm配合度很高。
4+
5+
Compose 是 Docker 容器进行编排的工具,定义和运行多容器的应用,可以一条命令启动多个容器,使用Docker Compose不再需要使用shell脚本来启动容器。
6+
7+
Compose 通过一个配置文件来管理多个Docker容器,在配置文件中,所有的容器通过services来定义,然后使用docker-compose脚本来启动,停止和重启应用,和应用中的服务以及所有依赖服务的容器,非常适合组合使用多个容器进行开发的场景。
8+
9+
docker-compose默认的模板文件是 docker-compose.yml,其中定义的每个服务都必须通过 image 指令指定镜像或 build 指令(需要 Dockerfile)来自动构建。
10+
11+
其它大部分指令都跟 docker run 中的类似。
12+
13+
如果使用 build 指令,在 Dockerfile 中设置的选项(例如:CMD, EXPOSE, VOLUME, ENV 等) 将会自动被获取,无需在 docker-compose.yml 中再次设置。
14+
使用Compose 基本上分为三步:
15+
16+
1.Dockerfile 定义应用的运行环境
17+
2.docker-compose.yml 定义组成应用的各服务
18+
3.docker-compose up 启动整个应用
19+
20+
21+
2.安装Compose
22+
23+
两种docker-compose安装方式
24+
25+
1.从github上下载docker-compose二进制文件安装
26+
27+
下载最新版的docker-compose文件
28+
29+
$ sudo curl -L https://github.com/docker/compose/releases/download/1.16.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
30+
添加可执行权限
31+
$ sudo chmod +x /usr/local/bin/docker-compose
32+
测试安装结果
33+
34+
$ docker-compose --version
35+
docker-compose version 1.16.1, build 1719ceb
36+
2.pip安装
37+
38+
2.1、安装python-pip
39+
40+
yum -y install epel-release
41+
yum -y install python-pip
42+
2.2、安装docker-compose
43+
pip install docker-compose
44+
待安装完成后,执行查询版本的命令,即可安装docker-compose
45+
46+
[root@swarm01 fendo]# docker-compose version
47+
docker-compose version 1.21.2, build a133471
48+
docker-py version: 3.3.0
49+
CPython version: 2.7.5
50+
OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 2017
51+
3.docker-compose.yml 配置文件详解
52+
53+
docker-compose文件结构,官方提供了一个 yaml Docker Compose 配置文件的标准例子
54+
55+
version: "3"
56+
services:
57+
58+
redis:
59+
image: redis:alpine
60+
ports:
61+
- "6379"
62+
networks:
63+
- frontend
64+
deploy:
65+
replicas: 2
66+
update_config:
67+
parallelism: 2
68+
delay: 10s
69+
restart_policy:
70+
condition: on-failure
71+
72+
db:
73+
image: postgres:9.4
74+
volumes:
75+
- db-data:/var/lib/postgresql/data
76+
networks:
77+
- backend
78+
deploy:
79+
placement:
80+
constraints: [node.role == manager]
81+
82+
vote:
83+
image: dockersamples/examplevotingapp_vote:before
84+
ports:
85+
- 5000:80
86+
networks:
87+
- frontend
88+
depends_on:
89+
- redis
90+
deploy:
91+
replicas: 2
92+
update_config:
93+
parallelism: 2
94+
restart_policy:
95+
condition: on-failure
96+
97+
result:
98+
image: dockersamples/examplevotingapp_result:before
99+
ports:
100+
- 5001:80
101+
networks:
102+
- backend
103+
depends_on:
104+
- db
105+
deploy:
106+
replicas: 1
107+
update_config:
108+
parallelism: 2
109+
delay: 10s
110+
restart_policy:
111+
condition: on-failure
112+
113+
worker:
114+
image: dockersamples/examplevotingapp_worker
115+
networks:
116+
- frontend
117+
- backend
118+
deploy:
119+
mode: replicated
120+
replicas: 1
121+
labels: [APP=VOTING]
122+
restart_policy:
123+
condition: on-failure
124+
delay: 10s
125+
max_attempts: 3
126+
window: 120s
127+
placement:
128+
constraints: [node.role == manager]
129+
130+
visualizer:
131+
image: dockersamples/visualizer:stable
132+
ports:
133+
- "8080:8080"
134+
stop_grace_period: 1m30s
135+
volumes:
136+
- "/var/run/docker.sock:/var/run/docker.sock"
137+
deploy:
138+
placement:
139+
constraints: [node.role == manager]
140+
141+
networks:
142+
frontend:
143+
backend:
144+
145+
volumes:
146+
db-data:
147+
一份标准配置文件应该包含 version、services、networks 三大部分,其中最关键的就是 services 和 networks 两个部分
148+
149+
3.1、文件配置
150+
151+
compose 文件是一个定义服务、 网络和卷的 YAML 文件 。Compose 文件的默认路径是 ./docker-compose.yml
152+
153+
服务定义包含应用于为该服务启动的每个容器的配置,就像传递命令行参数一样 docker container create。同样,网络和卷的定义类似于 docker network create 和 docker volume create。
154+
155+
正如 docker container create 在 Dockerfile 指定选项,如 CMD、 EXPOSE、VOLUME、ENV,在默认情况下,你不需要再次指定它们docker-compose.yml。
156+
157+
可以使用 Bash 类 ${VARIABLE} 语法在配置值中使用环境变量。
158+
159+
提示: 可以是用 .yml 或 .yaml 作为文件扩展名
160+
161+
3.2、版本
162+
163+
Compose目前为止有三个版本分别为Version 1,Version 2,Version 3,Compose区分Version 1和Version 2(Compose 1.6.0+,Docker Engine 1.10.0+)。Version 2支持更多的指令。Version 1没有声明版本默认是"version 1"。Version 1将来会被弃用。
164+
165+
3.3、配置选项
166+
167+
1.bulid
168+
169+
服务除了可以基于指定的镜像,还可以基于一份 Dockerfile,在使用 up 启动之时执行构建任务,这个构建标签就是 build,它可以指定 Dockerfile 所在文件夹的路径。Compose 将会利用它自动构建这个镜像,然后使用这个镜像启动服务容器
170+
build: /path/to/build/dir
171+
也可以是相对路径
172+
173+
build: ./dir
174+
设定上下文根目录,然后以该目录为准指定 Dockerfile
175+
176+
build:
177+
context: ../
178+
dockerfile: path/of/Dockerfile
179+
180+
2. context
181+
182+
context 选项可以是 Dockerfile 的文件路径,也可以是到链接到 git 仓库的url,当提供的值是相对路径时,它被解析为相对于撰写文件的路径,此目录也是发送到 Docker 守护进程的 context
183+
184+
build:
185+
context: ./dir
186+
3. dockerfile
187+
188+
使用此 dockerfile 文件来构建,必须指定构建路径
189+
build:
190+
context: .
191+
dockerfile: Dockerfile-alternate
192+
4.image
193+
194+
services:
195+
web:
196+
image: nginx
197+
在 services 标签下的第二级标签是 web,这个名字是用户自己自定义,它就是服务名称。
198+
image 则是指定服务的镜像名称或镜像 ID。如果镜像在本地不存在,Compose 将会尝试拉取这个镜像。
199+
例如下面这些格式都是可以的:
200+
image: redis
201+
image: ubuntu:14.04
202+
image: tutum/influxdb
203+
image: a4bc65fd
204+
205+
5. args
206+
207+
添加构建参数,这些参数是仅在构建过程中可访问的环境变量
208+
首先, 在Dockerfile中指定参数:
209+
ARG fendo
210+
ARG password
211+
212+
RUN echo "Build number: $fendo"
213+
RUN script-requiring-password.sh "$password"
214+
然后指定 build 下的参数,可以传递映射或列表
215+
216+
build:
217+
context: .
218+
args:
219+
fendo: 1
220+
password: fendo
221+
222+
223+
build:
224+
context: .
225+
args:
226+
- fendo=1
227+
- password=fendo
228+
指定构建参数时可以省略该值,在这种情况下,构建时的值默认构成运行环境中的值
229+
230+
args:
231+
232+
- fendo
233+
- password
234+
6.command
235+
236+
使用 command 可以覆盖容器启动后默认执行的命令。
237+
238+
command: bundle exec thin -p 3000
239+
该命令也可以是一个列表,方法类似于 dockerfile:
240+
241+
command: ["bundle", "exec", "thin", "-p", "3000"]
242+
7.container_name
243+
244+
Compose 的容器名称格式是:<项目名称><服务名称><序号>
245+
246+
虽然可以自定义项目名称、服务名称,但是如果你想完全控制容器的命名,可以使用这个标签指定:
247+
248+
container_name: app
249+
这样容器的名字就指定为 app 了。
250+
251+
8.depends_on
252+
253+
在使用 Compose 时,最大的好处就是少打启动命令,但是一般项目容器启动的顺序是有要求的,如果直接从上到下启动容器,必然会因为容器依赖问题而启动失败。
254+
255+
例如在没启动数据库容器的时候启动了应用容器,这时候应用容器会因为找不到数据库而退出,为了避免这种情况我们需要加入一个标签,就是 depends_on,这个标签解决了容器的依赖、启动先后的问题。
256+
257+
例如下面容器会先启动 redis 和 db 两个服务,最后才启动 web 服务:
258+
259+
version: '3'
260+
services:
261+
web:
262+
build: .
263+
depends_on:
264+
- db
265+
- redis
266+
redis:
267+
image: redis
268+
db:
269+
image: postgres
270+
注意的是,默认情况下使用 docker-compose up web 这样的方式启动 web 服务时,也会启动 redis 和 db 两个服务,因为在配置文件中定义了依赖关系。
271+
272+
9.pid
273+
274+
pid: "host"
275+
将PID模式设置为主机PID模式,跟主机系统共享进程命名空间。容器使用这个标签将能够访问和操纵其他容器和宿主机的名称空间。
276+
277+
10.ports
278+
279+
映射端口的标签。
280+
281+
使用HOST:CONTAINER格式或者只是指定容器的端口,宿主机会随机映射端口。
282+
283+
ports:
284+
285+
- "3000"
286+
- "8000:8000"
287+
- "49100:22"
288+
- "127.0.0.1:8001:8001"
289+
注意:当使用HOST:CONTAINER格式来映射端口时,如果你使用的容器端口小于60你可能会得到错误得结果,因为YAML将会解析xx:yy这种数字格式为60进制。所以建议采用字符串格式。
290+
11.extra_hosts
291+
292+
添加主机名的标签,就是往/etc/hosts文件中添加一些记录,与Docker client的--add-host类似:
293+
294+
extra_hosts:
295+
296+
- "somehost:162.242.195.82"
297+
- "otherhost:50.31.209.229"
298+
启动之后查看容器内部hosts:
299+
300+
162.242.195.82 somehost
301+
50.31.209.229 otherhost
302+
303+
12.volumes
304+
305+
挂载一个目录或者一个已存在的数据卷容器,可以直接使用 [HOST:CONTAINER] 这样的格式,或者使用 [HOST:CONTAINER:ro] 这样的格式,后者对于容器来说,数据卷是只读的,这样可以有效保护宿主机的文件系统。
306+
Compose的数据卷指定路径可以是相对路径,使用 . 或者 .. 来指定相对目录。
307+
308+
数据卷的格式可以是下面多种形式:
309+
310+
volumes:
311+
// 只是指定一个路径,Docker 会自动在创建一个数据卷(这个路径是容器内部的)。
312+
313+
- /var/lib/mysql
314+
315+
// 使用绝对路径挂载数据卷
316+
317+
- /opt/data:/var/lib/mysql
318+
319+
// 以 Compose 配置文件为中心的相对路径作为数据卷挂载到容器。
320+
321+
- ./cache:/tmp/cache
322+
323+
// 使用用户的相对路径(~/ 表示的目录是 /home/<用户目录>/ 或者 /root/)。
324+
325+
- ~/configs:/etc/configs/:ro
326+
327+
// 已经存在的命名的数据卷。
328+
329+
- datavolume:/var/lib/mysql
330+
如果你不使用宿主机的路径,你可以指定一个volume_driver。
331+
332+
volume_driver: mydriver
333+
原文:https://blog.csdn.net/u011781521/article/details/80464826

‎documents/mongodb.md

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
### MongoDB
2+
3+
- 查看所有数据库
4+
5+
> show dbs
6+
7+
- 创建或切换数据库
8+
9+
> use DB-Name
10+
11+
- 删除当前数据库
12+
13+
> ```
14+
> db.dropDatabase()
15+
> ```
16+
17+
18+
19+
- 集合(表)
20+
21+
- 创建
22+
23+
> ```shell
24+
> db.createCollection(name, options)
25+
> > use test
26+
> switched to db test
27+
> > db.createCollection("runoob")
28+
> { "ok" : 1 }
29+
> >
30+
> ```
31+
32+
- 查询
33+
34+
> 使用 **show collections** 或 **show tables** 命令
35+
>
36+
> ```
37+
> > show collections
38+
> runoob
39+
> system.indexes
40+
> ```
41+
42+
- 在 MongoDB 中,你不需要创建集合。当你插入一些文档时,MongoDB 会自动创建集合。
43+
44+
> ```
45+
> > db.mycol2.insert({"name" : "菜鸟教程"})
46+
> > show collections
47+
> mycol2
48+
> ...
49+
> ```
50+
51+
- 删除集合
52+
53+
```shell
54+
> use runoob
55+
switched to db runoob
56+
> db.createCollection("runoob") # 先创建集合,类似数据库中的表
57+
> show tables
58+
runoob
59+
> db.runoob.drop()
60+
true
61+
> show tables
62+
```
63+
64+

‎documents/prom-test/.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
HELP.md
2+
target/
3+
!.mvn/wrapper/maven-wrapper.jar
4+
!**/src/main/**
5+
!**/src/test/**
6+
7+
### STS ###
8+
.apt_generated
9+
.classpath
10+
.factorypath
11+
.project
12+
.settings
13+
.springBeans
14+
.sts4-cache
15+
16+
### IntelliJ IDEA ###
17+
.idea
18+
*.iws
19+
*.iml
20+
*.ipr
21+
22+
### NetBeans ###
23+
/nbproject/private/
24+
/nbbuild/
25+
/dist/
26+
/nbdist/
27+
/.nb-gradle/
28+
build/
29+
30+
### VS Code ###
31+
.vscode/

‎documents/prom-test/pom.xml

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4+
<modelVersion>4.0.0</modelVersion>
5+
<parent>
6+
<groupId>org.springframework.boot</groupId>
7+
<artifactId>spring-boot-starter-parent</artifactId>
8+
<version>2.2.6.RELEASE</version>
9+
<relativePath/> <!-- lookup parent from repository -->
10+
</parent>
11+
<groupId>top.microfrank</groupId>
12+
<artifactId>prom-test</artifactId>
13+
<version>0.0.1-SNAPSHOT</version>
14+
<name>prom-test</name>
15+
<description>Demo project for Spring Boot</description>
16+
17+
<properties>
18+
<java.version>1.8</java.version>
19+
</properties>
20+
21+
<dependencies>
22+
<dependency>
23+
<groupId>org.springframework.boot</groupId>
24+
<artifactId>spring-boot-starter-actuator</artifactId>
25+
</dependency>
26+
<dependency>
27+
<groupId>org.springframework.boot</groupId>
28+
<artifactId>spring-boot-starter-web</artifactId>
29+
</dependency>
30+
<dependency>
31+
<groupId>io.micrometer</groupId>
32+
<artifactId>micrometer-registry-prometheus</artifactId>
33+
<version>1.1.3</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.projectlombok</groupId>
37+
<artifactId>lombok</artifactId>
38+
<optional>true</optional>
39+
</dependency>
40+
<dependency>
41+
<groupId>org.springframework.boot</groupId>
42+
<artifactId>spring-boot-starter-test</artifactId>
43+
<scope>test</scope>
44+
<exclusions>
45+
<exclusion>
46+
<groupId>org.junit.vintage</groupId>
47+
<artifactId>junit-vintage-engine</artifactId>
48+
</exclusion>
49+
</exclusions>
50+
</dependency>
51+
</dependencies>
52+
53+
<build>
54+
<plugins>
55+
<plugin>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-maven-plugin</artifactId>
58+
</plugin>
59+
</plugins>
60+
</build>
61+
62+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package top.microfrank.promtest;
2+
3+
import org.springframework.web.bind.annotation.GetMapping;
4+
import org.springframework.web.bind.annotation.RequestMapping;
5+
import org.springframework.web.bind.annotation.RestController;
6+
7+
/**
8+
* @author Frank
9+
* @date 2020/5/5 13:03
10+
*/
11+
@RestController
12+
@RequestMapping("/")
13+
public class PromController {
14+
@GetMapping("/p1")
15+
public String p1(){
16+
return "p1";
17+
}
18+
19+
@GetMapping("/p2")
20+
public String p2(){
21+
return "p2";
22+
}
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
package top.microfrank.promtest;
2+
3+
import io.micrometer.core.instrument.Counter;
4+
import io.micrometer.core.instrument.MeterRegistry;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.stereotype.Component;
7+
import org.springframework.web.filter.OncePerRequestFilter;
8+
9+
import javax.servlet.FilterChain;
10+
import javax.servlet.ServletException;
11+
import javax.servlet.http.HttpServletRequest;
12+
import javax.servlet.http.HttpServletResponse;
13+
import java.io.IOException;
14+
import java.util.Map;
15+
16+
/**
17+
* @author Frank
18+
* @date 2020/5/5 13:04
19+
*/
20+
@Component
21+
public class PromFilter extends OncePerRequestFilter {
22+
@Autowired
23+
MeterRegistry registry;
24+
25+
@Override
26+
protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws ServletException, IOException {
27+
Counter totalRequest = registry.counter("total_request","method", httpServletRequest.getMethod(),"path",httpServletRequest.getRequestURI());
28+
totalRequest.increment();
29+
30+
doFilter(httpServletRequest,httpServletResponse,filterChain);
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package top.microfrank.promtest;
2+
3+
import io.micrometer.core.instrument.Counter;
4+
import io.micrometer.core.instrument.MeterRegistry;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.beans.factory.annotation.Value;
7+
import org.springframework.boot.SpringApplication;
8+
import org.springframework.boot.actuate.autoconfigure.metrics.MeterRegistryCustomizer;
9+
import org.springframework.boot.autoconfigure.SpringBootApplication;
10+
import org.springframework.context.annotation.Bean;
11+
import org.springframework.web.bind.annotation.GetMapping;
12+
import org.springframework.web.bind.annotation.RequestMapping;
13+
import org.springframework.web.bind.annotation.RestController;
14+
15+
@SpringBootApplication
16+
@RestController
17+
@RequestMapping("/")
18+
public class PromTestApplication {
19+
20+
public static void main(String[] args) {
21+
SpringApplication.run(PromTestApplication.class, args);
22+
}
23+
24+
@Bean
25+
MeterRegistryCustomizer<MeterRegistry> configurer(@Value("${spring.application.name}") String applicationName) {
26+
return (registry) -> registry.config().commonTags("application", applicationName);
27+
}
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
spring.application.name=prom-test
2+
management.endpoints.web.exposure.include=*
3+
management.metrics.tags.application=${spring.application.name}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package top.microfrank.promtest;
2+
3+
import org.junit.jupiter.api.Test;
4+
import org.springframework.boot.test.context.SpringBootTest;
5+
6+
@SpringBootTest
7+
class PromTestApplicationTests {
8+
9+
@Test
10+
void contextLoads() {
11+
}
12+
13+
}

‎documents/ser2net.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
### ser2net 命令
2+
3+
- 参考文档 https://www.twblogs.net/a/5c0cf2e4bd9eee5e40ba9510
4+
5+
1. 修改配置文件
6+
7+
```
8+
vim /etc/ser2net.conf
9+
# telnet
10+
# <TCP port>:<state>:<timeout>:<device>:<options>
11+
20053:telnet:14400:/dev/ttyUSB5:115200 8DATABITS NONE 1STOPBIT LOCAL banner
12+
```
13+
14+
2. 重启 ser2net 服务
15+
16+
sudo service ser2net restart

‎documents/shell.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## 移动光标
2+
3+
- `ctrl+b`: 前移一个字符(backward)
4+
- `ctrl+f`: 后移一个字符(forward)
5+
- `alt+b`: 前移一个单词
6+
- `alt+f`: 后移一个单词
7+
- `ctrl+a`: 移到行首(a是首字母)
8+
- `ctrl+e`: 移到行尾(end)
9+
- `ctrl+xx`: 行首到当前光标替换
10+
11+
## 编辑命令
12+
13+
- `alt+.`: 粘帖最后一次命令最后的参数(通常用于`mkdir long-long-dir`后, `cd`配合着`alt+.`
14+
- `alt+d`: 删除当前光标到临近右边单词开始(delete)
15+
- `ctrl+u`: 删除光标左边所有
16+
- `ctrl+h`: 删除光标前一个字符(相当于backspace)
17+
- `ctrl+d`: 删除光标后一个字符(相当于delete)
18+
- `ctrl+w`: 删除当前光标到临近左边单词结束(word)
19+
- `ctrl+k`: 删除光标右边所有
20+
- `ctrl+l`: 清屏
21+
- `ctrl+shift+c`: 复制(相当于鼠标左键拖拽)
22+
- `ctrl+shift+v`: 粘贴(相当于鼠标中键)
23+
24+
## 其它
25+
26+
- `ctrl+n`: 下一条命令
27+
- `ctrl+p`: 上一条命令
28+
- `alt+n`: 下一条命令(例如输入`ls`, 然后按'alt+n', 就会找到历史记录下的`ls`命令)
29+
- `alt+p`: 上一条命令(跟`alt+n`相似)
30+
- `shift+PageUp`: 向上翻页
31+
- `shift+PageDown`: 向下翻页
32+
- `ctrl+r`: 进入历史查找命令记录, 输入关键字。 多次按返回下一个匹配项
33+
34+
## Vim
35+
36+
### 移动光标
37+
38+
- `b`: 向前移动一个单词
39+
- `w`: 向后移动一个单词
40+
41+
### 删除
42+
43+
- `dw`: 从当前光标开始删除到下一个单词头
44+
- `de`: 从当前光标开始删除到单词尾
45+
46+

‎documents/收藏.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
## 收藏
2+
3+
### 1. markdown
4+
5+
- 图床工具
6+
7+
- https://github.com/Molunerfinn/PicGo/releases
8+
9+
- 使用教程 https://www.jianshu.com/p/9d91355e8418
10+
11+
- GitHub token 权限设置
12+
13+
![](https://raw.githubusercontent.com/b59118/picBed/master/img/20190704182508.png)
14+
15+
16+
17+
### 2. url
18+
19+
- 编程练习 https://leetcode-cn.com/explore/
20+
- docker 入门文档 https://legacy.gitbook.com/@yeasy
21+
22+
### 3. Docker
23+
24+
1. Docker自带的如下ARG参数,可以在其他指令中直接引用:
25+
26+
- HTTP_PROXY
27+
- http_proxy
28+
- HTTPS_PROXY
29+
- https_proxy
30+
- FTP_PROXY
31+
- ftp_proxy
32+
- NO_PROXY
33+
- no_proxy
34+
35+
2. vim 在插入模式粘贴代码缩进办法
36+
37+
:set paste 粘贴完成是 set nopaste
38+
39+
3. shell 自动补全忽略大小写
40+
41+
> add file ~/.inputrc
42+
>
43+
> set completion-ignore-case on

0 commit comments

Comments
 (0)
Please sign in to comment.