《实战Nginx》PDF电子书下载

这本书全称是《实战Nginx:取代Apache的高性能Web服务器》,国内的张宴写的,这哥们应该是在金山逍遥网工作。

现在提供的下载是网上找的,仅为学习使用,如果大家觉得不错,希望支持一下作者,毕竟是咱们中国人自己写的书
https://diavps.vpser.net/nginx-pdf-download.zip
https://www.boobooke.com/b/book0469.zip
两个下载地址任选其一。

响应号召,页面变灰(方法转自张宴博客)

步骤如下:
  1、重新编译Nginx,增加http_sub_module模块:
wget https://nginx.org/download/nginx-0.8.39.tar.gz
tar zxvf nginx-0.8.39.tar.gz
cd nginx-0.8.39
./configure –user=www –group=www –prefix=/usr/local/webserver/nginx –with-http_stub_status_module –with-http_ssl_module –with-http_sub_module
make && make install
pkill -9 nginx
/usr/local/webserver/nginx/sbin/nginx

在nginx.conf配置文件的http {…}大括号内增加以下两行:
sub_filter  ‘</head>’  ‘<style type="text/css">html {filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); }</style></head>’;
sub_filter_once on;

保存后,重新加载配置文件:
/usr/local/webserver/nginx/sbin/nginx -t
/usr/local/webserver/nginx/sbin/nginx -s reload

如果某些带有Flash的页面仍显示彩色,或浏览器上下滚动条拖动时Flash FLV播放器变花(例如剑网3、剑侠世界官网分流页),将Flash改为JS输出(本例为SWFObject):
<script type="text/javascript" src="https://v.xoyo.com/site/v.xoyo.com/web/js/swf.js”></script&gt;
<div id="video_content"></div>
<script type="text/javascript">
<!–
    var video_player_so = new SWFObject("https://api.v.xoyo.com/external/player.swf?autostart=true&config=https://api.v.xoyo.com/external/video-542.swf", "sotester", "439", "246", "7");
    video_player_so.addParam("wmode", "opaque");
    video_player_so.addParam("allowfullscreen","true");
    video_player_so.addParam("allowscriptaccess","always");
    video_player_so.write("video_content");
//–>
</script>

ASE ChartDirector 简单介绍

这个程序是跨平台跨系统的在几乎所有编程语言下生成各种图表的程序(收费,如果没有lic文件的话,会在生成的图片下出现黄色条)

1、下载
https://www.advsofteng.com/download.html
目前支持语言
ChartDirector for ASP/COM/VB
ChartDirector for .NET
ChartDirector for JSP/Java
ChartDirector for ColdFusion
ChartDirector for PHP
ChartDirector for Perl
ChartDirector for Python
ChartDirector for Ruby
ChartDirector for Ruby

图形DEMO
https://www.advsofteng.com/gallery.html

继续阅读ASE ChartDirector 简单介绍

rrdtool学习系列-4

今天这讲是讲如何用rrdtool 进行绘图(接近成功)

rrdtool graph 文件名,一般文件名我们都用 *.png 格式;后面的参数比较多,咱们慢慢说
1、[-s|–start time] [-e|–end time] [-S|–step seconds]
你可以理解为你这个图做出了要显示的一个时间段,比如
–start=now-7200 \
–end=now \
意识是这个图是从2个小时前开始画起,到当前时间结束;step可省略,按rrd生成时候的step默认

2、[-t|–title string] [-v|–vertical-label string]
这个就不详细介绍了,-t 是图的标题,-v是图的Y轴注释

3、[-w|–width pixels] [-h|–height pixels] [-j|–only-graph]
图的宽度高度,-j这个参数有点意思,如果你指定-j,并设置高度<32像素,那么你会得到一个icon。

继续阅读rrdtool学习系列-4

设置DNS的BAT

有些时候找东西要翻墙,总是手动设置DNS,随着次数增多就发现太麻烦了,写个批处理执行

@echo off
@echo 开始更换DNS
@echo 正在设置主DNS信息………
netsh interface ip set dns "Local Area Connection" static 8.8.8.8 primary
@echo 正在设置辅DNS信息………
netsh interface ip add dns "Local Area Connection" 8.8.4.4
@echo DNS更换完成…
pause

红色标注的地方要换成你的网卡名

关于php的PEAR扩展库的使用

摘抄:PEAR是PHP扩展与应用库(the PHP Extension and Application Repository)的缩写。它是一个PHP扩展及应用的一个代码仓库,简单地说,PEAR就是PHP的CPAN。

今天安装phpbt做测试(https://phpbt.sourceforge.net/),就要用到PEAR,发现原来编译的php5.2.13用了without-pear,赶紧重新编译,加上了PEAR支持,安装phpbt,报告还是没有PEAR:DB,DB.php没有找到,仔细看了看安装完成后的PHP信息,原来要加一行到php.ini里的include_path里,如下
include_path = "/usr/local/php/lib/php"

加上后原以为会正常执行,还是报没有DB.php,到PEAR目录/usr/local/php/lib/php里发现的确没有DB.php怎么办?找了一些都是windows的例子,仔细分析,发现要用 pear install XX来安装,find发现pear已经被安装到php的bin目录了,那就好办了,去pear网站下载DB包(https://pear.php.net/package/DB),最后一版的名字叫db-1.7.14rc1,放在PEAR目录下,然后执行
/usr/local/php/bin/pear install db-1.7.14rc1
安装,等一会就会出现安装成功的提示,在看一下目录里是不是多了DB.php了?

需要说明的是,目前DB已经被MDB2 代替了,如果是较新的程序,装MDB2吧,支持的数据库更多。安装完后会在PEAR目录里生成一个MDB2.php的文件,但是DB.php和MDB2.php这两个程序无法互换。

我把这个过程写下来,希望会对以后用PEAR的朋友有个帮助!再废个话,phpbt界面太小气,舍弃!

rrdtool学习系列-3

今天这讲非常简单,就是如何更新(图)库文件!!虽然功能很简单,但这是出图很重要的一步,这步有问题,图根本就出不来。

rrdtool update demo1.rrd N:3.44:3.15:U:23
Update the database file demo1.rrd with 3 known and one UNKNOWN value. Use the current time as the update time.

rrdtool update demo2.rrd 887457267:U 887457521:22 887457903:2.7
Update the database file demo2.rrd which expects data from a single data-source, three times. First with an UNKNOWN value then with two regular readings. The update interval seems to be around 300 seconds

就这四句话,第1、3句是例子,2,4句是解释

N代表当前时间,U代表unknown数据;在第二个例子中,你要知道
887457267:U 887457521:22 887457903:2.7
标记为红色字体的这些数值都是时间,后面是插入的数据,就够了,很简单,而我们一般写shell的时候都用N来更新数据源,方便。大家消化消化,有什么问题可以在评论上写。