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 | |
/** | |
* Use php curl multi, rolling request url. | |
* | |
* @author liwanghui@dratio.com | |
*/ | |
class CurlRoll | |
{ | |
/** |
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://pac.itzmx.com | |
var proxy = "PROXY ip:port;"; | |
var domains = { | |
"telegram.org": 1, | |
"abc.xyz": 1, | |
"findmima.com": 1, | |
"mima.re": 1, | |
"ip.cn": 1, |
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
转发请标明来源:http://www.dabu.info/centos6-4-structures-pptp-vpn.html | |
一、基本步骤: | |
1.先检查vps是否满足配置pptp vpn的环境。因为有的openvz的vps被母鸡给禁用了。其实,你在配置前最好向vps的客服发TK,可能客服会帮你开通vpn或者客服那里会给你他们自己定制的vpn一键安装包也有可能。 | |
2.接着是安装配置pptp vpn的相关软件,安装ppp和iptables。 | |
配置安装好后的pptp软件,这个不像windows那样,安装的过程就是配置的过程。linux的要安装完之后,修改配置文件,才算是完成配置。 | |
3.启动pptp vpn 服务。此时,就是检验你能够vpn拨号成功,如果你拨号成功了,说明你的pptp vpn的安装配置就算真正的完成了。但是此时只能登录vpn,却不能用来上网。 | |
4.开启内核和iptables的转发功能。这个步骤是为了让你连上vpn之后,能够上网,上那些yourporn,youtube之类的。这步是最关键的,很多人能成功拨号,登录vpn,但是却不能上网就是因为这个步骤没做好。这步骤完成了,你就可以尽情去国外的网站访问了。 | |
****************************************************************************************************************************** | |
第一步:检测是否符合pptp的搭建环境的要求 |
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
# -*- coding: utf-8 -*- | |
import sys | |
ip_src = sys.argv[1] | |
mask_src = sys.argv[2] | |
ip_dst = sys.argv[3] | |
mask_dst = sys.argv[4] | |
ip_src_arr = ip_src.split(".") | |
mask_src_arr = mask_src.split(".") |
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
---- | |
Linux 基于策略的路由(Linux Policy Routing) | |
Linux 有传统的基于数据包目的地址的路由算法,和新的基于策略的路由算法 | |
新算法优点:支持多个路由表,支持按数据报属性(源地址、目的地址、协议、端口、数据包大小、内容等)选择不同路由表 | |
# 查看规则命令,后面可跟其它参数,默认为 show(list) 显示全部 | |
ip rule |
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
function git_branch { | |
branch="`git branch 2>/dev/null | grep "^\*" | sed -e "s/^\*\ //"`" | |
if [ "${branch}" != "" ];then | |
if [ "${branch}" = "(no branch)" ];then | |
branch="(`git rev-parse --short HEAD`...)" | |
fi | |
echo " ($branch)" | |
fi | |
} |
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
#!/bin/sh | |
# create self-signed server certificate: | |
read -p "Enter your domain [www.example.com]: " DOMAIN | |
echo "Create server key..." | |
openssl genrsa -des3 -out $DOMAIN.key 1024 |
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
# 主要是用到了nginx的error_page指令 | |
server{ | |
server_name 10.21.200.75; | |
listen 6666; | |
error_page 404 @404; | |
location @404 { | |
root /home/fey6779; | |
try_files /404.html =404; | |
} | |
error_page 500 @500; |
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
#!/usr/bin/stap | |
global connections | |
global filter_port = 80 | |
// | |
global report | |
global spend_time | |
global active_count | |
global have_spend_time = 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
/** | |
* @param $lPort 本地端口 | |
* @param $rHost 远程主机 | |
* @param $rPort 远程端口 | |
*/ | |
function actionProxy2($lPort, $rHost, $rPort) | |
{ | |
$recvTimeoutSec = 5; | |
$localServer = stream_socket_server("tcp://0.0.0.0:$lPort", $lErrno, $lErrstr); | |
if ($localServer === FALSE) |
OlderNewer