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

fix

上级 3b7a8ca7
# README
- [x] 个人仓库 java linux mysql ...
## 简介
- [blog]( https://blog.xushufa.cn )   [gitlab]( https://gitlab.com/xuyq123/mynotes )   [gitee]( https://gitee.com/xy180/MyNotes )   [github]( https://github.com/scott180/MyNotes )
******************************************
## 1、笔记
- [x] [**note**]( https://gitee.com/xy180/MyNotes/blob/master/note.md )   [java]( https://gitee.com/xy180/MyNotes/blob/master/java.md )
九零后,程序员,热爱生活、乐于记录的普通青年。
---
- [x] 运维
- [linux笔记]( https://gitee.com/xy180/MyNotes/blob/master/linuxNote-x.md )   [git笔记]( https://github.com/scott180/MyNotes/blob/master/gitNote.md )   [docker笔记]( https://github.com/scott180/MyNotes/blob/master/%E5%85%B6%E4%BB%96/docker.md )
> 关于编程
**技术还可以的程序猿。**
- [x] 后端
`java` `linux` `mysql` `redis` ... <br/>
`git` `idea` `postman` `notepad++` ... <br/>
- [springcloud-test]( https://github.com/scott180/springcloud-test ) &ensp; [springboot初始化]( https://start.spring.io/ ) &ensp; [2小时学会springboot]( https://blog.csdn.net/forezp/article/details/61472783 ) &ensp; [springCloud教程]( https://www.cnblogs.com/ityouknow/category/994104.html )
- [dubbo]( https://github.com/scott180/dubbo-test ) &ensp; [RabbitMQ]( https://github.com/scott180/RabbitMQ-test )
| 序号 | 地址 |
| ---- | ----------- |
| 1 | [gitlab]( https://gitlab.com/xuyq123/MyNotes ) |
| 2 | [coding]( https://xyqin.coding.net/public/my/MyNotes/git ) |
| 3 | [github]( https://github.com/scott180/MyNotes ) |
---
- [x] 数据库
- [mysqlNote]( https://github.com/scott180/MyNotes/blob/master/mysqlNote.md ) &ensp; [oracleNote]( https://github.com/scott180/MyNotes/blob/master/oracleNote.md ) &ensp; [mongo笔记]( https://github.com/scott180/MyNotes/blob/master/mongo.md ) &ensp; [ldap]( https://github.com/scott180/MyNotes/blob/master/%E5%85%B6%E4%BB%96/ldapNote.txt )
---
- [x] 前端
* [nodejs &ensp; vue.md]( https://github.com/scott180/MyNotes/blob/master/nodejs%20%26%20vue.md )
* [深入理解javascript原型和闭包]( https://github.com/scott180/MyNotes/tree/master/%E6%B7%B1%E5%85%A5%E7%90%86%E8%A7%A3javascript%E5%8E%9F%E5%9E%8B%E5%92%8C%E9%97%AD%E5%8C%85 )
* [layui官网]( https://www.layui.com/ ) &ensp; [layuimini]( https://github.com/zhongshaofa/layuimini/tree/onepage ) &ensp; [LayUI后台管理与综合示例]( https://www.cnblogs.com/best/p/9150271.html )
* [react入门实例教程]( http://www.ruanyifeng.com/blog/2015/03/react.html ) &ensp; [react官方文档]( https://reactjs.org/docs/forms.html )
- [x] 其他
- [本地安装zookeeper]( https://blog.csdn.net/xu180/article/details/105235397 )
- [kafka本地安装方法]( https://blog.csdn.net/xu180/article/details/109309482 )
- `markdown` &ensp;[typora]( https://typora.io/#windows ) [作业部落]( https://www.zybuluo.com/mdeditor )
<br/>
******************************************
## 网站
```
个人资料一般保存在git平台及网盘,如下:
git平台:gitlab、github、gitee、csdn_code、coding、bitbucket
网盘:阿里云网盘、百度网盘、阿里云个人邮箱网盘、坚果云、天翼云、微云、wps云盘
笔记:csdn、博客园、作业部落、有道云笔记、qq邮箱记事本、语雀、腾讯文档、飞书、简书
> 博客网站
```
**生活随笔-编程笔记-书法练习轨迹。**
## 2、软件
- [x] idea maven mysql
| 软件 | 下载地址 |
| -------- | ----- |
| 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 ) |
| 徐书法 | 地址 | 备注 |
| ----- | ----------- | ------------- |
| 1 | [xushufa.cn]( https://xushufa.cn ) | 书法练习网站。 |
| 2 | [blog.xushufa.cn]( https://blog.xushufa.cn ) | `vuepress`构建的博客网站。 |
| 3 | [web.xushufa.cn]( https://web.xushufa.cn ) | `vuepress-theme-reco`构建的博客网站。|
---
```
java mysql maven
idea git navicat notepad++
postman xshell fillder typora VMware
redis mongo kafka zookeeper tomcat eclipse
python nodejs vue
火绒安全软件 向日葵 Everything
```
## 3、网站
> **平台**
- 若有志同道合的小伙伴想联系本人,可通过以下方式发邮件或私信。路漫漫其修远兮,吾将上下而求索。共勉。
| 平台 | 链接 |
| -------------- | -------------- |
| **项目仓库** | [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; | 今日头条号 |
| --------- | ------------------------------------------------------------- | - | ---------- |
| 二维码 | ![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构建的网站。 |
1021151991@qq.com
***
---
\ No newline at end of file
# git笔记
> [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、常用命令
[git知识大全]( https://gitee.com/help/articles/4122 )
```vb
提交代码
git add .
git commit -m "fix"
git push origin dev_20190510001
查询状态
git status
查看日志
git log --stat
git reflog --date=iso
建立分支
git checkout -B dev_20190510001
git push
git push --set-upstream origin dev_20190510001
```
```basic
展示文件 ls
删除文件 git rm test2.txt
撤销操作 git checkout -- test.txt
添加文件到缓存:
git add test.txt 单个文件
git add . 当前目录全部文件
提交(包含注释)到本地仓库:
git commit -m '第一次版本提交'
上传文件到远程仓库:
git push origin [本地分支名]:[远端分支名]
当然如果你的本地分支名和远端分支名是一样的,那么就只需要git push origin [分支名称]就可以了。
git push
恢复最近版本文件
git fetch
git reset --hard origin/master //恢复到远程仓库,删除git add和commit的文件
git pull 拉取 从远程拉取最新版本到本地,并自动合并 merge
git fetch 获取 从远程获取最新版本到本地,不会自动合并 merge,需要手动合并
git merge 合并 使用fetch 可以在merge之前可以看清楚更新情况,再决定是否合并。
git merge --abort 中止合并
git 一个分支完全覆盖另一个分支 ,如下:dev_20210729覆盖develop
$ git checkout develop
$ git reset --hard dev_20210729
$ git push origin develop --force
不允许推送 You are not allowed to force push code to a protected branch on this project
"Settings" -> "Repository" -> scroll down to "Protected branches".
```
```haskell
git回滚之前的版本 http://www.cnblogs.com/yu-hailong/p/10681905.html
git log 查询日历记录
git reset --hard 5fa86ae3758e7e2a86825452977da40f34b6dd58 回滚到之前的版本
git push origin HEAD --force 强制提交
还原本地文件 git reset -hard
git reset soft + 版本号
回退到某个版本,只回退了commit的信息,不会改变已经修改过的代码。
git reset --soft HEAD^
git reset hard + 版本号
git reset --hard orgin
彻底回退到某个版本,本地的代码也会改变上一个版本内容。
#本地仓库回退到某个版本 git reflog --date=iso
git reset -hard bae168
#本地仓库回退到上一次提交
git reset -hard
git reset --hard HEAD
回退到当前版本的前一个版本
git reset --hard HEAD^
回退到当前版本的上上个版本
git reset --hard HEAD^^
回退到当前版本之前的100个版本
git reset --hard HEAD~100
丢弃本地提交,强制回到线上最新版本
git fetch --all
git reset --hard origin/你需要下拉的分支(默认master)
git fetch
```
### 1.2、配置
```vb
vi /etc/ssh/sshd_config
查看版本:
git --version
查看配置:
git config --list
设置配置:
git config --global pack.windowMemory 1024m
git config --global pack.packsizelimit 1g
git config --global http.postBuffer 1g
删除配置:
git config --global --unset pack.deltacachesize
```
### 1.3、分支
```sql
https://edu.aliyun.com/jiaocheng/1834?spm=5176.11182473.menu.7.k6ksTN
创建分支命令(复制当前分支下文件):
git branch (branchname)
提交分支到仓库命令:
git push origin (branchname)
切换分支命令:
git checkout (branchname)
列出分支基本命令:
git branch -a
删除分支命令:
git branch -d (branchname)
创建新分支并立即切换到该分支下
git checkout -b newtest
有同名分支会提示错误
强制创建新分支,并且会覆盖原来存在的同名分支
git checkout -B new_branch
设置本地分支关联远程分支
git push --set-upstream origin
合并分支:
git checkout master
git merge test // test分支合并到master分支
git push origin master
查看分支 git branch -a
删除本地分支 git branch -D branch-name
删除远程分支 git push origin --delete branch-name
查看当前配置有哪些远程仓库
git remote -v
彻底删除文件--会删除对应提交记录(包含正常文件的提交历史)
git filter-branch --force --index-filter 'git \
rm --cached --ignore-unmatch test彻底删除.txt' \
--prune-empty --tag-name-filter cat -- --all
git push --all --force
```
```
创建一个空白内容的分支json
// 创建新分支
git checkout --orphan json
// 删除所有文件
git rm -rf .
// 创建新文件后,全部提交
git add .
git commit -m "json"
// 推送
git push
git push --set-upstream origin json
```
```vb
修改分支名称 https://www.jianshu.com/p/cc740394faf5
a. 重命名远程分支对应的本地分支
git branch -m oldName newName
b. 删除远程分支
git push --delete origin oldName
c. 上传新命名的本地分支
git push origin newName
d.把修改后的本地分支与远程分支关联
git branch --set-upstream-to origin/newName
```
```sh
// 查看所有标签
git tag
// 新建标签
git tag t20220330
// 推送标签
git push origin t20220330
// 删除远程标签
git push origin :refs/tags/t20220330
// 删除本地标签
git tag -d t20220330
```
------------------------
## 2、高级操作
### 2.1、查看文件状态及日志
```vb
git status 命令用于查看项目的当前状态。
git status -s 查看详情
git diff
git diff --stat
执行 git diff 来查看执行 git status 的结果的详细信息。
git diff 命令显示已写入缓存与已修改但尚未写入缓存的改动的区别。
git diff 有两个主要的应用场景。
尚未缓存的改动:git diff
查看已缓存的改动: git diff --cached
查看已缓存的与未缓存的所有改动:git diff HEAD
显示摘要而非整个 diffgit diff --stat
退出git diff : q
查看全部分支的已经commit但是没有push的:
git log --branches --not --remotes
git cherry -v 只能查看未传送提交的描述/说明
git log master ^origin/master 则可以查看未传送提交的详细信息
查看全部分支的全部的最近的commit
git log --branches --not --remotes --simplify-by-decoration --decorate --online
查看日志
git log
git log --oneline -3 当前分支的最近三次提交记录
git log --stat https://www.cnblogs.com/fancyop/p/Git_Log.html
用来显示每次提交的下面列出所有被修改过的文件、有多少文件被修改了以及被修改过的文件的哪些行被移除或是添加了。 在每次提交的最后还有一个总结。
git reflog 所有分支的记录
git reflog --date=iso
```
### 2.2、stash暂存
```vb
git stash: 备份当前的工作区的内容,从最近的一次提交中读取相关内容,让工作区保证和上次提交的内容一致。同时,将当前的工作区内容保存到Git栈中。
git stash pop: Git栈中读取最近一次保存的内容,恢复工作区的相关内容。由于可能存在多个Stash的内容,所以用栈来管理,pop会从最近的一个stash中读取内容并恢复。
git stash list: 显示Git栈内的所有备份,可以利用这个列表来决定从那个地方恢复。
git stash clear: 清空Git栈。此时使用gitg等图形化工具会发现,原来stash的哪些节点都消失了。
git stash apply 恢复暂存之后不删除暂存
git stash pop 恢复暂存之后删除暂存
git stash drop Git栈删除最旧的一个暂存
```
### 2.3、修改注释信息
```
git使用amend选项提供了最后一次commit的反悔。但是对于历史提交呢,就必须使用rebase了。
git rebase -i HEAD~3
表示要修改当前版本的倒数第三次状态。
这个命令出来之后,会出来三行东东:
pick:*******
pick:*******
pick:*******
如果你要修改哪个,就把那行的pick改成edit,然后退出。
这时通过git log你可以发现,git的最后一次提交已经变成你选的那个了,这时再使用:
git commit --amend
来对commit进行修改。 :wq
修改完了之后,要回来对不对?
使用git rebase --continue
git rebase --abort
OK,一切都搞定了。
https://xiewenbo.iteye.com/blog/1285693
```
```
恢复已删除分支
https://blog.csdn.net/changerzhuo_319/article/details/81133533
git reflog --date=iso
git checkout -b reback_remove_branch ddd94a4
```
### 2.4、撤销
> git commit之后如何撤销
```
git log 查询提交记录
如果在git commit之后,需要撤回commit一般有以下三种方式
1.git reset --soft 版本号
git reset --soft HEAD^ //回到上一个版本
git reset --soft 9478618f5b73885e3b5dd0ff946ae557b86c7560
不删除工作区改动的代码,撤销commit,不撤销git add .
2.git reset --mixed 版本号
git reset --mixed HEAD^ //回到上一个版本
git reset --mixed 9478618f5b73885e3b5dd0ff946ae557b86c7560
不删除工作区改动的代码,撤销commit,撤销git add .
3.git reset --hard 版本号
git reset --hard HEAD^ //回到上一个版本
git reset --hard 9478618f5b73885e3b5dd0ff946ae557b86c7560
删除工作区的代码,撤销commit,撤销git add . 回到上一次commit的状态
参考 https://blog.csdn.net/weixin_44843859/article/details/111385032
```
---
> git revert 撤销版本
```
git revert -n 9478618f5b73885e3b5dd0ff946ae557b86c7560
https://blog.csdn.net/yxlshk/article/details/79944535
https://segmentfault.com/a/1190000012897697
```
------------------------
## 3、问题
### 3.1、github添加ssh公钥
``` vb
## github添加ssh公钥 git clone
打开 git bash
ssh-keygen -t rsa
cat ~/.ssh/id_rsa.pub
添加到 https://github.com/settings/keys 依次点击"Setting -> SSH Keys"->"New SSH key"
ssh -T git@github.com
git clone git@github.com:scott180/MyNotes.git
```
### 3.2、提交及更新失败
``` java
用git pull来更新代码的时候遇到了下面的问题
error: Your local changes to the following files would be overwritten by merge:
xxx/xxx/xxx.php
Please, commit your changes or stash them before you can merge.
Aborting
https://www.cnblogs.com/xd502djj/p/6973477.html
解决方法
方法1暂存本地文件下载最新代码恢复本地修改的代码修改冲突的文件提交代码
git stash //暂存
git pull //下载最新代码
git stash pop //恢复暂存文件
git status //查询状态
git add xxx/xxx/Test.java //提交文件 不能使用全部提交:(git add .)
git commit -m "fix" //注释
git push //提交文件
方法2 放弃本地修改文件下载最新代码
git reset --hard
git pull
```
```vb
GIT拉取代码的时候提示AUTHENTICATION FAILED FOR []
解决方法:
输入 git config --global credential.helper store
然后 git pull 输入账号密码
或者清除密码
git config --system --unset credential.helper
```
```sql
git(小乌龟)向github远程推送(push)文件是会报一个异常 no supported authentication methods avaiable
https://blog.csdn.net/Maxiao1204/article/details/81476618
解决方法:
因为git(小乌龟)和Git的冲突我们需要把乌龟git设置改正如下。
找到TortoiseGit--》Settings--》Network
SSH client指向 D:\git\usr\bin\ssh.exe (我的Git工具安装在d盘)
这里更改ssh 路径的时候,要把上面的“使用代理服务器” 勾打上,点击应用,再确定
```
# Spring Cloud 入门
<br />
> 本文基于 Spring Cloud Netflix
>
> 转载自:https://juejin.im/post/5de2553e5188256e885f4fa3
......
# cpu过高分析
<br />
> cpu java linux
`--20190325`
## 命令
```shell
[root@localhost ~]# top --查看cpu
[root@localhost ~]# top -p 6734 -H --观察该进程中所有线程的CPU占用
[root@localhost ~]# printf "%x\n" 6759 --找出CPU消耗较多的线程id,转16进制
1a67
[root@localhost ~]# jstack 6734|grep 1a67 -A 30 --打印堆栈信息,提交开发分析处理
```
```shell
[root@localhost ~]# top --查看cpu
6734 root 20 0 4557896 1.823g 10900 S 373.4 11.7 728:54.78 java
3207 root 20 0 3005436 858680 8156 S 24.9 5.3 350:39.55 mysqld
1 root 20 0 57640 7524 2644 S 0.0 0.0 0:02.75 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.08 kthreadd
3 root 20 0 0 0 0 S 0.0 0.0 0:02.27 ksoftirqd/0
5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
7 root rt 0 0 0 0 S 0.0 0.0 0:00.02 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/0
10 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/1
11 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/2
12 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcuob/3
13 root 20 0 0 0 0 S 0.0 0.0 0:12.53 rcu_sched
14 root 20 0 0 0 0 S 0.0 0.0 0:03.63 rcuos/0
15 root 20 0 0 0 0 S 0.0 0.0 0:04.65 rcuos/1
16 root 20 0 0 0 0 S 0.0 0.0 0:04.78 rcuos/2
17 root 20 0 0 0 0 R 0.0 0.0 0:04.42 rcuos/3
18 root rt 0 0 0 0 S 0.0 0.0 0:00.57 watchdog/0
[root@localhost ~]# top -p 6734 -H --观察该进程中所有线程的CPU占用
6759 root 20 0 4557896 1.812g 10876 R 41.5 11.7 67:40.75 java
6764 root 20 0 4557896 1.812g 10876 R 39.2 11.7 67:57.70 java
6761 root 20 0 4557896 1.812g 10876 R 38.9 11.7 69:24.02 java
6760 root 20 0 4557896 1.812g 10876 R 37.9 11.7 67:31.72 java
6756 root 20 0 4557896 1.812g 10876 R 36.5 11.7 67:53.37 java
6758 root 20 0 4557896 1.812g 10876 R 36.5 11.7 68:01.22 java
6763 root 20 0 4557896 1.812g 10876 R 36.5 11.7 68:14.78 java
6762 root 20 0 4557896 1.812g 10876 R 35.2 11.7 67:48.78 java
6757 root 20 0 4557896 1.812g 10876 R 33.2 11.7 67:32.28 java
6755 root 20 0 4557896 1.812g 10876 R 30.9 11.7 70:03.97 java
```
--------------------------------------
```shell
[root@localhost ~]# printf "%x\n" 6759 --找出CPU消耗较多的线程id,转16进制
1a67
[root@localhost ~]# jstack 6734|grep 1a67 -A 30 --打印堆栈信息,提交开发分析处理
"startJob_Worker-5" prio=10 tid=0x00007f15c4c07800 nid=0x1a67 runnable [0x00007f159cc74000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
at org.hibernate.intercept.FieldInterceptionHelper.extractFieldInterceptor(FieldInterceptionHelper.java:45)
at org.hibernate.intercept.FieldInterceptionHelper.clearDirty(FieldInterceptionHelper.java:81)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:209)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:127)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.stech.jgy.impl.local.rich.local.JgyManager.getStudentAppointByTeacherAppointId(JgyManager.java:1929)
at com.stech.webplus.jgy.action.Util.AppointThread.correctStudentAppointError(AppointThread.java:410)
at com.stech.webplus.jgy.action.Util.AppointThread.checkThreadByHours(AppointThread.java:148)
at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
"startJob_Worker-4" prio=10 tid=0x00007f15c47bf000 nid=0x1a66 runnable [0x00007f159cd75000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
at org.hibernate.intercept.FieldInterceptionHelper.extractFieldInterceptor(FieldInterceptionHelper.java:45)
at org.hibernate.intercept.FieldInterceptionHelper.clearDirty(FieldInterceptionHelper.java:81)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:209)
[root@localhost ~]#
```
## 实例
```shell
================================================================================
[root@localhost ~]# jstack 6734|grep la4e -A 30
[root@localhost ~]# printf "%x\n" 6764
1a6c
[root@localhost ~]# jstack 6734|grep 1a6c -A 30
"startJob_Worker-10" prio=10 tid=0x00007f15c45c7000 nid=0x1a6c runnable [0x00007f159c76e000]
java.lang.Thread.State: RUNNABLE
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValues(AbstractEntityTuplizer.java:256)
at org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValues(PojoEntityTuplizer.java:209)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:3581)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:167)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.stech.jgy.impl.local.rich.local.JgyManager.getStudentAppointByTeacherAppointId(JgyManager.java:1929)
at com.stech.webplus.jgy.action.Util.AppointThread.correctStudentAppointError(AppointThread.java:410)
at com.stech.webplus.jgy.action.Util.AppointThread.checkThreadByHours(AppointThread.java:148)
at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
"startJob_Worker-9" prio=10 tid=0x00007f15c4b84000 nid=0x1a6b runnable [0x00007f159c870000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
at org.hibernate.intercept.FieldInterceptionHelper.extractFieldInterceptor(FieldInterceptionHelper.java:45)
at org.hibernate.intercept.FieldInterceptionHelper.clearDirty(FieldInterceptionHelper.java:81)
[root@localhost ~]#
```
---
```shell
[root@localhost ~]# printf "%x\n" 6761
1a69
[root@localhost ~]# jstack 6734|grep 1a69 -A 30
"startJob_Worker-7" prio=10 tid=0x00007f15c4aa5800 nid=0x1a69 runnable [0x00007f159ca71000]
java.lang.Thread.State: RUNNABLE
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:145)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getPropertyValues(AbstractEntityTuplizer.java:256)
at org.hibernate.tuple.entity.PojoEntityTuplizer.getPropertyValues(PojoEntityTuplizer.java:209)
at org.hibernate.persister.entity.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:3581)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:167)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.stech.jgy.impl.local.rich.local.JgyManager.getStudentAppointByTeacherAppointId(JgyManager.java:1929)
at com.stech.webplus.jgy.action.Util.AppointThread.correctStudentAppointError(AppointThread.java:410)
at com.stech.webplus.jgy.action.Util.AppointThread.checkThreadByHours(AppointThread.java:148)
at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
"startJob_Worker-6" prio=10 tid=0x00007f15c4249000 nid=0x1a68 runnable [0x00007f159cb73000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
[root@localhost ~]#
```
---
```java
[root@localhost ~]# printf "%x\n" 6760
1a68
[root@localhost ~]# jstack 6734|grep 1a68 -A 30
"startJob_Worker-6" prio=10 tid=0x00007f15c4249000 nid=0x1a68 runnable [0x00007f159cb73000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
at org.hibernate.intercept.FieldInterceptionHelper.extractFieldInterceptor(FieldInterceptionHelper.java:45)
at org.hibernate.intercept.FieldInterceptionHelper.clearDirty(FieldInterceptionHelper.java:81)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:209)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:127)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.stech.jgy.impl.local.rich.local.JgyManager.getStudentAppointByTeacherAppointId(JgyManager.java:1929)
at com.stech.webplus.jgy.action.Util.AppointThread.correctStudentAppointError(AppointThread.java:410)
at com.stech.webplus.jgy.action.Util.AppointThread.checkThreadByHours(AppointThread.java:148)
at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
"startJob_Worker-5" prio=10 tid=0x00007f15c4c07800 nid=0x1a67 runnable [0x00007f159cc74000]
java.lang.Thread.State: RUNNABLE
at java.lang.Class.getInterfaces(Native Method)
at org.hibernate.intercept.FieldInterceptionHelper.extractFieldInterceptor(FieldInterceptionHelper.java:45)
at org.hibernate.intercept.FieldInterceptionHelper.clearDirty(FieldInterceptionHelper.java:81)
at org.hibernate.event.def.DefaultFlushEntityEventListener.isUpdateNecessary(DefaultFlushEntityEventListener.java:209)
[root@localhost ~]#
[root@localhost ~]# printf "%x\n" 6756
1a64
[root@localhost ~]# jstack 6734|grep 1a64 -A 30
"startJob_Worker-2" prio=10 tid=0x00007f15c45f7800 nid=0x1a64 runnable [0x00007f159cf76000]
java.lang.Thread.State: RUNNABLE
at java.util.HashMap.get(HashMap.java:303)
at org.hibernate.util.FastHashMap.get(FastHashMap.java:254)
at org.hibernate.tuple.EntityModeToTuplizerMapping.getTuplizerOrNull(EntityModeToTuplizerMapping.java:59)
at org.hibernate.tuple.EntityModeToTuplizerMapping.getTuplizer(EntityModeToTuplizerMapping.java:72)
at org.hibernate.tuple.entity.EntityMetamodel.getTuplizer(EntityMetamodel.java:106)
at org.hibernate.persister.entity.AbstractEntityPersister.getTuplizer(AbstractEntityPersister.java:3198)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3596)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:53)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:164)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:120)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:196)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:76)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:35)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:969)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1114)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at com.stech.jgy.impl.local.rich.local.JgyManager.getStudentAppointByTeacherAppointId(JgyManager.java:1929)
at com.stech.webplus.jgy.action.Util.AppointThread.correctStudentAppointError(AppointThread.java:410)
at com.stech.webplus.jgy.action.Util.AppointThread.checkThreadByHours(AppointThread.java:148)
at sun.reflect.GeneratedMethodAccessor672.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.util.MethodInvoker.invoke(MethodInvoker.java:276)
at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:260)
at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:86)
at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
"startJob_Worker-1" prio=10 tid=0x00007f15c4aff800 nid=0x1a63 runnable [0x00007f159d077000]
```
\ No newline at end of file
......@@ -497,6 +497,17 @@ syso+Alt+/ 输出
---
```
java mysql maven
idea git navicat notepad++
postman xshell fillder typora VMware
redis mongo kafka zookeeper tomcat eclipse
python nodejs vue
火绒安全软件 向日葵 Everything
```
---
### 3.2、java maven环境变量
```java
......
# java资料集
## 序
[gitlab]( https://gitlab.com/xuyq123/mynotes ) &ensp; [gitee]( https://gitee.com/xy180/MyNotes ) &ensp; [github]( https://github.com/scott180 ) &ensp; [csdn]( https://blog.csdn.net/xu180 ) &ensp; [stackoverflow]( https://stackoverflow.com/questions/tagged/java ) &ensp; [segmentfault]( https://segmentfault.com/ )
[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 ) &ensp; [csdn]( https://blog.csdn.net/xu180 ) &ensp; [stackoverflow]( https://stackoverflow.com/questions/tagged/java ) &ensp; [segmentfault]( https://segmentfault.com/ )
## 1、java
......@@ -37,7 +37,7 @@ Java注解之 @Target、@Retention、@Documented简介 | [链接]( https://b
### 1.2、java资料
- [x] 1.[JavaGuide]( https://snailclimb.gitee.io/javaguide ) &ensp; [guide仓库]( https://gitee.com/SnailClimb/JavaGuide ) <br/>
> 1.[JavaGuide]( https://snailclimb.gitee.io/javaguide ) &ensp; [guide仓库]( https://gitee.com/SnailClimb/JavaGuide ) <br/>
- [Java hashCode() 和 equals()的若干问题解答]( https://www.cnblogs.com/skywang12345/p/3324958.html ) &ensp; [ArrayList源码+扩容机制分析]( https://snailclimb.gitee.io/javaguide/#/docs/java/collection/ArrayList%E6%BA%90%E7%A0%81+%E6%89%A9%E5%AE%B9%E6%9C%BA%E5%88%B6%E5%88%86%E6%9E%90 )
......@@ -51,7 +51,7 @@ Java注解之 @Target、@Retention、@Documented简介 | [链接]( https://b
- [Spring IoC有什么好处呢]( https://www.zhihu.com/question/23277575/answer/169698662 ) &ensp; [Spring IOC 容器源码分析]( https://javadoop.com/post/spring-ioc ) &ensp; [Spring Bean的生命周期 ]( https://www.cnblogs.com/zrtqsk/p/3735273.html )
---
- [x] 2.[Java知识体系最强总结(2020版)]( https://blog.csdn.net/ThinkWon/article/details/103592572 ) <br/>
> 2.[Java知识体系最强总结(2020版)]( https://blog.csdn.net/ThinkWon/article/details/103592572 ) <br/>
序号 | 内容
----------- | ---------
......@@ -83,7 +83,23 @@ Java面试题大全(2020版) | [链接]( https://blog.csdn.net/
整理了 20 道 Spring Boot 面试题 | [链接]( https://blog.csdn.net/weixin_34367257/article/details/89618361 )
- [x] 3.[java资料汇总]( https://gitee.com/xy180/MyNotes/blob/master/java%E8%B5%84%E6%96%99%E6%B1%87%E6%80%BB.md ) <br/>
> 3.[java资料汇总]( https://gitee.com/xy180/MyNotes/blob/master/java%E8%B5%84%E6%96%99%E6%B1%87%E6%80%BB.md ) <br/>
- [x] 后端
- [springcloud-test]( https://github.com/scott180/springcloud-test ) &ensp; [springboot初始化]( https://start.spring.io/ ) &ensp; [2小时学会springboot]( https://blog.csdn.net/forezp/article/details/61472783 ) &ensp; [springCloud教程]( https://www.cnblogs.com/ityouknow/category/994104.html )
- [dubbo]( https://github.com/scott180/dubbo-test ) &ensp; [RabbitMQ]( https://github.com/scott180/RabbitMQ-test )
---
- [x] 前端
* [vue.md]( https://www.runoob.com/vue3/vue3-tutorial.html )
* [layui官网]( https://www.layui.com/ ) &ensp; [layuimini]( https://github.com/zhongshaofa/layuimini/tree/onepage ) &ensp; [LayUI后台管理与综合示例]( https://www.cnblogs.com/best/p/9150271.html )
* [react入门实例教程]( http://www.ruanyifeng.com/blog/2015/03/react.html ) &ensp; [react官方文档]( https://reactjs.org/docs/forms.html )
---
......
# mybatis笔记
<br />
> 核心:输入映射和输出映射
<br />
## 1.配置文件
```xml
新建java project 导入jar 写配置文件
......
# servlet-jsp学习
<br />
```java
servletjsp学习教程myeclipse 10 + tomcat 7 --2016
......
# springmvc笔记
<br />
```
springmvc(笔记—传播智客 苗润土)
1.前端处理器 dispathcherServlet
......
# tomcat笔记
<br />
> tomcat myeclipse
`--20170329`
## 安装配置
| 软件 | 下载地址 |
| -------- | ----- |
| 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 ) |
```
tomcat环境变量配置
创建 TOMCAT_HOME E:\ProgramFiles\apache-tomcat-8.5.31
添加 CLASSPATH %TOMCAT_HOME%\BIN;
验证
启动 bin/startup.bat
访问 http://localhost:8080/ (或 http://127.0.0.1:8080/ )
```
```java
http://blog.csdn.net/al_assad/article/details/76383107
tomcat配置JAVA_HOME
编辑 Tomcat根目录/bin/setclasspath.sh 在文件的开头添加以下
export JAVA_HOME=/usr/lib/jvm/java-openjdk
export JRE_HOME=/usr/lib/jvm/java-openjdk/jre
其中JAVA_HOME,JRE_HOME的值添加为实际的路径
之后再重新启动Tomcat返回信息正确
Using CATALINA_BASE: /apache-tomcat-8.5.16
Using CATALINA_HOME: /apache-tomcat-8.5.16
Using CATALINA_TMPDIR: /apache-tomcat-8.5.16/temp
Using JRE_HOME: /usr/lib/java-1.8.0-opendjk/jre
Using CLASSPATH: /apache-tomcat-8.5.16/bin/bootstrap.jar:/apache-tomcat-8.5.16/bin/tomcat-juli.jar
Tomcat started.
```
```java
================== 服务器布署多个tomcat ===================
1.HTTP端口默认8080如下改为8081
[html] view plain copy
<Connector port="8081" protocol="HTTP/1.1"
connectionTimeout="60000"
redirectPort="8443" disableUploadTimeout="false" executor="tomcatThreadPool" URIEncoding="UTF-8"/>
2.远程停服务端口默认8005如下改为8006
[html] view plain copy
<Server port="8006" shutdown="SHUTDOWN">......
3.AJP端口默认8009如下改,8010
[html] view plain copy
<Connector port="8010" protocol="AJP/1.3" redirectPort="8443" />
```
---
```
myeclipse中tomcat常见问题及解决方法:
----- 问题1:在myeclipse中布署tomcat 及 修改tomcat端口
----- 问题2:copy当前myeclippse项目要注意的问题
----- 问题3:The Tomcat... Server at localhost-config is missing --servers丢失
----- 问题4:Several ports (8005,8080, 8009) ....are already in use ---端口被使用
----- 问题5:Could not publish server..... Two or more Web modules defined in the configuration have 不能发布服务器
----- 问题6:myeclipse复制项目后引用的url还是原来的项目名称
----- 问题7:exploded archive packaged archive 区别
----- 问题8:警告: Unable to load server configuration from [H:\workspace\.metadata\.plugin....
----- 问题9:xml无法自动提示
----- 问题10:myeclipse里面有许多tomcat的localhost命名,请问怎么删除
----- 问题11:myeclipse中xml 默认使用myeclipse editor打开
----- 问题12:Setting property 'IEncoding' to 'utf-8' did not find a matching property.
----- 问题13:A context path must either be an empty string or start with a '/' and do not end with a '/'.
----- 问题14:run as on server 和 add deployment的区别
----- 问题15:Setting property 'source' to 'org.eclipse.jst.jee.server:ext3.0' did not find a matching property.
```
---
## myeclipse布署tomcat
```
====================================================================================
问题1: 在myeclipse中布署tomcat 及 修改tomcat端口
在myeclipse中布署tomcat:
window-perference--输入tomcat--进入tomcat7.0,然后将自己安装目录添加进去.选择Enable.
我们找到Myeclipse自带的tomcat项,将自带的tomcat设为禁用(disable).
点击tomcat7.x,就是我们自己添加的tomcat,我们将tomcat7.x的jdk设置为自己安装的jdk,为了统一。
点击apply,然后点击ok.
修改tomcat端口:
在安装目录G:\tomcat-7\conf中,打开server.xml文件(备份一个)
找到 <Connector port="8080" protocol="HTTP/1.1"
将8080修改掉,如 <Connector port="8888" protocol="HTTP/1.1" 即可
```
## 复制myeclippse项目
```java
====================================================================================
问题2:copy当前myeclippse项目要注意的问题
方法:
注意 1.run as 选择server时需要removeAll清除server里原来的项目,否则会出现问题无法发布服务器
注意 2.myeclipse复制项目后引用的url如果还是原来的项目名称。
若 myeclipse复制项目后引用的url还是原来的项目名称
方法:
Properties------Web Project Setting-------(Server.xml)
1--如果新闻网站项目一个用的servlet(showNews),另一个是用框架修改的(showNews_framework),但是在运行后者的jsp文件的时候路径确是showNews/***
2--这时右键复制过的项目(此处为showNews_framework),选择Properties,或者选中该项目点击Alt+Enter,进入属性设置界面
3--找到下面的Web Project Setting,注意看这里的Context root是不是你的项目名称,比如我的就还是之前的项目名:showNews
4--如果不是,就把这里的Context root改为你复制后自己起的项目名称,这里为
showNews_framework
5--该过之后注意会弹出确认修改配置文件的框,注意这里需要选择是,然后重启服务器即可
6--注意事项
如果还不行请查看Server项目中的Server.xml文件最下面有没有一个Context标签,把其中docBase="showNews_framework" path="/showNews_framework"的值改为相同
http://jingyan.baidu.com/article/642c9d34ca8cba644a46f71b.html
```
## localhost-config is missing
```js
====================================================================================
问题3: The Tomcat server configuration at \Servers\Tomcat v5.5 Server at localhost-config is missing
-- Server丢失
方法:
删除Tomcat Server,然后在Servers视图里边,再New一个Server.
```
## already in use
```java
====================================================================================
问题4:Several ports (8005,8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).
-- 端口被使用
方法:
------- 启动任务管理器---停掉javaw.exe
```
## Could not publish
```npm
====================================================================================
问题5:
Could not publish server configuration for Tomcat v7.0 Server at localhost.
无法发布服务器配置Tomcat v7.0服务器在本地
Two or more Web modules defined in the configuration have the same context root (/Strust2_020_Introduction). To start this server you will need to remove the duplicate(s).
两个或两个以上的Web模块中定义的配置有相同背景的根(/ strust2_020_introduction)。要启动此服务器,您将需要删除重复的副本(S)。
-- 因为tomcat为项目建立服务器的配置出现错误,一个tomcat中有两个项目,发生冲突。
方法:
一:项目布署在本地的tomcat中,不能用右键--Run as 启动,使用servers 里的Run server启动。
二:
重新为项目配置tomcat以清空tomcat中其他项目。
步骤:将项目改名----右键----Run As---- Run On Server ---- Choose an existing server(Always use this server...) --- Next--- Remove All ---- Finish
三:
1、将D:\Test\Servers\Tomcat v5.5 Server at localhost-config\server.xml当中新加入的错误Context删除,同时将D:\Test\test\.settings\org.eclipse.wst.common.component当中的deploy-name和property name的键值改为新项目的名称,重新加入tomcat的服务,问题解决。
2、如果你使用的是eclipse启动tomcat,在自己下载的 tomcat中找不到上面的这种情况,那么就到你项目的eclipse中的workspace中去找,如:....\项目名\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf文件下面找到server.xml文件,然后向第一种方法一样删除重复的
<Context docBase="项目名" path="/项目名"reloadable="true" source="org.eclipse.jst.j2ee.server:项目名"/>
```
## myeclipse复制项目后引用
```html
====================================================================================
问题6:myeclipse复制项目后引用的url还是原来的项目名称
方法:
Properties------Web Project Setting-------(Server.xml)
1--如果新闻网站项目一个用的servlet(showNews),另一个是用框架修改的(showNews_framework),但是在运行后者的jsp文件的时候路径确是showNews/***
2--这时右键复制过的项目(此处为showNews_framework),选择Properties,或者选中该项目点击Alt+Enter,进入属性设置界面
3--找到下面的Web Project Setting,注意看这里的Context root是不是你的项目名称,比如我的就还是之前的项目名:showNews
4--如果不是,就把这里的Context root改为你复制后自己起的项目名称,这里为
showNews_framework
5--该过之后注意会弹出确认修改配置文件的框,注意这里需要选择是,然后重启服务器即可
6--注意事项
如果还不行请查看Server项目中的Server.xml文件最下面有没有一个Context标签,把其中docBase="showNews_framework" path="/showNews_framework"的值改为相同
http://jingyan.baidu.com/article/642c9d34ca8cba644a46f71b.html
```
## exploded archive packaged archive
```shell
====================================================================================
问题7:exploded archive packaged archive 区别
1. exploded archive (development mode)
这种叫开发模式这是直接把文件夹,jsp页面 ,classes等等移到tomcat 部署文件夹里面,进行加载部署
2. Packaged Archive(production mode)
这种叫发布模式,这是先打成war包,再发布
```
## Unable to load server configuration
```
====================================================================================
问题8:警告: Unable to load server configuration from [H:\workspace\.metadata\.plugin....
Unable to load server configuration from [H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\conf\server.xml]
--jar包有问题,重新导入jar包
--或者清空项目,Project--Clean--Clean all projects 。重新运行tomcat。
--重启myeclipse
http://bbs.csdn.net/topics/340035300
```
## xml无法自动提示
```xml
====================================================================================
问题9:xml无法自动提示
方法:
--选择xml文件---Open With----Default Editor---(左下角)Source
--进入H:\软\struts-2.3.31-all\struts-2.3.31\lib 解压struts2-core-2.3.31.jar,找到struts-2.3.dtd这个文件,Window>>Preferences,输入catalog,找到XML Catalog,选择add
Location--File System
如下
Location:H:\MaShiBingJava\struts2\struts2-core-2.3.31\struts-2.3.dtd
Key type :URL
Key: http://struts.apache.org/dtds/struts-2.3.dtd
(注意:struts2-core-2.3.31.jar 解压的目录不能有中文)
```
## 删除localhost命名
```sql
====================================================================================
问题10:myeclipse里面有许多tomcat的localhost命名,请问怎么删除
window-show View - others-- 搜索servers-- 选择WTP servers ----delete
```
## xml 默认使用myeclipse editor打开
```php
====================================================================================
问题11:myeclipse中xml 默认使用myeclipse editor打开
window-->preferences-->general-->editors-->file association-->*.xml
在下面选择一种打开方式 设置DEFAULT
```
## Setting property 'IEncoding' to 'utf-8'
```
====================================================================================
问题12:Setting property 'IEncoding' to 'utf-8' did not find a matching property.
原因:Tomcat的 server.xml端口有两个8080端口设置
<Connector port="8080" protocol="HTTP/1.1" .....
打开Tomcat目录/conf/server.xml 删掉一个
```
## A context path must either be an empty string
```c
====================================================================================
问题13:A context path must either be an empty string or start with a '/' and do not end with a '/'
上下文路径必须是一个空字符串,或者以“/”开头,不要以“/”结尾。
原因:tomcat的server.xml中添加了多余的无效的context标签,将其删除即可。
举例:
我出现的问题是:
十一月 23, 2016 5:17:05 下午 org.apache.catalina.core.StandardContext setPath
警告: A context path must either be an empty string or start with a '/' and do not end with a '/'. The path [Struts2_071_ActionParamInput] does not meet these criteria and has been changed to [/Struts2_071_ActionParamInput]
原来我的tomcat的server.xml文件中出现了这一段(之前手动加入的,没有删除)
<Context path="Struts2_071_ActionParamInput" docBase="G:\tomcat-7\webapps\Struts2_071_ActionParamInput\WebRoot" reloadable="true"/>
将其删除即可。
提示:server.xml在tomcat的config目录下。
```
## run as on server 和 add deployment的区别
```java
问题14:run as on server 和 add deployment的区别
--- run as on server是在myeclipse中建立临时的tomcat,配置信息在
H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\conf目录server.xml中。
(tmp3是随机名称,也许是temp0、temp1、tem2等等)
项目在H:\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps目录。
下一次启动run as on server 时之前存在的项目会被删除。当前只存在一个项目。
--- add deployment是把项目复制到本地tomcat文件中,
配置信息在本地tomcat的安装目录G:\tomcat-7\conf目录的server.xml中。
项目在G:\tomcat-7\webapps目录,一直存在。
====================================================================================
Setting property 'source' to 'org.eclipse.jst.jee.server:ext3.0' did not find a matching property.
环境:Tomcat 7.0.69 + myeclipse 10
原因:设置属性“source” 没有找到匹配的属性。
方法:删除临时的tomcat,重新发布。
步骤:
-----1. 找到此项目发布的临时的tomcat目录,一般在\workspace\.metadata\.plugins\org.eclipse.wst.server.core目录
-----2. 删除...core目录下所有文件
-----3. 找到tomcat目录里的conf目录里的Catalina目录里有个localhost文件夹,把文件夹里面的文件全删除掉。
-----4. 清空项目,Project--Clean--Clean all projects 。
-----5. Run as on server 启动tomcat
若出现Unable to load server configuration from [H:\workspace\.metadata\.plugin....
则重启myeclipse 再Run as on server 启动tomcat。
参考自http://blog.csdn.net/z69183787/article/details/19911935
```
\ No newline at end of file
# 布隆过滤器
<br />
> 文档来自[javaguide]( https://snailclimb.gitee.io/javaguide/#/ )
海量数据处理以及缓存穿透这两个场景让我认识了 布隆过滤器 ,我查阅了一些资料来了解它,但是很多现成资料并不满足我的需求,所以就决定自己总结一篇关于布隆过滤器的文章。希望通过这篇文章让更多人了解布隆过滤器,并且会实际去使用它!
......
# 排序算法
<br />
> 时间复杂度
```
时间复杂度
时间维度:是指执行当前算法所消耗的时间,我们通常用「时间复杂度」来描述。
空间维度:是指执行当前算法需要占用多少内存空间,我们通常用「空间复杂度」来描述。
常见的时间复杂度量级有:
常数阶O(1)
对数阶O(logN)
线性阶O(n)
线性对数阶O(nlogN)
平方阶O(n²)
立方阶O(n³)
K次方阶O(n^k)
指数阶(2^n)
时间复杂度为O(logn)。
  当数据增大n倍时,耗时增大logn倍(这里的log是以2为底的,比如,当数据增大256倍时,耗时只增大8倍,是比线性还要低的时间复杂度)
https://blog.csdn.net/qq_41523096/article/details/82142747
https://zhuanlan.zhihu.com/p/50479555
https://www.cnblogs.com/biehongli/p/11672380.html
```
```
对数公式是数学中的一种常见公式,如果a^x=N(a>0,且a≠1),则x叫做以a为底N的对数,记做x=log(a)(N),其中a要写于log右下。
其中a叫做对数的底,N叫做真数。
通常我们将以10为底的对数叫做常用对数,以e为底的对数称为自然对数。
(1)常用对数:lg(b)=log10b(10为底数)。
(2)自然对数:ln(b)=logeb(e为底数)。 ㏒ebеенp
e为无限不循环小数,通常情况下只取e=2.71828。
https://www.cnblogs.com/chenxi188/p/11050016.html
```
```
参考 八大排序算法
http://www.oschina.net/code/snippet_123685_11589
https://blog.csdn.net/liang_gu/article/details/80627548
https://www.cnblogs.com/onepixel/articles/7674659.html
https://www.runoob.com/w3cnote/ten-sorting-algorithm.html
https://www.toutiao.com/a6873663185333780999/?channel=&source=search_tab
```
## 1、冒泡排序
......
# [note]( https://gitlab.com/xuyq123/mynotes/-/blob/master/note.md )
# note
<br />
* [1、日常](#note)
* [2、工作](#wrok)
* [2、工作](#work)
* [3、java](#java)
* [4、我的](#myShu)
- [ ] `仓库` &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>
<h2 id="note"></h2>
## 1、日常
......@@ -138,6 +141,12 @@ markdown空格符号
```
```
markdown表格宽度设置
| git仓库 | 布署方法 | <span style="white-space:nowrap;">备注&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;</span> |
```
```
gitlab、github、gitee布署mkdocs主题仓库
......@@ -324,7 +333,60 @@ Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinHttpAutoProxySv
```
<h2 id="work"></h2>
#### 1.3.4、shell批量推送git
```sh
#!/bin/bash
#sh push-ca.sh
copyPush(){
cp -r /e/Project/gitlab/calligraphy/*.md $data_dir
cp -r /e/Project/gitlab/calligraphy/书法字帖 $data_dir
cd $data_dir
echo $PWD 'begin...'
git add .
git commit -m "fix"
git push
echo '.........end.........'
}
#agit 1
data_dir=/e/Project/gitlab/agit/calligraphy
copyPush
#bitbucket 2
data_dir=/e/Project/gitlab/bitbucket/calligraphy
copyPush
#codeberg 3
data_dir=/e/Project/gitlab/codeberg/calligraphy
copyPush
#coding 4
data_dir=/e/Project/gitlab/coding/calligraphy
copyPush
#gitcode 5
data_dir=/e/Project/gitlab/gitcode/calligraphy
copyPush
#gitea 6
data_dir=/e/Project/gitlab/gitea/calligraphy
copyPush
#sourceforge 7 need password
#gitee 8
data_dir=/e/Project/gitee/calligraphy
copyPush
#github 9
data_dir=/e/Project/github/calligraphy
copyPush
```
<h2 id="work"></h2>
## 2、工作
......@@ -434,7 +496,7 @@ http://localhost:8080/druid/sql.html
*************************
<h2 id="java"></h2>
<h2 id="java"></h2>
## 3、java
......@@ -697,6 +759,28 @@ slist = list.stream().sorted(Comparator.comparing(Student::getAge).reversed()).c
slist.forEach(e -> System.out.println("Id:" + e.getId() + ", Name: " + e.getName() + ", Age:" + e.getAge()));
分组排序
https://www.toutiao.com/article/7096484701099295263
TreeMap<TypeEnum, List<Customer>> treeMap4 = customers.stream().sorted(Comparator.comparing(Customer::getAge, Comparator.nullsLast(Integer::compareTo)))
.collect(Collectors.groupingBy(Customer::getType, TreeMap::new, Collectors.toList()));
Map<String, List<LogisticsStatisticsDAO>> logisticsRegionMap = logisticsStatisticsDAOS.stream().
collect(Collectors.groupingBy(LogisticsStatisticsDAO::getRegion, WarehouseUtil::getCustomSortTreeMap, Collectors.toList()));
public static TreeMap<String, List<LogisticsStatisticsDAO>> getCustomSortTreeMap() {
// return new TreeMap<>(Comparator.comparingInt(TypeEnum::getPriority));
TreeMap<String, List<LogisticsStatisticsDAO>> map = new TreeMap<String, List<LogisticsStatisticsDAO>>(new Comparator<String>() {
@Override
public int compare(String r1, String r2) {
// 升序
return CommonUtil.regionSort(r1, r2);
}
});
return map;
}
```
#### 3.1.4、flatmap,peek,newArrayList
......@@ -935,6 +1019,17 @@ syso+Alt+/ 输出
---
```
java mysql maven
idea git navicat notepad++
postman xshell fillder typora VMware
redis mongo kafka zookeeper tomcat eclipse
python nodejs vue
火绒安全软件 向日葵 Everything
```
---
#### 3.3.2、java maven环境变量
```java
......@@ -1031,7 +1126,7 @@ maven常用打包命令
---
<h2 id="muShu"></h2>
<h2 id="myShu"></h2>
## 4、我的
......
......@@ -3,7 +3,7 @@
## 定时任务
```
```js
#打开定时任务
crontab -e
......@@ -20,7 +20,7 @@ crontab -l
```
```
```tex
说明:
......@@ -99,7 +99,7 @@ find $data_dir -mtime +7 -name 'data_[1-9].sql' -exec rm -rf {} \;
```
```
``` java
/bin/sh^M: bad interpreter:没有那个文件或目录解决
因为操作系统是windows我在windows下编辑的脚本所以有可能有不可见字符
脚本文件是DOS格式的, 即每一行的行尾以\n\r来标识, 其ASCII码分别是0x0D, 0x0A.
......
# 排序算法
## 时间复杂度
```
时间复杂度
https://blog.csdn.net/qq_41523096/article/details/82142747
https://zhuanlan.zhihu.com/p/50479555
https://www.cnblogs.com/biehongli/p/11672380.html
时间维度:是指执行当前算法所消耗的时间,我们通常用「时间复杂度」来描述。
空间维度:是指执行当前算法需要占用多少内存空间,我们通常用「空间复杂度」来描述。
常见的时间复杂度量级有:
常数阶O(1)
对数阶O(logN)
线性阶O(n)
线性对数阶O(nlogN)
平方阶O(n²)
立方阶O(n³)
K次方阶O(n^k)
指数阶(2^n)
时间复杂度为O(logn)。
  当数据增大n倍时,耗时增大logn倍(这里的log是以2为底的,比如,当数据增大256倍时,耗时只增大8倍,是比线性还要低的时间复杂度)
```
```
对数公式是数学中的一种常见公式,如果a^x=N(a>0,且a≠1),则x叫做以a为底N的对数,记做x=log(a)(N),其中a要写于log右下。
其中a叫做对数的底,N叫做真数。
通常我们将以10为底的对数叫做常用对数,以e为底的对数称为自然对数。
(1)常用对数:lg(b)=log10b(10为底数)。
(2)自然对数:ln(b)=logeb(e为底数)。 ㏒ebеенp
e为无限不循环小数,通常情况下只取e=2.71828。
https://www.cnblogs.com/chenxi188/p/11050016.html
```
```
https://www.runoob.com/w3cnote/ten-sorting-algorithm.html
https://www.toutiao.com/a6873663185333780999/?channel=&source=search_tab
```
## 冒泡排序
```
```
# ldapNote
************ 1、安装ldap和berkeley-db ******************************************************************************************************************
<br />
> ldap笔记 --20190403
<br />
## 1、介绍
```java
LADP基本介绍
LDAP轻量级目录访问协议以目录的形式来管理资源域用户用户组地址簿邮件用户打印机等等)。
https://www.cnblogs.com/itzxy/p/9566548.html
特点
1. LDAP是一种网略协议而不是数据库而且LDAP的目录不是关系型的没有RDBMS那么复杂LDAP不支持数据库的Transaction机制纯粹的无状态请求-响应的工作模式
2. LDAP不能存储BOLB,LDAP的读写操作是非对称的读的方便写的比较麻烦LDAP支持复杂的查询过滤器
3. LDAP使用树状结构接近于公司组织结构文件目录结构域名结构等
4. LDAP使用简单接口标准并支持SSL访问
用途
信息安全类数字证书管理授权管理单点登陆
科学计算类DCE(分布式计算环境)UDDI(统一描述发现和集成协议)
网络资源管理类MAIL系统DNS系统网络用户管理电话号码簿
电子政府资源管理类内网组织信息服务电子政务目录体系人口基础库法人基础库
结构
一颗目录信息树有若干条目Entry组成每一个条目有唯一的标识名DN(Distingushed Name),条目可以用来描述用户账号打印机和计算机等对象一个条目是一个对象每个条目有多个属性Attribute组成每一属性有一个类型和一个到多个值组成每个属性可以对应一个或多个值Value)。
```
## 2、安装
> 安装ldap和berkeley-db
```sh
可以使用 db-5.3.21.tar.gz 和 openldap-2.4.33.tgz
安装ldap参考 https://blog.csdn.net/qiang359503893/article/details/44858491
......@@ -22,8 +56,9 @@ make install
注意:安装完成后把执行
# cp /usr/local/berkeleyDB/include/* /usr/include/
# cp /usr/local/berkeleyDB/lib/* /usr/lib/
```
```java
2配置berkeleyDB 环境变量
vi ~/.bash_profile
添加
......@@ -37,19 +72,18 @@ export LD_LIBRARY_PATH
3安装openLDAP
wget ftp://ftp.openldap.org/pub/OpenLDAP/openldap-release/openldap-2.4.40.tgz
# tar -xzvf openldap-2.4.15.tgz
# cd openldap-2.4.15/
# ./configure --prefix=/usr/local/openldap
# make depend
# tar -xzvf openldap-2.4.15.tgz
# cd openldap-2.4.15/
# ./configure --prefix=/usr/local/openldap
# make depend
# make && make install
```
# make && make install
## 3、配置
> 设置lapd配置文件 及导入初始化数据
************ 2、设置lapd配置文件 及导入初始化数据 ***********************************************************************************************
```c
安装完成后配置slapd.conf
注:Slapd.conf 位于/usr/local/openldap/etc/openldap
1)插入下面六条记录
......@@ -71,22 +105,23 @@ index nisMapName,nisMapEntry eq,pres,sub
2)schema文件夹下的文件拖入路径为:
/usr/local/openldap/etc/openldap/schema下的usergrouporg三个schema
```
3)设置密码 root / sudy12344
```sql
3)设置密码 root / pwd12344
vi /usr/local/openldap/etc/openldap/slapd.conf
database bdb
suffix "dc=sudytech,dc=com"
rootdn "cn=root,dc=sudytech,dc=com"
suffix "dc=stech,dc=com"
rootdn "cn=root,dc=stech,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoid. See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw {MD5}5jnSmZCVnBZyaTmptpc73w==
```
```
产生加密密码散列的方法是使用slappasswd命令,用-h选项指明加密时使用的方式。示例如下:
[root@localhost openldap]# /usr/local/openldap/sbin/slappasswd -h {MD5}
New password:
......@@ -100,17 +135,39 @@ http://www.cnitblog.com/tacimoto/archive/2006/12/19/20773.html
access to *
by anonymous auth
by dn.subtree="ou=aclUsers,dc=sudytech,dc=com" write
by dn.subtree="ou=aclDisabledUsers,dc=sudytech,dc=com" none
by dn.subtree="ou=aclUsers,dc=stech,dc=com" write
by dn.subtree="ou=aclDisabledUsers,dc=stech,dc=com" none
by * read
access to dn.subtree="dc=sudytech,dc=com"
access to dn.subtree="dc=stech,dc=com"
by anonymous auth
by dn.subtree="ou=aclUsers,dc=sudytech,dc=com" write
by dn.subtree="ou=aclDisabledUsers,dc=sudytech,dc=com" none
by dn.subtree="ou=aclUsers,dc=stech,dc=com" write
by dn.subtree="ou=aclDisabledUsers,dc=stech,dc=com" none
```
```
权限控制
普通用户 ou=people
能通过登录验证,但是进入软件时:LDAP error:无此对象
禁用账号 ou=aclDisabledUsers
能通过登录验证,但是进入软件时:LDAP error:无此对象
只读账号 ou=aclReadUsers
能登录,能查看所有用户,不能维护(增删改都没有权限)
读写账号 ou=aclUsers
登录,增删改查都可以
指定账户授权
隐藏密码
```
**************************************************************************************************************
```sh
启动LDAP
  /usr/local/openldap/libexec/slapd -d256
......@@ -125,23 +182,23 @@ access to dn.subtree="dc=sudytech,dc=com"
通过配置文件导入数据
/usr/local/openldap/bin/ldapadd -x -W -D "cn=root,dc=sudytech,dc=com" -f /usr/local/openldap/bin/ldap-initData.ldif
/usr/local/openldap/bin/ldapadd -x -W -D "cn=root,dc=stech,dc=com" -f /usr/local/openldap/bin/ldap-initData.ldif
/usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=sudytech,dc=com" -w sudy12344 -f /usr/local/openldap/bin/ldap-initData.ldif
/usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=stech,dc=com" -w pwd12344 -f /usr/local/openldap/bin/ldap-initData.ldif
/usr/local/openldap/bin/ldapadd -x -W -D "cn=root,dc=sudytech,dc=com"
/usr/local/openldap/bin/ldapadd -x -W -D "cn=root,dc=stech,dc=com"
备份
/usr/local/openldap/sbin/slapcat > backup.ldif
/usr/local/openldap/sbin/slapcat > /usr/local/openldap/bin/backup.ldif
查询条目
/usr/local/openldap/bin/ldapsearch -x -b "dc=sudytech,dc=com"
/usr/local/openldap/bin/ldapsearch -x -b "uid=test2,ou=people,dc=sudytech,dc=com"
/usr/local/openldap/bin/ldapsearch -x -b "dc=stech,dc=com"
/usr/local/openldap/bin/ldapsearch -x -b "uid=test2,ou=people,dc=stech,dc=com"
/usr/local/openldap/bin/ldapsearch -x -b "uid=0121140114,ou=People,dc=shcc,dc=edu,dc=cn"
删除
/usr/local/openldap/bin/ldapdelete -x -D 'cn=root,dc=sudytech,dc=com' -w sudy12344 'uid=test2,ou=people,dc=sudytech,dc=com'
/usr/local/openldap/bin/ldapdelete -x -D 'cn=root,dc=stech,dc=com' -w pwd12344 'uid=test2,ou=people,dc=stech,dc=com'
导入数据(如果是备份的数据,需要过滤掉系统信息)
1、新建过滤正则表达式slapcat.regex
......@@ -161,23 +218,24 @@ access to dn.subtree="dc=sudytech,dc=com"
cat backup.ldif | sed -f slapcat.regex > backup1.ldif
3、导入数据
/usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=sudytech,dc=com" -w sudy12344 -f backup1.ldif
/usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=stech,dc=com" -w pwd12344 -f backup1.ldif
```
================================== =================================== =================================== ===================================
## 4、报错
```js
启动LDAP报错
[root@localhost bin]# /usr/local/openldap/libexec/slapd -d256
5b62c60d @(#) $OpenLDAP: slapd 2.4.33 (Aug 2 2018 14:28:14) $
root@localhost.localdomain:/usr/local/src/openldap-2.4.33/servers/slapd
5b62c60d bdb_db_open: warning - no DB_CONFIG file found in directory /usr/local/openldap/var/openldap-data: (2).
Expect poor performance for suffix "dc=sudytech,dc=com".
5b62c60d bdb(dc=sudytech,dc=com): BDB1539 Build signature doesn't match environment
5b62c60d bdb_db_open: database "dc=sudytech,dc=com" cannot be opened, err -30969. Restore from backup!
5b62c60d bdb(dc=sudytech,dc=com): BDB1566 txn_checkpoint interface requires an environment configured for the transaction subsystem
5b62c60d bdb_db_close: database "dc=sudytech,dc=com": txn_checkpoint failed: Invalid argument (22).
5b62c60d backend_startup_one (type=bdb, suffix="dc=sudytech,dc=com"): bi_db_open failed! (-30969)
5b62c60d bdb_db_close: database "dc=sudytech,dc=com": alock_close failed
Expect poor performance for suffix "dc=stech,dc=com".
5b62c60d bdb(dc=stech,dc=com): BDB1539 Build signature doesn't match environment
5b62c60d bdb_db_open: database "dc=stech,dc=com" cannot be opened, err -30969. Restore from backup!
5b62c60d bdb(dc=stech,dc=com): BDB1566 txn_checkpoint interface requires an environment configured for the transaction subsystem
5b62c60d bdb_db_close: database "dc=stech,dc=com": txn_checkpoint failed: Invalid argument (22).
5b62c60d backend_startup_one (type=bdb, suffix="dc=stech,dc=com"): bi_db_open failed! (-30969)
5b62c60d bdb_db_close: database "dc=stech,dc=com": alock_close failed
5b62c60d slapd stopped.
缺少配置文件
......@@ -199,12 +257,14 @@ cp DB_CONFIG.example DB_CONFIG
ps -ef|grep ldap
kill -9
```
---
=================================== =================================== =================================== ===================================
```java
导入备份的ldif数据报错
[root@localhost sbin]# /usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=sudytech,dc=com" -w sudy12344 -f test2.ldif
adding new entry "uid=test2,ou=people,dc=sudytech,dc=com"
[root@localhost sbin]# /usr/local/openldap/bin/ldapadd -x -D "cn=root,dc=stech,dc=com" -w pwd12344 -f test2.ldif
adding new entry "uid=test2,ou=people,dc=stech,dc=com"
ldap_add: Constraint violation (19)
additional info: structuralObjectClass: no user modification allowed
......@@ -213,10 +273,9 @@ https://www.cnblogs.com/ccdc/p/3356518.html
解决方案清除ldapback.ldif中的系统信息
 步骤:
步骤
  1、新建过滤正则表达式slapcat.regex
复制代码
1新建过滤正则表达式slapcat.regex
cat >slapcat.regex <<EOF
/^creatorsName: /d
......@@ -228,17 +287,19 @@ cat >slapcat.regex <<EOF
/^entryCSN: /d
EOF
复制代码
  2、过滤掉系统信息
2过滤掉系统信息
cat ldapback.ldif | sed -f slapcat.regex > slapdata.ldif
  3、使用ldapadd导入
3使用ldapadd导入
ldapadd -H ldap://127.0.0.1 -x -D "用户" -f slapdata.ldif -w 密码
# 服务器程序导入 初始使用可能失败
#slapadd -l slapdate.ldif
```
# mongo
<br />
* [1、说明](#introducer)
* [2、增删改查](#crud)
* [3、三种情况下mongo内嵌文档的查询与保存、](#innerDocument)
......
# mysql
# mysql笔记
## 1、安装mysql
```
安装mysql 5.7
> 安装mysql 5.7
```js
参考
http://blog.xushufa.cn
http://blog.csdn.net/wengengeng/article/details/52013650
https://www.cnblogs.com/jyjia/archive/2019/03/07/10490013.html
下载mysql
https://www.mysql.com/
https://www.aliyundrive.com/s/pymjQca3DbY
```
```java
下载mysql
进入官网https://www.mysql.com/
......@@ -23,7 +36,6 @@ http://blog.csdn.net/wengengeng/article/details/52013650
2.创建my.ini文件 D:\mysql-5.7.13-winx64 目录),内容如下
[plain] view plain copy
[mysqld]
port=3306
......@@ -36,6 +48,10 @@ http://blog.csdn.net/wengengeng/article/details/52013650
注意basedir和datadir是必须要配置的basedir就是你解压的目录官方文档上说如果你喜欢用反斜杠则要用双反斜杠斜杠的话就不用这样D:\\mysql-5.7.13-winx64\\ D:/mysql-5.7.13-winx64/
由于本人喜欢把数据库的数据文件独立出来所以就把datadir配置到其它地方方便管理另外创建该目录
```
```java
3.配置环境变量
添加一个名叫 MYSQL_HOME 的变量
......@@ -46,12 +62,10 @@ http://blog.csdn.net/wengengeng/article/details/52013650
以管理员身份运行cmd进入mysql的bin目录
初始化数据库文件
[plain] view plain copy
mysqld --initialize
初始化成功后会在datadir目录下生成一些文件其中xxx.err文件里说明了root账户的临时密码那行大概长这样
[plain] view plain copy
2016-07-24T05:19:20.152135Z 1 [Note] A temporary password is generated for root@localhost: bL2uuwuf0H(X
......@@ -59,33 +73,24 @@ http://blog.csdn.net/wengengeng/article/details/52013650
即密码是bL2uuwuf0H(X
注册mysql服务
[html] view plain copy
mysqld -install MySQL
启动mysql服务
[plain] view plain copy
net start MySQL
修改root密码
输入以下命令,回车,然后输入上面的默认密码:
[sql] view plain copy
输入以下命令回车然后输入上面的默认密码
mysql -u root -p
进入MySQL命令行模式后,输入如下命令,命令中的 new_password 为root账号的新密码,请修改它。
[sql] view plain copy
进入MySQL命令行模式后输入如下命令命令中的 new_password 为root账号的新密码请修改它
ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
```
```java
注意
如果会弹出无法启动此程序因为计算机中丢失 msvcp120.dll...等类似的提示 请安装 vcredist_x86.exe
......@@ -153,7 +158,8 @@ https://jingyan.baidu.com/article/7c6fb42865213f80642c90c3.html
6 报错 ERROR 1820 (HY000): Unknown error 1820
SET PASSWORD = PASSWORD('12344');
win10 不能自启
https://www.cnblogs.com/jyjia/archive/2019/03/07/10490013.html
解决办法 my.ini文件保存为ANSI格式文件 !!!
......@@ -162,7 +168,7 @@ https://www.cnblogs.com/jyjia/archive/2019/03/07/10490013.html
## 2、基础命令
```
```sql
-- dos命令进入数据
1.进入安装mysql的目录
......@@ -399,7 +405,7 @@ mysqldump -uroot -p –default-character-set=latin1 –set-charset=gbk –skip-o
### 3.1、linux命令
```
```sql
指令 ps -ef|grep mysql 得出结果
root 17659 1 0 2011 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid
......@@ -509,7 +515,7 @@ SELECT FROM_UNIXTIME(operation_time/1000,"%Y-%m-%d %H:%i:%s") operationDate FROM
### 3.3、group_concat函数
```
```sql
MySQLgroup_concat函数
https://www.iteye.com/blog/hchmsguo-555543
......@@ -614,7 +620,7 @@ inner join(等值连接) 只返回两个表中联结字段相等的行
举例如下:
--------------------------------------------
表A记录如下:
aID     aNum
aID     aNums
1     a20050111
2     a20050112
3     a20050113
......@@ -699,7 +705,7 @@ compopr参数指定关系比较运算符:"=", "<", ">", "<=", ">=" 或
### 3.4、Case when 的使用方法
```
```java
Case when 的使用方法
https://www.cnblogs.com/yazdao/archive/2009/12/09/1620482.html
......@@ -836,7 +842,7 @@ CONSTRAINT check_salary CHECK
### 4.1、复制表结构、表数据
```
```java
Mysql复制表结构表数据的方法
......@@ -889,6 +895,32 @@ SELECT * INTO 表2 FROM 表1
```
```
sql中文排序
SELECT id,name FROM `T_USER` ORDER BY convert(name using gbk) ASC limit 10,100;
```
```js
https://www.cnblogs.com/kyosusan/p/5198934.html
修改root密码
知道原来的myql数据库的root密码
①: 在终端命令行输入 mysqladmin -u root -p password "新密码" 回车 Enter password: 输入原来的旧密码
②: 登录mysql系统修改 mysql -uroot -p 回车 Enter password: 输入原来的密码
mysql>use mysql;
mysql> update user set password=password("新密码") where user='root'; 密码注意大小写
mysql> flush privileges;
mysql> exit;
```
### 4.2、文档
- [数据库隔离级别]( https://blog.xushufa.cn )
......
# Mysql开启log-bin日志
<br />
> 一 、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 )
......
# oracle笔记
## 1、学习教程
......@@ -1346,6 +1345,18 @@ cmd imp
)
WHERE RN >= 21
oracle查询:分组查询,取出每组中的第一条记录
https://blog.csdn.net/yatou5211/article/details/53764676
SELECT * FROM(
SELECT z.type , z.code ,ROW_NUMBER()
OVER(PARTITION BY z.type ORDER BY z.code) AS code_id
FROM group_info z
)
WHERE code_id =1;
oracle dt = session.query(sql, new Integer[]{rowBeginIndex+rows,rowBeginIndex});
mysql dt = session.query(sql, new Integer[]{rowBeginIndex,rows});
......@@ -1354,7 +1365,6 @@ create sequence HIBERNATE_SEQUENCE start with 1 increment by 1;
进程报错 maximum number of processes (150) exceeded :
sqlplus /nolog
conn /as sysdba;
......
# javaScript笔记
<br />
> js javaScript jquery
`--20190403`
## js
```js
url中文转换 encodeURI(encodeURI(name)) decodeURI(name)
$('#passwordAnwser').textbox('textbox').validatebox('options').required = false;
$('#name').validatebox({required:false});
//$('#passwordAnwser').textbox('setValue','1');
//$('#password').passwordbox('hidePassword');
$.fn.validatebox.defaults.rules.email.message = '请输入有效的<br/>电子邮件地址';
alert回调
$.messager.alert("提示:", msg, "info",function(){
$('#userDeptEmailFrom').focus();
});
一秒刷新
setTimeout(function(){
window.location.reload();
},1000);
// 定时
setTimeout(function(){
init();
layer.close(loading);
},500);
滚动条设置在顶端
$('body').scrollTop( $('body').height() );
```
```js
字符串转函数
var bb = 'function play(){alert("getplay");}';
var ss = bb;
var ex = {getplay:eval("("+ss+")")};
ex.getplay();
JSON.parse(string) 接受一个 JSON 字符串并将其转换成一个 JavaScript 对象
JSON.stringify(obj) 接受一个 JavaScript 对象并将其转换为一个 JSON 字符串
layer.close(index);
layer.closeAll(); //疯狂模式,关闭所有层
layer.closeAll('dialog'); //关闭信息框
layer.closeAll('page'); //关闭所有页面层
layer.closeAll('iframe'); //关闭所有的iframe层
layer.closeAll('loading'); //关闭加载层
layer.closeAll('tips'); //关闭所有的tips层
```
---
```js
function hoverRowSrc(obj){
var img = '<img class="add" data-tool="left" style="float:right;position:relative;top:8px;cursor:pointer;" src="img/add.png">';
if(!$(obj).is(':has(img)') ){
$(obj).append($(img));
}
}
function outRowSrc(obj){
if($(obj).is(':has(img)') ){
setTimeout(function(){
$(obj).find('img').remove();
},50)
}
}
function initCheckAll(){
$('input[name="input1"]').on('ifChecked', function(event){
$('div[name="divSrc"]').each(function(){
$(this).addClass('checked');
});
if($('div[name="divSrc"]').length>0){
$('button[data-tool="right"]').removeAttr("disabled");
}
});
$('input[name="input1"]').on('ifUnchecked', function(event){
$('div[name="divSrc"]').each(function(){
$(this).removeClass('checked');
});
$('button[data-tool="right"]').attr("disabled","");
});
}
function selectSrc(obj){
var st = $(obj).attr('class');
setTimeout(function(){if(st.indexOf('checked')>-1){
$(obj).removeClass('checked');
var flag = true;
$('div[name="divSrc"]').each(function(){
if($(this).hasClass("checked")){
flag = false;
}
})
if(flag){
$('button[data-tool="right"]').attr("disabled","");
}
}else{
$(obj).addClass('checked');
$('button[data-tool="right"]').removeAttr("disabled");
}},20);
}
```
---
```
$("#tt").tabs({
onSelect : function( title ){
<%-- if(title == '短信'){
if(!$("#smsDetail").attr("src")){
$("#smsDetail").attr("src","<%=smsDetailPage%>");
}
} else if(title == '邮件'){
if(!$("#emailDetail").attr("src")){
$("#emailDetail").attr("src","<%=emailDetailPage%>");
}
} else if(title == '即时消息'){
if(!$("#imDetail").attr("src")){
$("#imDetail").attr("src","<%=imDetailPage%>");
}
} else if(title == '微信'){
if(!$("#wxDetail").attr("src")){
$("#wxDetail").attr("src","<%=wxSendDetail%>");
}
} --%>
<%-- if(!$("#smsDetail").attr("src")){
$("#smsDetail").attr("src","<%=smsDetailPage%>");
} --%>
var pp = $('#tt').tabs('getSelected');
var ifr = $($("iframe",pp)[0]);
if(!ifr.attr("src")){
var url = ifr.attr("tarsrc");
ifr.attr("src",url);
}
}
$(document).ready(function() {
$("#fm").form({
onSubmit: function() {
return $(this).form("validate");
},
success: function(result) {
if (result == 'success') {
$.messager.alert('提示', '保存成功!', 'info');
} else {
alertMsg(result);
}
}
});
});
function check()
{
$('#fm').submit();
}
$('#loginNameInput').textbox('textbox').keyup(function(event) {
$('#userName').textbox("setValue", '');
$('#userId').val('0');
var text = $('#loginNameInput').combobox("getText");
val = text || val ;
text = val;
if (event.keyCode == "13") {
$.ajax({
url : 'getUsersByLoginName.do?domainId=1&loginName='+text,
type: 'get',
dataType:'json',
success:function(result){
var data = [];
data = result;
$('#loginNameInput').combobox("loadData", data);
$('#loginNameInput').combobox("showPanel");
$('#loginNameInput').combobox("setText", text);
}
});
}
});
```
## 选择框
```js
//联动单选框
$('#radio21').on('ifChecked', function(event){
$('#radio22').iCheck('check');
$('#radio24').iCheck('uncheck');
});
$('#radio23').on('ifChecked', function(event){
$('#radio22').iCheck('uncheck');
$('#radio24').iCheck('check');
});
//时间选择框
timebox('#datebox');
//demo必填文本框:添加清空文本框信息
$('#tt').textbox().textbox('addClearBtn', 'icon-clear');
//demo文本域:添加事件
$('#textarea').textbox('textbox').on('click', function(){
console.log(1);
});
//复选框事件
$(".checkbox input").each(function(i,el){
$(this).on('ifChecked', function(event){
switch(i)
{
case 0:
console.log('第一个按钮已选中');
break;
case 1:
console.log('第二个按钮已选中');
break;
default:
//console.log(event.type);
}
});
$(this).on('ifUnchecked', function(event){
switch(i)
{
case 0:
console.log('第一个按钮已移除');
break;
case 1:
console.log('第二个按钮已移除');
break;
default:
//console.log(event.type);
}
});
});
//复选框,单选框:添加皮肤
$('input[type="checkbox"],input[type="radio"]').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue',
increaseArea: '20%'
});
//单选框、复选框样式
function checkboxAndRadioStyle() {
$('input[type="checkbox"],input[type="radio"]').iCheck({
checkboxClass: 'icheckbox_minimal-blue',
radioClass: 'iradio_minimal-blue',
increaseArea: '20%'
});
}
```
## radio选中
```js
$("input[name='radioName']").on('ifChecked', function(event){
test();
});
$().ready(function(){
$("input[name='statisticsTimeRadio']").on('click', function(){
var type = $("input[name='statisticsTimeRadio']:checked").attr("value");
if(type==0){
$('#statisticsTime').hide();
}else{
$('#statisticsTime').show();
}
});
});
$("#rdo1").prop("checked","checked");
$(".selector").find("option[text='pxx']").attr("selected",true);
function initCheckBox(){
$('input[type="radio"],input[type="checkbox"]')
.iCheck({
checkboxClass : 'icheckbox_minimal-blue',
radioClass : 'iradio_minimal-blue'
});
$('input[name="checkall"]').on('ifChecked', function(event){
$('input[type="checkbox"]').iCheck('check');
});
$('input[name="checkall"]').on('ifUnchecked', function(event){
$('input[type="checkbox"]').iCheck('uncheck');
});
}
```
---
```js
// radio
$("input[name='display']").on('ifChecked', function(event){
if($('#display2').prop('checked')){
$("#perEdit1").iCheck('unCheck');
$("#perEdit2").iCheck('check');
}
});
// checkbox
$('#field6Box').on('ifChecked', function(event){
$('#field1Box').iCheck('check');
});
$('#field6Box').on('ifUnchecked', function(event){
if(!$('#field7Box').prop('checked')){
$('#field1Box').iCheck('unCheck');
}
});
```
## css配置
```css
//超出部分感叹号表示
h3.app-name {
display: inline-block;
max-width: 160px;
overflow: hidden; /*超出部分隐藏*/
text-overflow: ellipsis; /*超出部分感叹号显示*/
white-space: nowrap; /*一行显示*/
}
//图片圆角
.user-info.user-avatar img {
overflow: hidden;
border-radius: 20px;
width: 20px;
}
//获取浏览器宽度
function getBrowserWidth(){
alert($(window).width());
}
//获取屏幕宽度
function getScreenWidth(){
alert(window.screen.width);
}
//css 悬浮事件
li:hover,.s1:hover{
opacity:0.6; //透明度
filter:alpha(opacity=60); /* IE8 及更早版本 */
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border-radius:20px;//边框圆角
border:1px solid #aaa;
}
ul{
list-style-type:none;
margin:0;
padding:0;
}
li{
display:inline-block;
}
```
## 正则表达式
```js
/*是否带有小数*/
function isDecimal(strValue ) {
var objRegExp= /^\d+\.\d+$/;
return objRegExp.test(strValue);
}
/*校验是否中文名称组成 */
function ischina(str) {
var reg=/^[\u4E00-\u9FA5]{2,4}$/; /*定义验证表达式*/
return reg.test(str); /*进行验证*/
}
/*校验是否全由8位数字组成 */
function isStudentNo(str) {
var reg=/^[0-9]{8}$/; /*定义验证表达式*/
return reg.test(str); /*进行验证*/
}
/*校验电话码格式 */
function isTelCode(str) {
var reg= /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/;
return reg.test(str);
}
var reg = /^(-){1}\d+|\d+$/;
/*校验邮件地址是否合法 */
function IsEmail(str) {
var reg=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
return reg.test(str);
}
特殊字符正则
var pattern = new RegExp("[`~!@#$^&*()=|{}':;',\\[\\].<>/?~!@#¥……&*()——|{}【】‘;:”“'。,、?]") ;
return !pattern.exec(value); //不包含
```
## validatebox
```js
身份证验证
var idCard = function (value) {
//if (value.length == 15) return true;
var number = value.toLowerCase();
var d, sum = 0, v = '10x98765432', w = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], a = '11,12,13,14,15,21,22,23,31,32,33,34,35,36,37,41,42,43,44,45,46,50,51,52,53,54,61,62,63,64,65,71,81,82,91';
var re = number.match(/^(\d{2})\d{4}(((\d{2})(\d{2})(\d{2})(\d{3}))|((\d{4})(\d{2})(\d{2})(\d{3}[x\d])))$/);
if (re == null || a.indexOf(re[1]) < 0) return false;
if (re[2].length == 9) {
number = number.substr(0, 6) + '19' + number.substr(6);
d = ['19' + re[4], re[5], re[6]].join('-');
} else d = [re[9], re[10], re[11]].join('-');
if (!isDateTime.call(d, 'yyyy-MM-dd')) return false;
for (var i = 0; i < 17; i++) sum += number.charAt(i) * w[i];
return (re[2].length == 9 || number.charAt(17) == v.charAt(sum % 11));
}
<div><input id="email" name="email" value="" style="padding:4px;float:left;width: 250px;height:18px;border-radius:4px;border:1px solid #ccc;"
validType="validEmail" class="easyui-validatebox validatebox-text" panelHeight="auto"></div>
validBirthDate
$.extend($.fn.validatebox.defaults.rules, {
validEmail: {
validator: function(value, param) {
var regEx = /^[a-zA-Z0-9_]{1,}@(([a-zA-z0-9]){1,}\.){1,3}(com|cn|net)$/;
var a = regEx.test(value);
return a;
},
message: '请输入正确邮箱格式'
}
});
```
```js
$.extend($.fn.validatebox.defaults.rules, {
phoneValidType: {
validator: function(value, param) {
return /^1[3|4|5|6|7|8|9][0-9]{9}$/.test(value);
},
message: '请输入正确的手机号码'
}
});
$.extend($.fn.validatebox.defaults.rules, {
emailValidType: {
validator: function(value, param) {
if(value.indexOf('*')>0){
return false;
}
//var reg = /^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/;
//return !reg.test(value);
return /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
},
message: '请输入有效的电子邮件地址'
}
});
$.extend($.fn.validatebox.defaults.rules, {
telephoneValidType: {
validator: function (value, param) {
return /^((0(((\d{2,3})-(\d){7,8})|(\d{2,3}(\d){7,8}))))$/.test(value);
},
message: '联系电话不正确'
}
});
```
\ No newline at end of file
## nodejs
* [1、说明](#introducer)
* [2、安装](#install)
* [3、常用命令](#usually)
* [4、vue](#vue)
# npm笔记
## 安装
<h2 id="introducer"></h2>
### 1、说明
[nodejs官方下载]( https://nodejs.org/en/download/ )
[安装参考]( https://blog.csdn.net/qq_44894359/article/details/89283325 )
[教程]( https://www.runoob.com/nodejs/nodejs-tutorial.html )
```sh
nodejs官方 https://nodejs.org/en/download/
参考 https://blog.csdn.net/qq_44894359/article/details/89283325
教程 https://www.runoob.com/nodejs/nodejs-tutorial.html
```
<h2 id="install"></h2>
### 2、安装
```
1、环境变量
```java
NODE_HOME
D:\ProgramFiles\nodejs
......@@ -29,8 +23,12 @@ PATH
node --version
npm -v
```
2、设置全局安装及缓存目录
```js
npm config set prefix "D:\\ProgramFiles\\nodejs\node_global"
npm config set cache "D:\\ProgramFiles\\nodejs\node_cache"
......@@ -48,11 +46,20 @@ npm root -g
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
```
```js
安装模块
npm install -g vue
npm install express -g
简写
npm i vue // i表示install
全局安装
npm i vue -g // g表示global
使用淘宝定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm
npm install -g cnpm --registry=https://registry.npm.taobao.org
......@@ -60,6 +67,7 @@ npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install --global vue-cli
-------------------------------
npm命令失效
https://blog.csdn.net/qq_39085705/article/details/81134453
......@@ -72,6 +80,7 @@ https://blog.csdn.net/qq_39085705/article/details/81134453
3在应用程序选项卡最下面点新任务输入explorer.exe就是重启了explorer.exe.
-------------------------------
配置全局变量变量后每次重启电脑node命令失效
可将 默认目录下文件 C:\Users\x\.npmrc 复制到 安装目录 D:\ProgramFiles\nodejs\node_modules\npm\
重启电脑即可
......@@ -80,36 +89,98 @@ https://blog.csdn.net/qq_39085705/article/details/81134453
```
## 发包
```js
在NPM上发包
https://blog.csdn.net/weixin_43275638/article/details/84587061
https://blog.csdn.net/qq_39115469/article/details/122010538
<h2 id="usually"></h2>
### 3、常用命令
[npm使用介绍]( https://www.runoob.com/nodejs/nodejs-npm.html )
[Webpack 入门教程]( https://www.runoob.com/w3cnote/webpack-tutorial.html )
1注册npm
https://www.npmjs.com/~xushufa
2设置镜像源
确保npm的源是本身的源 https://registry.npmjs.org
npm config set registry https://registry.npmjs.org
通过 npm config get registry 进行查询
```
```js
3终端登录账号
npm adduser
<h2 id="vue"></h2>
npm login
### 4、vue
<h2 id="document"></h2>
must use TLS 1.2 or higher
https://blog.csdn.net/Ricky__H/article/details/120673036
npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/ npm notice Beginning October 4, 2021, all connections to the npm registry - including for package installation - must use TLS 1.2 or higher. You are currently using plaintext http to connect. Please visit the GitHub blog for more information: https://github.blog/2021-08-23-npm-registry-deprecating-tls-1-0-tls-1-1/ npm ERR! code E426
#### 4.1、vue教程
从2021年10月4日开始所有与npm网站和npm注册表的连接包括软件包安装必须使用TLS 1.2或更高版本
[vue官网]( https://cn.vuejs.org/ )
将npm镜像地址设为https的地址
npm config set registry https://registry.npmjs.org
[教程]( https://www.runoob.com/vue2/vue-tutorial.html )
运行以下命令支持TLS 1.2
npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz
<h2 id="project"></h2>
#### 4.2、vue项目
4发布
npm init
npm publish
package.json文件中的 name 配置是npm依赖包名不能和npm平台下的依赖包名重名否则发布失败
每次更新 package.json 里面的version的版本号
在重新运行 npm publish 发布就可以
npm i xushufa-shu
```
```c
cdn
https://www.jsdelivr.com/
https://cdn.jsdelivr.net/npm/xushufa-shu/yan/duo1-1000/0001大.jpg
https://cdn.jsdelivr.net/npm/xushufa-imgs/imgs/mingyue/2020/IMG_20210101_141310.jpg
https://cdn.jsdelivr.net/npm/xushufa-imgs@1.0.0/imgs/mingyue/2020/IMG_20210101_141310.jpg
配置淘宝镜像
npm config get registry
npm config set registry http://registry.npm.taobao.org/
删除包
npm unpublish 包名@版本号 //指定删除包
npm unpublish 包名 --force //删除整个包
查看远程包
查看最新版本:
npm view xushufa version
查看所有的版本:
npm view xushufa versions
或者:
npm info xushufa
```
[npm使用介绍]( https://www.runoob.com/nodejs/nodejs-npm.html )<br />
[Webpack 入门教程]( https://www.runoob.com/w3cnote/webpack-tutorial.html )<br />
[vue官网]( https://cn.vuejs.org/ ) &ensp; [教程]( https://www.runoob.com/vue2/vue-tutorial.html )
| git项目 | 地址 | demo |
| -------- | ----- | ---- |
| git@github.com:lin-xin/vue-manage-system.git | [地址]( https://github.com/lin-xin/vue-manage-system ) | [演示]( https://lin-xin.gitee.io/example/work/#/dashboard ) |
| git@github.com:wdlhao/vue2-element-touzi-admin.git | [地址]( https://github.com/wdlhao/vue2-element-touzi-admin ) | [演示]( http://www.jiouai.com/permission/index/index ) |
---
# window安装RabbitMQ
<br />
> [RabbitMQ_3.8.2--ErLang_otp_win64_22.2下载]( https://download.csdn.net/download/xu180/12305633 )
`--20210515`
## 1、安装 ErLang
> 安装 ErLang_otp_win64_22.2.exe
- 设置环境变量,新建 `ERLANG_HOME`
- 修改环境变量path,增加`Erlang`变量至`path``%ERLANG_HOME%\bin`;
- 打开`cmd`命令框,输入 `erl -version` 验证
## 2、安装 RabbitMQ
> 安装 rabbitmq-server-3.8.2.exe
- 设置环境变量,新建 `RABBITMQ_SERVER`
- 修改环境变量`path`,增加`rabbitmq`变量至`path``%RABBITMQ_SERVER%\sbin`;
- 打开cmd命令框,切换至`...\sbin`目录下,输入 `rabbitmqctl status` 验证
- 创建`RabbitMQ`服务并启动 `rabbitmq-plugins.bat enable rabbitmq_management`
- 登陆 http://127.0.0.1:15672/ 账号密码 `guest,guest`
--------------
```sh
D:\>cd D:\ProgramFiles\rabbitmq-server-3.8.2\rabbitmq_server-3.8.2\sbin
D:\ProgramFiles\rabbitmq-server-3.8.2\rabbitmq_server-3.8.2\sbin>rabbitmqctl status
创建RabbitMQ服务并启动
D:\ProgramFiles\rabbitmq-server-3.8.2\rabbitmq_server-3.8.2\sbin>rabbitmq-plugins.bat enable rabbitmq_management
停止:net stop RabbitMQ
启动:net start RabbitMQ
启动命令
D:\ProgramFiles\rabbitmq-server-3.8.2\rabbitmq_server-3.8.2\sbin>rabbitmq-server.bat
```
---
```
参考
https://blog.csdn.net/lihua5419/article/details/93006834
https://blog.csdn.net/zhm3023/article/details/82217222
RabbitMQ教程 https://blog.csdn.net/hellozpc/article/details/81436980
erlang官网 https://www.erlang.org/downloads
rabbitmq官网 https://www.rabbitmq.com/download.html
```
# window安装consul
<br />
- Consul 是 HashiCorp 公司推出的开源工具,用于实现分布式系统的服务发现与配置。与其它分布式服务注册与发现的方案,Consul 的方案更“一站式”,内置了服务注册与发现框 架、分布一致性协议实现、健康检查、Key/Value 存储、多数据中心方案,不再需要依赖其它工具(比如 ZooKeeper 等)。使用起来也较为简单。
- Consul 使用 Go 语言编写,因此具有天然可移植性(支持Linux、windows和Mac OS X);安装包仅包含一个可执行文件,方便部署,与 Docker 等轻量级容器可无缝配合。
- 在分布式服务发现的软件中,Euerka 和 Consul 使用最为广泛。
`--20210514`
---
- 1、启动
cd 到对应的目录下,使用 `cmd` 启动 `Consul`
```sh
cd D:\ProgramFiles\consul_1.7.2_windows_amd64
#cmd启动:
consul agent -dev # -dev表示开发模式运行,另外还有-server表示服务模式运行
```
为了方便期间,可以在同级目录下创建一个 run.bat 脚本来启动,脚本内容如下:
```sh
consul agent -dev
pause
```
- 2、验证
启动成功之后访问:http://localhost:8500 ,可以看到 Consul 的管理界面
```
参考
http://www.ityouknow.com/springcloud/2018/07/20/spring-cloud-consul.html
```
\ No newline at end of file
# 二进制数负数
将十进制数转化为二进制数,再将源码转换为反码。
在反码的个位上加1就是补码, 而这个补码就是十进制数的负数了。
`0000 0101`在十进制中表示`5`,将这个二进制数(源码)转换为反码就是 `1111 1010`
而它的补码就是在反码的个位上加1为`1111 1011` 这个补码的 十进制数为`-5`
\ No newline at end of file
# eclipse
## 1、eclipse 快捷键
```
sout 打印
Shift+Enter 另起一行
Ctrl+h 全局关键词搜索
Ctrl+f 当前文件查找、替换
Ctrl+shift+r 全局文件查找
Ctrl+shift+f 整理代码格式
Ctrl+shift+x 大小写
Ctrl+shift+o 整理导入包
alt+insert 快速生成get和set方法、构造方法
alt+shift+r 批量重命名
alt+shift+m 提取本地变量及方法
Ctrl+Alt+↑ 往上或下复制当前内容
Alt+↓ 将当前行的内容往上或下移动
Alt+/ 导入一个包
Ctrl+m 编辑器窗口最大化
ctrl+o 快速outline,查找方法
ctrl+e 快速转换编辑器
syso+Alt+/ 输出
1. ctrl+shift+r:打开资源
2. ctrl+o:快速outline
3. ctrl+e:快速转换编辑器
4. ctrl+2,L:为本地变量赋值
5. alt+shift+r:重命名
6. alt+shift+l以及alt+shift+m:提取本地变量及方法
7. shift+enter及ctrl+shift+enter
8. Alt+方向键
9. ctrl+m
10. ctrl+.及ctrl+1:下一个错误及快速修改
```
## 2、版本号
| 版本号 | 代号 | 代号名 | 发布日期 |
| ------------- | --------- | ----------------- | -------- |
| Eclipse 3.1 | IO | 木卫一,伊奥 | 2005 |
| Eclipse 3.2 | Callisto| 木卫四,卡里斯托 | 2006 |
| Eclipse 3.3 | Europa | 木卫二,欧罗巴 | 2007 |
| Eclipse 3.4 | Ganymede| 木卫三,盖尼米得 | 2008 |
| Eclipse 3.5 | Galileo | 伽利略 | 2009 |
| Eclipse 3.6 | Helios | 太阳神 | 2010 |
| Eclipse 3.7 | Indigo | 靛蓝 | 2011 |
| Eclipse 4.2 | Juno | 朱诺 | 2012 |
| Eclipse 4.3 | Kepler | 开普勒 | 2013 |
| Eclipse 4.4 | Luna | 月神 | 2014 |
| Eclipse 4.5 | Mars | 火星 | 2015 |
| Eclipse 4.6 | Neon | 霓虹灯 | 2016 |
| Eclipse 4.7 | Oxygen | 氧气 | 2017 |
| Eclipse 4.8 | Photon | 光子 | 2018 |
| Eclipse 3.1 | IO | 木卫一,伊奥 | 2005 |
| Eclipse 3.2 | Callisto| 木卫四,卡里斯托 | 2006 |
| Eclipse 3.3 | Europa | 木卫二,欧罗巴 | 2007 |
| Eclipse 3.4 | Ganymede| 木卫三,盖尼米得 | 2008 |
| Eclipse 3.5 | Galileo | 伽利略 | 2009 |
| Eclipse 3.6 | Helios | 太阳神 | 2010 |
| Eclipse 3.7 | Indigo | 靛蓝 | 2011 |
| Eclipse 4.2 | Juno | 朱诺 | 2012 |
| Eclipse 4.3 | Kepler | 开普勒 | 2013 |
| Eclipse 4.4 | Luna | 月神 | 2014 |
| Eclipse 4.5 | Mars | 火星 | 2015 |
| Eclipse 4.6 | Neon | 霓虹灯 | 2016 |
| Eclipse 4.7 | Oxygen | 氧气 | 2017 |
| Eclipse 4.8 | Photon | 光子 | 2018 |
## 3、下载地址
### [官网下载]( http://www.eclipse.org/downloads/packages )
| 版本号 | 代号 | 日期 | 下载地址 |
| ----------- | ------------------------- | ------- | ----------- |
| Eclipse 3.1 | IO[木卫一,伊奥] | 2005 | http://archive.eclipse.org/eclipse/downloads/drops/R-3.1-200506271435/ |
| Eclipse 3.2 | Callisto[木卫四,卡里斯托] | 2006 | http://archive.eclipse.org/eclipse/downloads/drops/R-3.2-200606291905/ |
| Eclipse 3.3 | Eruopa[木卫二,欧罗巴] | 2007 | http://www.eclipse.org/downloads/packages/release/europa/winter |
| Eclipse 3.4 | Ganymede[木卫三,盖尼米德] | 2008 | http://www.eclipse.org/downloads/packages/release/ganymede/r |
| Eclipse 3.5 | Galileo[伽利略] | 2009 | http://www.eclipse.org/downloads/packages/release/galileo/r |
| Eclipse 3.6 | Helios[太阳神] | 2010 | http://www.eclipse.org/downloads/packages/release/helios/r |
| Eclipse 3.7 | Indigo[靛青] | 2011 | http://www.eclipse.org/downloads/packages/release/indigo/r |
| Eclipse 4.2 | Juno[朱诺] | 2012 | http://www.eclipse.org/downloads/packages/release/juno/r |
| Eclipse 4.3 | Kepler[开普勒] | 2013 | http://www.eclipse.org/downloads/packages/release/kepler/r |
| Eclipse 4.4 | Luna[月神] | 2014 | http://www.eclipse.org/downloads/packages/release/kepler/r |
| Eclipse 4.5 | Mars[火星] | 2015 | http://www.eclipse.org/downloads/packages/release/mars/r |
| Eclipse 4.6 | Neon[霓虹灯] | 2016 | http://www.eclipse.org/downloads/packages/release/neon/r |
| Eclipse 4.7 | Oxygen[氧气] | 2017 | http://www.eclipse.org/downloads/packages/release/oxygen/r |
| Eclipse 4.8 | Photon[光子] | 2018 | http://www.eclipse.org/downloads/packages/release/photon/r |
---
### 国内镜像下载
| 学校 | 下载地址 |
| ------------ | ------------- |
| [北京理工大学]( http://mirror.bit.edu.cn ) | http://mirror.bit.edu.cn/eclipse/technology/epp/downloads/release/ |
| [华中科技大学]( http://mirrors.hust.edu.cn/ ) | http://mirrors.hust.edu.cn/eclipse/technology/epp/downloads/release/ |
| [大连东软信息学院]( http://mirrors.neusoft.edu.cn/) | http://mirrors.neusoft.edu.cn/eclipse/technology/epp/downloads/release/ |
| [清华大学]( https://mirrors.tuna.tsinghua.edu.cn/ ) | https://mirrors.tuna.tsinghua.edu.cn/eclipse/technology/epp/downloads/release/ |
| [中科大]( http://mirrors.ustc.edu.cn/ ) | http://mirrors.ustc.edu.cn/eclipse/technology/epp/downloads/release/ |
## 4、类型说明
- 1、Eclipse IDE for Java Developers 该版本适合Java开发者,集成CVS,Git,XML编辑器,Mylyn, Maven integration和WindowBuilder等插件。
- 2、Eclipse IDE for Java EE Developers 该版本集成了Java ee开发常用插件,方便动态web网站开发。适合Java web开发者使用。集成了XML编辑器、数据库查看工具,提供jsp可视化编辑器。
- 3、Eclipse IDE for C/C++ Developers 该版本适合C/C++开发者,集成了良好的C/C++语言支持。
- 4、Eclipse for PHP Developers该版本适合PHP开发者,集成了良好的PHP语言支持,Git客户端, Mylyn和JavaScript脚本编辑器, HTML, CSS和XML。
- 5、Eclipse IDE for Eclipse Committers;该版本是eclipse最基础的版本,适合Java se个人开发者、或希望根据自己需求配置插件的开发者使用。
- 6、Eclipse IDE for Java and DSL Developers 对于Java和DSL开发者必不可少的工具,包括Java和XTend ID。
- 那么它们之间到底有什么区别:最大的区别就是标题和解压包大小不同。下载解压后就会发现,不同的Eclipse版本之间就是plugins/features目录下的文件不同而已。 一个标准的Eclipse的,给它添加一些JEE开发需要的plugins,比如WTP,WST等等,它摇身一变就变成”Eclipse IDE for Java EE“了。其他的也一样。如果是一个熟练的Eclipse使用者,选择哪一个都可以,需要的plugin都可以从Eclipse官网获取。
作为一名初学者,或者非企业环境开发者/自学者。推荐1,即JavaDeveloper。或者(因为现在纯单机Java应用较少,都是联网工作的)即推荐2,即Java EE。
此差异已折叠。
此差异已折叠。
# git笔记
<br />
> [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 )
......@@ -241,6 +242,7 @@ git tag
// 新建标签
git tag t20220330
git tag -a v1.1 -m '版本介绍'
// 推送标签
git push origin t20220330
......
# gitbook部署博客
## 基础命令
```sh
安装GitBook
npm install gitbook-cli -g
验证
gitbook -V
安装依赖
gitbook install
运行
gitbook serve
打包
gitbook build
卸载
npm uninstall -g gitbook
```
```sh
版本
$ gitbook -V
CLI version: 2.3.2
GitBook version: 3.2.3
$ node -v
v14.17.5
$ npm -v
6.14.14
```
```
配置说明
https://www.gitbook.com
https://www.cnblogs.com/zhangycun/p/15099747.html
参考案例
https://www.cnblogs.com/fenggedainifei/p/15500749.html
https://blog.windrunner.me/tool/gitbook-tutorial.html
https://suerimn-1.gitbook.io/suerimn-s-blog/css3/yuan-su-ju-zhong
```
## 插件配置
```json
插件配置
book.json
{
"title": "无为徐生",
"language": "zh-hans",
"links": {
"sidebar": {
"github": "https://github.com/scott180/gitbook-blog",
"xushufa": "https://xushufa.cn"
}
},
"plugins": ["-sharing", "sharing-plus", "lightbox", "page-toc-button","expandable-chapters"],
"pluginsConfig": {
"sharing": {
"all": []
},
"page-toc-button": {
"maxTocDepth": 2,
"minTocSize": 2
}
}
}
插件说明:
sharing :右上角分享
lightbox :点击打开图片
page-toc-button :悬浮目录
expandable-chapters :左侧目录折叠
```
```json
主题配置
https://www.npmjs.com/search?q=gitbook-theme
book.json
{
"title": "书法练习",
"language": "zh-hans",
"links": {
"sidebar": {
"github": "https://github.com/scott180/calligraphy",
"xushufa": "https://xushufa.cn"
}
},
"plugins": ["theme-beauty"],
"pluginsConfig": {
"theme-beauty":{
"search-placeholder":"输入关键字搜索",
"logo":"./logo.jpg",
"favicon": "./favicon.ico"
}
}
}
```
```
开启github pages
1、gitbook build生成_book目录,将_book改成docs
2、位置:Setting - GitHub Pages - Save
选择目录docs
发布成功https://scott180.github.io/gitbook-calligraphy/
```
## 常见错误
```java
gitbook -V 报错
"cb.apply is not a function"
Installing GitBook 3.2.3
(node:6632) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 error listeners added to [TLSSocket]. Use emitter.setMaxListeners() to increase limit
参考 https://www.jianshu.com/p/6221330b36ba
解决方法
E:\ProgramFiles\node-v12.22.9-win-x64\node_global\node_modules\gitbook-cli\node_modules\npm\node_modules\graceful-fs\polyfills.js
将以下三行注释或删除
// fs.stat = statFix(fs.stat)
// fs.fstat = statFix(fs.fstat)
// fs.lstat = statFix(fs.lstat)
```
---
```
gitbook serve 报错
Error: ENOENT: no such file or directory, stat 'E:\Project\github\gitbook-blog\_book\gitbook\gitbook-plugin-fontsettings\fontsettings.js'
Error: ENOENT: no such file or directory, stat 'D:\projects\github\test\gitbook\_book\gitbook\gitbook-plugin-livereload\plugin.js' no such file or directory, stat 'D:\projects\github\gitbook\_book\gitbook\gitbook-plugin-livereload\plugin.js'
参考 https://blog.csdn.net/yinlongfei_love/article/details/84636035
解决方法
C:\Users\Administrator\.gitbook\versions\3.2.3\lib\output\website\copyPluginAssets.js 中的112行内容
将confirm的true 需要修改为false
```
# gitlab、github、gitee布署mkdocs主题仓库
<br />
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
## 1、概述
......
# gitlab、github绑定自定义域名
<br />
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
## github绑定自定义域名
......
# git平台docsify布署markdown文件
<br />
`网址` &ensp; [xushufa]( https://xushufa.cn ) &ensp; [blog]( https://vuepress-blog.xushufa.cn )
## 本地安装
......
# linux笔记-xyq
<br />
- [x] 2017.08.22--now
`xyq` `linux` `note`
......
# linux笔记-xyq
# shell语法
<br />
> [blog]( https://blog.xushufa.cn ) &ensp; [MyNotes]( https://gitee.com/xy180/MyNotes ) &ensp; [typora]( https://typora.io/#windows ) &ensp; [作业部落]( https://www.zybuluo.com/mdeditor ) &ensp; [菜鸟教程]( https://www.runoob.com )
<br />
* [1、常用命令](#command)
* [2、shell编程](#shell)
* [2.1、shell概述及优势](#shellIntroduce)
* [2.2、shell创建、执行](#shellExecute)
* [2.3、shell 变量、引号、数组、传递参数](#shellParams)
* [2.3、shell 变量](#shellParams)
* [2.4、shell 运算符](#shellOperator)
* [2.5、shell 常用命令](#shellCommonCommand)
* [2.6、shell 流程控制](#shellFlow)
......@@ -14,44 +20,121 @@
* [3、vi命令详解](#viCommand)
> [linux]( 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>
## 1、常用命令
<h3 id="commonCommand"></h3>
[常用linux命令]( https://gitee.com/xy180/MyNotes/blob/master/linuxNote-x.md )
说明 | 命令
----------------- | -----------------------------------------------------------------
进入目录 | cd dir1
创建目录 | mkdir dir1
创建多级目录 | mkdir -p d1/d2/d3
查看当前目录 | pwd
复制文件 | cp srcname targetname
复制目录 | cp -r dir1/ dir2/
修改名称(移动文件) | mv readme.txt readme.doc
跨服务器复制 | scp /data/ROOT.tar.gz root@192.168.239.35:/opt/saiwen/db_backup
删除普通文件a.txt | rm a.txt (-f:表示强制)
目录a删除 | rm -rf a (-f:表示强制; -r:表示目录)
建立新文件 | touch test.txt
清空文件 | cat /dev/null >json.log
`-----------------` | `--------------------------------------------------------------`
查看磁盘空间 | df -h
查看文件大小 | du -h filepath
显示文件或目录类型 | file test
查询程序的位置 | which test
统计文件信息 | wc testfile
3 92 598 testfile | testfile文件的行数为3、单词数92、字节数598
`-----------------` | `--------------------------------------------------------------`
压缩tar | tar -zcvf /home/love.tar.gz /home/yx/love
解压tar | tar -zxvf /home/love.tar.gz
压缩zip | zip test.zip test
解压zip | unzip test.zip
压缩gz | gzip -c test.log > /root/test.gz
解压gz | gunzip -c debug.2020-07-02.log.gz > ./0702.log
`-----------------` | `--------------------------------------------------------------`
模糊查找当前目录文件 | find *txt
从根目录查找文件 | find / -name test
查找文件 | find /home -name 'test.log' -type f -print
查找目录 | find / -name 'tech' -type d -print
查找当前目录及子目录文件 | find . -name "*root*" -maxdepth 1 (maxdepth指层数)
查找大文件 | find / -type f -size +400M | xargs ls -hlrt
`-----------------` | `--------------------------------------------------------------`
从旧到新并显示大小 | ls -hlrt (ls -lrt 从旧到新)
从新到旧并显示大小 | ls -hlt (ls -lt 从新到旧 )
按大小升序 | ls -hSlr
按大小降序 | ls -hSl
模糊查找文件 | ls name* (ls /etc/rc.d/init.d/my*)
显示当前目录文件 | ls
`-----------------` | `--------------------------------------------------------------`
查看linux版本 | cat /proc/version lsb_release -a
查看linux内核版本 | uname -a
查看centos版本 | cat /etc/redhat-release
查看java版本 | java -version
查看进程 | ps
查看tomcat进程 | ps -ef | grep tomcat
`-----------------` | `--------------------------------------------------------------`
上传 | sz filename (安装上传下载 yum install lrzsz)
下载 | sz
显示10行历史记录 | history 10
查看ip | ifconfig
清楚屏幕 | clear
查看时间 | date
时间格式化 | date "+%Y-%m-%d %H:%M:%S"
查看指定年月日历 | cal 3 2013
建立链接 | ln -fs /opt/tech/mysql/bin/mysql /usr/local/bin/mysql
删除链接 | rm -rf name
查看所有别名 | alias
添加别名 | alias test="tar -zcvf "
删除别名 | unalias test
显示所有分区的信息 | fdisk -l
帮助 | help
查看命令手册 | man ls
树状结构展示目录 | tree (安装tree命令 yum install tree)
输出重定向(保存文件)| ls > dir.txt
追加文件 | ls >> dir.txt
`-----------------` | `--------------------------------------------------------------`
关机 | halt
重启 | reboot
关机重启 | shutdown -r
关机不重启 | shutdown -h
立刻关机 | shutdown now
********************************************************
<h2 id="shell"></h2>
## 2、Shell编程
<h3 id="shellIntroduce"></h3>
### 2.1、shell概述及优势
```java
==============================================================
Shell是一个命令语言解释器它拥有自己内建的Shell命令集Shell也能被系统中其他应用程序调用
当普通用户成功登录后系统将执行一个称为Shell的程序正是Shell进程提供了命令行提示符作为默认值对普通用户用“$”作提示符对超级用户(root)“#”作提示符
Linux中的Shell有多种类型其中最常见的是Bourne Shell (sh)C Shell (csh)和Korn Shell (ksh)三种Shell各有优缺点Bourne Shell是Unix最初始的Shell并且在每种Unix上都可以使用Bourne Shell在Shell编程方面相当优秀但在处理与用户的交互方面做得不如其他几种ShellBash(Bourne Again Shell)是Bourne Shell的扩展与Bourne Shell完全向下兼容并且增加了许多特性它还包含了很多C Shell和Korn Shell中的优点有灵活和强大的编程接口同时又有很友好的用户界面
C Shell是一种比Bourne Shell更适于编程的Shell它的语法与C语言很相似Linux为喜欢使用C Shell的人员提供了TcshTcsh是C Shell的一个扩展版本Tcsh包括命令行编辑可编程单词补全拼写矫正历史命令替换作业控制和类似C语言的语法它提供比Bourne Shell更多的提示符参数
Korn Shell集合了C Shell和Bourne Shell的优点并且和Bourne Shell完全兼容Linux系统提供了pdksh(ksh的扩展)它支持任务控制可以在命令行上挂起后台执行唤醒或终止程序
```
```
Bash是大多数Linux系统(包括红旗Linux系统)的默认Shell。Bash有以下的优点:
(1) 补全命令。当你在Bash命令提示符下输入命令或程序名时,你不必输全命令或程序名,按【Tab】键,Bash将自动补全命令或程序名。
(2) 通配符。在Bash下可以使用通配符“*”和“?”。“*”可以替代多个字符,而“?”则替代一个字符。
(3) 历史命令。Bash能自动跟踪用户每次输入的命令,并把输入的命令保存在历史列表缓冲区。缓冲区的大小由HISTSIZE变量控制。当用户每次登录后,home目录下的“.bash_history”文件将初始化历史列表缓冲区。也能通过history和fc命令执行、编辑历史命令。
(4) 别名。在Bash下,可用alias和unalias命令给命令或可执行程序起别名和清除别名,这样就可以用自己习惯的方式输入命令。
```
查看所有别名 alias
添加别名 alias test="tar -zcvf "
删除别名 unalias test
```
(5)输入/输出重定向。输入重定向用于改变命令的输入,输出重定向用于改变命令的输出。输出重定向更为常用,它经常用于将命令的结果输入到文件中,而不是屏幕上。输入重定向的命令是“<”,输出重定向的命令是“>”
```
① 输入重定向:
[root@redflag /root]#wc</etc/passwd
20 23 726
......@@ -59,12 +142,12 @@
[root@redflag /root]#ls>dir.out
上面命令将ls命令的输出保存为文件dir.out。
[root@redflag /root]#ls>>dir1.out “>>”表示要将一条命令的输出结果追加到文件dir1.out的后面,该文件的原有内容不被破坏,如果使用“>”,则文件原有内容被覆盖。
```
(6) 管道。管道用于将一系列的命令连接起来,也就是把前面命令的输出作为后面命令的输入。管道的命令是“|”。
```
(6) 管道。管道用于将一系列的命令连接起来,也就是把前面命令的输出作为后面命令的输入。管道的命令是“|”。
root@redflag /root]# cat dir.out|grep "test "|wc –l
管道将cat命令(列出一个文件的内容)的输出送给grep命令,grep命令在输入里查找单词test,grep的输出则是所有包含单词test的行,这个输出又被送给wc命令,wc命令统计出输入中的行数。
```
(7) 提示符。
(8) 作业控制。
......@@ -76,19 +159,19 @@
```
<h3 id="shellExecute"></h3>
### 2.2、shell创建、执行
​```java
==============================================================
```
Shell 脚本(shell script),是一种为 shell 编写的脚本程序。业界所说的 shell 通常都是指 shell 脚本。
一、创建 Shell 脚本
打开文本编辑器(可以使用 vi/vim 命令来创建文件),新建一个文件 test.sh,扩展名为 sh(sh代表shell),扩展名并不影响脚本执行,见名知意就好,如果你用 php 写 shell 脚本,扩展名就用 php 好了。
输入一些代码,一般是这样:
```
#!/bin/bash
echo "Hello World !"
```
#! 是一个约定的标记,它告诉系统这个脚本需要什么解释器来执行,即使用哪一种 Shell。
① 如果Shell脚本的第一个非空白字符不是“#”,则它会使用Bourne Shell。
② 如果Shell脚本的第一个非空白字符是“#”,但不是以“#!”开头时,则它会使用C Shell。
......@@ -96,32 +179,33 @@
echo 命令用于向窗口输出文本。
二、运行 Shell 脚本有两种方法:
​ 1、作为可执行程序
​ 将上面的代码保存为 test.sh,并 cd 到相应目录:
```
​ chmod +x ./test.sh #使脚本具有执行权限
​ ./test.sh #执行脚本
```
​ 注意,一定要写成 ./test.sh,而不是 test.sh,运行其它二进制的程序也一样,直接写 test.sh,linux 系统会去 PATH 里寻找有没有叫 test.sh 的,而只有 /bin, /sbin, /usr/bin,/usr/sbin 等在 PATH 里,你的当前目录通常不在 PATH 里,所以写成 test.sh 是会找不到命令的,要用 ./test.sh 告诉系统说,就在当前目录找。
​ 2、作为解释器参数
​ 这种运行方式是,直接运行解释器,其参数就是 shell 脚本的文件名,如:
```
​ /bin/sh test.sh
​ /bin/php test.php
```
​ 这种方式运行的脚本,不需要在第一行指定解释器信息,写了也没用。
==============================================================
```
<h3 id="shellParams"></h3>
### 2.3、shell 变量、引号、数组、传递参数
​```java
==============================================================
### 2.3、shell 变量
```
shell 变量、引号、数组、传递参数
http://www.runoob.com/linux/linux-shell-variable.html 转自菜鸟教程
test="测试引号"
......@@ -212,14 +296,13 @@ $ ./test.sh 1 2 3
2
3
==============================================================
```
<h3 id="shellOperator"></h3>
### 2.4、shell 运算符
```java
==============================================================
```
原生bash不支持简单的数学运算,但是可以通过其他命令来实现,例如 awk 和 expr,expr 最常用。
expr 是一款表达式计算工具,使用它能完成表达式的求值操作。
......@@ -241,7 +324,9 @@ LT 就是 LESS THAN小于
GE 就是 GREATER THAN OR EQUAL 大于等于
LE 就是 LESS THAN OR EQUAL 小于等于
```
#### 2.4.1、算术运算符
```
`算术运算符`
下表列出了常用的算术运算符,假定变量 a 为 10,变量 b 为 20:
......@@ -303,6 +388,7 @@ if...then...fi 是条件语句,后续将会讲解。
```
#### 2.4.2、关系运算符
```
`关系运算符`
关系运算符只支持数字,不支持字符串,除非字符串的值是数字。
......@@ -591,6 +677,7 @@ fi
```
### 2.5、shell 常用命令 <h3 id="shellCommonCommand"></h3>
#### 2.5.1、shell echo命令
```java
......@@ -845,7 +932,9 @@ fi
```
<h3 id="shellFlow"></h3>
### 2.6、shell 流程控制
#### 2.6.1、if
```java
......@@ -916,7 +1005,9 @@ fi
输出结果:
两个数字相等!
```
#### 2.6.2、for
```
for 循环
与其他编程语言类似,Shell支持for循环。
......@@ -1020,6 +1111,7 @@ done
```
#### 2.6.5、case
```
`case esac`
Shell case语句为多选择语句。可以用case语句匹配一个值与一个模式,如果匹配成功,执行相匹配的命令。case语句格式如下:
......@@ -1114,6 +1206,7 @@ case的语法和C family语言差别很大,它需要一个esac(就是case反
```
<h3 id="shellFunction"></h3>
### 2.7、shell 函数
```java
......@@ -1217,6 +1310,7 @@ $? 显示最后命令的退出状态。0表示没有错误,其他任何值表
```
<h3 id="shellIO"></h3>
### 2.8、shell 输入、输出重定向
```java
......@@ -1372,6 +1466,8 @@ xxx 2>&1 > list
==============================================================
```
<h3 id="shellFileContain"></h3>
### 2.9、shell 文件包含
```java
......@@ -1412,6 +1508,7 @@ $ ./test2.sh
```
<h2 id="viCommand"></h2>
## 3、vi命令详解
```java
......
......@@ -169,6 +169,21 @@ Deployment request failed for 5a3201f6016e6e078f0f3c46eb4132a3d9014bdd due to in
```
---
> 主要命令
```sh
# 启动
npm run docs:dev
# 打包
npm run docs:build
# 部署
npm run deploy
```
### 1.3 备案号
......@@ -199,23 +214,91 @@ Copyright © 2022 · xushufa.cn · 无为徐生 <br/> [浙ICP备2022008289号-1
```
---
> 主要命令
```sh
# 启动
npm run docs:dev
### 1.4 阅读量
# 打包
npm run docs:build
参考 [Vuepress-阅读量统计]( https://heshiyu1996.github.io/blog/tool/vuepress-stat/ ) &ensp; [valine]( https://valine.js.org/ ) &ensp; [leancloud]( https://console.leancloud.cn/apps )
# 部署
npm run deploy
项目 [vuepress-calligraphy]( https://github.com/scott180/vuepress-calligraphy )
```
yarn add leancloud-storage -S
yarn add valine -S
```
创建`Valine.vue` 及 继承默认主题,并在`Page.vue`下引入 `<Valine />`。[commit]( https://github.com/scott180/vuepress-calligraphy/commit/18f3aefd2928e5e445a200842e61f9fa888575c5 )
### 1.5 时间格式化
[plugin-last-updated]( https://vuepress.vuejs.org/zh/plugin/official/plugin-last-updated.html ) &ensp; [momentjs]( http://momentjs.cn/ )
```
npm install moment --save
```
```js
plugins: [
[
'@vuepress/last-updated',
{
transformer: (timestamp, lang) => {
// 不要忘了安装 moment
const moment = require('moment')
moment.locale(lang)
return moment(timestamp).format('YYYY-MM-DD HH:mm:ss');
}
}
]
]
```
```js
locales: {
'/': {
lang: 'zh-CN',
title: 'VuePress',
description: 'Vue 驱动的静态网站生成器'
}
}
```
### 1.6 全局搜索
```js
themeConfig: {
// algolia 全局搜索
algolia: {
apiKey: '123',
indexName: 'xushufa',
appId: '456',
},
官网
https://crawler.algolia.com/admin/crawlers/9f0f4253-4d83-44d8-9f0a-472f436581fd/overview
https://www.algolia.com/apps/ODP1ID8WCB/explorer/browse/xushufa?searchMode=search
教程
https://docsearch.algolia.com/docs/legacy/config-file/
https://www.cnblogs.com/yayujs/p/15982507.html
```
```java
搜索为空,一般是 pathsToMatch 没配置好
crawler.algolia.com -- Editor -- new Crawle -- pathsToMatch
pathsToMatch: ["https://blog.xushufa.cn/**"]
```
## 二、vuepress-theme-reco主题
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册