- 开启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
| # Mathieu Blondel, September 2010 | |
| # License: BSD 3 clause | |
| import numpy as np | |
| from numpy import linalg | |
| import cvxopt | |
| import cvxopt.solvers | |
| def linear_kernel(x1, x2): | |
| return np.dot(x1, x2) |
| require "try-catch" | |
| try { | |
| function() | |
| error('oops') | |
| end, | |
| catch { | |
| function(error) | |
| print('caught error: ' .. error) |
| -- 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() |
| 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} |
| import os | |
| import struct | |
| import numpy as np | |
| """ | |
| MNist loading helper for Python 2.7. | |
| For Python 3.x, see https://gist.github.com/akesling/42393ccb868125071fdea77d98a0d2f0 | |
| Loosely inspired by http://abel.ee.ucla.edu/cvxopt/_downloads/mnist.py |
| # coding=utf-8 | |
| """ | |
| LICENSE http://www.apache.org/licenses/LICENSE-2.0 | |
| """ | |
| import datetime | |
| import sys | |
| import time | |
| import threading | |
| import traceback | |
| import SocketServer |
| #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 |
| #!/bin/sh | |
| PROXY_USER=user | |
| PROXY_PASS=password | |
| PROXY_PORT=3128 | |
| # Clear the repository index caches | |
| yum clean all | |
| # Update the operating system |
vi /etc/sysctl.conf
# 将net.ipv4.ip_forward=0更改为net.ipv4.ip_forward=1
sysctl -p
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): |