技术相关

享受过程,期待结果!

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);

(更多…)

Linux关闭SELinux

0

在Linux下关闭 SELinux 的方法如下:

vim /etc/sysconfig/selinux

找到

selinux=enabled

改为 (更多…)

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>

(更多…)

C++ 笔记

0

http://www.uow.edu.au/~lukes/TEXTBOOK/notes-cpp/stl-containers/list/list-header.html

链表类方法解析http://www.uow.edu.au/~lukes/TEXTBOOK/notes-cpp/stl-containers/list/list-header.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了。 (更多…)

JS 定时器(setInterval/setTimeout)使用和失效

0

使用问题的话网上太多文章了,这里不赘述了

一直刷

var MyInterval=setInterval(“Refresh()”,1000);

(更多…)

Oracle是谁锁了表?

0

在多人协同开发中,往数据库中添加数据时常常会遇到有人锁定了整张表,查查谁锁掉表的用下面的语句吧!

直接在PL/SQL中新建一个SQL窗口运行即可。 (更多…)

Go to Top