java Runtime.exec() 执行问题

摘要: Runtime.exec() 不等同于直接执行command line命令!Runtime.exec()很有局限性,对有些命令不能直接把command line里的内容当作String参数传给exec().比如重定向等命令。举个例子:javap -l xxx > output.txt这时要用到ex... 阅读全文
posted @ 2015-07-15 17:11 renshaoping 阅读(1252) 评论(0) 推荐(0)

java log4j动态生成log文件

摘要: 1.配置logger的appender里面的filename是变量2.system.setpropery()变量值3.重新加载log4j.xml文件 DOMConfigurator.configure(url);4.getLoger保存得到的logger 阅读全文
posted @ 2015-07-14 18:47 renshaoping 阅读(612) 评论(0) 推荐(0)

java udp地址匹配

摘要: public static boolean regexUdpUrl(String url) { if (url == null) return false; Pattern pattern = Pattern .compile("[udp]+[://]+((\\d){1,})+\\.(... 阅读全文
posted @ 2015-07-03 13:56 renshaoping 阅读(239) 评论(0) 推荐(0)

Java socket阻塞设置超时

摘要: setSoTimeout(inttimeout) 启用/禁用带有指定超时值的 SO_TIMEOUT,以毫秒为单位。 阅读全文
posted @ 2015-07-03 13:54 renshaoping 阅读(1135) 评论(0) 推荐(0)

java httpsserver访问慢问题

摘要: https server访问满问题查看线程"Thread-2" prio=10 tid=0x00007f9a901a2800 nid=0x878 runnable [0x00007f9a4b2d2000] java.lang.Thread.State: RUNNABLE at java.net.In... 阅读全文
posted @ 2015-06-18 12:49 renshaoping 阅读(1381) 评论(0) 推荐(0)

java 查看ssl log

摘要: java -Djavax.net.debug=help MyApp Here are the current options: all turn on all debugging ssl turn on ssl debugging ... 阅读全文
posted @ 2015-06-17 11:48 renshaoping 阅读(966) 评论(0) 推荐(0)

iptables配置https防火墙策略

摘要: 需要两条规则:iptables -A INPUT -p tcp --dport 443 -j ACCEPT规则1用于放行客户端请求https服务的报文 阅读全文
posted @ 2015-06-10 10:44 renshaoping 阅读(902) 评论(0) 推荐(0)

java 一致性哈希源码 转

摘要: package hash;import java.nio.ByteBuffer;import java.nio.ByteOrder;import java.util.List;import java.util.SortedMap;import java.util.TreeMap;public cla... 阅读全文
posted @ 2015-05-15 16:18 renshaoping 阅读(144) 评论(0) 推荐(0)

mysql主备配置方法

摘要: 主备复制配置1,主备创建账号GRANT REPLICATION SLAVE,REPLICATION CLIENT ON *.*TO rep@’172.16.0.%’ IDENTIFIED BY ‘rep’;2,配置主库My.cnflog_bin=mysql-binserver_id=10innodb... 阅读全文
posted @ 2015-04-17 16:19 renshaoping 阅读(558) 评论(0) 推荐(0)

hibernate 缓存配置

摘要: 添加ehcache等jar包 hiberante.cfg.xml文件里面配置 true true org.hibernate.cache.ehcache.EhCacheRegionFactory ehcache.xml 阅读全文
posted @ 2015-01-05 17:07 renshaoping 阅读(97) 评论(0) 推荐(0)