-
在Apache Tomee 1.7.4 下 可以通过指定log4j.configuration system properties来指定log4j.properties的位置。
export JAVA_OPTS="$JAVA_OPTS -Dlog4j.configuration=path_to_log4j_properties"
path_to_log4j_properties must be: **file:///**path
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
**mvn help:effective-pom** - 生成完整的pom.xml,包含从parent projects继承而来的东西 | |
**mvn dependency:copy-dependencies** - 将项目依赖的所有jars放到一个目录中target/dependency | |
以上两个命令可以将一个maven项目转换成一个Java project(src/, lib/, ...). | |
这个有时候在出现解决不了的问题,请求外部support时比较有用。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 布局显示 | |
我们的web项目,是基于angularjs + bootstrap的实现,在大部分用户的机器上页面显示正常,但在极少的用户机显示布局不整齐。 | |
有时候同一个浏览器同一个版本,大部分用户OK,少数不OK,问题不好重现。 | |
这个问题用户是在Firefox上发现的,但是我未能在本地Firefox重现,但在本地IE 10重现。 | |
解决:通过Inspect Element, 手动动态enable/disable CSS选项,找出问题CSS设置,有可能是CSS设置冲突。从找到解决办法到解决问题 | |
只花了不到十分钟。 | |
2. 页面加载 | |
CKEditor autosave插件在大部分用户那都能正常加载,少量用户那不能加载,显示TypeError: event.editor.lang.autosave is undefined plugin.js:60:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. API为什么这么火? | |
个人觉得API经济这么火,主要有两方面的原因: | |
一是越来越多的公司更加注重Ecosystem(生态系统)建设,将自己的服务和数据通过一定的方式共享出去,让开发者和第三方开发相应的应用, | |
既能扩大自身的资源利用率又能获取更多用户的认可,是一个多赢的局面; | |
二是移动互联网时代的到来,用户接入的多样化,任何系统都需要面对多终端的情况,造成一个后台,多套前端。需要进行前后端分离。 | |
后端以API的方式提供是一个很好的方式。 | |
2. REST API为什么这么火? | |
这是由REST 架构风格的好处决定的。虽然不是标准,但被广泛采用,胜似标准。因为不是标准,所以没有实现上的强制要求,有的只是指导原则。 | |
下面是对网络上设计原则及最佳实践的整理。 | |
3. REST API的设计原则 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@myhost # setcap cap_net_bind_service=+ep /usr/sbin/httpd | |
root@myhost # getcap /usr/sbin/httpd | |
/usr/sbin/httpd = cap_net_bind_service+ep | |
refer: https://wiki.apache.org/httpd/NonRootPortBinding |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# allow access to 80/443 for all | |
iptables -I INPUT -p tcp --dport 80 -j ACCEPT | |
iptables -I INPUT -p tcp --dport 443 -j ACCEPT | |
# allow access to 9081/9444 for all (for adminCenter operations) | |
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 9081 -j ACCEPT | |
iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 9444 -j ACCEPT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. mvn archetype:create-from-project | |
2. cd target/generated-sources/archetype | |
3. mvn install | |
Maven document: | |
Archetype creation | |
https://maven.apache.org/archetype/maven-archetype-plugin/advanced-usage.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# ---修改ip地址--- | |
ifconfig eth0 192.168.1.155 netmask 255.255.255.0 | |
# ---修改default gateway--- | |
route add default gw 192.168.1.1 | |
# 注意:一定要修改默认网关,否则外部ping 不通。 可以在修改IP前,通过netstat -rn 查看默认网关设置。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 创建putty 快捷方式 | |
2. 右键到properties | |
3. 在shortcut tab的Target中添加参数-load {alias name} -ssh -l {username} -pw {password} | |
4. 如果是使用ssh key的方式,则只需要添加-load {alias name} | |
5. 双击快捷方式可以实现自动登录 |
=== remove single line comment
eg: <!-- -->
sed -i '/<!--.*-->/ d' file
===
OlderNewer