Skip to content

Commit 788009b

Browse files
committed
Git使用 MySQL编码 Java 知识点 等
1 parent 8e93841 commit 788009b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+409
-199
lines changed

DevOps/Base.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ MAVEN_REPO/ticm
1616

1717
### 使用域名服务器,必须使用域名
1818

19-
否则后续所有文档、服务配置都充斥着 IP 会很难受
19+
否则后续所有文档、服务配置都充斥着 IP 会很难受、特别是公司搬迁更换 IP 时
2020

2121
### 设置域名解析超时时间
2222

@@ -45,6 +45,13 @@ vim /etc/hostname
4545
#xx.xxx.xxx.xxx hostname
4646
```
4747

48+
### HTTPS 站点注意内网根证书校验,避免打开缓慢,红色不安全导致不能保存密码
49+
50+
- 没有根证书服务器但有根证书时可以双击安装到受信任的根证书
51+
- 存量系统没有根证书时可以在 Chrome 快捷方式后面增加忽略 HTTPS 证书校验
52+
```
53+
-ignore-certificate-errors
54+
```
4855

4956
### 采购的网络火墙等系统要有人性化的申请流程
5057

@@ -59,4 +66,7 @@ https://directory.apache.org/
5966

6067
Gitlab、Jenkins、Jira、Confluence、Graylog
6168

62-
或者用 GitLab 的 OAuth 2.0 作为 Jenkins、Sonar 等系统的单点登录
69+
或者用 GitLab 的 OAuth 2.0 作为 Jenkins、Sonar 等系统的单点登录
70+
71+
72+
### 使用 Git 分享测试环境 DBeaver 数据库连接配置,避免每个人都花时间去问连接

DevOps/README.md

+1-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,7 @@
1313

1414
版本控制 & 变更控制
1515

16-
[Git](Git.md)
17-
18-
[GitLab](GitLab.md)
19-
20-
[分支管理 Branch](Branch.md)
16+
[Git 相关](git/README.md)
2117

2218
[语义化版本 2.0.0](https://semver.org/lang/zh-CN/)
2319

File renamed without changes.

DevOps/git/Gerrit.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Gerrit
2+
3+
### 使用 Gerrit 避免每次都要拉取代码才能提交
4+
5+
### 点击右上角 ABANDON 废弃不要的提交避免堆积在 OPEN 中
6+
7+
8+
9+
## 审核
10+
11+
### 审核时若前一个 Gerrit 提交不通过,可以点右上角 REBASE 解除关联
12+
13+
### 审核时可以点击文件清单右上角 EXPAND ALL 滚动查看修改
14+
15+
16+
17+
## 管理
18+
19+
### Submit type 应为 Rebase if necessary
20+
21+
否则每个提交都会有个 Merge 提交,历史线条非常乱
22+
23+
24+
### 禁止开发提交 Merge
25+
26+
开发失误复位到高版本的提交,合并到低版本分支,后面有其他提交时难以恢复
27+
28+
- Reference: refs/for/refs/heads/*
29+
- Push Merge Commit
30+
- DENY: MY_REPO/master
31+
- DENY: Anonymous Users
32+
- ALLOW: user/Devops
33+
34+

DevOps/GitLab.md DevOps/git/GitLab.md

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
## GitLab
22

3+
4+
5+
6+
## 审核
7+
8+
### 线上自动创建并接受 GitLab 合并请求(没有审核人力时用)
9+
10+
https://gitlab.com/LinWanCheng/gitlab-auto-merge
11+
12+
13+
14+
## 管理
15+
316
### GitLab 项目都放到一个一级群组中,若要二级群组不要按部门创建
417

518
以便在一级群组中设置全局变量
@@ -12,6 +25,4 @@
1225

1326
### 不要对人设置权限,把人设置到角色/组,然后给角色/组设置权限
1427

15-
人总是会变动的,一旦变动的话,修改按人设置的权限就很大工作量
16-
17-
### 修复问题时使用`Fixed #问题号`
28+
人总是会变动的,一旦变动的话,修改按人设置的权限就很大工作量

