- 博客(53)
- 收藏
- 关注
原创 近期计划写的blog
1. Collection: HashSet & HashMap2. ConcurrentHashMap3. java.util.concurrent package4. ThreadPool5. JVM6. ClassLoading
2016-06-12 15:29:23
444
原创 Iterate HTTP request headers
StringBuilder sb = new StringBuilder("HTTP Request headers information... ");Enumeration names = request.getHeaderNames();while(names.hasMoreElements()){ String name = names.nextElement()
2015-10-22 13:17:38
694
原创 Liberty OpenID TAI configuration
By following links- https://w3-connections.ibm.com/wikis/home?lang=en-us#!/wiki/BlueID%20Single%20Sign-On%20%28SSO%29%20Self-Boarding%20Process/page/Configuring%20the%20WAS%20TAI%20for%20OpenID- h
2015-08-25 13:32:41
934
原创 Setup liberty server
1. create SSLbin/securityUtility createSSLCertificate --server=svr1 --password=passwd
2015-08-24 13:35:57
494
原创 URLRewriteFilter usage - use-query-string="true" and use-context="true"
manual: http://tuckey.org/urlrewrite/manual/4.0/1. If you want to take into account the url query parameters to the filter rules add use-query-string="true" to 2. Normal the rule
2015-08-18 14:24:35
1216
原创 Websphere liberty cluster installation
1. Override the defaultHostNamePlease pay more attention to command line options:collective help createcollective help joinThen I found:bin/collective create testController --h
2015-08-14 15:30:56
1359
原创 linux 更新war中的某个文件
比如要更新ROOT.war下的WEB-INF/web.xmlunzip ROOT.war1. 解压ROOT.war到当前目录(注意不是解压到ROOT/WEB-INF/, 否则会更新不成功)目录结构为:WEB-INF/web.xmlWEB-INF/...2. 更新WEB-INF/web.xml3. 重新装入war文件jar uvf ROOT.war
2015-08-14 10:02:01
949
原创 Linux iptables setup port 80/9080/9443
1. Problem - Found on website, using the following command to add a ruleiptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 9080 -j ACCEPTiptables -A INPUT -m state --state NEW -m tcp -
2015-08-13 15:52:27
738
原创 IBM HTTP Server https configuration
1. Generate kdbgskcmd -keydb -create -db ihskey -pw pwd -type pks12 -expire 365 -stash2. Generate Certificategskcmd -cert -create -db ihskey -pw pwd -size 1024 -dn CN=localhost,O=IBM,OU=IBM
2015-08-12 16:18:35
2076
原创 ask question on freenode IRC
ask question on freenode IRC/connect chat.freenode.net ./join openEJB //join a channel
2015-07-28 15:40:16
438
原创 #!/usr/bin/env bash和#!/usr/bin/bash的比较
stackoverflow:http://stackoverflow.com/questions/16365130/the-difference-between-usr-bin-env-bash-and-usr-bin-bash`#!/usr/bin/env bash` #lends you some flexibility on different systems`#!/usr/
2015-06-22 07:40:45
8739
原创 Coursera class library(xlsx) rJava加载失败
参考:http://www.r-statistics.com/2012/08/how-to-load-the-rjava-package-after-the-error-java_home-cannot-be-determined-from-the-registry/Sys.setenv(JAVA_HOME='C:\\Program Files\\Java\\jre7') # fo
2015-05-09 08:35:44
611
原创 linux 系统管理 - 用户管理
adduser与useradd的区别1. useradd 是更底层的命令,adduser是一个perl脚本,是对useradd的封装2. 在ubuntu下,可以看到/usr/sbin/useradd是不可读的二进制文件,而/usr/sbin/adduser是一个perl脚本文件,而且adduser中有对useradd的系统调用3. adduser提供交互时创建一个用户,会建立home
2015-03-30 07:35:32
491
原创 linux 系统管理
vnc server 配置:http://www.blogjava.net/icewee/archive/2013/02/22/395594.html
2015-03-27 16:35:58
426
原创 maven release
当小版本跳跃式升级时:可以用 mvn versions:set然后输入大版本号因为maven release plugin默认只是小版本号 +1.
2015-03-27 13:59:31
755
原创 Java 程序(httpclient) 访问https保护的网站
会报证书异常:解决办法:1. 浏览器信任证书后,从浏览器导出证书到一个文件;2. 导入证书到JRE cacerts中$ keytool -import -alias SYSTEMNAME -file SYSTEMNAME.cer -keystore $JRE_HOME/lib/security/cacerts
2015-03-26 17:41:07
562
原创 镜像maven repository的使用
1. 使用mirror的好处是什么? 提高项目build的速度。内网速度更高。2. 在mirror repository里,有些私有的repository, 用来存放hot fix的artificts比如,有些依赖的第三方jar有问题,但他们的release周期比较长,可以自己打patch, 放到私有仓库中等官方版本available之后,再替换。
2015-03-25 15:11:54
524
原创 hadoop 伪分布式的安装
出现的问题:1. 开启Hadoop2.6.0出现ssh无法解析主机名Starting namenodes on [Java HotSpot(TM) Client VM warning: You have loaded library /hadoop/hadoop-2.6.0/lib/native/libhadoop.so.1.0.0 which might have disabled st
2015-03-22 22:30:21
444
原创 主机Windows + 虚拟机linux 网络连接的配置
如果想在VMWare虚拟机中的ubuntu能上网,有两种配置:NAT: 在VMWare虚拟机的Virtual Machine Settings中Network 选择NAT模式 主机的Wireless Network Connection的属性Sharing中选择允许共享VMware Network Adapter VMnet8.Bridged:
2015-03-22 08:32:02
477
原创 Solr 与 项目 集成、单元测试
1. 新建一个mock-search maven module2. 将solr home configuation放到src/main/resource下3. copy solr home 到project/target/下 org.apache.openejb.maven tomee-ma
2015-03-17 13:28:00
906
原创 Solr migration from 4.7.1 to Solr 5.0
1. 不支持在solr.xml中定义solr core,采用discovery模式: 目录下含有core.properties,则为一个solr core.... in solr.xml 会导致solr初始化失败。2. 为了兼容性而存在的一下字段定义被删除了 比如在schema.xml中定义的如下字段必须删除(因为对应的类已经在solr-core-x.jar中删除了,
2015-03-14 12:52:45
441
原创 redhat linux apache2 安装
1. 安装APR > ./configure > make && make install2. 安装APR-Util > ./configure > make && make install3. 安装apache httd >./configure --prefix=/usr/local/apache2 --enable-so -
2015-02-13 13:54:29
597
原创 某B公司面试
1. 什么情况下发生内存溢出?什么情况下触发Full GC?2. ThreadLocal 变量存储在什么位置?3. 归并排序与快排的时间复杂度比较?4. 对select * from where a=* and b=* order by c 如何建索引?5. linux 里如何查看IO的负载状况?vmstat, iostat
2015-02-13 08:43:33
430
原创 redhat iptables 修改
iptables -A INPUT -p tcp --dport 8081 -j ACCEPT iptables -A OUTPUT -p tcp --sport 8081 -j ACCEPT service iptables save service iptables restart
2015-02-03 16:11:23
417
原创 web 负载均衡
1. 正向代理就是我们通常说的代理,需要客户端做特殊配置。正向代理接收客户端的请求,然后向目标服务器发送请求,并将接收到的响应返回客户端。比如,国内无法访问Facebook, 需要使用代理才能访问,这里的代理是正向代理。正向代理可以向目标服务器屏蔽客户端的身份。2. 反向代理对客户端是透明的,客户端不知道我们访问的是代理服务器。反向代理服务器接收客户端的请求,并根据
2015-02-01 15:40:05
437
原创 redhat linux下 Nginx的安装
1. 安装pcre去www.pcre.org 下载pcre-8.35./configure 提示没有gcc, g++...解决: yum install gcc yum install gcc-c++ not yum install g++2. 安装nginx./configure --user=www --group=www --prefix
2015-01-31 19:07:59
549
原创 gwt SplitLayoutPanel
panel.addSouth(), panel.addNorth(), panel.addEast(), panel.addWest() 必须出现在panel.add之前。panel.add其实就是add to Center.
2015-01-14 17:29:14
499
原创 gwt + ckeditor config.js定制化问题
此问题出现在本地测试的时候:1. 定制化config.js应该放的位置放到gwt/server 端的src/main/webapp/ckeditor/config.js下,这样会被打包到apache-tomee/webapps/ROOT下, 然后$wnd.CKEDITOR .replace(id, {
2015-01-14 13:20:27
477
原创 2015 互联网面试问题总结
1. 如何判断两次连续的http请求是否为同一个请求,防止第一个请求未返回时,又重复发送一遍? - 前端处理?2. 如果是service的话,如何判断是同一个请求, 避免重复处理?3. 如何对你的项目做性能评估,找出瓶颈?
2015-01-09 14:45:12
348
转载 Java EE中@Schedule的用法
From: http://superleo.iteye.com/blog/173349下面的表格显示了@Schedule annotation的一些默认值:Attribute Allowable Values Default Second[0,59]0Minute[0,59]0Hour[0,23
2014-12-24 15:25:44
924
原创 如何保持用户使用CKeditor时的设置选项(获取+恢复)
1. 对于B Bold, I: Italic, U: Underline, 可以通过使用editor.getCommand(command).state来获取是否设置 (CKEDITOR.TRISTATE_ON, CKEDITOR.TRISTATE_OFF), 然后通过editor.execCommand(command)来恢复用户设置的选项;2. 对于Styles, Fon
2014-12-23 14:14:00
570
原创 Solr 4.7.0 在windows7 & tomcat7.0.55 下部署及使用
1, 解压solr-4.7.0.zip,部署solr.war到tomcat/webapps下
2014-11-12 16:28:55
830
原创 Solr logging 配置
Tomcat by default uses a customized version of java logging api. The configuration is located at${tomcat_home}/conf/logging.properties. It follows the standard java logging configuration syntax plus
2014-11-10 14:40:35
1880
原创 java访问https服务时 keystore的管理
异常:PKIXCertPathBuilderImpl could not build a valid CertPath解决办法:
2014-10-29 16:22:42
1823
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人