技术相关
享受过程,期待结果!
js获取网页的width和height属性
1网页的width和height属性可以利用下面获得:
查看区别使用下面代码
alert(“网页可见区域宽: document.body.clientWidth:” + document.body.clientWidth + “\n网页可见区域高: document.body.clientHeight:” + document.body.clientHeight + “\n网页可见区域宽: document.body.offsetWidth (包括边线的宽):” + document.body.offsetWidth + “\n网页可见区域高: document.body.offsetHeight (包括边线的高):” + document.body.offsetHeight + “\n网页正文全文宽: document.body.scrollWidth:” + document.body.scrollWidth + “\n网页正文全文高: document.body.scrollHeight:” + document.body.scrollHeight + “\n网页被卷去的高: document.body.scrollTop:” + document.body.scrollTop + “\n网页被卷去的左: document.body.scrollLeft:” + document.body.scrollLeft + “\n网页正文部分上: window.screenTop:” + window.screenTop + “\n网页正文部分左: window.screenLeft:” + window.screenLeft + “\n屏幕分辨率的高: window.screen.height:” + window.screen.height + “\n屏幕分辨率的宽: window.screen.width:” + window.screen.width + “\n屏幕可用工作区高度: window.screen.availHeight:” + window.screen.availHeight + “\n屏幕可用工作区宽度: window.screen.availWidth:” + window.screen.availWidth);
JS 父窗口加载效果
0实现的效果大致如下,打开1.htm,点击链接新建窗口2.htm,点击2.htm中的链接,新建的窗口关闭并在1.htm窗口重定向。
1.htm代码如下
<html>
<body>
<a href=2.htm onclick=”window.open(’2.htm’)”>new</a>
</body>
</html>
PPTP和L2TP用户断线检测和强制下线
0使用Freeradius2+mysql+pptp+l2tp的过程中,发现非法断开或多人在线要强制断开一个连接其实很简单,直接修改数据库置为0不能将真实上线置0,正确的做法应该是通过循环检测特定的ppp进程,直接kill掉,才能真正下线。
为nginx站点添加ipv6访问
1最近为博客添加了ipv4、ipv6双解析,使用教育网进行v6测试通过,市区的网络是不支持ipv6的,其实添加ipv6非常简单,当然,首先,你必须为你的nginx安装好ipv6模块,就是在编译的时候使用–with-ipv6来安装,配置非常简单,我是配置ipv6独立ip访问,设置如下,在server段中,原先的设置完全不必变动,只需在listen 80下面加入下面一行即可,然后重启你的nginx。
listen [2607:f358:1:fed5:22:0:????:????]:80 ipv6only=on;
为特定Nginx站点设置SSL
0参考文献:http://wiki.nginx.org/NginxHttpSslModule
1.生成SSL证书公私钥
openssl req -new -x509 -nodes -out cert.pem -keyout cert.key
2.修改站点入站端口和加载SSL证书
server的监听由80改为443:listen 443;
在server中添加下面几行加载证书 (更多…)
为nginx添加http auth basic认证
0参考文献:http://wiki.nginx.org/NginxHttpAuthBasicModule
1.生成指定登录密钥
cd /usr/local/nginx/conf
mkdir auth
cd auth/
htpasswd -c -d .htpasswd 用户名 #回车并输入密码再回车
cacti监控nginx出现 no (LWP::UserAgent not found)
0当你使用cacti监控nginx性能时可能会出现 no (LWP::UserAgent not found) 的错误。经过我两台VPS环境对比发现的确原因是系统 perl 缺少了相关组件,但是解决办法却不是网络上搜出来的那些
cpan> install LWP::UserAgent
经过对比发现,缺少的是perl-libwww-perl这个软件包,解决方法就是直接yum安装进去就ok了。 (更多…)
最新评论