自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(58)
  • 收藏
  • 关注

原创 CentOS常用功能命令集合

(1)不解压获取文件列表。未完待续......

2024-03-28 10:08:57 554

原创 Anaconda管理虚拟环境操作命令

打开一个新的窗口,输入以下命令。*代表着当前的编译所属环境。

2024-03-22 15:58:44 274

原创 CentOS7 安装IPFS

CentOS7 安装IPFS流程步骤

2023-11-15 14:37:15 199

原创 RestTemplate响应乱码问题解决

说明:需要修改修改RestTemplate默认配置,每次请求都需要设置编码,如果不设置就默认为上次设置的编码。说明:推荐使用这种方法,不用修改RestTemplate默认配置。验证:这种方式经过验证,可以解决响应乱码问题;验证:这种方式经过验证,可以解决响应乱码问题;

2023-11-11 11:20:41 1748

原创 CentOS7单磁盘挂载一个目录

CentOS7单磁盘挂载一个目录

2023-10-24 20:17:11 169

原创 CentOS 挂载ntfs格式U盘

CentOS 挂载ntfs格式U盘流程步骤

2023-06-27 11:31:04 3690 1

原创 Nginx使用账号nginx启动后后端Tomcat报错Broken pipe

背景:接到服务器安全问题整改要求,有基线问题需要修复,里面有nginx禁止使用root账号启动,需要修改成nobody或者nginx账号启动。至此,nginx基线禁止使用root后引发的问题处理完毕,查看后端程序日志未发现之前的报错日志,接口正常请求获取数据。我使用yum安装的nginx,目录是:/var/lib/nginx/tmp/proxy。我使用yum安装的nginx,目录是:/etc/nginx/nginx.conf。我使用yum安装的nginx,目录是:/usr/sbin/nginx。

2023-05-25 14:48:42 1224

原创 CentOS7安装chrome和chromedriver

CentOS7安装chrome和chromedriver

2022-09-07 10:39:57 3539

原创 CentOS7多磁盘挂载一个目录

CentOS7多磁盘挂载一个目录fdisk -l 或 fdisk -l |grep dev通过下图可以看出有四块磁盘(/dev/vdb、/dev/vdc、/dev/vdd、/dev/vde)共计4T需要挂载2、进入分区工具设置(以磁盘/dev/vdc为例)fdisk /dev/vdc依次输入以下选项 n p 回车 回车 t 8e w按照以上的操作对/dev/vdb、/dev/vdd、/dev/vde磁盘进行操作3、安装pv系列命令yum install l...

2022-04-12 11:44:48 6138

原创 层级关系下角色作用范围

在具有层级结构的项目中,角色展示范围以及可用范围是个问题,角色设计时可以添加两个参数:参数1:scope_type(作用范围类型:0本层级可用;1本层级以及下属层级可用;2自定义范围机构可用)参数2:scope_dept_ids(自定义范围机构id集合,即只有scope_type为2的时候才需要有值)实际使用:角色列表可只查询本层级创建的角色,使用dept_id即可实现 用户创建时加载角色列表可使用作用范围加载出可以使用的角色...

2021-11-02 15:15:48 279

原创 具有层级关系的关系型数据库表设计

项目开发过程中经常会遇到具有层级关系的数据,进行表结构设计时可设计如下四个必备参数:参数1:id(表主键id,一般为int类型)一般为int类型,可设置主键自增参数2:parent_id(直属父级id)和id相同类型,一般为int类型 顶级数据parent_id为0,即没有父级的时候parent_id为0 有父级的时候parent_id的值为直属父级的id值参数3:top_parent_id(顶级父级id)和id相同类型,一般为int类型 顶级数据top_parent_id为0,即

2021-11-02 14:49:54 2345

原创 Frp内网穿透

一、下载frphttps://github.com/fatedier/frp/releases二、解压配置frps为服务器端配置,即具有外网的服务器,打开frps.ini进行配置(默认端口为7000,可自主进行修改)bind_port = 7000frpc为客户端配置,即内网服务器,打开frpc.ini进行配置[common]server_addr = 外网服务器IPserver_port = 外网服务器frp端口,即外网服务器frps.ini配置中bind_port的值

2021-10-15 14:19:00 279

原创 SpringBoot集成Validation进行接口参数校验

一、pom文件引入<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-validation</artifactId></dependency>二、创建分组package com.hdy.validation.data.validation;public interface I

2021-09-23 16:34:04 404

原创 SpringBoot集成Elasticsearch使用RestHighLevelClient

1、引入pom.xml依赖<!--引入elasticsearch依赖--><dependency> <groupId>org.elasticsearch.client</groupId> <artifactId>elasticsearch-rest-high-level-client</artifactId> <version>7.6.1</version></dependency>

