- 博客(77)
- 资源 (33)
- 收藏
- 关注
原创 hadoop 命令执行报错解决
ls: Failed on local exception: java.io.IOException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any
2017-11-09 14:20:17
2592
原创 获取服务器出口ip
curl ip.cncurl http://members.3322.org/dyndns/getipcurl http://ifconfig.me/ip
2017-07-04 11:30:10
3251
原创 rsyslog 接收远程日志且去掉日志头
最近碰到一个需求是要用syslog接收远程日志,将远程日志输出到一个单独的文件中。实现这个需求,只需要在/etc/rsyslog.conf添加如下配置:$template IpTemplate,"/var/log/%FROMHOST-IP%.log"*.* ?IpTemplate& ~添加这三行配置之后,远程日志会被单独输出到一个以IP命名的日志文件中。查看该文件日志会发现每一条
2017-05-23 15:12:27
8077
原创 Spring @Value注解失败
Spring 版本 3.0.5.Release@Value注解有两种形式:1、@Value("${}")如果只在application-context.xml中注册配置文件: classpath:base.properties classpath:web.properties 在xxx-servlet.xml中不注册改配置文件,
2017-05-10 19:06:23
9906
原创 linux tomcat7 配置证书(JKS和PKCS12格式)
1. 环境说明系统:debian7JDK版本:1.7tomcat版本:72. 启动tomcat7说明apt-get install tomcat7之后,tomcat相关文件会被分配到两个目录:一个是/var/lib/tomcat7,另外一个是/usr/share/tomcat7。这两个目录catalina.home=/usr/share/tomcat7;catalina.b
2017-04-17 14:26:27
6385
原创 log4j.aditivity实现某类日志只输出到特定file
第一种需求:将log4j level高的输出到一个特定的文件,以便查看。下面展示一个log4j配置来实现这一功能### set log levels ### log4j.rootLogger = debug , stdout , D , E ### 输出到控制台 ### log4j.appender.stdout = org.apache.log4j.ConsoleA
2017-03-27 17:04:12
1904
1
原创 HttpClient javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
最近在调用一些https的接口,然后采用的认证方式是用户名+密码。这个时候调用接口则会提示httpclient未认证的错误,导致接口无法调用:HttpClient javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated。下面是我找到的解决方法。方法一: httpClient jar包版本为4.1.x
2017-02-16 16:33:28
8311
转载 DDoS攻击类型及工具总结
OSI 层级 攻击内容 Network Based (2-4层) IP Fragment Tear Drop SYN Flood (Dirt Jumper) TCP (connection) Flood e.g. SYN-ACK, ACK & PUSH-ACK, RST or FIN and F
2017-01-23 17:14:42
5908
原创 slowhttptest初体验
源码由于google code关闭,目前已经在Google code上搜不到slowhttptest,我在github上搜到了下面这个。源码:https://github.com/shekyan/slowhttptest参数中文说明测试模式:-Hslow headers 攻击,缓慢发送\r\n,让服务器一直等待-Bslow Body 攻击
2017-01-11 15:53:30
10414
原创 ubuntu安装ModSecurity
环境:Ubuntu 14.04一、准备各种库文件1、安装apacheapt-get install apache2apt-get install apache2-dev2、安装libapr和libapr-util官网http://apr.apache.org/下载libapr和libapr-util压缩包先安装libapr./configuremakesud
2017-01-04 16:08:32
2188
原创 LeetCode 387. First Unique Character in a String
387. First Unique Character in a StringGiven a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"retu
2016-12-02 19:18:10
505
原创 kafka 生产者和消费者实例
一、环境安装配置1、去官网下载kafka我下载的版本是 kafka_2.11-0.10.0.1.tgz,下面的实例也是基于该版本。2、解压安装tar -xzf kafka_2.11-0.10.0.1.tgz mv kafka_2.11-0.10.0.1 /root3、修改配置文件cd /root/kafka_2.11-0.10.0.1/configcp serve
2016-09-27 20:14:00
12198
原创 spring-data-redis连接操作redis
Java连接redis的客户端有很多,其中比较常用的是Jedis. (参考:redis client)spring-data-redis则是对Jedis进行了高度封装,使用起来非常方便。下面就以代码为例说明spring-data-redis的使用。整个项目使用maven管理jar包,pom文件如下:<project xmlns="http://maven.apache.org/PO
2016-08-02 21:12:32
24555
1
原创 利用内存分析工具(Memory Analyzer Tool,MAT)分析java项目内存泄露
一、开发环境:操作系统:ubuntu 14.04IDE:Eclipse Java EE IDE for Web Developers. Version: Luna Service Release 2 (4.4.2)JDK版本:1.7.0_80MAT版本:1.5.0二、事件起因最近通过公司的哨兵监控系统发现我的项目内存使用率每天都会增加一点,如下图。对于一个稳定运行的java
2016-02-23 20:46:29
74694
2
原创 使用Ibatis操作MySQL数据库
iBatis 是apache 的一个开源项目,一个O/R Mapping 解决方案,iBatis 最大的特点就是小巧,上手很快。如果不需要太多复杂的功能,iBatis 是能够满足你的要求又足够灵活的最简单的解决方案,现在的iBatis 已经改名为Mybatis 了。使用Ibatis操作数据库,我们的操作对象依然是student 表,创建语句:CREATE TABLE student(
2015-05-29 21:41:45
4205
原创 使用Spring JDBC框架连接并操作数据库
在前一篇博文JAVA通过JDBC连接并操作MySQL数据库中,我们知道如何通过JDBC连接并操作数据库,但是请看程序,整个程序连接数据库和关闭数据库占了很大一部分代码量,而且每次我们执行一下数据库操作都得来这么一大段重复代码,这是很烦人的。而在Spring框架中同样提供了JDBC框架,以供我们操作数据库。spring中的JDBC框架则可以为我们省去连接和关闭数据库的代码,我们只要关注我们想对数据库
2015-05-29 20:50:31
55816
19
原创 JAVA通过JDBC连接并操作MySQL数据库
JAVA通过JDBC连接并操作MySQL数据库 JDBC(Java Data Base Connectivity,java数据库连接)是一种用于执行SQL语句的Java API,可以为多种关系数据库提供统一访问,它由一组用Java语言编写的类和接口组成。首先我们在MySQL数据库中创建一个table,以供测试使用。建表语句如下:CREATE TABLE student(
2015-05-29 17:30:54
7840
原创 LeetCode 014. Longest Common Prefix
Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.找出所有字符串的最长公共前缀思路:先求前两个字符串的最长公共前缀,之后再将之前求出的最长公共前缀与第三个字符串求最
2015-01-18 15:01:37
1037
原创 LeetCode 013. Roman to Integer
Roman to Integer Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.从左至右进行遍历,如果当前的字符大于或等于后一个字符,那么总和加上该罗马字
2015-01-17 20:36:45
840
原创 LeetCode 012. Integer to Roman
Integer to RomanGiven an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.罗马数字规则:1、罗马数字共有7个,即I(1)、V(5)、X(10)、L
2015-01-17 20:32:07
980
原创 LeetCode 011. Container With Most Water
Container With Most Water Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of
2015-01-09 15:43:18
980
原创 LeetCode 005. Longest Palindromic Substring
Longest Palindromic Substring Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palind
2015-01-04 12:36:35
1086
原创 LeetCode 029. Divide Two Integers
Divide Two IntegersDivide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.这道题要求不用乘法、除法、模运算来计算两个整数的除法运算。
2014-12-29 20:43:20
951
原创 LeetCode 028. Implement strStr()
Implement strStr() Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.这道题实现是为了实现strStr(
2014-12-29 15:22:38
1034
原创 LeetCode 023. Merge k Sorted Lists
Merge k Sorted Lists Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity.一开始的思路是先将两个链表合并,然后每次从剩下的链表中取出一个链表与之合并。假设共有m条链表且
2014-12-25 16:43:16
805
原创 Leetcode - C++ 目录
LeetCode - C++ 目录LeetCode 001. Two SumLeetCode 002. Add Two NumbersLeetCode 003. Longest Substring Without Repeating CharactersLeetCode 004. Median of Two Sorted ArraysLeetCo
2014-12-24 13:26:33
1489
原创 LeetCode 026. Remove Duplicates from Sorted Array
Remove Duplicates from Sorted ArrayGiven a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for an
2014-12-24 13:15:49
810
原创 LeetCode 021. Merge Two Sorted Lists
Merge Two Sorted ListsMerge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.
2014-08-27 00:34:08
1054
原创 LeetCode 067. Add Binary
Add Binary Total Accepted: 15221 Total Submissions: 58891My SubmissionsGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".
2014-08-25 23:27:38
919
原创 LeetCode 061. Rotate List
Rotate List Given a list, rotate the list to the right by k places, where k is non-negative.For example:Given 1->2->3->4->5->NULL and k = 2,return 4->5->1->2->3->NULL.这道题要求
2014-08-25 22:39:28
819
原创 LeetCode 034. Search for a Range
Search for a Range Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the order of O(log n).
2014-08-25 12:20:12
855
原创 LeetCode 035. Search Insert Position
Search Insert Position Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may a
2014-08-03 21:18:39
815
原创 LeetCode 019. Remove Nth Node From End of List
Remove Nth Node From End of List Total Accepted: 17264 Total Submissions: 58052My SubmissionsGiven a linked list, remove the nth node from the end of list and return its head.For examp
2014-08-03 21:06:11
920
原创 LeetCode 025. Reverse Nodes in k-Group
Reverse Nodes in k-Group Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not a multiple of k then left-out node
2014-07-27 20:11:08
830
原创 LeetCode 027. Remove Element
Remove ElementGiven an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn't matter what you leave bey
2014-07-20 19:54:21
762
原创 LeetCode 017. Letter Combinations of a Phone Number
Letter Combinations of a Phone Number Total Accepted: 12594 Total Submissions: 48534My SubmissionsGiven a digit string, return all possible letter combinations that the number could repr
2014-07-20 17:05:15
957
原创 LeetCode 024. Swap Nodes in Pairs
Swap Nodes in Pairs Given a linked list, swap every two adjacent nodes and return its head.For example,Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm shoul
2014-07-20 16:18:49
996
原创 LeetCode 020. Valid Parentheses
Valid Parentheses Total Accepted: 14193 Total Submissions: 50886My SubmissionsGiven a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input stri
2014-07-19 14:14:54
893
openjdk-8-src-b132-03_mar_2014.zip
2018-01-17
SMPTE标准
2013-08-13
Keil4与Proteus7.8联调
2012-05-14
北邮信通院数字信号处理课件DSP合集
2012-03-08
verilog 实现数字跑表
2011-06-04
verilog 实现数字跑表
2011-05-31
数字信号处理 丁玉美 高西全 西安电子科技大学出版社出版 课后习题答案
2010-11-18
Visual C++实效编程百例光盘源代码
2010-06-26
Linux 命令大全
2010-06-26
VISUAL C++实效编程280例
2010-06-26
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人