摘要:
根据同事的经验分享:
环境:
os:windows7
vpn: openvpn5
1. 进入"设备管理器" 阅读全文
阅读排行榜
Apache, Nginx获得nginx代理后的真实用户Ip
2014-03-11 18:11 by cmsd, 459 阅读, 收藏,
摘要:
Nginx 的反向代理设置proxy_set_header X-Real-IP $remote_addr;apache可以设置日志格式将 %h替换为%{X-Real-Ip}i 如:LogFormat "%{X-Real-Ip}i %l %u %t \"%mhttp://%v%U%q\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" - %h" combinednginx可以设置$http_x_real_ip变量。 如log_format main '$http_x 阅读全文
rsync+sersync实时同步
2014-04-06 15:58 by cmsd, 447 阅读, 收藏,
摘要:
sersync安装配置
1.建立目录
mkdir -p /opt/sersync/{bin,conf,log}
2. 下载解压sersync
wget http://sersync.googlecode.com/files/sersync2.5_64bit_binary_stable_final.tar.gz
tar xvf sersync2.5_64bit_binary_stable_final.tar.gz 阅读全文
Python之配置文件模块 ConfigParser
2014-07-30 12:56 by cmsd, 445 阅读, 收藏,
摘要:
read(filename) #读取配置文件
sections() #返回所有section
options(section) #返回section中的option
items(section) #返回sectiond的键值对
get(section, option) #返回某个section,某个option的值,类型是string
getint, getfloat, getboolean 等等返回的只是类型不同
修改配置
add_section(section) #添加section
set(section,option,value) #添加或者修改值
write(open(filename,'w')) #保存到配置文件 阅读全文
screen命令学习
2013-12-18 11:40 by cmsd, 442 阅读, 收藏,
摘要:
我们有时需要做一些长时间的工作,比如格式化一个20T的raid磁盘,可能需要几个小时以上,如果只是执行格式化的话,由于网络不稳定,或者要下班了,还没格式化完成,关闭了ssh的窗口,命令可能就执行失败了,有人说用nohup后台执行,这个也是可以的,但是我们今天来用screen实现。1. screen分session和window session就是执行screen [-S session-name]生成的一个会话,在会话中可以打开多个window2. screen命令使用说明 -A 将所有的视窗都调整为目前终端机的大小。 -d 将指定的screen作业离线。 -m 即使目前已在作业中的... 阅读全文
浙公网安备 33010602011771号