DevOps/git/Git_Commiter.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Git 提交
2+
3+
### 提交时注意作者和邮箱是否正确,避免不统一
4+
5+
https://git-scm.com/book/zh/v2/Git-工具-重写历史
6+
7+
### 使用`.gitkeep`空文件在`Git`中保留空文件夹
8+
9+
### 提交信息应带有分支名方便查看
10+
11+
### 提交信息格式 `对象:内容 Fixed #问题号` 方便看某个对象的相关修改
12+
13+
- Fixed 兼容 GitHub 和 GitLab
14+
15+
16+
### 禁止复位到其他分支
17+
18+
### 本地使用拉取衍合 Rebase 避免分支凌乱

DevOps/git/Git_Confict.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Git 避免冲突
2+
3+
### 把会出现多人同时添加的公共文件拆分成多个
4+
5+
比如每个服务一个配置文件而不是在同个文件中,避免同时添加或不同分支合并出现冲突
6+
7+
8+
### 分工时依据修改添加哪些文件分工,必要时指定清楚
9+
10+
否则两个人都添加或修改了同一处就会出现冲突
11+
12+
### 发现问题不只是改正,要对全量代码和历史数据做全面排查
13+
14+
### 禁止未在群中声明就修改公共代码,需要列出影响清单以便测试
+14-39
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
# Git
22

3-
## `SVN``Git`
3+
### 创建分支时打标签标记分支初始代码
44

5-
### `SVN`迁移`Git`可以保留提交记录,尽量保留提交记录迁移
6-
7-
```shell
8-
git svn clone svn地址 --username=用户名
5+
方便列代码清单
6+
```sh
7+
git tag 分支名_init
8+
git push origin 分支名_init
9+
git diff tag1 tag2 --name-only > diff.txt
10+
# 中文乱码解决 先改下配置
11+
git config --global core.quotepath false
912
```
1013

14+
1115
### 使用`.gitignore`文件忽略编译后的文件和本地运行时产生的日志等
1216

1317
IDEA 提示”部分忽略的目录未从索引和搜索中排除“时,\
@@ -19,28 +23,16 @@ IDEA 提示”部分忽略的目录未从索引和搜索中排除“时,\
1923
.svn
2024
```
2125

22-
Git Maven 项目忽略配置参考:[.gitignore](../.gitignore)
26+
Git Maven 项目忽略配置参考:[.gitignore](../../.gitignore)
2327

2428
官方文档:
2529
https://mirrors.edge.kernel.org/pub/software/scm/git/docs/gitignore.html
2630

2731

28-
### 使用`.gitkeep`空文件在`Git`中保留空文件夹
29-
30-
### 提交时注意作者和邮箱是否正确,避免不统一
31-
32-
https://git-scm.com/book/zh/v2/Git-工具-重写历史
33-
34-
35-
## 创建分支时打标签标记分支初始代码
32+
### `SVN`迁移`Git`可以保留提交记录,尽量保留提交记录迁移
3633

37-
方便列代码清单
38-
```sh
39-
git tag 分支名_init
40-
git push origin 分支名_init
41-
git diff tag1 tag2 --name-only > diff.txt
42-
# 中文乱码解决 先改下配置
43-
git config --global core.quotepath false
34+
```shell
35+
git svn clone svn地址 --username=用户名
4436
```
4537

4638

@@ -51,21 +43,4 @@ git config core.sparsecheckout true
5143
echo "subDir/" >> .git/info/sparse-checkout
5244
git pull origin master
5345
```
54-
https://git-scm.com/docs/git-sparse-checkout
55-
56-
## 避免冲突
57-
58-
### 把会出现多人同时添加的公共文件拆分成多个
59-
60-
比如每个服务一个配置文件而不是在同个文件中,避免同时添加或不同分支合并出现冲突
61-
62-
63-
### 分工时依据修改添加哪些文件分工,必要时指定清楚
64-
65-
否则两个人都添加或修改了同一处就会出现冲突
66-
67-
### 发现问题不只是改正,要对全量代码和历史数据做全面排查
68-
69-
### 禁止未在群中声明就修改公共代码,需要列出影响清单以便测试
70-
71-
46+
https://git-scm.com/docs/git-sparse-checkout

DevOps/git/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Git 相关
2+
3+
[分支管理](Branch.md)
4+
5+
[Git 提交者](Git_Commiter.md)
6+
7+
[Git 管理员](Git_Maintainer.md)
8+
9+
[Git 避免冲突](Git_Confict.md)
10+
11+
12+
[Gerrit](Gerrit.md)
13+
14+
[GitLab](GitLab.md)

