- 开启ipv4转发
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
- 安装dnsmasq 和pdnsd解决dns污染
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from Queue import Queue | |
import threading, random, time | |
__author__ = 'homeway' | |
__version__ = '2015.10.01' | |
class producer(threading.Thread): |
<?php | |
class MCrypt { | |
private $hex_iv = '00000000000000000000000000000000'; // converted JAVA byte code in to HEX and placed it here | |
private $key = 'U1MjU1M0FDOUZ.Qz'; //Same as in JAVA | |
function __construct() { | |
$this->key = hash('sha256', $this->key, true); | |
} | |
function encrypt($str) { |
#!/bin/bash | |
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin | |
export PATH | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script, please use root to install nfs" | |
exit 1 | |
fi |
#!/bin/sh | |
param=$1 | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script." | |
exit 1 | |
fi | |
start() |
package mojolly.io | |
import org.jboss.netty.bootstrap.ClientBootstrap | |
import org.jboss.netty.channel._ | |
import socket.nio.NioClientSocketChannelFactory | |
import java.util.concurrent.Executors | |
import org.jboss.netty.handler.codec.http._ | |
import collection.JavaConversions._ | |
import websocketx._ | |
import java.net.{InetSocketAddress, URI} |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <string.h> | |
#include <sys/wait.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#define TRUE 1 |
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
DNS的解析方案为 resolve.conf ==> dnsmasq ==> pdnsd
#!/bin/sh | |
PROXY_USER=user | |
PROXY_PASS=password | |
PROXY_PORT=3128 | |
# Clear the repository index caches | |
yum clean all | |
# Update the operating system |
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de> | |
-- licensed under the terms of the LGPL2 | |
-- character table string | |
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
-- encoding | |
function enc(data) | |
return ((data:gsub('.', function(x) | |
local r,b='',x:byte() |
require "try-catch" | |
try { | |
function() | |
error('oops') | |
end, | |
catch { | |
function(error) | |
print('caught error: ' .. error) |