![](https://img-blog.csdnimg.cn/20201217172452303.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
姿势备忘
文章平均质量分 57
人备忘
陈一米八
随便写写
展开
-
通过SSH同步两台服务器时间
expect脚本获取远程服务器时间 time.sh#!/usr/bin/expectset timeout 15set cmd_prompt "]#|~]?"spawn ssh root@192.168.2.1expect "password*"send "密码\r"set output [open datetime.now "w"]expect -re $cmd_prompt { send "date '+%Y%m%d %T'" send "\r" expect -re "\r\原创 2021-04-14 18:48:46 · 739 阅读 · 1 评论 -
Java导出CSV文件excel乱码
指定bom编码,把下面的代码拼接到最前面。new String(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF})比如new String(new byte[]{(byte) 0xEF, (byte) 0xBB, (byte) 0xBF}) + "测试"原创 2020-08-05 17:47:36 · 260 阅读 · 0 评论 -
使用java代码替换URL中的参数
private String replaceUrlParam(String url, String paramName, String paramValue) { if (StringUtils.isNotBlank(url) && StringUtils.isNotBlank(paramValue)) { int index = url.indexOf(paramName + "="); if (index != -1) {原创 2020-07-27 15:47:33 · 1695 阅读 · 0 评论 -
win10连接虚拟机Redis
首先创建redis安装目录# cd /usr/local/# mkdir redis# cd redis下载redisredis下载地址:http://download.redis.io/releases/# wget http://download.redis.io/releases/redis-5.0.3.tar.gz安装# cd redis-5.0.2# make && make install启动redis测试是否安装成功# redis-server关原创 2020-07-11 11:54:46 · 2828 阅读 · 1 评论 -
使用idea搭建maven项目时 java目录下的xml文件没有加载
<build> <resources> <resource> <directory>src/main/java</directory> <includes> <inclu...原创 2019-08-21 18:03:01 · 168 阅读 · 0 评论 -
springboot启动报错Failed to configure a DataSource: 'url' attribute is not specified
Description:Failed to configure a DataSource: ‘url’ attribute is not specified and no embedded datasource could be configured.Reason: Failed to determine a suitable driver classAction:Consider the...原创 2019-07-23 11:38:35 · 352 阅读 · 0 评论 -
spring-cloud-dependencies-Finchley.RC1.pom 下载失败
修改maven配置文件 settings.xml把 * 改为 central <mirror> <id>nexus-aliyun</id> <mirrorOf>*</mirrorOf> <name>Nexus aliyun</name> <url>http://maven.aliyu...原创 2019-07-22 15:56:24 · 2563 阅读 · 1 评论 -
码云+Maven+Jenkins+Tomcat构建SpringBoot项目
1、环境详细安装方法网上有很多教程,这里不再啰嗦那么多了javayum install java-1.8.0-openjdk.x86_64mavenyum install mavengityum install gittomcat下载地址:http://tomcat.apache.org/2、下载下载地址下载之后是一个war包3、启动将下载的war包放到t...原创 2019-10-17 16:14:55 · 351 阅读 · 0 评论 -
网页切换CSS实现换肤,并缓存到浏览器
引入两个CSS文件<link href="${base}/theme/classic/dist/css/default.css" rel="stylesheet" type="text/css" title="default"/><link href="${base}/theme/classic/dist/css/tumblr_style.css" rel="alternate stylesheet" type="text/css" title="tumblr"/>用JS来实原创 2020-05-24 21:19:19 · 460 阅读 · 0 评论 -
spring接口返回对象忽略为空的字段
spring接口返回对象忽略为空的字段开发中有两个接口经常会用到一个VO来返回数据,列表和详情接口,列表接口往往只需要返回id、名称等很少的信息,如果和详情接口共用一个VO的话会造成返回数据里有很多空值引入fastjson<dependency> <groupId>com.alibaba</groupId> <artifactId>fastjson</artifactId></dependency>在返回对象原创 2020-05-19 18:32:57 · 1800 阅读 · 0 评论 -
@ConfigurationProperties赋值给对象数组
项目中要用到多个微信配置,放到数据库每次去查很麻烦,想到把数据放到配置文件里,用@ConfigurationProperties注解赋值给数组,并添加根据某个属性获取配置的方法(类似于枚举)application.ymltest: configs: - name: config_1 value: 111 msg: 配置1 - name: config...原创 2020-04-29 21:48:21 · 4193 阅读 · 0 评论 -
java字节数组转File返回File对象
public static File bytesToFile(byte[] bytes, String fileType) throws IOException { return FileUtils.createTmpFile(new ByteArrayInputStream(bytes), UUID.randomUUID().toString(), fileType);...原创 2020-03-28 13:12:01 · 6248 阅读 · 2 评论 -
批处理根据端口号结束进程
新建一个txt,将下面的代码copy进去,改文件后缀为.bat,双击运行@echo off:startclsset i=0echo ===============================echo 【1】 显示所有端口占用情况echo 【2】 查看指定端口占用情况echo ===============================echo.set /p i="请选择...原创 2019-09-13 17:40:38 · 563 阅读 · 0 评论 -
UML各种图总结精华
参考:https://zhuanlan.zhihu.com/p/44518805https://www.w3cschool.cn/uml_tutorial/uml_tutorial-yen728t6.htmlUML(Unified Modeling Language)是一种统一建模语言,为面向对象开发系统的产品进行说明、可视化、和编制文档的一种标准语言。下面将对UML的九种图+包图的基本概念...转载 2019-09-02 15:24:27 · 385 阅读 · 0 评论 -
微信自定义菜单和个性化菜单添加emoji表情(兼容ios和安卓,防止小方框)
准备可访问外网电脑公众号后台账号密码AppidSecretPostman步骤1、 操作电脑IP需要在公众号后台设置IP白名单2、 打开https://mp.weixin.qq.com/debug/3、 获取公众号access_token(需要appid和secret)4、 自定义菜单>>自定义菜单创建接口>>将菜单json字符串添加到Body栏>...原创 2019-07-25 16:39:26 · 1371 阅读 · 0 评论 -
java返回某个字符串第某次出现的位置
public static Integer indexOfStr(String str,String findStr, int index){ Pattern pattern = Pattern.compile(findStr); Matcher findMatcher = pattern.matcher(str); int number =...原创 2019-07-30 15:29:58 · 1693 阅读 · 0 评论 -
chrome浏览器如何将网页保存为图片
1、ctrl+shift+i打开审查元素窗口2、ctrl+shift+p,输入full,回车原创 2019-08-27 10:55:26 · 2128 阅读 · 3 评论 -
如何用键盘控制windows窗口移动
有时候某个窗口的可拖动边框被移动到桌面外了,怎么把它给整回来?1、底部任务栏选中该窗口,或者alt+tab选中该窗口2、alt+space后按m键3、通过上下左右键移动窗口...原创 2019-08-27 11:04:01 · 4691 阅读 · 0 评论