提交 fe3767aa 编写于 作者: whatyn's avatar whatyn

1

上级 5efaa9f7
......@@ -2,7 +2,7 @@
- [x] 个人仓库 java linux mysql ...
- [gitlab]( https://gitlab.com/xuyq123/mynotes )   [gitee]( https://gitee.com/xy180/MyNotes )   [github]( https://github.com/scott180/MyNotes )   [csdn_code]( https://codechina.csdn.net/xu180/MyNotes )   [coding]( https://xyqin.coding.net/public/my/MyNotes/git/files )   [bitbucket]( https://bitbucket.org/xu12345/mynotes )
- [blog]( https://blog.xushufa.cn )   [gitlab]( https://gitlab.com/xuyq123/mynotes )   [gitee]( https://gitee.com/xy180/MyNotes )   [github]( https://github.com/scott180/MyNotes )
******************************************
......@@ -50,17 +50,16 @@
******************************************
```
个人资料一般保存在git平台及网盘,如下:
git平台:gitlab、github、gitee、csdn_code、coding、bitbucket
网盘:阿里云网盘、百度网盘、阿里云个人邮箱网盘、坚果云、天翼云、微云、wps云盘
笔记:csdn、博客园、作业部落、有道云笔记、qq邮箱记事本、语雀、腾讯文档、飞书、简书
```
## 2、软件
```
java mysql maven
idea git navicat notepad++
postman xshell fillder typora VMware
redis mongo kafka zookeeper tomcat eclipse
python nodejs vue
火绒安全软件 向日葵 Everything
```
- [x] idea maven mysql
......@@ -75,45 +74,52 @@ python nodejs vue
| eclipse | [eclipse官方下载]( http://www.eclipse.org/downloads/packages ) [版本说明]( ./eclipse.md ) |
## 3、项目
---
```
个人资料一般保存在git平台及网盘,如下:
git平台:gitlab、github、gitee、csdn_code、coding、bitbucket
网盘:阿里云网盘、百度网盘、阿里云个人邮箱网盘、坚果云、天翼云、微云、wps云盘
笔记:csdn、博客园、作业部落、有道云笔记、qq邮箱记事本、语雀、腾讯文档、飞书、简书
java mysql maven
idea git navicat notepad++
postman xshell fillder typora VMware
redis mongo kafka zookeeper tomcat eclipse
python nodejs vue
火绒安全软件 向日葵 Everything
```
<br/>
## 3、网站
> 项目 <br/>
| 名称 | 仓库 | 备注 |
| --------- | ------------------------------------------------------------- | ---------- |
| MyNotes | [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180/MyNotes ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/MyNotes ) &ensp; [coding]( https://xyqin.coding.net/public/my/MyNotes/git/files ) &ensp; [bitbucket]( https://bitbucket.org/xu12345/mynotes ) | 工作笔记 |
| java-book | [gitlab]( https://gitlab.com/xuyq123/java-book ) &ensp; [gitee]( https://gitee.com/xy180/java-book ) &ensp; [github]( https://github.com/scott180/java-book ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/java-book ) &ensp; [coding]( https://xyqin.coding.net/public/my/java-book/git/files ) | java书籍 |
| calligraphy-boot | [gitlab]( https://gitlab.com/xuyq123/calligraphy-boot ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy-boot ) &ensp; [github]( https://github.com/scott180/calligraphy-boot ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/calligraphy-boot ) | springboot项目 |
| calligraphy | [gitlab]( https://gitlab.com/xuyq123/calligraphy ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy ) &ensp; [github]( https://github.com/scott180/calligraphy ) &ensp; [gitlab_pages]( https://xuyq123.gitlab.io/plain/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89.html ) &ensp; [gitlab_mkdocs]( https://xuyq123.gitlab.io/plain-mkdocs/ ) | 书法练习轨迹 |
| mkdocs | gitlab [note-mkdocs]( https://gitlab.com/xuyq123/note-mkdocs )&ensp; [**网页**]( https://xuyq123.gitlab.io/note-mkdocs/ ) &ensp;&ensp; [myblog-mkdocs]( https://gitlab.com/xuyq123/myblog-mkdocs )&ensp; [网页]( https://xuyq123.gitlab.io/myblog-mkdocs/ ) <br/>github [note-mkdocs]( https://github.com/scott180/note-mkdocs )&ensp; [网页]( https://scott180.github.io/note-mkdocs/ ) &ensp;&ensp;[myblog-mkdocs]( https://github.com/scott180/myblog-mkdocs )&ensp; [网页]( https://scott180.github.io/myblog-mkdocs/ )<br/>gitee [plain-mkdocs]( https://gitee.com/xy180/plain-mkdocs/tree/master/note ) [网页]( http://xy180.gitee.io/plain-mkdocs/note/site/ ) &ensp;&ensp;[myblog-mkdocs]( https://gitee.com/xy180/myblog-mkdocs ) | 我的笔记与博客 |
| docsify | gitlab [plain-docsify]( https://gitlab.com/xuyq123/plain-docsify )&ensp; [**网页**]( https://xuyq123.gitlab.io/plain-docsify/ ) &ensp;&ensp; [myblog-docsify]( https://gitlab.com/xuyq123/myblog-docsify )&ensp; [网页]( https://xuyq123.gitlab.io/myblog-docsify/ ) <br/>github [plain-docsify]( https://github.com/scott180/plain-docsify )&ensp; [网页]( https://scott180.github.io/plain-docsify/ ) &ensp;&ensp;[myblog-docsify]( https://github.com/scott180/myblog-docsify )&ensp; [网页]( https://scott180.github.io/myblog-docsify/ ) | 笔记与博客docsify |
> **平台**
- 若有志同道合的小伙伴想联系本人,可通过以下方式发邮件或私信。路漫漫其修远兮,吾将上下而求索。共勉。
******************************************
******************************************
******************************************
| 平台 | 链接 |
| -------------- | -------------- |
| **项目仓库** | [gitlab]( https://gitlab.com/xuyq123/calligraphy ) &ensp; [coding]( https://xyqin.coding.net/public/my/calligraphy/git ) &ensp; [github]( https://github.com/scott180/calligraphy ) &ensp; [bitbucket]( https://bitbucket.org/xu12345/calligraphy ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy ) &ensp; [sourceforge]( https://sourceforge.net/p/calligraphy/code ) &ensp; [github_docsify]( https://scott180.github.io/docsify-calligraphy ) |
| **资讯账号** | [微信公众号]( https://mp.weixin.qq.com/s/HmdDsCaeumuZg_DfitIdlw ) &ensp; [头条]( https://www.toutiao.com/c/user/token/MS4wLjABAAAA2_bWhiknCbcKNu4c6VTM2B7m2vr7zBrh0x6fSyOrtGU ) &ensp; [豆瓣]( https://www.douban.com/people/80730595/photos ) &ensp; [知乎]( https://www.zhihu.com/people/xu-xian-sheng-72-29/posts ) |
| **个人邮箱** | 1021151991@qq.com |
***
> 注册了微信公众号及今日头条号:**无为徐生**,以后会将书法练习轨迹、程序员笔记以及一些随笔感想更新在此。若有兴趣,可扫码关注。
> **公众号**
- 注册了微信公众号及今日头条号:[**无为徐生**]( https://scott180.github.io/calligraphy/%E6%97%A0%E4%B8%BA%E5%BE%90%E7%94%9F ),以后会将书法练习轨迹、程序员笔记以及一些随笔感想更新在此。<br/>
- 每周一会在无为徐生**微信公众号**同步《书法练习轨迹》,持续更新,敬请关注。
| 无为徐生 | 今日头条号 | &ensp; | 微信公众号 |
| 无为徐生 | 微信公众号 | &ensp; | 今日头条号 |
| --------- | ------------------------------------------------------------- | - | ---------- |
| 二维码 | ![t]( https://codechina.csdn.net/xu180/document/-/raw/master/imgs/toutiao/无为徐生.png ) | <br/> | ![w]( https://codechina.csdn.net/xu180/document/-/raw/master/imgs/weixin/无为徐生.png ) |
| 二维码 | ![w]( https://xyqin.coding.net/p/my/d/imgs/git/raw/master/other/wuweixusheng_weixin.png ) | <br/> | ![t]( https://xyqin.coding.net/p/my/d/imgs/git/raw/master/other/wuweixusheng_toutiao.png ) |
***
> **我的网站**
- 徐书法 `xushufa.cn` 个人书法练习网站
| 徐书法 | 我的网站 | 备注 |
| --- | ------------- | ------------- |
| 1 | [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://blog.xushufa.cn ) | 《书法练习轨迹》及博客网站。 |
| 2 | [docsify-calligraphy]( https://docsify-calligraphy.xushufa.cn ) &ensp; [docsify-blog]( https://docsify-blog.xushufa.cn ) | docsify构建的网站。 |
| 3 | [mkdocs-calligraphy]( https://mkdocs-calligraphy.xushufa.cn ) &ensp; [mkdocs-blog]( https://mkdocs-blog.xushufa.cn ) | mkdocs构建的网站。 |
***
## git笔记
# git笔记
> [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180 )
> [blog]( https://blog.xushufa.cn ) &ensp; [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180 )
------------------------
### 1、基础操作
## 1、基础操作
#### 1.1、常用命令
### 1.1、常用命令
[git知识大全]( https://gitee.com/help/articles/4122 )
......@@ -119,7 +119,7 @@ git push origin HEAD --force 强制提交
```
#### 1.2、配置
### 1.2、配置
```vb
vi /etc/ssh/sshd_config
......@@ -143,7 +143,7 @@ vi /etc/ssh/sshd_config
```
#### 1.3、分支
### 1.3、分支
```sql
https://edu.aliyun.com/jiaocheng/1834?spm=5176.11182473.menu.7.k6ksTN
......@@ -218,9 +218,9 @@ git branch --set-upstream-to origin/newName
------------------------
### 2、高级操作
## 2、高级操作
#### 2.1、查看文件状态及日志
### 2.1、查看文件状态及日志
```vb
......@@ -265,7 +265,7 @@ git diff 有两个主要的应用场景。
```
#### 2.2、stash暂存
### 2.2、stash暂存
```vb
git stash: 备份当前的工作区的内容,从最近的一次提交中读取相关内容,让工作区保证和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。
......@@ -284,7 +284,7 @@ git stash drop 从Git栈删除最旧的一个暂存
```
#### 2.3、修改注释信息
### 2.3、修改注释信息
```
git使用amend选项提供了最后一次commit的反悔。但是对于历史提交呢,就必须使用rebase了。
......@@ -327,7 +327,7 @@ git checkout -b reback_remove_branch ddd94a4
```
#### 2.4、撤销
### 2.4、撤销
> git commit之后如何撤销
......@@ -373,9 +373,9 @@ https://segmentfault.com/a/1190000012897697
------------------------
### 3、问题
## 3、问题
#### 3.1、github添加ssh公钥
### 3.1、github添加ssh公钥
``` vb
......@@ -397,7 +397,7 @@ git clone git@github.com:scott180/MyNotes.git
```
#### 3.2、提交及更新失败
### 3.2、提交及更新失败
``` java
用git pull来更新代码的时候遇到了下面的问题
......
### jdk
> Java Development Kit (JDK) 是Sun公司(已被Oracle收购)针对Java开发员的软件开发工具包。自从Java推出以来,JDK已经成为使用最广泛的Java SDK(Software development kit)。
- [ ] jdk6--jdk10都是来自[官网]( http://www.oracle.com/technetwork/java/archive-139210.html )
这些jdk软件有三种格式:tar.gz、zip、bin
- 1、zip是windoxs软件,解压后会有exe格式的jdk软件,直接安装即可。
- 2、tar.gz是linux软件,需要用tar -zxvf xx.tar.gz解压。
- 3、bin也是linux软件,需解压:
- 添加执行权限
chmod u+x jdk-6u45-linux-x64.bin
- 解压
./jdk-6u45-linux-x64.bin
- [ ] 软件名称里含有x64则是64位软件,32位为则没有。如下:
- jdk-8u162-windows-x64.zip jdk-8u162-linux-x64.tar.gz 是64位软件
- jdk-8u72-windows-i586.zip jdk-8u72-linux-i586.tar.gz 是32位软件
***
| 云盘链接 | 密码 |
| -------- | ----- |
| [jdk6]( https://pan.baidu.com/s/1z3p1DecyBVugP7cECIupyg ) | 829h |
| [jdk7]( https://pan.baidu.com/s/17ik9x-g3RkYEu6vah9CZVw ) | muvr |
| [jdk8]( https://pan.baidu.com/s/1MT8zldLnH9PuZsVR77DEAw ) | mv5i |
| [jdk9]( https://pan.baidu.com/s/1SMGJqedJKR3hULrpWn4eLA ) | hai6 |
| [jdk10]( https://pan.baidu.com/s/1SHA7XNoPxBdOkaed3cunow ) | hgyn |
......@@ -8,7 +8,7 @@
- [x] 2017.08.22--now
`xyq` `linux` `note`
> [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes/blob/master/linuxNote-x.md ) &ensp; [作业部落]( https://www.zybuluo.com/mdeditor ) &ensp; [CSDN]( https://me.csdn.net/xu180 ) &ensp; [马克飞象]( https://maxiang.io ) &ensp; [typora]( https://typora.io/#windows )
> [blog]( https://blog.xushufa.cn ) &ensp; [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes/blob/master/linuxNote-x.md ) &ensp; [作业部落]( https://www.zybuluo.com/mdeditor ) &ensp; [CSDN]( https://me.csdn.net/xu180 ) &ensp; [马克飞象]( https://maxiang.io ) &ensp; [typora]( https://typora.io/#windows )
<h2 id="command"></h2>
......@@ -94,6 +94,22 @@
关机重启 | shutdown -r
关机不重启 | shutdown -h
立刻关机 | shutdown now
```
[root]# vi /etc/profile
[root]# source /etc/profile
[root]# echo $LANG
# export LC_ALL="zh_CN.GBK"
# export LANG="zh_CN.GBK"
LANG=zh_CN.UTF-8
LC_ALL=en_US.UTF-8
```
********************************************************
......@@ -605,6 +621,87 @@ make uninstall
********************************************************************
#### 1.3.8 nginx命令
```
启动
sudo /usr/local/lighthouse/softwares/nginx/sbin/nginx
$ sudo systemctl start nginx #systemd
OR
$ sudo service nginx start #sysvinit
重载 Nginx 服务
sudo /usr/local/lighthouse/softwares/nginx/sbin/nginx -s reload
$ sudo systemctl reload nginx #systemd
$ sudo service nginx reload #sysvinit
停止
sudo /usr/local/lighthouse/softwares/nginx/sbin/nginx -s stop
$ sudo systemctl stop nginx #systemd
OR
$ sudo service nginx stop #sysvinit
开机自启动
$ sudo systemctl enable nginx #systemd
$ sudo service nginx enable #sysv init
查询状态
sudo /usr/local/lighthouse/softwares/nginx/sbin/nginx -t
ps -ef | grep nginx
$ sudo systemctl status nginx #systemd
$ sudo service nginx status #sysvinit
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
killall -9 nginx
```
```
docsify 使用nginx布署在私有服务器
// 安装docsify
npm i docsify-cli -g
docsify --version
docsify serve
注意问题:
将第一行的user www-data;,不管你那里是什么,统一改为user root,否则后面会出现403 forbidden.
server {
listen 8080;
server_name localhost;
location / {
root /home/lighthouse/shufaguiji/;
index index.html;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
```
---
<h3 id="IP"></h3>
### 1.4 IP及防火墙
......
......@@ -2,10 +2,10 @@
* [1、日常](#note)
* [2、工作](#wrok)
* [3、java](#java)
* [4、git仓库](#gitId)
* [4、我的](#myShu)
- [ ] `仓库` &ensp; [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180/MyNotes ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/MyNotes ) &ensp; [coding]( https://xyqin.coding.net/public/my/MyNotes/git/files ) &ensp; [bitbucket]( https://bitbucket.org/xu12345/mynotes )
- [ ] `仓库` &ensp; [blog]( https://blog.xushufa.cn ) &ensp; [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180/MyNotes )
<h2 id="note"></h2>
......@@ -883,18 +883,46 @@ syso+Alt+/ 输出
### 3.3、java软件
#### 3.3.1、java软件
#### 3.3.1、jdk java软件
| 软件 | 下载地址 |
| -------- | ----- |
| idea | [idea官方下载]( https://www.jetbrains.com/idea/download/other.html ) &ensp; [idea2019]( https://www.aliyundrive.com/s/oWgxBBNqGj9 ) |
| jdk | [Java Development Kit]( ./jdk.md ) |
| maven | [maven官方下载]( https://archive.apache.org/dist/maven/maven-3/ ) |
| mysql | [mysql_5.7]( https://www.aliyundrive.com/s/pymjQca3DbY ) |
| javaSoft | [java软件]( https://www.aliyundrive.com/s/fWXemUwcsUs ) redis/mongo/Navicat/kafka/zookeeper/git/Xshell... |
| tomcat | [tomcat官网]( https://archive.apache.org/dist/tomcat/ ) &ensp; ([云盘]( https://pan.baidu.com/s/1yPhAfIcACTGkpIOYlEds1g ) 密码: j9ug ) |
| eclipse | [eclipse官方下载]( http://www.eclipse.org/downloads/packages ) [版本说明]( ./eclipse.md ) |
---
> Java Development Kit (JDK) 是Sun公司(已被Oracle收购)针对Java开发员的软件开发工具包。自从Java推出以来,JDK已经成为使用最广泛的Java SDK(Software development kit)。
- [ ] jdk6--jdk10都是来自[官网]( http://www.oracle.com/technetwork/java/archive-139210.html )
这些jdk软件有三种格式:tar.gz、zip、bin
- 1、zip是windoxs软件,解压后会有exe格式的jdk软件,直接安装即可。
- 2、tar.gz是linux软件,需要用tar -zxvf xx.tar.gz解压。
- 3、bin也是linux软件,需解压:
- 添加执行权限
chmod u+x jdk-6u45-linux-x64.bin
- 解压
./jdk-6u45-linux-x64.bin
- [ ] 软件名称里含有x64则是64位软件,32位为则没有。如下:
- jdk-8u162-windows-x64.zip jdk-8u162-linux-x64.tar.gz 是64位软件
- jdk-8u72-windows-i586.zip jdk-8u72-linux-i586.tar.gz 是32位软件
| 云盘链接 | 密码 |
| -------- | ----- |
| [jdk6]( https://pan.baidu.com/s/1z3p1DecyBVugP7cECIupyg ) | 829h |
| [jdk7]( https://pan.baidu.com/s/17ik9x-g3RkYEu6vah9CZVw ) | muvr |
| [jdk8]( https://pan.baidu.com/s/1MT8zldLnH9PuZsVR77DEAw ) | mv5i |
| [jdk9]( https://pan.baidu.com/s/1SMGJqedJKR3hULrpWn4eLA ) | hai6 |
| [jdk10]( https://pan.baidu.com/s/1SHA7XNoPxBdOkaed3cunow ) | hgyn |
---
#### 3.3.2、java maven环境变量
```java
......@@ -991,85 +1019,44 @@ maven常用打包命令
---
<h2 id="gitId"></h2>
## 4、git仓库
### 4.1、书法练习轨迹
> 若无意外,一般每周一在gitlab《**书法练习轨迹--明月几时有**》记录上周练习情况。其他渠道,不定时同步。
| 序号 | 仓库 | 备注 |
| --- | ------------------------------------------------------------- | ----------------------------------- |
| 1 | [**gitlab**]( https://gitlab.com/xuyq123/calligraphy ) &ensp; [imgs]( https://gitlab.com/xuyq123/imgs ) | 国外网站,网速较慢。 |
| 2 | [csdn_code]( https://codechina.csdn.net/xu180/calligraphy ) &ensp; [imgs]( https://codechina.csdn.net/xu180/imgs ) | 备份,国内网站,速度快。用户较少。 |
| 3 | [github]( https://github.com/scott180/calligraphy ) &ensp; [imgs]( https://github.com/scott180/imgs ) | 备份,最流行git仓库。国外网站,但有时打不开。 |
| 4 | [coding]( https://xyqin.coding.net/public/my/calligraphy/git ) &ensp; [imgs]( https://xyqin.coding.net/public/my/imgs/git ) | 备份,速度快。但仓库markdown文件不渲染。 |
| 5 | [gitee]( https://gitee.com/xy180/calligraphy ) &ensp; [imgs]( https://gitee.com/xy180/imgs ) | 备份,国内网站,速度快。但可能会被[屏蔽]。 |
| 6 | [bitbucket]( https://bitbucket.org/xu12345/calligraphy ) &ensp; [imgs]( https://bitbucket.org/xu12345/imgs ) | 备份,国外网站。markdown渲染不太完善。 |
| - | **社区** | |
| 7 | [csdn博客]( https://blog.csdn.net/xu180/article/details/113602103 ) &ensp; [ReadMe]( https://blog.csdn.net/xu180/article/details/118492424 ) | 程序员技术交流平台,发布文章,有删减。 |
| 8 | [博客园]( https://www.cnblogs.com/scott123/p/14729493.html ) &ensp; [ReadMe]( https://www.cnblogs.com/scott123/p/14972979.html ) | 开发者知识分享社区。 |
| 9 | [语雀]( https://www.yuque.com/longguang123/ccgbto/cbq9u0 ) &ensp; [ReadMe]( https://www.yuque.com/longguang123/ccgbto/oby4hq ) | 文档与知识管理工具,无删减。阿里巴巴产品。 |
| 10 | [飞书]( https://nal4j8dwi0.feishu.cn/docs/doccntwAAd1yjADzHGQT0ueBkN7 ) &ensp; [ReadMe]( https://nal4j8dwi0.feishu.cn/docs/doccnpf5pWihfu3aW4psk5vO7ue ) | 办公平台。字节跳动产品。|
| 11 | [我来]( https://www.wolai.com/rDqeCwfv87RLPPmuu2fvyi ) &ensp; [ReadMe]( https://www.wolai.com/npaRuQ7wj44TYHqup5xg2w ) | 不仅仅是未来的云端协作平台与个人笔记。 |
| - | **云盘** | |
| 12 | [坚果云]( https://www.jianguoyun.com/p/DTnLeQEQxP-NBhjNrfED ) &ensp; [markdown]( https://www.jianguoyun.com/p/DfYHsfUQxP-NBhjOrfED ) | 文件分享。 |
| 13 | [百度网盘]( https://pan.baidu.com/s/1dOJMgeZAyCYolEflsKIOPQ ) | 提取码: zpxu 。pdf文件分享,需要登录。 |
| 14 | [阿里云盘]( https://www.aliyundrive.com/s/dKE1SMhqdwn ) | pdf文件分享,需要登录。 |
| 15 | [天翼云]( https://cloud.189.cn/t/RRBbumb2MB7b ) | pdf文件分享,需要登录。中国电信网盘。 |
| 16 | [和彩云]( https://caiyun.139.com/m/i?125CmrCy7hU1y ) | 提取码:WAmq 。pdf文件分享,需要登录。中国移动网盘。 |
| 17 | [wps云盘]( https://www.kdocs.cn/l/cpUDGjX6765H ) | pdf文件分享,需要登录。 |
| 18 | [微云]( https://share.weiyun.com/JKZ4ANJ5 ) &ensp; [腾讯文档]( https://docs.qq.com/pdf/DVmxKTG5YZHZBUGlx ) | pdf文件分享。 |
| 19 | [有道云]( http://note.youdao.com/s/V7b1jHjB ) | 笔记分享,无删减。 |
| 20 | [google云盘]( https://drive.google.com/file/d/1Ubx-Rz3Xwhn48PEXMx-BmWrJGyIAzNfn/view?usp=sharing ) | 文件分享,无删减。 |
| - | **网页** | |
| 21 | [作业部落]( https://www.zybuluo.com/scott180/note/1793757 ) &ensp; [ReadMe]( https://www.zybuluo.com/scott180/note/892814 ) | markdown编辑器,文件分享。 |
| 22 | [gitee_pages]( http://xy180.gitee.io/plain-mkdocs/calligraphy/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89.html ) &ensp; [ReadMe]( http://xy180.gitee.io/plain-mkdocs/calligraphy/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9ReadMe.html ) | gitee静态网页,markdown转html。 |
| 23 | [github_pages]( https://scott180.github.io/calligraphy/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89 ) &ensp; [ReadMe]( https://scott180.github.io/calligraphy ) | github静态网页,有时打不开。[主题1]( https://scott180.github.io/calligraphy1/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89 ) &ensp; [主题2]( https://scott180.github.io/calligraphy2/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89 ) |
| 24 | [**gitlab_pages**]( https://xuyq123.gitlab.io/plain/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89.html ) &ensp; [ReadMe]( https://xuyq123.gitlab.io/plain/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9ReadMe.html ) | gitlab静态网页,markdown转html。 |
### 4.2、笔记&项目
<h2 id="muShu"></h2>
```
个人资料一般保存在git平台及网盘,如下:
git平台:gitlab、github、gitee、csdn_code、coding、bitbucket
网盘:阿里云网盘、百度网盘、阿里云个人邮箱网盘、坚果云、天翼云、微云、wps云盘
笔记:csdn、博客园、作业部落、有道云笔记、qq邮箱记事本、语雀、腾讯文档、飞书、简书
## 4、我的
```
> **平台**
> 笔记 <br/>
> [note]( https://gitlab.com/xuyq123/mynotes/-/blob/master/note.md ) &ensp; [linuxNote]( https://gitlab.com/xuyq123/mynotes/-/blob/master/linuxNote-x.md ) &ensp; [gitNote]( https://gitlab.com/xuyq123/mynotes/-/blob/master/gitNote.md ) &ensp; [java]( https://gitlab.com/xuyq123/mynotes/-/blob/master/java.md )
- 若有志同道合的小伙伴想联系本人,可通过以下方式发邮件或私信。路漫漫其修远兮,吾将上下而求索。共勉。
<br/>
| 平台 | 链接 |
| -------------- | -------------- |
| **项目仓库** | [gitlab]( https://gitlab.com/xuyq123/calligraphy ) &ensp; [coding]( https://xyqin.coding.net/public/my/calligraphy/git ) &ensp; [github]( https://github.com/scott180/calligraphy ) &ensp; [bitbucket]( https://bitbucket.org/xu12345/calligraphy ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy ) &ensp; [sourceforge]( https://sourceforge.net/p/calligraphy/code ) &ensp; [github_docsify]( https://scott180.github.io/docsify-calligraphy ) |
| **资讯账号** | [微信公众号]( https://mp.weixin.qq.com/s/HmdDsCaeumuZg_DfitIdlw ) &ensp; [头条]( https://www.toutiao.com/c/user/token/MS4wLjABAAAA2_bWhiknCbcKNu4c6VTM2B7m2vr7zBrh0x6fSyOrtGU ) &ensp; [豆瓣]( https://www.douban.com/people/80730595/photos ) &ensp; [知乎]( https://www.zhihu.com/people/xu-xian-sheng-72-29/posts ) |
| **个人邮箱** | 1021151991@qq.com |
> 项目 <br/>
***
| 名称 | 仓库 | 备注 |
| --------- | ------------------------------------------------------------- | ---------- |
| MyNotes | [gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180/MyNotes ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/MyNotes ) &ensp; [coding]( https://xyqin.coding.net/public/my/MyNotes/git/files ) &ensp; [bitbucket]( https://bitbucket.org/xu12345/mynotes ) | 工作笔记 |
| java-book | [gitlab]( https://gitlab.com/xuyq123/java-book ) &ensp; [gitee]( https://gitee.com/xy180/java-book ) &ensp; [github]( https://github.com/scott180/java-book ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/java-book ) &ensp; [coding]( https://xyqin.coding.net/public/my/java-book/git/files ) | java书籍 |
| calligraphy-boot | [gitlab]( https://gitlab.com/xuyq123/calligraphy-boot ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy-boot ) &ensp; [github]( https://github.com/scott180/calligraphy-boot ) &ensp; [csdn_code]( https://codechina.csdn.net/xu180/calligraphy-boot ) | java项目 |
| calligraphy | [gitlab]( https://gitlab.com/xuyq123/calligraphy ) &ensp; [gitee]( https://gitee.com/xy180/calligraphy ) &ensp; [github]( https://github.com/scott180/calligraphy ) &ensp; [gitlab_pages]( https://xuyq123.gitlab.io/plain/%E4%B9%A6%E6%B3%95%E7%BB%83%E4%B9%A0%E8%BD%A8%E8%BF%B9--%E6%98%8E%E6%9C%88%E5%87%A0%E6%97%B6%E6%9C%89.html ) &ensp; [gitlab_mkdocs]( https://xuyq123.gitlab.io/plain-mkdocs/ ) | 书法练习轨迹 |
| mkdocs | gitlab [note-mkdocs]( https://gitlab.com/xuyq123/note-mkdocs )&ensp; [**网页**]( https://xuyq123.gitlab.io/note-mkdocs/ ) &ensp;&ensp; [myblog-mkdocs]( https://gitlab.com/xuyq123/myblog-mkdocs )&ensp; [网页]( https://xuyq123.gitlab.io/myblog-mkdocs/ ) <br/>github [note-mkdocs]( https://github.com/scott180/note-mkdocs )&ensp; [网页]( https://scott180.github.io/note-mkdocs/ ) &ensp;&ensp;[myblog-mkdocs]( https://github.com/scott180/myblog-mkdocs )&ensp; [网页]( https://scott180.github.io/myblog-mkdocs/ )<br/>gitee [plain-mkdocs]( https://gitee.com/xy180/plain-mkdocs/tree/master/note ) [网页]( http://xy180.gitee.io/plain-mkdocs/note/site/ ) &ensp;&ensp;[myblog-mkdocs]( https://gitee.com/xy180/myblog-mkdocs ) | 我的笔记与博客 |
| docsify | gitlab [plain-docsify]( https://gitlab.com/xuyq123/plain-docsify )&ensp; [**网页**]( https://xuyq123.gitlab.io/plain-docsify/ ) &ensp;&ensp; [myblog-docsify]( https://gitlab.com/xuyq123/myblog-docsify )&ensp; [网页]( https://xuyq123.gitlab.io/myblog-docsify/ ) <br/>github [plain-docsify]( https://github.com/scott180/plain-docsify )&ensp; [网页]( https://scott180.github.io/plain-docsify/ ) &ensp;&ensp;[myblog-docsify]( https://github.com/scott180/myblog-docsify )&ensp; [网页]( https://scott180.github.io/myblog-docsify/ ) | 笔记与博客docsify |
> **公众号**
---
- 注册了微信公众号及今日头条号:[**无为徐生**]( https://scott180.github.io/calligraphy/%E6%97%A0%E4%B8%BA%E5%BE%90%E7%94%9F ),以后会将书法练习轨迹、程序员笔记以及一些随笔感想更新在此。<br/>
- 每周一会在无为徐生**微信公众号**同步《书法练习轨迹》,持续更新,敬请关注。
---
| 无为徐生 | 微信公众号 | &ensp; | 今日头条号 |
| --------- | ------------------------------------------------------------- | - | ---------- |
| 二维码 | ![w]( https://xyqin.coding.net/p/my/d/imgs/git/raw/master/other/wuweixusheng_weixin.png ) | <br/> | ![t]( https://xyqin.coding.net/p/my/d/imgs/git/raw/master/other/wuweixusheng_toutiao.png ) |
***
> 注册了微信公众号及今日头条号:**无为徐生**,以后会将书法练习轨迹、程序员笔记以及一些随笔感想更新在此。若有兴趣,可扫码关注。
> **我的网站**
| 无为徐生 | 微信公众号 | &ensp; | 今日头条号 |
| --------- | ------------------------------------------------------------- | - | ---------- |
| 二维码 | ![w]( https://codechina.csdn.net/xu180/document/-/raw/master/imgs/weixin/无为徐生.png ) | <br/> | ![t]( https://codechina.csdn.net/xu180/document/-/raw/master/imgs/toutiao/无为徐生.png ) |
- 徐书法 `xushufa.cn` 个人书法练习网站
| 徐书法 | 我的网站 | 备注 |
| --- | ------------- | ------------- |
| 1 | [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://blog.xushufa.cn ) | 《书法练习轨迹》及博客网站。 |
| 2 | [docsify-calligraphy]( https://docsify-calligraphy.xushufa.cn ) &ensp; [docsify-blog]( https://docsify-blog.xushufa.cn ) | docsify构建的网站。 |
| 3 | [mkdocs-calligraphy]( https://mkdocs-calligraphy.xushufa.cn ) &ensp; [mkdocs-blog]( https://mkdocs-blog.xushufa.cn ) | mkdocs构建的网站。 |
***
## mongo
# mongo
* [1、说明](#introducer)
* [2、增删改查](#crud)
......@@ -7,7 +7,7 @@
<h2 id="introducer"></h2>
### 1、说明
## 1、说明
```
SQL术语/概念 MongoDB术语/概念 解释/说明
database database 数据库
......@@ -71,7 +71,7 @@ https://www.cnblogs.com/qingtianyu2015/p/5968400.html
<h2 id="crud"></h2>
### 2、增删改查
## 2、增删改查
```
1 列出并选用
......@@ -351,19 +351,20 @@ http://lhkzyz.iteye.com/blog/1669796
db.getCollection('channelmessagestate').find({"recipientBy.address":{ "$regex" : ".*uc_u:\\(2\\).*" , "$options" : "i"} } )
http://www.runoob.com/mongodb/mongodb-query.html
```
排序 sort()方法可以通过参数指定排序的字段,并使用 1 和 -1 来指定排序的方式,其中 1 为升序排列,而-1是用于降序排列。
db.getCollection('mongomessage').find({}).sort({"createTime":-1})
```
<h2 id="innerDocument"></h2>
### 3、三种情况下mongo内嵌文档的查询与保存
## 3、内嵌文档
> 三种情况下mongo内嵌文档的查询与保存
```
......
## mysql
# mysql
### 1.安装mysql
## 1.安装mysql
```
安装mysql 5.7
......@@ -160,7 +160,7 @@ https://www.cnblogs.com/jyjia/archive/2019/03/07/10490013.html
```
### 2.基本sql
## 2.基本sql
```
......@@ -395,7 +395,7 @@ mysqldump -uroot -p –default-character-set=latin1 –set-charset=gbk –skip-o
```
### 3.linux操作mysql
## 3.linux操作mysql
```
......@@ -494,7 +494,7 @@ lower_case_table_names = 2
```
### 4.其他
## 4.其他
```
......@@ -504,7 +504,7 @@ SELECT FROM_UNIXTIME(operation_time/1000,"%Y-%m-%d %H:%i:%s") operationDate FROM
```
#### 4.1.group_concat函数
### 4.1.group_concat函数
```
MySQL中group_concat函数
......@@ -597,7 +597,7 @@ select id,group_concat(name order by name desc) from aa group by id;
```
#### 4.2.left join、right join、inner join的区别
### 4.2.left join、right join、inner join的区别
```
......@@ -694,7 +694,7 @@ compopr参数指定关系比较运算符:"=", "<", ">", "<=", ">=" 或
```
#### 4.3.Case when 的使用方法
### 4.3.Case when 的使用方法
```
......@@ -829,7 +829,7 @@ CONSTRAINT check_salary CHECK
```
#### Mysql复制表结构、表数据的方法
### 4.4、Mysql复制表结构、表数据的方法
```
......@@ -881,3 +881,14 @@ SELECT * INTO 表2 FROM 表1
```
## 5. 文档
| 徐书法 | 我的网站 | 备注 |
| --- | ------------- | ------------- |
| 1 | [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://blog.xushufa.cn ) | 笔记及博客网站。 |
| 2 | [vuepress-calligraphy]( https://vuepress-calligraphy.xushufa.cn ) &ensp; [vuepress-blog]( https://vuepress-blog.xushufa.cn ) | vuepress构建的网站。|
| 3 | [docsify-calligraphy]( https://docsify-calligraphy.xushufa.cn ) &ensp; [docsify-blog]( https://docsify-blog.xushufa.cn ) | docsify构建的网站。 |
| 4 | [mkdocs-calligraphy]( https://mkdocs-calligraphy.xushufa.cn ) &ensp; [mkdocs-blog]( https://mkdocs-blog.xushufa.cn ) | mkdocs构建的网站。 |
# Mysql开启log-bin日志
> 一 、logbin日志 记录新增、更新、删除的sql [参考1]( https://www.cnblogs.com/kerrycode/p/6610874.html ) [参考2]( https://www.cnblogs.com/handle/p/9761702.html )
> 二、general_log 记录增删改查所有日志 [general log]( http://www.zsythink.net/archives/1246 )
## 一 、logbin日志
```sql
show binary logs;
show master status;
......@@ -31,7 +33,7 @@ show master status;
- 2、开启log-bin日志记录
```
找到my.cnf 中 [mysqld] 添加如下
# binlog 配置
-- # binlog 配置
log-bin = D:\\ProgramFiles\\mysql-5.7.20-winx64\\logs\\mysql-bin.log
expire-logs-days = 14
max-binlog-size = 500M
......
## oracle笔记
# oracle笔记
## 常用命令
```
登录
select * from dba_directories;
SYS DATA_PUMP_DIR /opt/oracle/admin/orcl/dpdump/
sqlplus saiwen_imp/saiwen_imp
将 idsweb-2.0.oracle.dmp 文件上传到 /opt/saiwentech/imp_oracle/data目录,进入容器(不需要登录oralc)执行导入导出命令。
导入idsweb-2.0.oracle.dmp
cp /opt/dbdata/local/idsweb-2.0.oracle.dmp /opt/oracle/admin/orcl/dpdump/
impdp saiwen_imp/saiwen_imp DIRECTORY=DATA_PUMP_DIR DUMPFILE=idsweb-2.0.oracle.dmp REMAP_SCHEMA=saiwen_imp:saiwen_imp
// impdp account/password DIRECTORY=DATA_PUMP_DIR DUMPFILE=idsweb-2.0.oracle.dmp REMAP_SCHEMA=form:to
导出idsweb-2.0.oracle.dmp
expdp saiwen_imp/saiwen_imp schemas=saiwen_imp dumpfile=idsweb-2.0.oracle.dmp directory=DATA_PUMP_DIR;
cp /opt/oracle/admin/orcl/dpdump/idsweb-2.0.oracle.dmp /opt/dbdata/local/
导入 Iframework_V4.2_scott_exp.dmp
cp /opt/dbdata/local/Iframework_V4.2_scott_exp.dmp /opt/oracle/admin/orcl/dpdump/
imp saiwen_imp/saiwen_imp BUFFER=64000 FILE=/opt/oracle/admin/orcl/dpdump/Iframework_V4.2_scott_exp.dmp FROMUSER=SCOTT TOUSER=saiwen_imp
说明: DATA_PUMP_DIR 为oralce创建的目录,可用如下命令查询:
select * from dba_directories;
登录
sqlplus /nolog
conn / as sysdba
sqlplus saiwen_imp/password
```
```
mysql ---> oracle 全部要大写
......@@ -17,7 +55,11 @@ datetime ----> DATE
时间比较
to_date('2018-10-01 00:00:00','yyyy-mm-dd hh24:mi:ss')
----------------------------------------------------------------------------------------------------------------
```
```
添加字段
ALTER TABLE T_IDS_APPAUTH ADD (DYNAMICPASSLOGINENABLE NUMBER(1) DEFAULT '0' );
......@@ -90,83 +132,14 @@ ALTER TABLE T_INVOICE_DETAIL ADD CONSTRAINT FK_INVOICE_ID FOREIGN KEY(INVOICE_ID
alter table unique_test add constraint email_unique unique(email);
----------------------------------------------------------------------------------------------------------------
一、调整oracle表中字段显示顺序:用系统用户
调整oracle表中字段显示顺序 此操作要在系统用户下执行,否则未授权错误 [Err] ORA-01031: insufficient privileges
1、查询出指定用户下的指定表的object_id
select object_id from all_objects where owner='test' and object_name='表名'
2、根据object_id查询出表字段实际的顺序
select obj#,col#,name from sys.col$ where obj#=79119 ;
3、通过update更改字段的实际顺序。
update sys.col$ set col#=7 where obj#=79119 and name='字段名'
update sys.col$ set col#=4 where obj#=(select object_id from all_objects where owner='ZS12_IMP' and object_name='T_IDS_APPAUTH' ) and name='RESPONSEIMPL';
二、调整oracle表中字段显示顺序:删除原表
如果要修改字段顺序,一般情况可以使用以下步骤(注意外键):
--(1)备份目标表数据
create table T_IDS_APPAUTH2 as select * from T_IDS_APPAUTH;
--(2)drop 目标表
drop table 目标表;
--(3)再重新按照要求的字段顺序建表;
create table 临时表 (col1,................coln);
--(4)之后用select将数据从临时表导回。
create table T_USER_EXTRAINFO_OLD as select * from T_USER_EXTRAINFO;
drop table T_USER_EXTRAINFO;
CREATE TABLE "T_USER_EXTRAINFO" (
"USERID" NUMBER(11) REFERENCES T_USER(ID) ON DELETE CASCADE,
"FIELD1" NVARCHAR2(2000) DEFAULT NULL,
"FIELD2" NVARCHAR2(100) DEFAULT NULL,
"FIELD3" NVARCHAR2(100) DEFAULT NULL,
"FIELD4" NVARCHAR2(100) DEFAULT NULL,
"FIELD5" NVARCHAR2(2000) DEFAULT NULL,
"FIELD6" NVARCHAR2(100) DEFAULT NULL,
"FIELD7" NVARCHAR2(100) DEFAULT NULL,
"FIELD8" NVARCHAR2(100) DEFAULT NULL,
"FIELD9" NVARCHAR2(100) DEFAULT NULL,
"FIELD10" NVARCHAR2(100) DEFAULT NULL,
CONSTRAINT T_USER_EXTRAINFO_UNIQUE UNIQUE (USERID)
)
;
insert into T_USER_EXTRAINFO("USERID","FIELD1", "FIELD2", "FIELD3", "FIELD4", "FIELD5","FIELD6", "FIELD7", "FIELD8", "FIELD9", "FIELD10") select "USERID","FIELD1", "FIELD2", "FIELD3", "FIELD4", "FIELD5","FIELD6", "FIELD7", "FIELD8", "FIELD9", "FIELD10" from T_USER_EXTRAINFO_OLD;
三、调整oracle表中字段显示顺序:删除原字段
* 由于oracle 不能调整字段顺序,也不能改变有数据的表的字段长度和类型。因此是采用如下方法来插入字段。
* 1、创建备份表; 2、删除多余字段(注意外键); 3、按顺序添加字段; 4、从备份表中复制原数据 (5、删除备份表)
* (如果表中没有数据,可以将表删除,然后按照需要的顺序创建新表)
* 某些日志文件数据比较大,如果采用上述方法,升级脚本速度可能相当慢。如果不需要日志文件,
* 可以在升级前将日志文件删除,涉及升级日志表有:认证日志( T_IDS_LOGINLOG )。
-- T_IDS_DATASOURCE 在 DbPassword 字段后添加 BaseDb
create table T_IDS_DATASOURCE_OLD as select * from T_IDS_DATASOURCE;
ALTER TABLE T_IDS_DATASOURCE DROP COLUMN MONITOR;
ALTER TABLE T_IDS_DATASOURCE DROP COLUMN MONITORNOTICEUSER;
ALTER TABLE T_IDS_DATASOURCE ADD "BASEDB" NUMBER(1) DEFAULT 0;
ALTER TABLE T_IDS_DATASOURCE ADD "MONITOR" NUMBER(1) DEFAULT 0;
ALTER TABLE T_IDS_DATASOURCE ADD "MONITORNOTICEUSER" NVARCHAR2(100) DEFAULT NULL;
ALTER TABLE T_IDS_DATASOURCE ADD "REMARK" NVARCHAR2(2000) DEFAULT NULL;
merge into T_IDS_DATASOURCE A using T_IDS_DATASOURCE_OLD B
on(A.id=B.id)
when matched then
update set A.MONITOR = B.MONITOR,A.MONITORNOTICEUSER = B.MONITORNOTICEUSER;
```
ORA-02270:no matching unique or primary key for this column-list(此列列表的唯一或主键不匹配)
错误说明:外键的定义必须是另外一张表的主键,否则就会报这个错
----------------------------------------------------------------------------------------------------------------
## 序列与触发器
```
#创建序列
create sequence t_user_id_seq start with 1 increment by 1;
......@@ -252,36 +225,89 @@ create sequence HIBERNATE_SEQUENCE start with 1 increment by 1;
startup;
----------------------------------------------------------------------------------------------------------------
select * from dba_directories;
SYS DATA_PUMP_DIR /opt/oracle/admin/orcl/dpdump/
sqlplus saiwen_imp/saiwen_imp
将 ids-2.0.oracle.dmp 文件上传到 /opt/saiwentech/imp_oracle/data目录,进入容器(不需要登录oralc)执行导入导出命令。
```
导入ids-2.0.oracle.dmp
cp /opt/dbdata/local/ids-2.0.oracle.dmp /opt/oracle/admin/orcl/dpdump/
impdp saiwen_imp/saiwen_imp DIRECTORY=DATA_PUMP_DIR DUMPFILE=ids-2.0.oracle.dmp REMAP_SCHEMA=saiwen_imp:saiwen_imp
--- impdp account/password DIRECTORY=DATA_PUMP_DIR DUMPFILE=ids-2.0.oracle.dmp REMAP_SCHEMA=form:to
导出ids-2.0.oracle.dmp
expdp saiwen_imp/saiwen_imp schemas=saiwen_imp dumpfile=ids-2.0.oracle.dmp directory=DATA_PUMP_DIR;
cp /opt/oracle/admin/orcl/dpdump/ids-2.0.oracle.dmp /opt/dbdata/local/
## 调整字段顺序
```
导入 Iframework_V4.2_scott_exp.dmp
cp /opt/dbdata/local/Iframework_V4.2_scott_exp.dmp /opt/oracle/admin/orcl/dpdump/
imp saiwen_imp/saiwen_imp BUFFER=64000 FILE=/opt/oracle/admin/orcl/dpdump/Iframework_V4.2_scott_exp.dmp FROMUSER=SCOTT TOUSER=saiwen_imp
一、调整oracle表中字段显示顺序:用系统用户
调整oracle表中字段显示顺序 此操作要在系统用户下执行,否则未授权错误 [Err] ORA-01031: insufficient privileges
1、查询出指定用户下的指定表的object_id
select object_id from all_objects where owner='test' and object_name='表名'
说明: DATA_PUMP_DIR 为oralce创建的目录,可用如下命令查询:
select * from dba_directories;
登录
sqlplus /nolog
conn / as sysdba
sqlplus saiwen_imp/password
----------------------------------------------------------------------------------------------------------------
2、根据object_id查询出表字段实际的顺序
select obj#,col#,name from sys.col$ where obj#=79119 ;
3、通过update更改字段的实际顺序。
update sys.col$ set col#=7 where obj#=79119 and name='字段名'
update sys.col$ set col#=4 where obj#=(select object_id from all_objects where owner='ZS12_IMP' and object_name='T_IDS_APPAUTH' ) and name='RESPONSEIMPL';
二、调整oracle表中字段显示顺序:删除原表
如果要修改字段顺序,一般情况可以使用以下步骤(注意外键):
--(1)备份目标表数据
create table T_IDS_APPAUTH2 as select * from T_IDS_APPAUTH;
--(2)drop 目标表
drop table 目标表;
--(3)再重新按照要求的字段顺序建表;
create table 临时表 (col1,................coln);
--(4)之后用select将数据从临时表导回。
create table T_USER_EXTRAINFO_OLD as select * from T_USER_EXTRAINFO;
drop table T_USER_EXTRAINFO;
CREATE TABLE "T_USER_EXTRAINFO" (
"USERID" NUMBER(11) REFERENCES T_USER(ID) ON DELETE CASCADE,
"FIELD1" NVARCHAR2(2000) DEFAULT NULL,
"FIELD2" NVARCHAR2(100) DEFAULT NULL,
"FIELD3" NVARCHAR2(100) DEFAULT NULL,
"FIELD4" NVARCHAR2(100) DEFAULT NULL,
"FIELD5" NVARCHAR2(2000) DEFAULT NULL,
"FIELD6" NVARCHAR2(100) DEFAULT NULL,
"FIELD7" NVARCHAR2(100) DEFAULT NULL,
"FIELD8" NVARCHAR2(100) DEFAULT NULL,
"FIELD9" NVARCHAR2(100) DEFAULT NULL,
"FIELD10" NVARCHAR2(100) DEFAULT NULL,
CONSTRAINT T_USER_EXTRAINFO_UNIQUE UNIQUE (USERID)
)
;
insert into T_USER_EXTRAINFO("USERID","FIELD1", "FIELD2", "FIELD3", "FIELD4", "FIELD5","FIELD6", "FIELD7", "FIELD8", "FIELD9", "FIELD10") select "USERID","FIELD1", "FIELD2", "FIELD3", "FIELD4", "FIELD5","FIELD6", "FIELD7", "FIELD8", "FIELD9", "FIELD10" from T_USER_EXTRAINFO_OLD;
三、调整oracle表中字段显示顺序:删除原字段
* 由于oracle 不能调整字段顺序,也不能改变有数据的表的字段长度和类型。因此是采用如下方法来插入字段。
* 1、创建备份表; 2、删除多余字段(注意外键); 3、按顺序添加字段; 4、从备份表中复制原数据 (5、删除备份表)
* (如果表中没有数据,可以将表删除,然后按照需要的顺序创建新表)
* 某些日志文件数据比较大,如果采用上述方法,升级脚本速度可能相当慢。如果不需要日志文件,
* 可以在升级前将日志文件删除,涉及升级日志表有:认证日志( T_IDS_LOGINLOG )。
-- T_IDS_DATASOURCE 在 DbPassword 字段后添加 BaseDb
create table T_IDS_DATASOURCE_OLD as select * from T_IDS_DATASOURCE;
ALTER TABLE T_IDS_DATASOURCE DROP COLUMN MONITOR;
ALTER TABLE T_IDS_DATASOURCE DROP COLUMN MONITORNOTICEUSER;
ALTER TABLE T_IDS_DATASOURCE ADD "BASEDB" NUMBER(1) DEFAULT 0;
ALTER TABLE T_IDS_DATASOURCE ADD "MONITOR" NUMBER(1) DEFAULT 0;
ALTER TABLE T_IDS_DATASOURCE ADD "MONITORNOTICEUSER" NVARCHAR2(100) DEFAULT NULL;
ALTER TABLE T_IDS_DATASOURCE ADD "REMARK" NVARCHAR2(2000) DEFAULT NULL;
merge into T_IDS_DATASOURCE A using T_IDS_DATASOURCE_OLD B
on(A.id=B.id)
when matched then
update set A.MONITOR = B.MONITOR,A.MONITORNOTICEUSER = B.MONITORNOTICEUSER;
ORA-02270:no matching unique or primary key for this column-list(此列列表的唯一或主键不匹配)
错误说明:外键的定义必须是另外一张表的主键,否则就会报这个错
```
----------------------------------------------------------------------------------------------------------------
```
\ No newline at end of file
## redis
# redis
## 安装
``` sql
windowsredis安装
......@@ -27,6 +29,11 @@ redis 设置来密码,出现来这个错误,
改成
requirepass 123456
```
## 启动
```
启动redis
./redis/src/redis-server ./redis/redis.conf &
......
# 数据库隔离级别
## 隔离级别
```
转载 https://www.cnblogs.com/dwxt/p/8807899.html
数据库事务的隔离级别(isolation)有4个,由低到高依次为Read uncommitted、Read committed、Repeatable read、Serializable,这四个级别可以逐个解决脏读、不可重复读、幻读这几类问题。
脏读即为session A读取到了session B中未提交的数据
不可重复读即为session A读取到了session B提交的数据,即前后session A读取的数据不一致
幻读即为session A读取到了session B insert的数据。
√:可能出现,×:不会出现
+------------------+------------+-------------+-------------+-------------+
| | | 脏读 | 不可重复读 | 幻读 |
+------------------+------------+-------------+-------------+-------------+
| read-uncommitted | 读未提交 | √ | √ | √ |
+------------------+------------+-------------+-------------+-------------+
| read-committed | 读已提交 | × | √ | √ |
+------------------+------------+-------------+-------------+-------------+
| repeatable-read | 可重复读 | × | × | √ |
+------------------+------------+-------------+-------------+-------------+
| serializable | 串行化 | × | × | × |
+------------------+------------+-------------+-------------+-------------+
1. read_uncommitted : 这是事务最低的隔离级别,它充许令外一个事务可以看到这个事务未提交的数据。
这种隔离级别会产生脏读,不可重复读和幻像读。
2. read_committed :保证一个事务修改的数据提交后才能被另外一个事务读取。另外一个事务不能读取该事务未提交的数据。
3. repeatable_read :这种事务隔离级别可以防止脏读,不可重复读。但是可能出现幻像读。 mysql默认级别。
它除了保证一个事务不能读取另一个事务未提交的数据外,还保证了避免下面的情况产生(不可重复读)。
4. serializable :这是花费最高代价但是最可靠的事务隔离级别。事务被处理为顺序执行。
除了防止脏读,不可重复读外,还避免了幻像读。
```
## 第1级别:Read Uncommitted
```
我们使用 test 数据库,新建 tx 表:---MySQL数据库
第1级别:Read Uncommitted(读取未提交内容)
(1)所有事务都可以看到其他未提交事务的执行结果
(2)本隔离级别很少用于实际应用,因为它的性能也不比其他级别好多少
(3)该级别引发的问题是——脏读(Dirty Read):读取到了未提交的数据
#首先,修改隔离级别
set tx_isolation='READ-UNCOMMITTED';
select @@tx_isolation;
+------------------+
| @@tx_isolation |
+------------------+
| READ-UNCOMMITTED |
+------------------+
#事务A:启动一个事务
start transaction;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务B:也启动一个事务(那么两个事务交叉了)
在事务B中执行更新语句,且不提交
start transaction;
update tx set num=10 where id=1;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 10 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务A:那么这时候事务A能看到这个更新了的数据吗?
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 10 | --->可以看到!说明我们读到了事务B还没有提交的数据
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务B:事务B回滚,仍然未提交
rollback;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务A:在事务A里面看到的也是B没有提交的数据
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 | --->脏读意味着我在这个事务中(A中),事务B虽然没有提交,但它任何一条数据变化,我都可以看到!
| 2 | 2 |
| 3 | 3 |
+------+------+
```
## 第2级别:Read Committed
```
第2级别:Read Committed(读取提交内容)
(1)这是大多数数据库系统的默认隔离级别(但不是MySQL默认的)
(2)它满足了隔离的简单定义:一个事务只能看见已经提交事务所做的改变
(3)这种隔离级别出现的问题是——不可重复读(Nonrepeatable Read):不可重复读意味着我们在同一个事务中执行完全相同的select语句时可能看到不一样的结果。
|——>导致这种情况的原因可能有:(1)有一个交叉的事务有新的commit,导致了数据的改变;(2)一个数据库被多个实例操作时,同一事务的其他实例在该实例处理其间可能会有新的commit
#首先修改隔离级别
set tx_isolation='read-committed';
select @@tx_isolation;
+----------------+
| @@tx_isolation |
+----------------+
| READ-COMMITTED |
+----------------+
#事务A:启动一个事务
start transaction;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务B:也启动一个事务(那么两个事务交叉了)
在这事务中更新数据,且未提交
start transaction;
update tx set num=10 where id=1;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 10 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务A:这个时候我们在事务A中能看到数据的变化吗?
select * from tx; --------------->
+------+------+ |
| id | num | |
+------+------+ |
| 1 | 1 |--->并不能看到! |
| 2 | 2 | |
| 3 | 3 | |
+------+------+ |——>相同的select语句,结果却不一样
|
#事务B:如果提交了事务B呢? |
commit; |
|
#事务A: |
select * from tx; --------------->
+------+------+
| id | num |
+------+------+
| 1 | 10 |--->因为事务B已经提交了,所以在A中我们看到了数据变化
| 2 | 2 |
| 3 | 3 |
+------+------+
```
## 第3级别:Repeatable Read
```
第3级别:Repeatable Read(可重读)
(1)这是MySQL的默认事务隔离级别
(2)它确保同一事务的多个实例在并发读取数据时,会看到同样的数据行
(3)此级别可能出现的问题——幻读(Phantom Read):当用户读取某一范围的数据行时,另一个事务又在该范围内插入了新行,当用户再读取该范围的数据行时,会发现有新的“幻影” 行
(4)InnoDB和Falcon存储引擎通过多版本并发控制(MVCC,Multiversion Concurrency Control)机制解决了该问题
#首先,更改隔离级别
set tx_isolation='repeatable-read';
select @@tx_isolation;
+-----------------+
| @@tx_isolation |
+-----------------+
| REPEATABLE-READ |
+-----------------+
#事务A:启动一个事务
start transaction;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务B:开启一个新事务(那么这两个事务交叉了)
在事务B中更新数据,并提交
start transaction;
update tx set num=10 where id=1;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 10 |
| 2 | 2 |
| 3 | 3 |
+------+------+
commit;
#事务A:这时候即使事务B已经提交了,但A能不能看到数据变化?
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 1 | --->还是看不到的!(这个级别2不一样,也说明级别3解决了不可重复读问题)
| 2 | 2 |
| 3 | 3 |
+------+------+
#事务A:只有当事务A也提交了,它才能够看到数据变化
commit;
select * from tx;
+------+------+
| id | num |
+------+------+
| 1 | 10 |
| 2 | 2 |
| 3 | 3 |
+------+------+
```
## 第4级别:Serializable
```
第4级别:Serializable(可串行化)
(1)这是最高的隔离级别
(2)它通过强制事务排序,使之不可能相互冲突,从而解决幻读问题。简言之,它是在每个读的数据行上加上共享锁。
(3)在这个级别,可能导致大量的超时现象和锁竞争
#首先修改隔离界别
set tx_isolation='serializable';
select @@tx_isolation;
+----------------+
| @@tx_isolation |
+----------------+
| SERIALIZABLE |
+----------------+
#事务A:开启一个新事务
start transaction;
#事务B:在A没有commit之前,这个交叉事务是不能更改数据的
start transaction;
insert tx values('4','4');
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
update tx set num=10 where id=1;
ERROR 1205 (HY000): Lock wait timeout exceeded; try restarting transaction
```
\ No newline at end of file
## docker
# docker
* [1、常用命令](#commonCommand)
* [2、docker安装问题](#installQuestion)
* [2.1、使用 yum 安装(CentOS 7下)](#yumInstallCentos7)
* [2.1、安装mongo](#installMongo)
* [2.3、安装docker-compose](#installCompose)
* [2.4、push镜像阿里云](#pullAliyun)
* [2.5、测试 run 运行容器](#testRun)
* [3、其他](#other)
### 1、常用命令 <h2 id="commonCommand"></h2>
* 建立镜像 (ucp:1.1.7 . 后面有个点)
cd /mnt/home/mobile/ucp1.1.7
docker build -f docker/Dockerfile -t ucp:1.1.7 .
* 初始化设置(建立容器)
docker run -it -v /mnt/opt/data/ucp1.1.7/config/ucp/:/opt/saiwentech/autoconfig/conf/ ucp:1.1.7 config -d
* 启动容器
cd /mnt/home/mobile
docker-compose -f docker-compose-ucp1.1.7.yml up -d
## 1、常用命令
```sql
* 查看镜像信息
docker images
......@@ -44,6 +22,35 @@ mysql -uroot -pSaiwen.web123
* 创建并进入容器
docker run -it --entrypoint /bin/bash registry.saiwentech.com:35000/library/tomcat:7.0_1.7
```
```java
- 导出镜像
docker save -o ucp1.1.7.tar.gz ucp:1.1.7
docker save -o /mnt/home/mobile/ucp1.1.7_docker_image.tar.gz 303d0cc15269
- 导入镜像
docker load -i xxx.tar.gz
- 下载镜像
docker pull 170.18.10.40/ucpplus-b/ucp:1.1.7
查看容器日志
docker logs --tail 50 --follow --timestamps 79921b85086b
docker logs --tail 350 --follow --timestamps mobile_ucp_db_1
- 查看容器
docker run -ti <your_Container_image>
- 查看镜像详细信息
docker inspect d49f922a0111
- 镜像改名
docker tag imageid name:tag
```
```
停止容器
docker stop mobile_ucp_1 mobile_ucp_db_1 mobile_ucp_mongo_db_1
......@@ -54,6 +61,22 @@ http://www.runoob.com/docker/docker-run-command.html
```
```
* 建立镜像 (ucp:1.1.7 . 后面有个点)
cd /mnt/home/mobile/ucp1.1.7
docker build -f docker/Dockerfile -t ucp:1.1.7 .
* 初始化设置(建立容器)
docker run -it -v /mnt/opt/data/ucp1.1.7/config/ucp/:/opt/saiwentech/autoconfig/conf/ ucp:1.1.7 config -d
* 启动容器
cd /mnt/home/mobile
docker-compose -f docker-compose-ucp1.1.7.yml up -d
* 请注意控制台输出,如果有错误,请按照错误信息修改配置,重新制作镜像
镜像删除操作
docker rmi ucp:1.1.7
......@@ -64,6 +87,8 @@ docker rm 【容器id】
/mnt/opt/data/ucp1.1.7/mysql/data
/mnt/opt/data/ucp1.1.7/mongo/data
```
```
提交镜像
docker commit 678ae48535b1 ucp:1.1.7
......@@ -87,7 +112,7 @@ docker commit -m "ucp1.1.7--20180428" -a "xyq" f54f18474f15 ucp:1.1.7
docker push 170.18.10.40/mobile/ucp:1.1.7
账号/密码
永钦 yqxu Yqxu123456
徐 yqxu Yqxu123456
docker login http://registry.saiwentech.com:35000
......@@ -104,31 +129,6 @@ docker commit -m "ucp1.1.7--20180428" -a "xyq" f54f18474f15 ucp:1.1.7
docker pull registry.saiwentech.com:35000/library/mysql:5.7.7_saiwen2
```
- 导出镜像
docker save -o ucp1.1.7.tar.gz ucp:1.1.7
docker save -o /mnt/home/mobile/ucp1.1.7_docker_image.tar.gz 303d0cc15269
- 导入镜像
docker load -i xxx.tar.gz
- 下载镜像
docker pull 170.18.10.40/ucpplus-b/ucp:1.1.7
```
查看容器日志
docker logs --tail 50 --follow --timestamps 79921b85086b
docker logs --tail 350 --follow --timestamps mobile_ucp_db_1
```
- 查看容器
docker run -ti <your_Container_image>
- 查看镜像详细信息
docker inspect d49f922a0111
- 镜像改名
docker tag imageid name:tag
* * *
```
参数设置
......@@ -153,13 +153,13 @@ mysql 添加配置文件 /mnt/opt/data/ucp1.1.7/mysql/conf/add.cnf
sql_mode='NO_ENGINE_SUBSTITUTION'
```
<h2 id="installQuestion"></h2>
### 2、docker安装问题
## 2、docker安装问题
<h3 id="yumInstallCentos7"></h3>
#### 2.1、使用 yum 安装(CentOS 7下)
### 2.1、使用 yum 安装
```
http://www.runoob.com/docker/centos-docker-install.html
Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前提条件来验证你的CentOS 版本是否支持 Docker 。
......@@ -170,6 +170,7 @@ Docker 要求 CentOS 系统的内核版本高于 3.10 ,查看本页面的前
[root@runoob ~]# service docker start
```
```
镜像加速
......@@ -196,6 +197,7 @@ Dockers 服务开机启动:
sudo systemctl enable docker.service
```
```
安装docker,启动不成功,报错信息
https://www.2cto.com/net/201803/730799.html
......@@ -228,7 +230,9 @@ systemctl daemon-reload
sudo systemctl restart docker
```
```
Ubuntu 16.04(LTS)安装dockerI
$ sudo apt-get update
......@@ -247,9 +251,11 @@ sudo apt-get update && sudo apt-get upgrade
```
<h3 id="installMongo"></h3>
---
#### 2.2、安装mongo
### 2.2、安装mongo
```
http://www.runoob.com/docker/docker-install-mongodb.html
docker search mongo 查找Docker Hub上的mongo镜像
......@@ -259,9 +265,9 @@ docker pull mongo:3.2
docker pull mysql:5.7.7
```
<h3 id="installCompose"></h3>
#### 2.3、安装docker-compose
### 2.3、安装docker-compose
```
http://www.cnblogs.com/52fhy/p/5991344.html
......@@ -271,6 +277,7 @@ chmod +x /usr/local/bin/docker-compose
docker-compose -version
```
```
卸载docker-compose
......@@ -280,22 +287,28 @@ rm /usr/local/bin/docker-compose
```
```
* 报错 Unsupported config option for services service: 'ucp_db' 。docker-compose版本低了。
```
https://stackoverflow.com/questions/36724948/docker-compose-unsupported-config-option-for-services-service-web
Support for the version 2 compose file format was introduced in docker-compose version 1.6, released around February of this year.
You're using 1.3.3, from July 2015.
You are using 1.3.3, from July 2015.
You need to upgrade to a more recent version to use the version 2 format configuration files.
```
<h3 id="pullAliyun"></h3>
#### 2.4、push镜像阿里云
* 镜像上传阿里云 cr.console.aliyun.com
### 2.4、阿里云镜像push
```
* 镜像上传阿里云 cr.console.aliyun.com
$ sudo docker login --username=明明之明夜 registry.cn-hangzhou.aliyuncs.com
$ sudo docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/saiwen/ucp:[镜像版本号]
$ sudo docker push registry.cn-hangzhou.aliyuncs.com/saiwen/ucp:[镜像版本号]
......@@ -306,9 +319,8 @@ You need to upgrade to a more recent version to use the version 2 format configu
```
<h3 id="testRun"></h3>
### 2.5、测试 run 运行容器
#### 2.5、测试 run 运行容器
```
docker run --name base -tid 170.18.10.40/library/baseenv:base /bin/bash
......@@ -329,9 +341,8 @@ MYSQL_ROOT_PASSWORD=Saiwen.web123 -d registry.cn-hangzhou.aliyuncs.com/saiwen/uc
```
<h2 id="other"></h2>
## 3、其他
### 3、其他
```
删除镜像
root@SZX1000041894:/home# docker tag centos 10.229.43.217:4000/xcb/centos
......@@ -446,7 +457,7 @@ curl -I -X DELETE http://170.18.10.40/v2/ucpplus-b/ucp/manifests/sha256:2ddac3e0
```
停止容器
docker stop mobile_ucp_db_1 mobile_ucp_mongo_db_1 mobile_ucp_1
......@@ -466,3 +477,4 @@ curl -I -X DELETE http://170.18.10.40/v2/ucpplus-b/ucp/manifests/sha256:2ddac3e0
进入数据库
mysql -uroot -pSaiwen.web123
```
\ No newline at end of file
## eclipse
# eclipse
## 1、eclipse 快捷键
......
## gitlab、github、gitee布署mkdocs主题仓库
# gitlab、github、gitee布署mkdocs主题仓库
`原址` &ensp; [布署mkdocs]( https://gitlab.com/xuyq123/mynotes/-/blob/master/gitlab%E3%80%81github%E3%80%81gitee%E5%B8%83%E7%BD%B2mkdocs%E4%B8%BB%E9%A2%98%E4%BB%93%E5%BA%93.md ) &ensp; [calligraphy]( https://gitlab.com/xuyq123/calligraphy )
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
### 1、概述
## 1、概述
```
mkdocs作用
在git平台创建mkdocs主题仓库,自动将markdown文件生成静态网页。
......@@ -21,7 +21,7 @@ mkdocs安装 pip install mkdocs
```
### 2、gitlab布署mkdocs
## 2、gitlab布署mkdocs
```
gitlab mkdocs主题仓库 (推送文件自动布署)
创建方法:
......@@ -87,7 +87,7 @@ gitbook, spacelab, cinder, pulse, mkdocs, cerulean, bootstrap, solar, journal, s
```
### 3、github布署mkdocs
## 3、github布署mkdocs
```
github mkdocs主题仓库 (mkdocs gh-deploy 一键布署)
......@@ -110,7 +110,7 @@ github mkdocs主题仓库 (mkdocs gh-deploy 一键布署)
```
### 4、gitee布署mkdocs
## 4、gitee布署mkdocs
```
gitee mkdocs主题仓库 (GiteePages服务布署目录)
创建方法:
......@@ -135,7 +135,7 @@ gitee mkdocs主题仓库 (GiteePages服务布署目录)
---
### 5、示例
## 5、示例
| 仓库 | 地址 | 备注 |
| ----- | ------------------------------------------------------------- | ----------------------------------- |
......@@ -143,7 +143,7 @@ gitee mkdocs主题仓库 (GiteePages服务布署目录)
| github | [plain-mkdocs]( https://github.com/scott180/plain-mkdocs ) &ensp; [网页]( https://scott180.github.io/plain-mkdocs/ ) <br/>[plain-pip-mkdocs]( https://github.com/scott180/plain-pip-mkdocs ) &ensp; [网页]( https://scott180.github.io/plain-pip-mkdocs ) <br/>[plain-mkdocs-serve]( https://github.com/scott180/plain-mkdocs-serve ) &ensp; [网页]( https://scott180.github.io/plain-mkdocs-serve ) | github布署mkdocs:命令mkdocs gh-deploy 。 |
| gitee | [plain-mkdocs]( https://gitee.com/xy180/plain-mkdocs ) &ensp; [网页1]( http://xy180.gitee.io/plain-mkdocs/1/site/ ) &ensp; [网页2]( http://xy180.gitee.io/plain-mkdocs/2/site/ ) &ensp; [网页3]( http://xy180.gitee.io/plain-mkdocs/3/site/ ) | gitee布署mkdocs:mkdocs build 布署目录。 |
| note-mkdocs | gitlab [note-mkdocs]( https://gitlab.com/xuyq123/note-mkdocs )&ensp; [**网页1**]( https://xuyq123.gitlab.io/note-mkdocs/ ) &ensp; [网页2]( https://xuyq123.gitlab.io/note-pip-mkdocs/ ) <br/>github [note-mkdocs]( https://github.com/scott180/note-mkdocs )&ensp; [网页]( https://scott180.github.io/note-mkdocs/ )<br/>gitee [plain-mkdocs]( https://gitee.com/xy180/plain-mkdocs/tree/master/note )&ensp; [网页]( http://xy180.gitee.io/plain-mkdocs/note/site/ ) | 个人笔记,含书法练习及java笔记。 |
| myblog-mkdocs | gitlab [myblog-mkdocs]( https://gitlab.com/xuyq123/myblog-mkdocs )&ensp; [网页]( https://xuyq123.gitlab.io/myblog-mkdocs/ ) <br/>github [myblog-mkdocs]( https://github.com/scott180/myblog-mkdocs )&ensp; [网页]( https://scott180.github.io/myblog-mkdocs/ )<br/>gitee [myblog-mkdocs]( https://gitee.com/xy180/myblog-mkdocs ) | 我的博客 |
| myblog-mkdocs | gitlab [mkdocs-blog]( https://gitlab.com/xuyq123/mkdocs-blog )&ensp; [网页]( https://xuyq123.gitlab.io/mkdocs-blog/ ) <br/>github [myblog-mkdocs]( https://github.com/scott180/myblog-mkdocs )&ensp; [网页]( https://scott180.github.io/myblog-mkdocs/ )<br/>gitee [myblog-mkdocs]( https://gitee.com/xy180/myblog-mkdocs ) | 我的博客 |
---
# gitlab、github绑定自定义域名
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
## github绑定自定义域名
```
示例:
github项目 https://github.com/scott180/docsify-blog
静态页面 https://scott180.github.io/docsify-calligraphy
自定义域名 https://docsify-calligraphy.xushufa.cn
```
- 1、先将github pages 静态网页发布成功,如 https://scott180.github.io/docsify-calligraphy
- 2、在域名管理中心,添加记录,如 <br/>
github静态网页 https://scott180.github.io/docsify-calligraphy <br/>
自定义域名 https://docsify-calligraphy.xushufa.cn <br/>
```
则在DNS解析--我的域名--添加记录的参数是:
主机记录:docsify-calligraphy
记录类型:CNAME
线路类型:默认
记录值:scott180.github.io
TTL: 600
```
- 3、在github Setting - GitHub Pages - Custom domain 输入 docsify-blog.xushufa.cn
```
稍后即可访问 https://docsify-calligraphy.xushufa.cn
浏览器地址栏可能会提示“不安全” , 勾选 Enforce HTTPS ,稍后再访问。
```
![1]( https://xyqin.coding.net/p/my/d/document/git/raw/master/imgs/other/custom_domain1.png )
---
![2]( https://xyqin.coding.net/p/my/d/document/git/raw/master/imgs/other/custom_domain2.png )
---
## gitlab绑定自定义域名
gitlab绑定自定义域名,比github复杂一点。需要申请SSL证书且修改域名记录。
官方参考 [custom_domains]( https://docs.gitlab.com/ee/user/project/pages/custom_domains_ssl_tls_certification/index.html#4-verify-the-domains-ownership )
```
示例:
gitlab项目 https://gitlab.com/xuyq123/mkdocs-blog
静态页面 https://xuyq123.gitlab.io/mkdocs-blog
自定义域名 https://mkdocs-blog.xushufa.cn
```
- 1、先将gitlab pages 静态网页发布成功,如 https://xuyq123.gitlab.io/mkdocs-blog
- 2、在域名管理中心申请免费SSL证书
```
绑定域名:mkdocs-blog.xushufa.cn
算法选择:RSA算法
```
- 3、在gitlab pages -- New Pages Domain <br/>
输入域名 mkdocs-blog.xushufa.cn <br/>
- 4、在域名管理中心--添加记录
```
主机记录:mkdocs-blog
记录类型:TXT
线路类型:默认
记录值:gitlab-pages-verification-code=ba841cb.....
TTL: 600
注:记录值就是 上一步Pages Domain的 Verification status 的 _gitlab-pages-verification-code.mkdocs-blog.xushufa.cn TXT 后面的值
```
![3]( https://xyqin.coding.net/p/my/d/document/git/raw/master/imgs/other/custom_domain3.png )
- 5、在gitlab pages -- Pages Domain -- Verification status <br/>
点击 Verified 如果有对号 说明域名绑定了。 <br/>
但此时还是不能访问。 <br/>
- 6、在域名管理中心--添加记录,修改数据
```
主机记录:mkdocs-blog // 不变
记录类型:CNAME // 从TXT 改为 CNAME
线路类型:默认
记录值:xuyq123.gitlab.io // 输入自己gitlab的静态账号
TTL: 600
```
- 7、在gitlab pages -- Pages Domain 会报错: <br/>
Something went wrong while obtaining the Let's Encrypt certificate <br/>
需要重试 Retry
```
稍后即可访问 https://mkdocs-blog.xushufa.cn
浏览器地址栏可能会提示“不安全” , 勾选 Force HTTPS (requires valid certificates) ,点击“Save changes” ,稍后再访问。
```
---
## git平台docsify布署markdown文件
# git平台docsify布署markdown文件
### 本地安装
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
## 本地安装
```
docsify 可以快速帮你生成文档网站。不同于GitBook、Hexo的地方是它不会生成静态的 .html 文件,所有转换工作都是在运行时。
......@@ -63,10 +65,9 @@ window.$docsify = {
```
---
### gitlab布署docsify
## gitlab布署docsify
```
1、创建 .gitlab-ci.yml
......@@ -109,7 +110,7 @@ pages:
---
### github布署docsify
## github布署docsify
```
1、本地生成 docsify项目
......@@ -134,10 +135,9 @@ https://scott180.github.io/myblog-docsify/
```
---
### gitee布署docsify
## gitee布署docsify
```
在对应的 Gitee 仓库服务中选择 Gitee Pages,选择您要部署的分支,填写您要部署的分支上的目录,
例如docs,填写完成之后点击启动即可。
......@@ -145,10 +145,10 @@ https://scott180.github.io/myblog-docsify/
---
### 示例
## 示例
| 名称 | 仓库 | 备注 |
| --------- | ------------------------------------------------------------- | ---------- |
| plain-docsify | gitlab [plain-docsify]( https://gitlab.com/xuyq123/plain-docsify )&ensp; [**网页**]( https://xuyq123.gitlab.io/plain-docsify/ ) <br/>github [plain-docsify]( https://github.com/scott180/plain-docsify )&ensp; [网页]( https://scott180.github.io/plain-docsify/ ) | 笔记docsify |
| myblog-docsify | gitlab [myblog-docsify]( https://gitlab.com/xuyq123/myblog-docsify )&ensp; [**网页**]( https://xuyq123.gitlab.io/myblog-docsify/ ) <br/>github [myblog-docsify]( https://github.com/scott180/myblog-docsify )&ensp; [网页]( https://scott180.github.io/myblog-docsify/ ) | 笔记与博客docsify |
| myblog-docsify | gitlab [myblog-docsify]( https://gitlab.com/xuyq123/myblog-docsify )&ensp; [**网页**]( https://xuyq123.gitlab.io/myblog-docsify/ ) <br/>github [docsify-blog]( https://github.com/scott180/myblog-docsify )&ensp; [网页]( https://scott180.github.io/docsify-blog ) | 笔记与博客docsify |
# vuepress构建项目
## 一、vuepress默认主题
使用vuepress构建的博客。
[github]( https://github.com/scott180/vuepress-blog ) &ensp; [vuepress-blog]( https://scott180.github.io/vuepress-blog ) &ensp; [vuepress-calligraphy]( https://scott180.github.io/vuepress-calligraphy )
### 1.1 安装
参考 [vuepress]( https://vuepress.vuejs.org/zh/ ) &ensp; [blog-vuepress]( https://github.com/codeteenager/blog-vuepress )
在使用前请先安装VuePress
```sh
$ npm install -g vuepress
```
```sh
mkdir vuepress-starter && cd vuepress-starter
```
```sh
yarn init # npm init
```
```sh
yarn add -D vuepress # npm install -D vuepress
```
```sh
mkdir docs && echo '# Hello VuePress' > docs/README.md
```
> 在 `package.json` 中添加一些 `scripts`
```json
{
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
}
}
```
使用`npm run docs:dev`启动项目,启动后在浏览器中使用`localhost:8080`进行访问
```sh
$ npm run docs:dev
```
使用`npm run docs:build`打包项目
```sh
$ npm run docs:build
```
### 1.2 部署
根目录创建 `deploy.sh` 文件
```
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm run docs:build
# 进入生成的文件夹
cd docs/.vuepress/dist
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# 如果发布到 https://<USERNAME>.github.io
# git push -f git@github.com:scott180/scott180.github.io.git master
# 如果发布到 https://<USERNAME>.github.io/<REPO> 注意配置 `docs\.vuepress\config.js` 的 `base`
# git push -f git@github.com:scott180/vuepress-calligraphy.git master:gh-pages
cd -
```
---
设置 `package.json`
```
{
"scripts": {
"deploy": "bash deploy.sh"
}
}
```
运行 `npm run deploy` 即可部署到github静态页面
---
注意路径配置问题:
- 1、如果要发布路径为用户名+项目名
```js
如访问地址为 `https://scott180.github.io/reco-blog`
`docs\.vuepress\config.js` 配置 `base` 字段为项目名 `reco-blog`
`deploy.sh` 配置 `git push -f git@github.com:scott180/reco-calligraphy.git master:gh-pages`
```
- 2、如果要绑定域名
```js
如访问地址为 `http://reco-blog.xushufa.cn/`
`docs\.vuepress\config.js` 配置 `base` 字段需注释掉
`deploy.sh` 配置
echo 'reco-blog.xushufa.cn' > CNAME
`git push -f git@github.com:scott180/reco-calligraphy.git master:gh-pages`
```
### 1.3 问题
> vuepress 底部添加网站备案号:ICP备案号与公安备案号 [富文本 footer]( https://vuepress.vuejs.org/zh/theme/default-theme-config.html#%E5%AF%8C%E6%96%87%E6%9C%AC-footer )
```
---
home: true
---
::: slot footer
MIT Licensed | Copyright © 2018-present [Evan You](https://github.com/yyx990803)
:::
```
---
```
---
home: true
---
::: slot footer
Copyright © 2022 · xushufa.cn · 无为徐生 <br/> [浙ICP备2022008289号-1]( http://beian.miit.gov.cn/ ) <img src="/ba.png" width="20"> [浙公网安备 33011002016354号]( http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33011002016354 )
:::
```
---
> 主要命令
```sh
# 启动
npm run docs:dev
# 打包
npm run docs:build
# 部署
npm run deploy
```
## 二、vuepress-theme-reco主题
使用vuepress-theme-reco构建的博客。
[github]( https://github.com/scott180/reco-blog ) &ensp; [reco-blog]( https://scott180.github.io/reco-blog ) &ensp; [reco-calligraphy]( https://scott180.github.io/reco-calligraphy )
### 2.1 安装
参考 [vuepress]( https://vuepress.vuejs.org/zh/ ) &ensp; [vuepress-theme-reco]( https://vuepress-theme-reco.recoluan.com/views/1.x/configJs.html ) &ensp; [vuepress-reco]( https://github.com/vuepress-reco/vuepress-theme-reco-1.x ) &ensp; [vuepress-theme-reco 主题优化]( https://blog.csdn.net/qq_42937522/article/details/122676915 ) &ensp; [vuepress-calligraphy]( https://github.com/scott180/vuepress-calligraphy )
```
# init
npm install @vuepress-reco/theme-cli -g
theme-cli init my-blog
# install
cd my-blog
npm install
# run
npm run dev
# build
npm run build
```
```
中文路径无效,需要安装插件
npm install -D vuepress-plugin-permalink-pinyin
module.exports = {
plugins: [
// 支持中文文件名
[
"permalink-pinyin",
{
lowercase: true, // Converted into lowercase, default: true
separator: "-", // Separator of the slug, default: '-'
},
],
]
}
```
### 2.2 部署
根目录创建 `deploy.sh` 文件
```
#!/usr/bin/env sh
# 确保脚本抛出遇到的错误
set -e
# 生成静态文件
npm run build
# 进入生成的文件夹
cd .vuepress/dist
# 如果是发布到自定义域名
# echo 'www.example.com' > CNAME
git init
git add -A
git commit -m 'deploy'
# 如果发布到 https://<USERNAME>.github.io
# git push -f git@github.com:scott180/scott180.github.io.git master
# 如果发布到 https://<USERNAME>.github.io/<REPO> 注意配置 `.vuepress\config.js` 的 `base`
# git push -f git@github.com:scott180/reco-calligraphy.git master:gh-pages
cd -
```
---
设置 `package.json`
```
{
"scripts": {
"deploy": "bash deploy.sh"
}
}
```
运行 `npm run deploy` 即可部署到github静态页面
---
> vuepress 底部添加网站备案号:ICP备案号与公安备案号 [备案信息]( https://vuepress-theme-reco.recoluan.com/views/1.x/configJs.html#%E5%A4%87%E6%A1%88%E4%BF%A1%E6%81%AF%E5%92%8C%E9%A1%B9%E7%9B%AE%E5%BC%80%E5%A7%8B%E6%97%B6%E9%97%B4 )
```
module.exports = {
themeConfig: {
record: '浙ICP备2022008289号-1',
recordLink: 'http://beian.miit.gov.cn',
cyberSecurityRecord: '浙公网安备 33011002016354号',
cyberSecurityLink: 'http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33011002016354',
}
}
```
---
> 主要命令
```sh
# 启动
npm run dev
# 打包
npm run build
# 部署
npm run deploy
```
---
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册