From 11e721f594f416ddaf68b1bf6c78290bcaa612bc Mon Sep 17 00:00:00 2001 From: root <2111319672@qq,com> Date: Mon, 28 Feb 2022 23:07:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96-=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .obsidian/app.json | 1 + .obsidian/appearance.json | 3 + .obsidian/core-plugins.json | 15 + .obsidian/hotkeys.json | 1 + .obsidian/workspace | 98 ++ docker/重置portainer密码.md | 30 + elk/es、logstash安装.md | 157 +++ front_end/js/js监听键盘键盘输入.md | 9 + .../element upload手动文件上传,多文件上传.md | 260 +++++ front_end/vue/nodejs安装命令.md | 40 + front_end/vue/vue引入百度地图.md | 98 ++ .../gitlab---create blank project and push.md | 32 + java/Java CMD运行Jar出现乱码问题.md | 28 + java/Java 通过反射获取枚举对象.md | 54 + .../Java 队列-生产者消费者模式之卖馒头.md | 169 +++ java/queue/java-queue(队列).md | 495 ++++++++ mysql/Ubuntu mysql 8.0+安装.md | 96 ++ mysql/mysql8.0 主从配置.md | 124 ++ network/VPN服务器搭建以及使用(L2TP类型).md | 1025 +++++++++++++++++ proxy/FRP内网穿透.md | 199 ++++ proxy/Ubuntu install 花生壳.md | 70 ++ ubuntu/MediaWiki搭建以及pivot皮肤配置.md | 164 +++ ubuntu/Ubuntu netplan 网络配置.md | 32 + ubuntu/Ubuntu20.04 设置开机自启.md | 29 + ubuntu/开机自启动.md | 35 + ubuntu/设置SSH密钥登录.md | 52 + 26 files changed, 3316 insertions(+) create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/hotkeys.json create mode 100644 .obsidian/workspace create mode 100644 docker/重置portainer密码.md create mode 100644 elk/es、logstash安装.md create mode 100644 front_end/js/js监听键盘键盘输入.md create mode 100644 front_end/vue/element upload手动文件上传,多文件上传.md create mode 100644 front_end/vue/nodejs安装命令.md create mode 100644 front_end/vue/vue引入百度地图.md create mode 100644 git/gitlab/gitlab---create blank project and push.md create mode 100644 java/Java CMD运行Jar出现乱码问题.md create mode 100644 java/Java 通过反射获取枚举对象.md create mode 100644 java/queue/Java 队列-生产者消费者模式之卖馒头.md create mode 100644 java/queue/java-queue(队列).md create mode 100644 mysql/Ubuntu mysql 8.0+安装.md create mode 100644 mysql/mysql8.0 主从配置.md create mode 100644 network/VPN服务器搭建以及使用(L2TP类型).md create mode 100644 proxy/FRP内网穿透.md create mode 100644 proxy/Ubuntu install 花生壳.md create mode 100644 ubuntu/MediaWiki搭建以及pivot皮肤配置.md create mode 100644 ubuntu/Ubuntu netplan 网络配置.md create mode 100644 ubuntu/Ubuntu20.04 设置开机自启.md create mode 100644 ubuntu/开机自启动.md create mode 100644 ubuntu/设置SSH密钥登录.md diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..990f337 --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "baseFontSize": 16 +} \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..ab1d511 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,15 @@ +[ + "file-explorer", + "global-search", + "switcher", + "graph", + "backlink", + "page-preview", + "note-composer", + "command-palette", + "editor-status", + "markdown-importer", + "word-count", + "open-with-default-app", + "file-recovery" +] \ No newline at end of file diff --git a/.obsidian/hotkeys.json b/.obsidian/hotkeys.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/hotkeys.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/workspace b/.obsidian/workspace new file mode 100644 index 0000000..7382f4f --- /dev/null +++ b/.obsidian/workspace @@ -0,0 +1,98 @@ +{ + "main": { + "id": "a32a17ad4cdacd00", + "type": "split", + "children": [ + { + "id": "2480116cbf7e41ff", + "type": "leaf", + "state": { + "type": "empty", + "state": {} + } + } + ], + "direction": "vertical" + }, + "left": { + "id": "f02df00dae391176", + "type": "split", + "children": [ + { + "id": "7d6c46e25b82a62c", + "type": "tabs", + "children": [ + { + "id": "914594b0e21a5aac", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": {} + } + }, + { + "id": "69a36f77ce322f8d", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "e66ca0b0c34a1e7f", + "type": "split", + "children": [ + { + "id": "1cd91799f12135b0", + "type": "tabs", + "children": [ + { + "id": "07f4554ee5b95f3d", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "active": "2480116cbf7e41ff", + "lastOpenFiles": [ + "Untitled.md", + "front_end/js/js监听键盘键盘输入.md", + "front_end/vue/nodejs安装命令.md", + "front_end/vue/element upload手动文件上传,多文件上传.md", + "proxy/FRP内网穿透.md", + "proxy/Ubuntu install 花生壳.md", + "front_end/vue/vue引入百度地图.md", + "ubuntu/MediaWiki搭建以及pivot皮肤配置.md", + "network/VPN服务器搭建以及使用(L2TP类型).md", + "elk/es、logstash安装.md" + ] +} \ No newline at end of file diff --git a/docker/重置portainer密码.md b/docker/重置portainer密码.md new file mode 100644 index 0000000..3278a49 --- /dev/null +++ b/docker/重置portainer密码.md @@ -0,0 +1,30 @@ +* ### 下载帮助镜像portainer/helper-reset-password + + ```shell + docker pull portainer/helper-reset-password + ``` +* ### 查看portainer container id + + ```shell + docker container ls + ``` + + ![1638772640815.png](http://39.107.103.48:8600//blog/admin/png/2021/12/6/1638772640815.png) +* ### 查看 portainer 的挂载信息 + + ```shell + docker inspect [portainer 容器id] + ``` + + ![1638772824025.png](http://39.107.103.48:8600//blog/admin/png/2021/12/6/1638772824025.png) +* ### 停止运行的portainer + + ```shell + docker stop [portainer 容器id] + ``` +* ### 运行重置命令 + + ```shell + docker run --rm -v [挂载信息] portainer/helper-reset-password + ``` + ![1638773641145.png](http://39.107.103.48:8600//blog/admin/png/2021/12/6/1638773641145.png) \ No newline at end of file diff --git a/elk/es、logstash安装.md b/elk/es、logstash安装.md new file mode 100644 index 0000000..a6df9e0 --- /dev/null +++ b/elk/es、logstash安装.md @@ -0,0 +1,157 @@ +es、logstash安装 +================ + +* 安装包准备(下载好之后上传至linux服务器) + + * elasticsearch https://repo.huaweicloud.com/elasticsearch/ + * ik分词器 https://github.com/medcl/elasticsearch-analysis-ik/releases + * logstash https://repo.huaweicloud.com/logstash/ + * kibana https://repo.huaweicloud.com/kibana/ + * elasticsearch-head https://github.com/mobz/elasticsearch-head + * node.js https://nodejs.org/en/download/ +* elasticsearch + + * 解压安装elasticsearch + + ```bash + tar -zxvf + ``` + * 配置elasticsearch.yml文件 + + * 打开配置文件 + + ```bash + vim config/elasticsearch.yml + ``` + * 在配置文件最下面输入以下内容后 wq保存退出 + + ```yaml + node.name: node-1 + cluster.initial_master_nodes: "node-1" + network.host: 0.0.0.0 + http.port: 9200 #端口 + http.cors.enabled: true #开启跨域 + http.cors.allow-origin: "*" + ``` + * 启动elasticsearch + + * 直接启动-执行bin目录下的elasticsearch + + ```bash + ./bin/elasticsearch + ``` + * 后台启动-执行bin目录下的elasticsearch 加上-d + + ``` + ./bin/elasticsearch -d + ``` + 使用ps kill命令杀掉当前elasticsearch后台 + + ```bash + ps -ef|grep elasticsearch + kill -9 + ``` + * 启动出现max virtual memory areas vm.max\_map\_count \[65530\] is too low, increase to at least \[262144\]解决办法 + + * 打开/etc/sysctl.conf + + ```bash + sudo /etc/sysctl.conf + ``` + * 在最下面添加以下内容 然后:wq保存退出 + + ```bash + vm.max_map_count=262144 + ``` + * 执行/sbin/sysctl -p立即生效 + + ```bash + sudo /sbin/sysctl -p + ``` +* ik 分词器安装(版本号要一致) + + ```bash + ./bin/elasticsearch-plugin install https://github.com/medcl/elasticsearch-analysis-ik/releases/download/v6.3.0/elasticsearch-analysis-ik-6.3.0.zip + ``` +* logstash安装 + + * 解压安装logstash + + ```bash + tar -zxvf + ``` + * 配置启动文件 + + * 在config文件目录下创建mysql.conf启动文件 + + ```bash + input { + jdbc { + jdbc_connection_string => "jdbc:mysql://192.168.3.51:3306/kf?serverTimezone=Asia/Shanghai&useSSL=false&allowPublicKeyRetrieval=true&allowMultiQueries=true" + jdbc_user => "lduan" + jdbc_password => "359" + jdbc_driver_library => "/home/gd-service/software/mysql-connector-java-8.0.23/mysql-connector-java-8.0.23.jar" + jdbc_driver_class => "com.mysql.cj.jdbc.Driver" + # 定时器 多久执行一次SQL,默认是一分钟 + schedule => "* * * * *" + #是否清除 last_run_metadata_path 的记录,如果为真那么每次都相当于从头开始查询所有的数据库记录 + clean_run => "false" + #记录字段保存的位置。 + last_run_metadata_path => "/home/gd-service/software/elk/logstash-7.8.0/station_parameter.txt" + # statement => "SELECT * FROM purchase_history" + # 执行的sql 文件路径+名称 + statement_filepath => "/home/gd-service/software/elk/logstash-7.8.0/mysql/jdbc.sql" + #是否分页 + jdbc_paging_enabled => "true" + jdbc_page_size => "5000" + # 索引类型 + type => "_doc" + #是否需要记录某列的值,用于实时同步更新 + use_column_value => true + #需要记录的字段一般用于记录主键Id,或者更新时间,用于sql查询最新 + tracking_column => "index" + #写入es数据的key,默认会被转成小写,该字段用于控制是否小写。 + lowercase_column_names => false + } + stdin{ + } + } + + #ElasticSearch中默认使用UTC时间,和中国时间相差8小时,加入以下配置 + filter { + ruby { + code => "event.set('timestamp',event.get('@timestamp').time.localtime+8*60*60)" + } + ruby { + code => "event.set('@timestamp',event.get('timestamp'))" + } + mutate { + remove_field => ["timestamp"] + } + # ruby { + # code => "event.set('myTimeField',event.get('myTimeField').time.localtime+8*60*60)" + # } + } + + #filter { json { source => "message" remove_field => ["message"] } } + + output { + elasticsearch { + hosts => ["localhost:9200"] + index => "product" + document_type => "_doc" + document_id => "%{index}" + } + stdout{ + # JSON格式输出 + codec => "json_lines" + } + } + ``` + * 启动logstash + + * 直接启动-执行bin目录下的logstash + + ```bash + ./logstash -f ../config/mysql.conf + ``` \ No newline at end of file diff --git a/front_end/js/js监听键盘键盘输入.md b/front_end/js/js监听键盘键盘输入.md new file mode 100644 index 0000000..5adfd7c --- /dev/null +++ b/front_end/js/js监听键盘键盘输入.md @@ -0,0 +1,9 @@ +```javascript +document.addEventListener('keydown', function(e){ + if (e.keyCode == 83 && (navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey)){ + #preventDefault() 方法会取消该事件,比如ctrl+s会保存当前网页,此方法可以取消这些原本的操作,写上我们要执行的操作给他覆盖掉 + e.preventDefault(); + alert('save'); + } +}); +``` diff --git a/front_end/vue/element upload手动文件上传,多文件上传.md b/front_end/vue/element upload手动文件上传,多文件上传.md new file mode 100644 index 0000000..4fbb860 --- /dev/null +++ b/front_end/vue/element upload手动文件上传,多文件上传.md @@ -0,0 +1,260 @@ +#### 自定义文件上传 + +``` + + + +``` + +#### 一次请求上传多个文件(推荐使用) + +``` + + + +``` \ No newline at end of file diff --git a/front_end/vue/nodejs安装命令.md b/front_end/vue/nodejs安装命令.md new file mode 100644 index 0000000..9e073bd --- /dev/null +++ b/front_end/vue/nodejs安装命令.md @@ -0,0 +1,40 @@ +nodejs安装命令 +============== + +* 安装nodejs + + ```bash + sudo apt-get install nodejs + ``` +* 安装npm + + ```bash + sudo apt-get install npm + ``` + * 设置淘宝镜像源 + + ```bash + npm config set registry https://registry.npm.taobao.org + ``` + * 获取当前镜像源 + + ```bash + npm config get registry + ``` + * 安装淘宝的cnpm,然后在使用时直接将npm命令替换成cnpm命令即可 + + ```bash + npm install -g cnpm --registry=https://registry.npm.taobao.org + ``` +* 安装vue + + ```bash + sudo npm install -g vue-cli + ``` +* 查看版本 + + ```bash + node -v + npm -v + vue -V + ``` \ No newline at end of file diff --git a/front_end/vue/vue引入百度地图.md b/front_end/vue/vue引入百度地图.md new file mode 100644 index 0000000..7ffb4d9 --- /dev/null +++ b/front_end/vue/vue引入百度地图.md @@ -0,0 +1,98 @@ +vue引入百度地图 +==================================== + +* ### 首先安装百度地图依赖 + + ```bash + npm install vue-baidu-map --save + ``` +* ### 申请百度地图开放平台百度地图密钥 + + * (申请链接http://lbsyun.baidu.com/index.php?title=jspopular/guide/getkey)根据网站提示填写应用信息。 + * 在应用类型出选择浏览器端 + * ip白名单填写\*号 +* ### 在main.js中全局注册 + + ```js + import Vue from 'vue' + //添加百度地图 + import BaiduMap from 'vue-baidu-map' + Vue.use(BaiduMap,{ + ak:'GHYWGm6cKODTU3BzuKDlEqARxc2ZEf3c' + }) + ``` +* ### 如果使用的是quasar-cli + + * 在src/boot 下创建启动文件baiduMap.js 添加以下内容 + + ```js + import Vue from 'vue' + //添加百度地图 + import BaiduMap from 'vue-baidu-map' + Vue.use(BaiduMap,{ + ak:'你申请的百度地图开放平台应用key' + }) + ``` + * 在quasar.conf.js文件中添加你的启动文件 + + ```json + boot: [ + 'i18n', + 'axios', + 'baiduMap' + ] + ``` +* ### 页面 + + ```vue + +