2021-09-23 16:29:28 1425

原创 SpringBoot启动后获取所有Controller接口

1、RequestInterfaceInitConfiguration实现ApplicationRunner接口实现项目启动运行package com.hdy.manage.configuration;import com.hdy.manage.data.entity.SysInterface;import com.hdy.manage.repository.SysInterfaceRepository;import lombok.extern.slf4j.Slf4j;import org.

2021-09-23 16:16:30 2342

原创 SpringBoot和RestTemplate集成

connectTimeout:指的是建立连接所用的时间 readTimeout:指的是建立连接后从服务器读取到可用资源所用的时间package com.hdy.manage.configuration;import lombok.extern.slf4j.Slf4j;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.factory.annotation.V

2021-09-23 15:59:12 243

原创 WebSocket+Redis实现集群消息

1、在pom.xml中引入相关依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId&

2021-09-23 15:50:08 884

原创 SpringBoot自定义拦截器注入Service

1、创建自定义拦截器,实现接口:org.springframework.web.servlet.HandlerInterceptorpackage com.hdy.manage.web.interceptor;import com.hdy.manage.service.SysLogService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.web.servlet

2021-09-23 15:24:52 3448 2

原创 Java的CentOS启动脚本

file_name="xxx.jar"logs_file="xxx"A=`ps -ef | grep ${file_name} | grep -v grep | wc -l`if [ $A -ne 0 ];then ps -ef | grep ${file_name} | grep -v grep | awk '{print $2}' | xargs kill -9finohup java -jar $(pwd)/${file_name} | $(which cronolog) $(pwd).

2021-08-27 14:44:34 248

原创 CentOS文件操作权限

CentOS7修改文件或文件夹操作权限命令:chmod -R 777 文件或目录7:表示rwx,拥有读、写和执行的权限 6:表示rw-,拥有读和写的权限 5:表示rx,拥有读取和执行的权限 4:表示r--,拥有只读权限 3:表示-wx,拥有写入和执行的权限 2:表示-w-,拥有只写权限 1:表示 - x,仅拥有执行权限 0:表示---,无权限...

2021-08-27 14:37:24 4092

原创 CentOS7使用root账号安装MySQL不能创建mysql账户

修改文件权限:chattr -i /etc/gshadowchattr -i /etc/shadowchattr -i /etc/groupchattr -i /etc/passwd卸载MySQL:rpm查询MySQL安装rpm -qa | grep mysqlrpm卸载安装rpm -e --nodeps mysql-community-server-5.7.35-1.el7.x86_64rpm -e --nodeps mysql-community-commo.

2021-08-13 10:44:08 182

原创 nohup日志使用cronolog按日切分

1、下载安装cronologyum install -y cronolog 如果不能使用yum安装就需要自己下载安装包解压安装,步骤可以自己百度搜索一下2、查看cronolog路径which cronolog 我本机cronolog路径为:/usr/sbin/cronolog,请记住这个路径,下面需要使用3、使用nohup和cronolog按日生成日志...

2020-04-28 10:09:07 1192 3

原创 CentOS7 yum安装wget

使用yum安装wget:yum install -y wget遇到问题:Loading mirror speeds from cached hostfileThere are no enabled repos. Run "yum repolist all" to see the repos you have. To enable Red Hat Subscription Ma...

2020-04-27 22:34:24 1626

原创 CentOS7不能ifconfig查看IP

虚拟机安装CentOS7后使用ifconfig命令查看IP地址时: ifconfig command not found解决办法: yum install -y net-tools

2020-04-27 22:01:40 410

原创 MySQL错误处理集合

1、MySQL5.7以及以上版本sql_mode问题错误信息:Caused by: java.sql.SQLSyntaxErrorException: Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'xxxxxx' which is not function...

2020-03-17 15:27:48 161

原创 MySQL常用命令

1、查询数据库文件路径show global variableslike "%datadir%"2、设置远程登录grant all privileges on *.* to root@'%' identified by 'password';flush privileges;3、修改密码alter user 'root'@'localhost' identifie...

2020-03-17 15:10:48 112

原创 CentOS7迁移MySQL磁盘目录

背景:服务器有两个磁盘(40G和100G),MySQL安装默认磁盘为40G磁盘,该磁盘空间耗尽导致MySQL不能正常操作,故需要将MySQL磁盘目录迁移到100G磁盘。1. 关闭MySQL服务systemctl stop mysqld或service mysql stop2. 新建MySQL存储目录(可省略)mkdir -p /data/xxx3. 迁移MySQL目录到...