DevOps/linux/sh_mnemonic.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,33 @@ sed -in "s/\$"{"key}/$key/g" pom.xml
1616
grep "行标识字符" pom.xml
1717
```
1818

19-
## 文件列表
19+
## IP 查机器
20+
```batch
21+
# 助记语:你不替食堂熬汤
22+
nbtstat -A IP
23+
```
24+
2025

26+
## 端口查进程
27+
```batch
28+
# 最后一列为 PID
29+
netstat -ano | findstr "端口"
30+
tasklist | finstr "PID"
2131
```
32+
33+
## 文件列表
34+
35+
```sh
2236
# Linux
2337
find -name *.java
2438

2539
# Windows 傻逼 fin(d)str
2640
dir /s/b finstr *.java
41+
```
42+
43+
## 剪切板
44+
```batch
45+
echo|set/p=文本|clip
46+
# 或
47+
set/p="文本"<nul|clip
2748
```

DevOps/linux/start.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
moduleName=$1
44
pidPath="$(dirname "$0")/$moduleName-pid_record"
55

6-
if [ -f "$myFile" ]; then
6+
if [ -f "$pidPath" ]; then
77
pid_record=$(cat "${pidPath}" | awk '{print $1}')
88
pid_record=$(ps -aef | grep "$pid_record" | awk '{print $2}' |grep "$pid_record")
99
if [ "$pid_record" ]; then

DevOps/linux/stop.sh

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/sh
2+
3+
moduleName=$1
4+
5+
pidPath="$(dirname "$0")/$moduleName-pid_record"
6+
7+
pid_record=$(cat "${pidPath}" | awk '{print $1}')
8+
pid_record=$(ps -aef | grep "$pid_record" | awk '{print $2}' |grep "$pid_record")
9+
if [ "$pid_record" ]; then
10+
kill "$pid_record"
11+
fi
File renamed without changes.
File renamed without changes.

README.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,10 @@ for DevTestOps, DevSecOps, BizDevOps
2828

2929
### Java
3030

31-
[Java 开发与运维](java/README.md)
31+
[Java 风格 API 框架 测试 运维](java/README.md)
3232

3333
[日志指南](log/README.md)
3434

35-
[Java 测试](java_test/README.md)
36-
3735
[Maven 指引](maven/README.md)
3836

3937

@@ -42,9 +40,14 @@ for DevTestOps, DevSecOps, BizDevOps
4240
[数据库 DB](db/README.md)
4341

4442

43+
### Test
44+
45+
[测试](test/README.md)
46+
47+
4548
### DevOps
4649

47-
[DevOps](DevOps/README.md)
50+
[自动化编译部署等 DevOps](DevOps/README.md)
4851

4952

5053
### JS

business/bank/interest.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 计息
2+
3+
### 对公对账会在意一分钱
4+
5+
### 支取重算可以避免存入时的bug或维护利率错误

business/im/IM.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 即时通讯 Instant Messaging
2+
3+
### 提供导出姓名部门等词库功能

db/DB_table.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,9 @@ import javax.validation.constraints.NotNull;
2222
### 表设计时需要考虑报表需求记录信息
2323

2424
- 如果数据中台不能接管所有报表时,微服务后无法跨库 JOIN 将会引起很多麻烦
25-
- 需要查用的不记在本系统甚至没有系统记录将
25+
- 需要查用的不记在本系统甚至没有系统记录将
26+
27+
28+
### 表前加库名可以方便后人接手
29+
30+
虽然可以在`information_schema.TABLES`

db/DBeaver.md

Whitespace-only changes.

db/MySQL.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ primary key = unique + not null
1313
稠密索引、稀疏索引
1414

1515
- 回表查询:先在非聚集索引上查询到主键值,然后拿着主键值回到表里查聚簇索引
16-
- 索引覆盖:返回字段在多列索引中可以避免回表查询,explain 的 extra 为 using index
16+
- 索引覆盖:返回字段在多列索引中可以避免回表查询,explain 的 extra 为 using index
17+
18+
### limit 的第一个参数从 0 开始,可省略,第二个参数是返回条数

0 commit comments

Comments
 (0)