- 博客(29)
- 资源 (6)
- 收藏
- 关注
原创 Linux下安装jdk并配置环境变量
1、先检查系统是否自带jdkrpm -qa |grep javarpm -qa |grep jdkrpm -qa |grep gcj2、如果有就批量卸载rpm -qa | grep java | xargs rpm -e --nodeps 3、直接yum安装1.8.0版本openjdkyum install java-1.8.0-openjdk* -y4、配置环境变量,编辑/etc/profile,最下方加上以下内容:#setjavaenvironment...
2021-12-23 17:02:23 764
原创 springboot访问静态资源文件
1、WebMvcConfiguration import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;import org.springframework.web.
2021-10-21 16:25:46 165
原创 springboot jar包启动
用以下命令,可以在服务运行的情况下,直接重启,不必先停掉进程再启动#!/bin/shcd /server;kill -9 $(cat demo.pid);rm -f demo.pid;nohup java -Dfile.encoding=UTF-8 -jar /server/demo.jar > /server/demo.log &echo $! > demo.pid;echo "执行完毕";tail -f /server/demo.log;...
2021-09-15 19:25:42 159
原创 mysql笔记
1、登录,然后输入密码mysql -uroot -p2、修改密码:ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';flush privileges;3、创建数据库create database dev_demo default character set utf8mb4 default collate utf8mb4_general_ci;4、查看新建的数据库show create ...
2021-09-15 19:20:14 86
原创 Liunx安装Nginx
需要安装 gcc-c++编译器,然后安装nginx依赖的pcre和zlib包。最后安装nginx1、安装gcc-c++编译器yum install gcc-c++yum install -y openssl openssl-devel2、安装pcre包yum install -y pcre pcre-devel3、安装zlib包yum install -y zlib zlib-devel4、在/usr/local/下创建文件nginx文件mkdir /usr/local/n
2021-09-14 23:07:54 86
原创 linux系统mysql配置文件修改(my.cnf)
1、不区分大小写查看:show variables like "%case%" ;修改:lower_case_table_names=12、group by 后的字段,不是必须在select存在查看:select @@GLOBAL.sql_mode;修改:sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_S
2021-09-01 11:26:28 1583
原创 linux服务器安装mysql 8.0
1.在 /use/local下 创建mysql文件夹 mkdir mysql2.切换到mysql文件夹下 cd mysql3.下载mysql wget https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz4.解压mysql tar xvJf mysql-8.0.20-linux-glibc2.12-x86_64.tar.xz5.重命名文件夹 mv mysql-8.0..
2021-06-01 11:35:11 191 2
原创 spring boot输出mybatis的sql
application.yml添加以下配置(1/2任选其一)1. logging: level: com.example.demo.dao : debug2. mybatis configuration: log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
2020-12-01 13:51:41 103
原创 linux 安装redis
1.安装redis数据库 1 yum install redis 2.下载fedora的epel仓库yum install epel-release3.启动redis服务systemctl start redis4.查看redis状态systemctl status redissystemctl stop redis 停止服务systemctl restart redis 重启服务5.查看redis进程6.设置开机
2020-11-18 10:24:32 108
原创 java 传参字符串转义
1、maven依赖<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-text</artifactId> <version>1.1</version></dependency>2、调用public static void main(String[] args) { St...
2020-10-28 10:44:25 812
原创 java判断当前系统是linux还是windows
public static boolean isOSLinux() { Properties prop = System.getProperties(); String os = prop.getProperty("os.name"); if (os != null && os.toLowerCase().indexOf("linux") > -1...
2020-06-29 15:33:39 1880
原创 java springboot 导出文件到csv
优点:可以大数据量导出,效率快一、public void exportExcel() throws Exception {//1、查询数据List<Map<String, Object>> list = baseMapper.exportCsv();//如果需要对查出来的数据进行处理,可以新建List,遍历查询结果,处理完后添加到List//List<Map<String, Object>> dataList = new ArrayList&
2020-06-29 15:08:01 1658
原创 java 监测服务是否超时,超时自动重启
1、java 写一定时任务,每1秒自动调用需要监测的服务接口例:超时90秒重启服务,超时180秒发短信int flag= 0;@Scheduled(cron = "*/1 * * * * ?")public void check() throws IOException { String status= HttpClientUtil.sendGet("http:127.0...
2020-04-29 13:14:47 653
原创 linux 定时执行脚本,清空日志
1、新建脚本文件cleallog.sh,放到/root目录下#!/bin/shsource /etc/profile;#环境变量,必须填写truncate -s 0 /log/log.out {} \;#清空文件内容,但不删除文件rm -rf /log/test/*;#删除文件夹下内容,不删除文件夹echo "执行完毕";2、crontab -e,按i进入编辑模式,添加以下命令(每...
2020-04-28 14:44:14 769
原创 resultMap继承
<resultMap id="BaseResultMap" type="com.admin.entity.Admin"> <id column="id" property="id"/> <result column="create_time" property="createTime"/> </resultMap><...
2020-02-16 12:21:39 521
原创 java enum 枚举用法
public enum Platform { DOUYIN("DOUYIN", "抖音"), KUAISHOU("KUAISHOU", "快手"); private String code; private String name; Platform(String code, String name) { this.code = code;...
2020-02-16 12:12:11 116
原创 java自定义日志文件
package com.common.util;import java.io.*;import java.util.Properties;/** * @author Administrator */public class CreateLog {SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); /...
2019-01-04 13:40:56 634
原创 SpringBoot导入excel
1、controller:@RequestMapping(value = "/importExcel", method = RequestMethod.POST)public void importExcel(@RequestParam(value = "file", required = true) MultipartFile file) { baseService.import...
2019-01-04 11:39:49 588
原创 SmsUtil发送手机短信验证码工具类
package com.common.util;import com.aliyuncs.DefaultAcsClient;import com.aliyuncs.IAcsClient;import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;import com.aliyuncs.dysmsapi.model.v20170525...
2019-01-04 11:32:22 934
原创 ExcelUtil导出工具类
package com.ztw.common.util;import cn.afterturn.easypoi.excel.ExcelExportUtil;import cn.afterturn.easypoi.excel.ExcelImportUtil;import cn.afterturn.easypoi.excel.entity.ExportParams;import cn.af...
2019-01-04 11:30:25 2224
原创 UploadUtil导入工具类
package com.common.util;import org.springframework.beans.factory.annotation.Value;import org.springframework.stereotype.Component;import org.springframework.web.multipart.MultipartFile;import j...
2019-01-04 11:28:58 825
原创 取redis中手机验证码,并验证是否正确
controller:/** * 校验验证码是否正确 * @param smsCode * @param phone */@RequestMapping(value = "checkSmsCode",method = RequestMethod.POST)public Result checkSmsCode(String smsCode, String phone) { ...
2018-12-24 16:14:04 1750
原创 发送验证按,存redis
1、pom引入:<dependency> <groupId>com.aliyun</groupId> <artifactId>aliyun-java-sdk-core</artifactId> <version>3.2.8</version></dependency&a
2018-12-24 16:06:05 202
原创 java SpringBoot上传附件
1、application.propertiesuploadPath=C:/images/spring.mvc.static-path-pattern=/**spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,\ classpath:/static/,classp...
2018-12-12 13:49:17 206
原创 springboot static静态方法获取配置文件
因为springboot默认扫描的是*Application同级的包,包含子目录,所以,如果扫描不到ExcelUtil,需要在*Application加上@ComponentScan("com.*") ...
2018-12-05 14:48:30 14016
原创 SpringBoot 导出excel,浏览器下载
1、添加Dependency<dependency> <groupId>cn.afterturn</groupId> <artifactId>easypoi-base</artifactId> <version>3.1.0</version></dependency&am
2018-12-05 14:28:41 4794
ip2region.db
2020-07-02
BCompare3无广告,带注册码
2018-11-26
IETester Web浏览器调试
2018-11-26
超级方便截图软件
2018-11-26
BCompare3带注册码
2018-11-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人