http://www.gnu.org/software/coreutils/coreutils.html
http://lingrok.org/xref/coreutils/ 这个看源码有高亮(但是跳转到定义还是不太好使)
- 其实 /usr/bin/[ /usr/bin/test 都是 src/test.c 编译出来的
DevOps
http://www.gnu.org/software/coreutils/coreutils.html
http://lingrok.org/xref/coreutils/ 这个看源码有高亮(但是跳转到定义还是不太好使)
fastcgi_keep_conn on;
参考资料: http://www.cnblogs.com/lanxuezaipiao/archive/2013/05/23/3096001.html
测试IDE: Intelijj
坎坷:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
package phpor.json; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import net.sf.json.util.JSONUtils; import java.util.HashMap; import java.util.Map; public class Test { public static void main(String[] args) { Map<String, String> map1 = new HashMap<String, String>(); map1.put("name", "phpor"); JSONArray ja1 = JSONArray.fromObject(map1); String json_obj = ja1.toString(); String json_str = JSONUtils.valueToString(ja1.toString()); System.out.println(); System.out.println(json_obj); System.out.println(json_str + "\n"); JSONObject jo1 = new JSONObject(); jo1.put("str", json_str); jo1.put("obj", json_obj); System.out.println("期望看到的"); System.out.println("{\"str\":\"[{\\\"name\\\":\\\"phpor\\\"}]\\\"}]\",\"obj\":[{\"name\":\"phpor\"}]}"); System.out.println(); System.out.println("实际看到的"); System.out.println(jo1.toString()); } } |
输出结果:
1 2 3 4 5 6 7 8 9 10 |
[{"name":"phpor"}] "[{\"name\":\"phpor\"}]" 期望看到的 {"str":"[{\"name\":\"phpor\"}]\"}]","obj":[{"name":"phpor"}]} 实际看到的 {"str":"[{\\\"name\\\":\\\"phpor\\\"}]","obj":[{"name":"phpor"}]} Process finished with exit code 0 |
mac上原本使用ipfw来完成类似iptable的事情,但是
The ipfw command is deprecated in OS X Mountain Lion and later, but it has not been removed from Mavericks. If you run man ipfw
, a message will appear saying: This utility is DEPRECATED. Please use pfctl(8)
instead. While you may want to do port forwarding with pfctl
to future proof your solution, these instructions showing how to use ipfw
to do port forwarding will still work on OS X Mavericks.
http://knowm.org/port-forwarding-80-to-8080-using-ipfw-on-mac-os-x/
关于pfctl的使用: https://gist.github.com/kujohn/7209628
参考资料:
linux在线man: http://man7.org/linux/man-pages/
测试
a.sh
1 2 3 4 5 |
#!/bin/sh export A=A a=a ./b.sh echo "b is $b" |
b.sh
1 2 3 4 5 |
#!/bin/sh export b=B echo "a is $a" echo "A is $A" sleep 1000 |
1 |
sh a.sh |
1 |
cat /proc/pid_of_a.sh/environ | tr \\0 \\n |
结果: 没有A=A ,也没有 a=a
1 |
cat /proc/pid_of_b.sh/environ | tr \\0 \\n |
结果: 有A=A, 没有 a=a
结论:
脚本中执行其它脚本的几种方法:
1. 修改了tomcat类文件中的一个常量,这个常量是要写到页面中的
2. 修改了view中的一些模板
3. 打war包
4. 替换war包,tomcat开始热部署
5. 部署完毕,修改完全没有生效
6. 重启tomcat,修改生效
tomcat 中似乎没有一个方法可以查看当前正在处理的请求数,下面是一种方法:
1 |
lsof -p $tomcatpid -a -i -P|grep ESTABLISHED|grep ":8080->"|wc -l |
hostname 命令如何实现的?uname命令如何实现的?都是通过uname系统调用来实现的
hostid是干啥的? man gethostid