2016年3月

shell判断文件,目录是否存在或者具有权限
#!/bin/sh

myPath="/var/log/httpd/"
myFile="/var /log/httpd/access.log"

# 这里的-x 参数判断$myPath是否存在并且是否具有可执行权限
if [ ! -x "$myPath"]; then
mkdir "$myPath"
fi

# 这里的-d 参数判断$myPath是否存在
if [ ! -d "$myPath"]; then
mkdir "$myPath"
fi

# 这里的-f参数判断$myFile是否存在
if [ ! -f "$myFile" ]; then
touch "$myFile"
fi

# 其他参数还有-n,-n是判断一个变量是否是否有值

- 阅读剩余部分 -

http://www.ingkee.com/s/?ctime=1459668248&uid=11366499&liveid=1459668248060711&share_uid=11366499
https://github.com/racaljk/hosts
https://raw.githubusercontent.com/racaljk/hosts/master/hosts

https://www.nginx.com/blog/thread-pools-boost-performance-9x/
http://www.cnblogs.com/mchina/archive/2013/01/30/2880680.html
http://www.cnblogs.com/allenblogs/archive/2011/05/19/2051136.html

server {

add_header Strict-Transport-Security max-age=31536000 always;

}
server {

ssl_session_cache        shared:SSL:10m;
ssl_session_timeout      60m;

ssl_session_tickets      on;
resolver                 8.8.4.4 8.8.8.8  valid=300s;
resolver_timeout         10s;
... ...

}