This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.inetbase.com/scripts/ddos/uninstall.ddos | |
chmod +x uninstall.ddos | |
./uninstall.ddos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FREQ=1 #检测的频率为1分钟 | |
NO_OF_CONNECTIONS=100 #当单个IP超过100个连接请求时判定为DDOS | |
APF_BAN=0 | |
#如果打算使用APF阻止IP,则设置为1(需要预先安装APF);如果使用iptables,则设置为0; | |
KILL=1 #是否阻止 | |
EMAIL_TO="[email protected]" #接收邮件 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ubuntu安装ab | |
#apt-get install apache2-utils | |
#测试之前需要准备一个简单的html、一个php、一个图片文件。 | |
#分别对他们进行测试。 | |
##################################################################################### | |
#ab.html | |
root@jing:~#ab -kc 1000 -n 1000 http://192.241.233.63/example/ab/ab.html | |
This is ApacheBench, Version 2.3 <$Revision: 655654 $> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Requests per second: 6065.46 [#/sec] (mean) | |
Time per request: 164.868 [ms] (mean) | |
Time per request: 0.165 [ms] (mean, across all concurrent requests) | |
Requests per second | |
#表示当前测试的服务器每秒可以处理6065.46个静态html的请求事务,后面的mean表示平均。这个数值表示当前机器的整体性能,值越大越好。 | |
Time per request | |
#单个并发的延迟时间,后面的mean表示平均。 | |
#隔离开当前并发,单独完成一个请求需要的平均时间。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ab的参数详细解释 | |
#普通的测试,使用-c -n参数配合就可以完成任务 | |
格式: ./ab [options] [http://]hostname[:port]/path | |
参数: | |
-n #测试的总请求数。默认时,仅执行一个请求 | |
-c #一次并发请求个数。默认是一次一个。 | |
-H #添加请求头,例如 ‘Accept-Encoding: gzip’,以gzip方式请求。 | |
-t #测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Ubuntu安装代码 | |
wget http://nodejs.org/dist/v0.10.15/node-v0.10.15.tar.gz | |
tar -zxf node-v0.10.15.tar.gz #Download this from nodejs.org | |
cd node-v0.10.15 | |
./configure && make && sudo make install | |
cp /usr/local/bin/node /usr/sbin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
http.createServer(function (request, response) { | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
response.end('Hello World\n'); | |
}).listen(8000); | |
console.log('Server running at http://localhost:8000/'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install bower -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@jing:/home/wwwroot# bower install jquery | |
#在root执行时会提示: Cannot be run with sudo, 强制执行: You can however run a command with sudo using --allow-root option | |
root@jing:/home/wwwroot# bower install jquery --allow-root | |
bower not-cached git://github.com/components/jquery.git#* | |
bower resolve git://github.com/components/jquery.git#* | |
bower download https://github.com/components/jquery/archive/2.1.0.tar.gz | |
bower extract jquery#* archive.tar.gz | |
bower resolved git://github.com/components/jquery.git#2.1.0 | |
bower install jquery#2.1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xcache 是中国人自己写的php加速器.据各种评测资料,xcache是个相当不错的php加速器了: | |
现在eAccelerator 半死不活的样子,PHPA则需要专利授权,而 APC 又 bug 一大堆,基本上需要完全重写。现在,唯一象样的 PHP 编译/加速器就属 Xcache 了. | |
它稳定、快速、具有很强的可移植性,并且是开放源代码的,还可以缓存对象。 | |
于是打算试试看,freebsd下最方便的软件安装方式就是ports了. | |
在/usr/ports/www下没有找到xcache.于是.单独升级www ports树. | |
caicai# cvsup -L 2 -h cvsup.cn.FreeBSD.org /usr/share/examples/cvsup/ports-supfile |