2020-02-04 12:39:19 1237 1

原创 CentOS7磁盘空间占用查询

1. 查看磁盘整体使用情况df -h2.查询所有磁盘(包括未挂载磁盘)fdisk -l3.查询磁盘占用详情cd /du -lh --max-depth=1查找到占用磁盘空间较大的目录,进入到该目录,继续执行:du -lh --max-depth=1,逐级查找...

2020-02-04 12:13:44 4751

原创 CentOS7更换阿里YUM源

安装base reop源cd /etc/yum.repos.d备份旧的配置文件mv CentOS-Base.repo CentOS-Base.repo.bak下载阿里源的文件wget -O CentOS-Base.repohttp://mirrors.aliyun.com/repo/Centos-7.repo安装epel repo源wget -O /etc/yum.r...

2020-01-09 14:59:06 270

原创 单节点Eureka注册中心搭建

Eureka Server相关配置1、Maven 引入相关的依赖:pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ...

2020-01-09 14:53:41 145

原创 Generate POJOs.groovy配置

import com.intellij.database.model.DasTableimport com.intellij.database.model.ObjectKindimport com.intellij.database.util.Caseimport com.intellij.database.util.DasUtil/* * Available context bin...

2019-11-29 12:21:38 1802

原创 CentOS7安装OpenResty以及OpenResty+Lua+Redis 实现IP限流

OpenResty官方下载网站:http://openresty.org/cn/linux-packages.html安装OpenRestyyum install -y yum-utilsyum-config-manager --add-repo https://openresty.org/package/centos/openresty.repoyum install -y ope...

2019-10-10 17:27:51 523

原创 Java数据类型

数据类型分类1. 引用数据类型2. 基本数据类型(值类型) 整数型:默认整数数据类型是int byte 一个字节 -128到127 short 两个字节 -2^15~2^15-1 int 四个字节 -2^31~2^31-1 long 八个字节 -2^63~2^63-1 浮点型:默认浮点型数...

2019-09-24 20:48:43 127

原创 CentOS7脚本检测SpringBoot项目JAR包变化后自动重启

#!/bin/bash# 文件目录fileDir=/usr/local/project/backlogDir=/usr/local/project/logs# 设置需要检测的文件路径fileName=media-fuse-1.0.0.jar# 获取当前文件最后编辑时间戳initTime=`stat -c %Y $fileDir/$fileName`# 循环查询文件最后编辑时间是否...

2019-09-24 18:36:46 758

原创 SpringBoot查询findBy规则

Keyword Sample JPQL snippet And findByLastnameAndFirstname … where x.lastname = ?1 and x.firstname = ?2 Or findByLastnameOrFirstname … where x.lastname = ?1 or x.firstname = ?2 ...

2019-09-24 18:03:57 3084

原创 SpringBoot集成MongoDB

前言:SpringBoot版本2.1.8.RELEASE,MongoDB版本4.2.0下载MongoDB下载地址:https://www.mongodb.com/download-center/community安装MongoDB安装步骤参考(Windows版本):https://blog.csdn.net/sj2050/article/details/82838882...

2019-09-24 17:59:50 230

原创 CentOS7使用YUM安装keepalived

查看是否可以YUM安装yum list keepalivedYUM安装yum install -y keepalived查看IP和网卡ifconfig 例如下图红框部分即为IP和网卡编辑配置文件vi /etc/ keepalived/ keepalived.conf主服务器配置:vrrp_instance VI_1 { state BACKUP...

2019-07-25 14:02:26 3951

原创 CentOS7脚本检测Redis/Nginx宕机并自动重启

1、Redis宕机检测并自动重启#!/bin/shwhile truedoA=`ps -C redis-server --no-header | wc -l`if [ $A -eq 0 ];then echo $(date +%F%n%T) "redis未启动,启动redis..." systemctl start redis sleep 10else...

2019-07-25 10:31:00 1410

原创 Shiro和SpringBoot集成前后端分离登陆验证和权限验证接口302获取不到返回结果的问题

1、Shiro相关的依赖<dependency> <groupId>org.apache.shiro</groupId> <artifactId>shiro-spring</artifactId> <version>1.4.0</version></dependency>...

2019-07-24 19:18:17 2976 1

原创 CentOS7脚本检测文件更新

#!/bin/bash# 文件目录fileDir=/usr/local/project# 设置需要检测的文件fileName=media-1.0.0.jar# 获取当前文件最后编辑时间戳initTime=`stat -c %Y $fileDir/$fileName`# 循环查询文件最后编辑时间是否变化while truedochangeTime=`stat -c %Y $fi...

2019-07-18 16:29:22 890

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除