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
# 1. Make sure you have nginx sub module compiled in | |
# nginx -V 2>&1 | grep --color=always '\-\-with\-http_sub_module' | |
# 2. add two directives below at HTTP level | |
# nginx.conf | |
http { | |
# ...... | |
sub_filter '</head>' '<style type="text/css">html{ filter:progid:DXImageTransform.Microsoft.BasicImage(grayscale=1); -webkit-filter: grayscale(100%); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ |
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
<?php | |
ini_set("memory_limit","500M"); | |
date_default_timezone_set('Asia/Shanghai'); | |
ini_set('max_execution_time',300000); | |
echo "<pre />"; | |
$array=array(); | |
$data=array(); | |
$file=fopen('2013-11-19.csv','r'); | |
while($re=fgets($file)){ | |
$arr=explode(",",$re); |
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
打开: https://gist.github.com/ | |
选择编程语言(language) | |
编写或粘贴代码 | |
点击 "Create Public Gist" | |
将gist页网址粘贴在发布框即可 |
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
#Yaf手册提供的Nginx的Rewrite (nginx.conf) | |
#vi /usr/local/nginx/conf/nginx.conf | |
server { | |
listen ****; | |
server_name domain.com; | |
root document_root; | |
index index.php index.html index.htm; |
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
; Start a new pool named 'www'. | |
[xen] | |
; The address on which to accept FastCGI requests. | |
; Valid syntaxes are: | |
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on | |
; a specific port; | |
; 'port' - to listen on a TCP socket to all addresses on a | |
; specific port; | |
; '/path/to/unix/socket' - to listen on a unix socket. |
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
server { | |
listen 80; | |
server_name ~^(?<subdomain>.+)\.jingwentian\.com$; | |
root /home/wwwroot/jingwentian/$subdomain; | |
index index.html index.htm index.php; | |
fastcgi_intercept_errors on; | |
error_page 404 = /404.html; | |
location / { | |
# This is cool because no php is touched for static content. | |
# include the "?$args" part so non-default permalinks doesn't |
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 https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py | |
$ chmod a+rx speedtest_cli.py | |
$ sudo mv speedtest_cli.py /usr/local/bin/speedtest-cli | |
$ sudo chown root:root /usr/local/bin/speedtest-cli |
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:~# dig +trace jingwentian.com |
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
#运行用户 | |
user nobody; | |
#启动进程,通常设置成和cpu的数量相等 | |
worker_processes 1; | |
#全局错误日志及PID文件 | |
#error_log logs/error.log; | |
#error_log logs/error.log notice; | |
#error_log logs/error.log info; |
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/install.sh | |
chmod +x install.sh | |
./install.sh |
OlderNewer