- 博客(173)
- 资源 (2)
- 收藏
- 关注
原创 查看服务器接口各行代码耗时的 linux 命令
命令 1 :curl -O https://arthas.aliyun.com/arthas-boot.jarjava -jar arthas-boot.jar命令 2 trace 加具体的方法路径
2024-06-19 10:23:47
450
原创 spring boot 将数据分段导出excel 并压缩成压缩文件。后删除
场景:例如导出文件过于大,几百万条。excel最大可就只有100万条,那这时候。然后导出n个excel并压缩一下。使用ali的easyexcel。
2023-07-01 17:44:37
818
原创 有一个100兆大小的文本文件,用java查询某字符串所在位置
这种方法使用内存映射文件,可以将文件映射到内存中,然后直接在内存中进行字符串匹配,速度比逐行读取文件要快。但是需要注意的是,这种方法会占用较多的内存,如果内存不足,可能会导致OutOfMemoryError。如果文本文件比较大,逐行读取文件会比较耗时。可以使用Java的内存映射文件(MappedByteBuffer)来加速字符串匹配。这种方法适用于文本文件比较小的情况,可以使用Java的BufferedReader逐行读取文件,并对每一行进行字符串匹配。
2023-05-24 11:52:23
929
1
原创 spring boot redis 设置key的前缀
当我们同一个项目,要部署好多次。但是都用的同一个redis。如果没有什么做区分,那会乱掉的。那么就需要一个默认前缀进行区分。但是,在项目中去改比较麻烦。或者每次都要写一个。所以。这里在配置中统一加一个前缀。
2023-05-18 13:48:38
2760
2
原创 mysql 将一个表的数据插入到另一个表,其他字段用其他值
INSERT INTO t_integral_record (uid,number_integrals,type,remarks,create_time,update_time,is_delete,point_type) (SELECT uid,50,1,'测试', '2023-05-12 18:00:00', '2023-05-12 18:00:00', 1 , 1 FROM uid_num)根据表中的一个字段进行插入,其他字段的值为默认值。其他的插入方式也是一样的。
2023-05-12 16:03:37
725
原创 根据nginx日志,设置防火墙。防止恶意攻击。ipset
有人恶意攻击我们服务器,可以根据nginx打印出来的访问日志ip,筛选出来访问量过大的ip,给他设置黑名单,设置防火墙,配置ipset,写一个脚本。
2023-04-30 17:22:53
378
原创 nginx+iptables+ipset 封禁频繁访问web服务的恶意IP
ipset就像一个集合,把需要封闭的ip地址写入这个集合中,ipset 是O(1)的性能,可以有效解决iptables直接封禁大量IP的性能问题。如果是RedHat/CentOS,首先用yum(Ubuntu/Debian用将yum换为apt-get既可 )安装ipset。基于自定义访问频率阈值或者请求敏感关键字来创建自动筛选恶意IP的脚本/data/iptables_ipset_deny.sh。~]# ipset del ipsetname 地址。用crontab定时启动脚本。
2023-04-29 09:28:44
1443
原创 linux配置nginx.service服务并开机启动
systemctl is-enable nginx.service 查询是否开机启动nginx服务。systemctl disable nginx.service 禁止开机启动nginx服务。systemctl start nginx.service 启动nginx服务。systemctl enable nginx.service 开机启动nginx服务。1、先安装nginx。
2023-04-26 16:42:02
1860
原创 常用的自动化测试工具
Appium 是一个移动端自动化测试开源工具,支持iOS 和Android 平台,支持Python、Java 等语言,即同一套Java Python 脚本可以同时运行在iOS 和Android平台,Appium 是一个C/S 架构, 核心是一个 Web 服务器,它提供了一套 REST 的接口。使用Jmeter做接口测试需要注意一点,小心使用“用户定义变量”,Jmeter组件有优先级的,如果多个线程同时执行的时候,“用户定义变量”组件定义的变量可能会乱套。License:免费。License:免费。
2023-04-21 16:59:20
517
原创 git .gitignore 常用配置
gradle/build/!target/!# IDE.classpath.project.settings.idea*.iws*.iml*.iprrebel.xmlbuild/*nbbuild/dist/nbdist/# Others*.log*.swp!!!
2023-04-21 13:48:10
243
原创 修改mysql密码
如果 update user set password=password('root') where user='root' and host='localhost';则使用 update mysql.user set authentication_string=password('root') where user='root';
2023-04-13 14:51:17
127
原创 阿里云提供的快速建站文档-linux装mysql、tomcat、nginx等
https://help.aliyun.com/document_detail/464748.html
2023-03-03 16:50:29
131
原创 window java 备份数据库
首先你要找到你的mysql安装目录。下面有个 mysqldump.exe文件。-u你的数据库的用户名,不要跟空格。-p你的数据库密码。cmd /c D:/3-project/这就是你mysqldump.exe所在的位置。mysqldump 这个不是文件夹。这个是获取到当天的时间的 比如2022-10-18这种格式的。你可以把它复制到任意目录。比如你项目的目录下。下面这一段都是对于下面代码的解释。如果要定时备份那就写个定时任务就好了。
2022-10-18 16:00:15
383
原创 linux部署 emqx(mqtt 物联网)
修改端口 可以将 1883替换 成 你想要的端口。我的服务器配置,根据配置去下载相应的文件。根据下面的命令进行下载。进行修改 账号 密码。
2022-09-30 11:12:45
1893
原创 springcache
让程序员实现无感缓存不再需要在业务上写各种代码但是 springcache只支持 string 对于list set zset hash均不支持基于注解实现缓存Spring为我们提供了几个注解来支持Spring Cache。其核心主要是@Cacheable和@CacheEvict。使用@Cacheable标记的方法在执行后Spring Cache将缓存其返回结果,而使用@CacheEvict标记的方法会在方法执行前或者执行后移除Spring Cache中的某些元素。下面我们将来详细介绍一下Sp.
2021-12-15 16:57:58
295
原创 linux 启动 spring boot .jar项目 .sh 脚本
run.sh 文件启动命令 sh run.sh会自动找到当前目录中的.jar文件。所以。当前文件夹中仅允许存在一个jar包#! /bin/bash# springboot的jar放同级目录下即可,只能有一个jar文件# ./run.sh: Permission denied 解决方案 chmod +x run.sh# 启动命令 sh run.sh# 需要手动创建 /home/javaproject/log/console.log文件CURRENT_PATH=/home/javapr..
2021-07-27 09:45:42
1758
原创 vue/react前端部署到nginx服务器
user nginx;worker_processes auto;error_log /var/log/nginx/error.log notice;pid /var/run/nginx.pid;events { worker_connections 1024;}http { include /etc/nginx/mime.types; default_type application/octet-stream; .
2021-06-08 13:28:48
336
4
原创 阿里云服务器linux安装nginx
下载相关组件 wget http://nginx.org/download/nginx-1.10.2.tar.gz wget http://www.openssl.org/source/openssl-fips-2.0.10.tar.gz wget http://zlib.net/zlib-1.2.11.tar.gz wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.40.tar.gz...
2021-06-08 13:09:26
306
原创 linux 安装rar 以及 zip
wget https://www.rarlab.com/rar/rarlinux-x64-5.6.0.tar.gztar zxvf rarlinux-x64-5.6.0.tar.gzcd rarmake
2021-06-07 15:20:07
143
原创 vue使用swiper轮播不断向内推送新数据
需求:如需要一个大屏滚动播放实时数据。那么就可以定时获取数据。然后推送至swiper轮播内<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <title>Swiper demo</title> <!-- Demo styles --> <style> .swiper-container { b.
2021-05-20 15:24:28
295
原创 vue 跳转页面 路由
首先在route内配置需要跳转的页面路由 { path:'/other/BigScreenRealTimeDataShow', component: (resolve) => require(['@/views/other/BigScreenRealTimeDataShow'], resolve), hidden: true },然后进行跳转两种方式openBigScreenRealTimeDataShow() { // 方式1 不弹出新页面
2021-05-10 09:31:51
208
原创 springboot controller 使用事务
//添加事务第一步 引入platformTransactionManager对象 @Autowired private PlatformTransactionManager platformTransactionManager; /** * 删除信息 */ @DeleteMapping("/{blKeys}") public AjaxResult remove(@PathVariable String[] blKeys) { ...
2021-04-12 10:40:51
1635
原创 Dropdown 下拉菜单中点击事件失效 el-dropdown-item 内的 @click点击无效
第一种就是把@click 改为 @click.native如果不行的话就使用指令@command写法 <el-dropdown trigger="click" @command="handleCommand" placement="bottom-end" style="margin-left: 10px" > <spa.
2021-04-06 16:44:25
2203
原创 redis实现高并发 redisson 分布式锁
使用 redis以及redisson开发首先配置 redis 以及 redisson ,redis省略这里配置redisson@Beanpublic Rdisson redisson(){ // 此为单机模式 COnfig config = new Config(); config.useSingleServer().setAddress("redis://localhost:6379"); return (Redisson) Redisson.create(
2021-04-05 19:30:10
354
原创 Host is not allowed to connect to this MySQL server 解决方法
首先进入 mysql 命令mysql -u root -p然后use mysql;然后update user set host = '%' where user = 'root';然后就报错了。不用管然后FLUSH PRIVILEGES;然后就可以连上了
2021-03-31 11:05:54
157
原创 控制台打印花式字体 patorjk.com
http://patorjk.com/software/taag/#p=display&h=2&v=1&f=Acrobatic&t=SUCCESS
2021-03-29 15:35:27
448
原创 java.sql.SQLException: Access denied for user ‘root‘@‘localhost‘ (using password: YES) 异常
原来的连接代码账号密码加" " 就好了或者有data-的把data-去掉也可以
2021-03-29 09:02:52
199
原创 idea 添加注释模板并在新建类时自定义描述信息
类模板setting-》File and Code Templates-》class/* * TODO * @version 1.0 * @author ${USER} * @date ${DATE} ${TIME} * */方法模板setting-》Editor-》Live Templates模板* * 功能描述: <br> * 〈$END$〉 * @Param: $param$ * @Return: $return$ * .
2021-03-12 15:16:41
2505
原创 postman post 传文件 以及 HttpMediaTypeNotSupportedException 异常处理
首先设置Content-Type 为 multipart/form-data然后HttpMediaTypeNotSupportedException 这个异常的解决 对象数据前面别加其他注解就好了
2021-01-30 15:10:16
1196
原创 Java 文件上传 工具类
工具类。可以直接复制粘贴。一些路径的Global需要自己写import com.manage.common.core.web.domain.ImgUrlEntity;import com.manage.common.global.filepath.FileGlobal;import org.apache.commons.io.FileUtils;import org.springframework.web.multipart.MultipartFile;import javax...
2021-01-30 15:03:19
2009
原创 springboot+nginx配置集群
注册码:更新于 2020/1/9QYYBAC9D3J-eyJsaWNlbnNlSWQiOiJRWVlCQUM5RDNKIiwibGljZW5zZWVOYW1lIjoi6LaF57qnIOeoi+W6j+WRmCIsImFzc2lnbmVlTmFtZSI6IiIsImFzc2lnbmVlRW1haWwiOiIiLCJsaWNlbnNlUmVzdHJpY3Rpb24iOiIiLCJjaGVja0N...
2021-01-13 16:17:41
15360
springboot+RabbitMq交换器Direct的demo
2019-03-21
springboot+shiro代码demo
2018-09-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人