- 博客(21)
- 收藏
- 关注
原创 git 命令
mixed 默认方式,只保留源码,回退commit和index信息 soft 回退到某个版本,只回退了commit的信息,不会恢复到index file一级。如果还要提交,直接commit hard 彻底回退,本地源码也会变成上一个版本内容 一 恢复暂存区 1.列出最近的60个提交的文件 find .git/objects -type f | xargs ls -lt | sed 60q ...
2019-07-11 17:24:19 85
原创 centos7安装mysql
1.官网获取下载链接 然后wget 链接 2.解压到 /usr/local/mysql目录下 3.设置环境变量 vi ~/.bash_profile source ~/.bash_profile 4.复制mysql/support-files/mysql.server /etc/init.d/mysql 5.创建 /etc/my.cnf [client] port=3306 so...
2019-03-14 15:05:56 88
原创 docker入门
安装 [root@localhost soft]# yum install -y docker 查看版本 [root@localhost soft]# docker version 启动 [root@localhost soft]# systemctl start docker 下载镜像 [root@localhost soft]# docker run centos:7 sleep 100...
2019-01-01 17:24:41 101
原创 linux_mysql
安装 [root@localhost ~]# wget http://repo.mysql.com/mysql57-community-release-el7-8.noarch.rpm [root@localhost ~]# rpm -ivh mysql57-community-release-el7-8.noarch.rpm [root@localhost ~]# yum install ...
2019-01-01 01:07:53 67
转载 Python 正则式学习笔记
Python正则式的基本用法 1.1基本规则 1.2重复 1.2.1最小匹配与精确匹配 1.3前向界定与后向界定 1.4组的基本知识 2. re模块的基本函数 2.1使用compile加速 2.2 match和search 2.3 finditer 2.4 字符串的修改与替换 3. 更深入的了解re的组与对象 3.1编译后的Pattern对象 3.2 组与Match...
2018-12-21 20:19:01 201
转载 awk学习
awk是行处理器: 相比较屏幕处理的优点,在处理庞大文件时不会出现内存溢出或是处理缓慢的问题,通常用来格式化文本信息 awk处理过程: 依次对每一行进行处理,然后输出 awk命令形式: awk [-F|-f|-v] ‘BEGIN{} //{command1; command2} END{}’ file [-F|-f|-v] 大参数,-F指定分隔符,-f调用脚本,-v定义变量 var=...
2018-12-21 14:41:33 119
原创 日志分析命令
$ find ./ -name 'app_20181220.log'|xargs grep XXXXX|grep 'XXXXXX'|awk -F "," '{print $6}'|sort|uniq -c | more 1334 errorMessage: 84 errorMessage:ERROR status:502 270 errorMessage:Read tim...
2018-12-21 10:42:06 89
原创 常用的工具类
org.springframework.util.StringUtils <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> com.google.common.cache.Cache
2018-12-13 10:51:14 96
原创 logback
maven添加依赖 <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.7.25</version>
2018-12-12 14:23:15 91
转载 logback日志与MDC机制
阅读更多 &amp;nbsp; &amp;nbsp; logback是个比较好用的java日志输出工具包,可配置型高,而且性能优秀。 &amp;nbsp; 一、Layout描述 1、%logger{length}、%c{length}、%lo{length}:在日志事件的源点输出logger的名称,比如 &amp;nbsp; &amp;nbsp; 1)LoggerFactory.get
2018-12-11 20:01:33 1241
转载 Mock
初识 Mockito 这个测试框架后,我们要使用 Mock 的属性创建一个被测试类实例时,大概会下面这么纯手工来打造。 假定类 MyService 有一个属性 MyRepository myRepository: @Repository public class MyRepository { public void doSomething() { System.o...
2018-12-01 23:44:41 486
转载 单测H2
概述 Dbunit是一个基于JUnit的数据库集成测试框架。DBUnit 的设计理念就是在测试之前,给对象数据库植入我们需要的准备数据,最后,在测试完毕后,回溯到测试前的状态;它使数据库在测试过程之间处于一种已知状态,如果一个测试用例对数据库造成了破坏性影响,它可以帮助避免造成后面的测试失败或者给出错误结果。 Spring Test DbUnit提供了Spring T...
2018-11-29 21:43:54 725
转载 shell基础
$ cd `dirname $0` 和PWD%/* shell变量的一些特殊用法 在命令行状态下单纯执行 $ cd `dirname $0` 是毫无意义的。因为他返回当前路径的"."。这个命令写在脚本文件里才有作用,他返回这个脚本文件放置的目录,并可以根据这个目录来定位所要运行程序的相对位置(绝对位置除外)。 在/home/admin/test/下新建test.sh内容如下: cd `dirn...
2018-11-08 17:19:53 69
原创 spring配置文件
<context:property-placeholder location="classpath:cfg.properties,classpath:cfg2.properties"/>
2018-10-30 18:48:20 83
原创 获取spring容器的几种方式
// classpath:META-INF/spring/spring-config.xml private static ApplicationContext buildApplicationContext(String springConfigPath) { DefaultResourceLoader resourceLoader = new DefaultResourceLoade...
2018-10-30 17:33:58 1136
原创 Centos7安装jdk
1.下载jkd 2.解压 tar zxvf 3.设置环境变量 vi /etc/profile export JAVA_HOME=/soft/jdk8/jdk1.8.0_181 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JAR_HOME}/lib export PATH=${JAVA_HOME}...
2018-10-14 17:42:11 70
转载 在VMware中设置CentOS7的网络
为了能够使用XShell来管理我们安装好的CentOS7系统,所以我们要先设置CentOS7的网络使其能够联网。 1.选择vmware的编辑,然后点击虚拟网络编辑器 2.点击更改设置(需要有管理员权限) 3.选择VMnet0为桥接模式,选择自动或者网卡 4.打开“网络和共享中心”选择“VMware Virtual Ethernet Adapter fo...
2018-10-14 13:07:23 72
原创 AbstractGenericHttpMessageConverter
<mvc:annotation-driven> <mvc:message-converters> <bean class="com.showe.MyMessageConverter"/> </mvc:message-converters> </mvc:annotation-driven> import...
2018-10-10 14:46:02 1440
原创 spring自动任务
<!-- 每1分钟触发一次 --> <bean id="retryTaskWork" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="retryTask"/&g
2018-10-09 19:50:56 86
原创 shell命令
查看当前可使用shell: cat /etc/shells 查看当前系统使用的shell : echo $SHELL 环境变量:1 对所有用户生效 /etc/profile 2:对当前用户生效 $HOME/.bash_profile 变量用"="连接值,等号两侧不可有空格 将一个命令的结果赋给一个变量两种方式 1: A=`ls -al` 2: A=$(ls -al) 单引号会对所有特殊字...
2018-09-21 20:36:11 163
原创 shell案例
set -x n=1 while [ 10 -gt $n ] do echo "$n" n=`expr $n + 1` done for variables in list_of_iterms do command1 command2 done world=$1 if [ -n "$world" ];then echo "world长度大于零" else if [ ! -n "$worl...
2018-09-21 20:34:02 143
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人