Quantcast
Channel: 看得透又看得远者prevail. ppt.cc/flUmLx ppt.cc/fqtgqx ppt.cc/fZsXUx ppt.cc/fhWnZx ppt.cc/fnrkVx ppt.cc/f2CBVx
Viewing all 20528 articles
Browse latest View live

利用全局代理程序-tun2socks翻墙

$
0
0
在mac机器上。
wget https://github.com/FlowerWrong/tun2socks/releases/download/v0.5/tun2socks_darwin_amd64
chmod 755 tun2socks_darwin_amd64
mkdir ~/.tun2socks/
cd .tun2socks/
wget https://github.com/FlowerWrong/tun2socks/raw/master/config.example.ini -O config.ini
nano config.ini
(在[udp]段,去掉enabled = true前面的#号,并修改enabled = true为enabled = false)
cd ~
sudo ./tun2socks_darwin_amd64
运行sudo ./tun2socks_darwin_amd64之后,该命令会自动把mac机器的dns server地址改为127.0.0.1 ,并且会启动其内置的dns server,所以不用再去运行额外的dns proxy程序。
不要关闭此terminal.
然后,整台mac机器就处于翻墙状态了。
这个tun2socks程序还能智能区分国内外流量,所以访问国内的显示ip的网站https://ip.cn/,它显示的是你的isp分配给你的ip,访问国外显示ip的网站https://www.ipaddress.com/,它显示的就是你的vps的ip.

项目地址:
https://github.com/FlowerWrong/tun2socks/
https://github.com/FlowerWrong/tun2socks/issues/66

翻墙工具-yyrp

$
0
0
A http/https, socks proxy server, a mitm server and a ssocks server with rules.
Tested on OSX and linux.

Get started:

bundle install

rake down_mmdb
rake unzip_mmdb

# Optional, it is for mitm
rake gen_ca
rake install_ca

cp config.example.json config.json

cd examples
ruby proxy.rb # only http/https and socks 5 proxy
ruby mitm.rb # mitm server for https packet capture
ruby ss.rb # ssocks server

Memory Info

# brew install glances
glances

Settings

Terminal setting in .zshrc or .bashrc ...

functionsetp(){
export http_proxy='http://127.0.0.1:7777'
export https_proxy='http://127.0.0.1:7777'
echo"HTTP Proxy on"
}

functionunsetp(){
unset http_proxy
unset https_proxy
echo"HTTP Proxy off"
}

OSX NetWork Setting(It is not work for terminal)

OSX NetWork Setting
# ignore proxy
127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, 0.0.0.0

Idea form

Test

rake

Rules, see more config.example.json

  • There are 4 adapters, directmitmhttp(https) and shadowsocks.
  • There are 6 actions, http(https):http_adaptershadowsocks:shadowsocks_adapterdirect:direct_adapterspeed:select fastest adaptersmitm:mitm_adapter, and reject:just close this socket.
  • There are 6 rule types, geoipdomaindomain_keyworddomain_suffixip_cidr and other, note: rules are in order.
  • Filters is for packet capture, just work for http. if it is https, please use mitm action

Note

  • If you are using https adapter, the auth will be ignore

libtuntap 0.4

$
0
0
The portable Tun/Tap devices configuration utility.
libtuntap is a library for configuring TUN or TAP devices in a portable manner.

Contents

  1. Description
  2. Install
  3. Notes
  4. Contributing
  5. License

Description

TUN and TAP are virtual networking devices which allow userland applications to receive packets sent to it. The userland applications can also send their own packets to the devices and they will be forwarded to the kernel.
This is useful for developping tunnels, private networks or virtualisation systems.

Supported Features

  • Creation of TUN and TAP devices;
  • Autodetection of available TUN or TAP devices;
  • Setting and getting the MAC address of the device;
  • Setting and getting the MTU of the device;
  • Setting the status of the device (up/down);
  • Setting the IPv4 address and netmask of the device;
  • Setting the persistence mode of the device;
  • Setting the name of the device (Linux only);
  • Setting the description of the device (OpenBSD and FreeBSD only);
  • Wrapper libraries for other languages.

Supported Systems

  • OpenBSD;
  • Linux;
  • NetBSD;
  • Darwin (up to High Sierra).

Current Porting Efforts

  • Windows;
  • FreeBSD.

In the future

  • AIX;
  • Solaris.

Install

Requires

  • cmake;
  • C and C++ compilers.

Build

This project is built with cmake:
$ mkdir build; cd build
$ cmake ../
$ make
# make install
It is possible to tweak the destination folder for the install rule with the environment variable DESTDIR. The default behaviour is to install under the /usr/lib folder for Linux and /usr/local/lib for everyone else.
Example make invocation:
$ DESTDIR=/tmp make install
The following options can be tweaked:
  • ENABLE_CXX: Enable building of the C++ wrapper library libtuntap++;
  • ENABLE_PYTHON: Enable building of the Python wrapper library pytuntap;
  • BUILD_TESTING: Enable building of the regress tests;
  • BUILD_SHARED_LIBS: Build shared libraries instead of static ones.

Other languages bindings

We currently provide wrappers for two other languages: C++ and Python, respectively named libtuntap++ and pytuntap. More instructions about them is provided in the bindings folder.
The C++ library is built by default and can be disabled with the flag ENABLE_CXX.
The Python library is disabled by default and requires both ENABLE_CXX and ENABLE_PYTHON to work. You will also need Python 3.6 and Boost libraries.
Example cmake invocation:
$ mkdir build; cd build
$ cmake -D ENABLE_CXX=ON -D ENABLE_PYTHON=ON ../

Tests

A series of regress tests can be built with the BUILD_TESTING option. They are enabled by default. A list and a description for each of them can be found in the regress folder.
Example cmake invocation:
$ mkdir build; cd build
$ cmake -D BUILD_TESTING=ON ../
# make test

Static or shared

Up to version 0.3 the libtuntap CMakeFiles.txt exported two libraries: one shared, one static. To simplify the building of the wrapper libraries it was decided to only build one. The default is to build a static library but this behaviour can be changed with the option BUILD_SHARED_LIBS.
Example cmake invocation:
$ mkdir build; cd build
$ cmake -D BUILD_SHARED_LIBS=ON ../
$ make

Local configurations

The main CMakeFiles.txt includes an optional CMakeFiles.txt.local which can be used to store persistent options across builds.
Example:
$ cat CMakeLists.txt.local
set(BUILD_SHARED_LIBS ON)
set(BUILD_TESTING OFF)
set(ENABLE_CXX OFF)

Notes

Notes for Mac OS X users

You need to install the tuntaposx project for this library to be useful, which is a third-party kext.

Notes for Windows users

You need to install the tap-windows driver provided by the OpenVPN project.

年代向錢看 川普的貿易戰再追殺習近平!下令美企離開中國!用"1977年IEEPA權力法"嗆中共高官! 人民幣破7.18

Mellow ,一个基于规则进行透明代理的 V2Ray 客户端

$
0
0
A V2Ray client that can handle all TCP/UDP/ICMP traffic.





支持 Windows 和 macOS。

下载

https://github.com/eycorsican/Mellow/releases/download/v0.0.10/Mellow-0.0.10.dmg

特性

Mellow 可对所有应用、所有请求进行透明代理,不需要为每个应用或程序单独设置代理,它所支持的特性可以概括为:
MellowSurge MacSSTapProxifierOutline
透明代理
TCP 代理
UDP 代理
IP 规则
域名规则
应用进程规则
端口规则
MitM
URL Rewrite
多个代理出口
负载均衡
DNS 分流
SOCKS
Shadowsocks
VMess
WebSocket, mKCP, QUIC, HTTP/2 传输
Windows 支持
macOS 支持
其它 V2Ray 所支持的功能也都是支持的,上面并没有全部列出。

构建

# macOS
yarn && yarn distmac

# Windows
yarn && yarn distwin

扩展功能配置方式

自动选择最优线路

可根据代理请求的 RTT,自动选择负载均衡组中最优线路来转发请求。
"routing": {
"balancers": [
{
"tag": "server_lb",
"selector": [
"server_1",
"server_2"
],
"strategy": "latency",
"totalMeasures": 2,
"interval": 300,
"delay": 1,
"timeout": 6,
"tolerance": 300,
"probeTarget": "tls:www.google.com:443",
"probeContent": "HEAD / HTTP/1.1\r\n\r\n"
}
]
}

应用进程规则

支持 * 和 ? 通配符匹配,匹配内容为进程名称。
在 Windows 上,进程名称通常为 xxx.exe,例如 chrome.exe,在 Mellow 的 Statistics 中可方便查看。
在 macOS 上也可以通过 Mellow 的 Statistics 查看,也可以通过 ps 命令查看进程。
"routing": {
"rules": [
{
"app": [
"git*",
"chrome.exe"
],
"type": "field",
"outboundTag": "proxy"
}
]
}

配置示例

cfg.json
{
"log": {
"loglevel": "info"
},
"dns": {
"hosts": {
"localhost": "127.0.0.1"
},
"servers": [
{
"address": "8.8.8.8",
"port": 53
},
{
"address": "223.5.5.5",
"port": 53,
"domains": [
"geosite:cn"
]
}
]
},
"outbounds": [
{
"protocol": "vmess",
"settings": {},
"tag": "economic_vps_1"
},
{
"protocol": "vmess",
"settings": {},
"tag": "economic_vps_2"
},
{
"protocol": "vmess",
"settings": {},
"tag": "bittorrent_vps_1"
},
{
"protocol": "vmess",
"settings": {},
"tag": "expensive_vps_1"
},
{
"protocol": "freedom",
"settings": {},
"tag": "direct"
},
{
"settings": {},
"protocol": "blackhole",
"tag": "block"
}
],
"policy": {
"levels": {
"0": {
"connIdle": 300,
"downlinkOnly": 0,
"uplinkOnly": 0,
"handshake": 4
}
}
},
"routing": {
"domainStrategy": "IPIfNonMatch",
"balancers": [
{
"tag": "limited",
"selector": [
"expensive_vps_1",
"economic_vps_1"
],
"strategy": "latency",
"totalMeasures": 2,
"interval": 300,
"delay": 1,
"timeout": 6,
"tolerance": 300,
"probeTarget": "tls:www.google.com:443",
"probeContent": "HEAD / HTTP/1.1\r\n\r\n"
},
{
"tag": "bt",
"selector": [
"bittorrent_vps_1"
]
},
{
"tag": "nolimit",
"selector": [
"economic_vps_1",
"economic_vps_2"
],
"strategy": "latency",
"totalMeasures": 2,
"interval": 120
}
],
"rules": [
{
"domain": [
"domain:doubleclick.net"
],
"type": "field",
"outboundTag": "block"
},
{
"type": "field",
"ip": [
"1.1.1.1",
"9.9.9.9",
"8.8.8.8",
"8.8.4.4"
],
"balancerTag": "limited"
},
{
"app": [
"ssh",
"git",
"brew",
"Dropbox"
],
"type": "field",
"balancerTag": "limited"
},
{
"type": "field",
"domain": [
"geosite:cn"
],
"outboundTag": "direct"
},
{
"type": "field",
"ip": [
"geoip:cn",
"geoip:private"
],
"outboundTag": "direct"
},
{
"type": "field",
"app": [
"aria2c"
],
"balancerTag": "bt"
},
{
"type": "field",
"domain": [
"googlevideo",
"dl.google.com",
"ytimg"
],
"balancerTag": "nolimit"
},
{
"type": "field",
"domain": [
"domain:youtube.com",
"android",
"google",
"nyaa",
"git"
],
"balancerTag": "limited"
},
{
"ip": [
"0.0.0.0/0",
"::/0"
],
"type": "field",
"balancerTag": "nolimit"
}
]
}
}
from https://github.com/eycorsican/Mellow

xgo - Go CGO cross compiler

$
0
0


Although Go strives to be a cross platform language, cross compilation from one platform to another is not as simple as it could be, as you need the Go sources bootstrapped to each platform and architecture.
The first step towards cross compiling was Dave Cheney's golang-crosscompile package, which automatically bootstrapped the necessary sources based on your existing Go installation. Although this was enough for a lot of cases, certain drawbacks became apparent where the official libraries used CGO internally: any dependency to third party platform code is unavailable, hence those parts don't cross compile nicely (native DNS resolution, system certificate access, etc).
A step forward in enabling cross compilation was Alan Shreve's gonative package, which instead of bootstrapping the different platforms based on the existing Go installation, downloaded the official pre-compiled binaries from the golang website and injected those into the local toolchain. Since the pre-built binaries already contained the necessary platform specific code, the few missing dependencies were resolved, and true cross compilation could commence... of pure Go code.
However, there was still one feature missing: cross compiling Go code that used CGO itself, which isn't trivial since you need access to OS specific headers and libraries. This becomes very annoying when you need access only to some trivial OS specific functionality (e.g. query the CPU load), but need to configure and maintain separate build environments to do it.

Enter xgo

My solution to the challenge of cross compiling Go code with embedded C/C++ snippets (i.e. CGO_ENABLED=1) is based on the concept of lightweight Linux containers. All the necessary Go tool-chains, C cross compilers and platform headers/libraries have been assembled into a single Docker container, which can then be called as if a single command to compile a Go package to various platforms and architectures.

Installation

Although you could build the container manually, it is available as an automatic trusted build from Docker's container registry (not insignificant in size):
docker pull karalabe/xgo-latest
To prevent having to remember a potentially complex Docker command every time, a lightweight Go wrapper was written on top of it.
go get github.com/karalabe/xgo

Usage

Simply specify the import path you want to build, and xgo will do the rest:
$ xgo github.com/project-iris/iris
...

$ ls -al
-rwxr-xr-x 1 root root 9995000 Nov 24 16:44 iris-android-16-arm
-rwxr-xr-x 1 root root 6776500 Nov 24 16:44 iris-darwin-10.6-386
-rwxr-xr-x 1 root root 8755532 Nov 24 16:44 iris-darwin-10.6-amd64
-rwxr-xr-x 1 root root 7114176 Nov 24 16:45 iris-ios-5.0-arm
-rwxr-xr-x 1 root root 10135248 Nov 24 16:44 iris-linux-386
-rwxr-xr-x 1 root root 12598472 Nov 24 16:44 iris-linux-amd64
-rwxr-xr-x 1 root root 10040464 Nov 24 16:44 iris-linux-arm
-rwxr-xr-x 1 root root 7516368 Nov 24 16:44 iris-windows-4.0-386.exe
-rwxr-xr-x 1 root root 9549416 Nov 24 16:44 iris-windows-4.0-amd64.exe
If the path is not a canonical import path, but rather a local path (starts with a dot . or a dash /), xgo will use the local GOPATH contents for the cross compilation.

Build flags

A handful of flags can be passed to go build. The currently supported ones are
  • -v: prints the names of packages as they are compiled
  • -x: prints the build commands as compilation progresses
  • -race: enables data race detection (supported only on amd64, rest built without)
  • -tags='tag list': list of build tags to consider satisfied during the build
  • -ldflags='flag list': arguments to pass on each go tool link invocation
  • -buildmode=mode: binary type to produce by the compiler

Go releases

As newer versions of the language runtime, libraries and tools get released, these will get incorporated into xgo too as extensions layers to the base cross compilation image (only Go 1.3 and above will be supported).
You can select which Go release to work with through the -go command line flag to xgo and if the specific release was already integrated, it will automatically be retrieved and installed.
$ xgo -go 1.6.1 github.com/project-iris/iris
Additionally, a few wildcard release strings are also supported:
  • latest will use the latest Go release (this is the default)
  • 1.6.x will use the latest point release of a specific Go version
  • 1.6-develop will use the develop branch of a specific Go version
  • develop will use the develop branch of the entire Go repository

Output prefixing

xgo by default uses the name of the package being cross compiled as the output file prefix. This can be overridden with the -out flag.
$ xgo -out iris-v0.3.2 github.com/project-iris/iris
...

$ ls -al
-rwxr-xr-x 1 root root 9995000 Nov 24 16:44 iris-v0.3.2-android-16-arm
-rwxr-xr-x 1 root root 6776500 Nov 24 16:44 iris-v0.3.2-darwin-10.6-386
-rwxr-xr-x 1 root root 8755532 Nov 24 16:44 iris-v0.3.2-darwin-10.6-amd64
-rwxr-xr-x 1 root root 7114176 Nov 24 16:45 iris-v0.3.2-ios-5.0-arm
-rwxr-xr-x 1 root root 10135248 Nov 24 16:44 iris-v0.3.2-linux-386
-rwxr-xr-x 1 root root 12598472 Nov 24 16:44 iris-v0.3.2-linux-amd64
-rwxr-xr-x 1 root root 10040464 Nov 24 16:44 iris-v0.3.2-linux-arm
-rwxr-xr-x 1 root root 7516368 Nov 24 16:44 iris-v0.3.2-windows-4.0-386.exe
-rwxr-xr-x 1 root root 9549416 Nov 24 16:44 iris-v0.3.2-windows-4.0-amd64.exe

Branch selection

Similarly to go get, xgo also uses the master branch of a repository during source code retrieval. To switch to a different branch before compilation pass the desired branch name through the --branch argument.
$ xgo --branch release-branch.go1.4 golang.org/x/tools/cmd/goimports
...

$ ls -al
-rwxr-xr-x 1 root root 4171248 Nov 24 16:40 goimports-android-16-arm
-rwxr-xr-x 1 root root 4139868 Nov 24 16:40 goimports-darwin-10.6-386
-rwxr-xr-x 1 root root 5186720 Nov 24 16:40 goimports-darwin-10.6-amd64
-rwxr-xr-x 1 root root 3202364 Nov 24 16:40 goimports-ios-5.0-arm
-rwxr-xr-x 1 root root 4189456 Nov 24 16:40 goimports-linux-386
-rwxr-xr-x 1 root root 5264136 Nov 24 16:40 goimports-linux-amd64
-rwxr-xr-x 1 root root 4209416 Nov 24 16:40 goimports-linux-arm
-rwxr-xr-x 1 root root 4348416 Nov 24 16:40 goimports-windows-4.0-386.exe
-rwxr-xr-x 1 root root 5415424 Nov 24 16:40 goimports-windows-4.0-amd64.exe

Remote selection

Yet again similarly to go get, xgo uses the repository remote corresponding to the import path being built. To switch to a different remote while preserving the original import path, use the --remote argument.
$ xgo --remote github.com/golang/tools golang.org/x/tools/cmd/goimports
...

Package selection

If you used the above branch or remote selection machanisms, it may happen that the path you are trying to build is only present in the specific branch and not the default repository, causing Go to fail at locating it. To circumvent this, you may specify only the repository root for xgo, and use an additional --pkg parameter to select the exact package within, honoring any prior branch and remote selections.
$ xgo --pkg cmd/goimports golang.org/x/tools
...

$ ls -al
-rwxr-xr-x 1 root root 4194956 Nov 24 16:38 goimports-android-16-arm
-rwxr-xr-x 1 root root 4164448 Nov 24 16:38 goimports-darwin-10.6-386
-rwxr-xr-x 1 root root 5223584 Nov 24 16:38 goimports-darwin-10.6-amd64
-rwxr-xr-x 1 root root 3222848 Nov 24 16:39 goimports-ios-5.0-arm
-rwxr-xr-x 1 root root 4217184 Nov 24 16:38 goimports-linux-386
-rwxr-xr-x 1 root root 5295768 Nov 24 16:38 goimports-linux-amd64
-rwxr-xr-x 1 root root 4233120 Nov 24 16:38 goimports-linux-arm
-rwxr-xr-x 1 root root 4373504 Nov 24 16:38 goimports-windows-4.0-386.exe
-rwxr-xr-x 1 root root 5450240 Nov 24 16:38 goimports-windows-4.0-amd64.exe
This argument may at some point be integrated into the import path itself, but for now it exists as an independent build parameter. Also, there is not possibility for now to build mulitple commands in one go.

Limit build targets

By default xgo will try and build the specified package to all platforms and architectures supported by the underlying Go runtime. If you wish to restrict the build to only a few target systems, use the comma separated --targets CLI argument:
  • --targets=linux/arm: builds only the ARMv5 Linux binaries (arm-6/arm-7 allowed)
  • --targets=windows/*,darwin/*: builds all Windows and OSX binaries
  • --targets=*/arm: builds ARM binaries for all platforms
  • --targets=*/*: builds all suppoted targets (default)
The supported targets are:
  • Platforms: androiddarwinioslinuxwindows
  • Achitectures: 386amd64arm-5arm-6arm-7arm64mipsmipslemips64mips64le

Platform versions

By default xgo tries to cross compile to the lowest possible versions of every supported platform, in order to produce binaries that are portable among various versions of the same operating system. This however can lead to issues if a used dependency is only supported by more recent systems. As such, xgo supports the selection of specific platform versions by appending them to the OS target string.
  • --targets=ios-8.1/*: cross compile to iOS 8.1
  • --targets=android-16/*: cross compile to Android Jelly Bean
  • --targets=darwin-10.9/*: cross compile to Mac OS X Mavericks
  • --targets=windows-6.0/*: cross compile to Windows Vista
The supported platforms are:
  • All Android APIs up to Android Lollipop 5.0 (API level ids)
  • All Windows APIs up to Windows 8.1 limited by mingw-w64 (API level ids)
  • OSX APIs in the range of 10.6 - 10.11
  • All iOS APIs up to iOS 9.3

Mobile libraries

Apart from the usual runnable binaries, xgo also supports building library archives for Android (android/aar) and iOS (ios/framework). Opposed to gomobile however xgo does not derive library APIs from the Go code, so proper CGO C external methods must be defined within the package.
In the case of Android archives, all architectures will be bundled that are supported by the requested Android platform version. For iOS frameworks xgo will bundle armv7 and arm64 by default, and also the x86_64 simulator builds if the iPhoneSimulator.sdk was injected by the user:
  • Create a new docker image based on xgo: FROM karalabe/xgo-latest
  • Inject the simulator SDK: ADD iPhoneSimulator9.3.sdk.tar.xz /iPhoneSimulator9.3.sdk.tar.xz
  • Bootstrap the simulator SDK: $UPDATE_IOS /iPhoneSimulator9.3.sdk.tar.xz

CGO dependencies

The main differentiator of xgo versus other cross compilers is support for basic embedded C/C++ code and target-platform specific OS SDK availability. The current xgo release introduces an experimental CGO dependency cross compilation, enabling building Go programs that require external C/C++ libraries.
It is assumed that the dependent C/C++ library is configure/make based, was properly prepared for cross compilation and is available as a tarball download (.tar.tar.gz or .tar.bz2). Further plans include extending this to cmake based projects, if need arises (please open an issue if it's important to you).
Such dependencies can be added via the --deps argument. They will be retrieved prior to starting the cross compilation and the packages cached to save bandwidth on subsequent calls.
A complex sample for such a scenario is building the Ethereum CLI node, which has the GNU Multiple Precision Arithmetic Library as it's dependency.
$ xgo --deps=https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2  \
--targets=windows/* github.com/ethereum/go-ethereum/cmd/geth
...

$ ls -al
-rwxr-xr-x 1 root root 16315679 Nov 24 16:39 geth-windows-4.0-386.exe
-rwxr-xr-x 1 root root 19452036 Nov 24 16:38 geth-windows-4.0-amd64.exe
Some trivial arguments may be passed to the dependencies' configure script via --depsargs.
$ xgo --deps=https://gmplib.org/download/gmp/gmp-6.1.0.tar.bz2  \
--targets=ios/* --depsargs=--disable-assembly \
github.com/ethereum/go-ethereum/cmd/geth
...

$ ls -al
-rwxr-xr-x 1 root root 14804160 Nov 24 16:32 geth-ios-5.0-arm
Note, that since xgo needs to cross compile the dependencies for each platform and architecture separately, build time can increase significantly.

利用全局代理程序:quickqservice-tun2socks翻墙

$
0
0
在mac机器上。
sudo route add 127.0.0.1/32 192.168.1.1
sudo route delete default && sudo route add default 10.255.0.1

cd $GOPATH
go get -u -v github.com/eycorsican/go-tun2socks/
cd$GOPATH/src/github.com/eycorsican/go-tun2socks/
go get -d ./...
make clean && make build
(在当前目录下,会生成build目录)
cd build
(可以看到build目录里面出现了一个可执行文件tun2socks)
 ./tun2socks -h 
sudo ./tun2socks -proxyServer 127.0.0.1:1080 -proxyType socks -tunAddr 10.255.0.2 -tunGw 10.255.0.1 tunName tun1
(你的mac机器上,需开着纸飞机)
sudo networksetup -setdnsservers "Wi-Fi" 127.0.0.1

cd ~/goproxy-by-snail007 && sudo ./proxy dns -S socks -T tcp -P 127.0.0.1:1080 -p :53
然后,你的整台mac机器就处于翻墙状态了。
项目地址:https://github.com/quickqhk/quickqservice-tun2socks
不过我有一个疑问: 
https://github.com/quickqhk/quickqservice-tun2socks/issues/1
--------
 
https://github.com/eycorsican/go-tun2socks/
https://github.com/eycorsican/go-tun2socks/issues/30 

tun2socks-manager

$
0
0
Manage automatically SOCKS5 tunnel created with tun2socks.

Manage automatically SOCKS5 tunnel created with tun2socks from package badvpn.

Install

Install dependencies
sudo apt install dnsmasq-base
We need badvpn-tun2socks
sudo apt install cmake
git clone https://github.com/ambrop72/badvpn.git
cd badvpn
mkdir badvpn-build
cd badvpn-build
cmake /path/to/badvpn -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1
make
sudo cp tun2socks/badvpn-tun2socks /usr/local/bin
Install
sudo make install

Configure

See files /etc/tun2socks-manager.conf and sample file in /etc/tun2socks-manager.d.

Troubleshooting

Error org.freedesktop.DBus.Error.ServiceUnknown with dnsmasq

Error org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.NetworkManager.dnsmasq
was not provided by any .service files

Debugging

Messages are sent to /var/log/messages
grep tun2socks-manager /var/log/messages
When troubleshooting, it helps to follow these messages in a separate window. For instance:
tail -f /var/log/messages
First, the tun interface is created with:
/usr/local/tun2socks-manager start
Then the routing rule are created with (replace with correct network interface as necessary):
/usr/local/tun2socks-manager update eth0 up
from https://github.com/xeyownt/tun2socks-manager

利用AoikSocksVPN翻墙

$
0
0
Create VPN in one-liners with Shadowsocks, Kcptun and BadVPN Tun2Socks.
The VPN works this way: Packets headed for target host -> Kernel routing -> Tun virtual interface -> BadVPN Tun2Socks virtual router -> Shadowsocks client -> Kcptun client ---> Kcptun server -> Shadowsocks server ---> Target host
Tested working with:
  • CentOS 5.11
  • CentOS 6.8
  • CentOS 7.2
  • Oracle Linux 5.9
  • Oracle Linux 6.8
  • Oracle Linux 7.2
  • Fedora 24
  • Debian 7.11
  • Debian 8.6
  • Ubuntu 14.04
  • Ubuntu 16.04
  • Linux Mint 18

Table of Contents

Usage

Download this repository

Run:
# Download this repository's archive file
wget https://github.com/AoiKuiyuyou/AoikSocksVPN/archive/master.zip -O AoikSocksVPN-master.zip

# Extract the archive file to directory
unzip AoikSocksVPN-master.zip

# Rename the extracted directory
mv -Tv AoikSocksVPN-master AoikSocksVPN

Set up OS package repository configs

See AoikOSPackageManagerHowto for setting up OS package repository configs so that OS packages can be downloaded from a faster mirror repository.

Set up Kcptun

Run on both VPN server and client sides:
sudo PATH="$PATH" bash AoikSocksVPN/tools/kcptun/kcptun-setup.sh

Set up Shadowsocks

Run on both VPN server and client sides:
sudo PATH="$PATH" bash AoikSocksVPN/tools/shadowsocks/shadowsocks-libev-setup.sh

Set up BadVPN

Run on VPN client side:
sudo PATH="$PATH" bash AoikSocksVPN/tools/badvpn/badvpn-setup.sh

Set up AoikSocksVPN server

Run on VPN server side:
sudo PATH="$PATH" \
AOIKSOCKSVPN_SERVER_DIR='/opt/aoiksocksvpn-server' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_HOST='127.0.0.1' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_PORT='2080' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_ENCRYPT_PASSWORD='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_ENCRYPT_METHOD='aes-256-cfb' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_HOST='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_PORT='2090' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_ENCRYPT_KEY='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_PROG_INNER_CMD_EXTRA_OPTS='--mode normal' \
bash AoikSocksVPN/tools/aoiksocksvpn/aoiksocksvpn-server-setup.sh
This setup script can be re-run after tweaking these environment variables. It will print program usage in the end.

Start AoikSocksVPN server

Run on VPN server side:
sudo PATH="$PATH" bash aoiksocksvpn-server

Set up AoikSocksVPN client

Run on VPN client side:
sudo \
PATH="$PATH" \
AOIKSOCKSVPN_CLIENT_DIR='/opt/aoiksocksvpn-client' \
AOIKSOCKSVPN_CLIENT_ORIG_GATEWAY_HOST='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_HOST='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_PORT='2090' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_KCPTUN_SERVER_ENCRYPT_KEY='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_CLIENT_SHADOWSOCKS_CLIENT_KCPTUN_CLIENT_HOST='127.0.0.1' \
AOIKSOCKSVPN_CLIENT_SHADOWSOCKS_CLIENT_KCPTUN_CLIENT_PORT='1090' \
AOIKSOCKSVPN_CLIENT_SHADOWSOCKS_CLIENT_KCPTUN_CLIENT_PROG_INNER_CMD_EXTRA_OPTS='--mode normal' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_ENCRYPT_PASSWORD='(_TWEAK_THIS_)' \
AOIKSOCKSVPN_SERVER_SHADOWSOCKS_SERVER_ENCRYPT_METHOD='aes-256-cfb' \
AOIKSOCKSVPN_CLIENT_SHADOWSOCKS_CLIENT_HOST='127.0.0.1' \
AOIKSOCKSVPN_CLIENT_SHADOWSOCKS_CLIENT_PORT='1080' \
AOIKSOCKSVPN_CLIENT_TUN2SOCKS_INTERFACE_HOST='10.255.0.2' \
AOIKSOCKSVPN_CLIENT_TUN2SOCKS_ROUTER_HOST='10.255.0.1' \
AOIKSOCKSVPN_CLIENT_TUN2SOCKS_NETMASK='255.255.255.0' \
bash AoikSocksVPN/tools/aoiksocksvpn/aoiksocksvpn-client-setup.sh
This setup script can be re-run after tweaking these environment variables. It will print program usage in the end.

Start AoikSocksVPN client

Run on VPN client side:
sudo PATH="$PATH" bash aoiksocksvpn-client
from https://github.com/dogfight360/AoikSocksVPN

tun2socks-demo-app on android

翻墙工具sshsocksvpn

$
0
0

SSH Socks5 VPN

Goal

Have an easy way to manage socks tunnels created via SSH and manage a tun2socks on top of it.

Dependencies

Installation

pip install sshsocksvpn

Configuration

See examples
For advanced SSH configuration use ~/.ssh/config

Usage

sshsocksvpn --help
usage: sshsocksvpn [-h] -n NAME [-p PATH] {start,stop}

positional arguments:
{start,stop} Command to perform

optional arguments:
-h, --help show this help message and exit
-n NAME, --name NAME Name of the server to start
-p PATH, --path PATH Config file to use default ~/.config/sshvpn.cfg
from https://github.com/grimpy/sshsocksvpn

翻墙工具all2tun

$
0
0
It is a shell script that enables rerouting all traffic (TCP and UDP) to ssh tunnel through socks5 proxy. Powered by badvpn-tun2socks.

 It is just automation of use badvpn tun2socks proxifier. For more details about badvpn please go to author's homepagehttps://code.google.com/p/badvpn/ or github https://github.com/ambrop72/badvpn
I create the script mostly for usage by myself but if it will be useful for somebody else - it'll be great !
You need to have server with "white" IP that will work as proxy (it can be OpenWRT router for example) and you need to compile badvpn-tun2socks for your system and badvpn-udpgw for your remote server.
It is possible that I'll add some help and more detailed description here but no promise.
I'm very beginner in shell scripting and linux so there may be much better way to get proper functionality. I'll be very grateful for any feedback, bug report or comment. Feel free to fork and contibute...

badvpn开发的tun2socks的用法

$
0
0

Introduction

tun2socks is used to "socksify" TCP (IPv4 and IPv6) connections at the network layer. It implements a TUN virtual network interface which accepts all incoming TCP connections (regardless of destination IP), and forwards them through a SOCKS server. This allows you to forward all connections through SOCKS, without any need for application support. It can be used, for example, to forward connections through a remote SSH server or through Tor. Because of how it works, it can even be installed on a Linux router to transparently forward clients through SOCKS.

Installation

tun2socks is part of BadVPN. If you're on Linux, just build BadVPN with its CMake build system (or use the Gentoo package net-misc/badvpn, the Arch AUR or Ubuntu PPA packages). You can build just tun2socks without any other software in the package; this way, you don't need to have the NSS and OpenSSL libraries installed:
mkdir badvpn-build cd badvpn-build cmake /path/to/badvpn -DBUILD_NOTHING_BY_DEFAULT=1 -DBUILD_TUN2SOCKS=1 make
Alternatively, you can use a shell script to compile tun2socks only, in case using CMake is a problem for you: http://badvpn.googlecode.com/svn/trunk/compile-tun2sock.sh .
If you're on Windows, simply grab the Windows build of BadVPN.

Example (tunnelling through SSH)

First create a TUN device:
  • On Linux, use ip tuntap add dev tun0 mode tun user .
  • On Windows, install OpenVPN (or, if you already have it, click the start menu shortcut that creates a new TAP-Win32 device). The new device will appear in Network Adapters and will be identifiable by its Device Name field (saying Tap-Win32 something).
Configure IP for the device: assign IP address 10.0.0.1, netmask 255.255.255.0.
Now start the program (on Linux, run it as ): badvpn-tun2socks --tundev --netif-ipaddr 10.0.0.2 --netif-netmask 255.255.255.0 --socks-server-addr 127.0.0.1:1080
where is:
  • on Linux, tun0,
  • on Windows, "tap0901::10.0.0.1:10.0.0.0:255.255.255.0" (the three numbers are TUN interface IP address, network, and subnet mask).
NOTE: --netif-ipaddr 10.0.0.2 is not a typo. It specifies the IP address of the virtual router inside the TUN device, and must be different than the IP of the TUN interface itself.
Now you should be able to ping the virtual router's IP (10.0.0.2).
Connect to the SSH server, passing -D localhost:1080 to the ssh command to enable dynamic forwarding. This will make ssh open a local SOCKS server which badvpn-tun2socks will use. If you use Putty, go to Connection->SSH->Tunnels, type 1080 in Source port, choose Dynamic and click Add.
All that remains is to route connections through the TUN device instead of the existing default gateway. This is done as follows:
  1. Add a route to the SSH server through your existing gateway, with a lower metric than the original default route.
  2. If your DNS servers are in the Internet (rather than your local network), also add routes for them (like for the SSH server). This is needed because tun2socks does not forward UDP by default (see below).
  3. Add default route through the virtual router in the TUN device, with a lower metric than the original default route, but higher than the SSH and DNS routes.
This will make all external connections go through the TUN device, except for the SSH connection (else SSH would go through the TUN device, which would go through... SSH).
For example (assuming there are no existing default routes with metric <=6; otherwise remove them or change their metrics), in Linux:
route add gw metric 5 route add default gw 10.0.0.2 metric 6
Or on Windows (NOTE: tun2socks must be running and the interface of the default gateway must be working for these to succeed):
route add metric 5 route add 0.0.0.0 mask 0.0.0.0 10.0.0.2 metric 6
These routes will not persist across a reboot. You should probably make scripts that install and remove them. You can remove a route by changing the add to del or delete, depending on whether you're in Linux or Windows.
Windows 7: This OS has problems with respecting route metrics. If after a few minutes of normal operation connections suddenly stop being routed into tun2socks and instead go out the original default gateway, for no apparent reason, take a look at issue 5. One workaround is to temporarily remove the original default route.

UDP forwarding

tun2socks can forward UDP, however this requires a daemon, badvpn-udpgw to run on the remote SSH server. To enable UDP forwarding:
  1. On the remote SSH server, start: badvpn-udpgw --listen-addr 127.0.0.1:7300
  2. Add the following arguments to badvpn-tun2socks: --udpgw-remote-server-addr 127.0.0.1:7300

IPv6 support

NOTE: IPv6 support is only available in the SVN repository, and is not yet in a release version.
IPv6 forwarding in tun2socks works much like IPv4 forwarding. It is enabled using the --netif-ip6addr command line option. For example, you can assign the address fdfe:dcba:9876::1 to the TUN interface, and tell tun2socks to assume the address fdfe:dcba:9876::2, like this:
badvpn-tun2socks ...other..options... --netif-ip6addr fdfe:dcba:9876::2/126
Once this is done, you should be able to ping the virtual router inside tun2socks at fdfe:dcba:9876::2. To forward IPv6 through tun2socks, update your routing table appropriately.
UDP forwarding via badvpn-udpgw also supports IPv6. It is irrelevant whether the connection to the badvpn-udpgw program is made using IPv4 or IPv6, as long as it works.

Using with Tor

The goal here is to have all connections initiating from a virtual machine go through Tor via tun2socks.
NOTE: It is hard, but not impossible, to use tun2socks with Tor on a single host without a virtual machine, since the OS would have to route tun2socks outgoing connections differently from other programs. This can be achieved using policy routing, but this guide does not provide any more information.
WARNING: software in the VM may reveal information about you without your knowledge. The Tor project recommends only using the Tor Browser Bundle as your web browser. However, it is not possible to properly use this browser together with transparent proxying as described here. You should however at least use something like Chrome's Incognito mode; however, this is not equivalent to using the bundle. You can read more about the privacy features of the Tor Browser Bundle you may be missing on in this document.
NOTE: DNS queries done by the guest will be slower than if applications were directly configured to use Tor.
The following steps show how to set transparent proxying for the virtual machine.
  1. Let's assume you use VirtualBox to run the VM, and you run Tor on the host.
  2. Set the Network Adapter type in VirtualBox to Host Only.
  3. On the host, identify the IP address of the host on the VirtualBox interface. This IP address can found and configured in File->Preferences->Network. Most likely it will be 192.168.56.1. On a Linux host, this interface will likely be called vboxnet0.
  4. On the host, configure Tor to provide a SOCKS and DNS server for the VM to use. Do this by adding the following options to the torrc file (use the right IP address): "SocksListenAddress 192.168.56.1" and "DNSPort 192.168.56.1:53".
  5. Start Tor on the host. If possible, verify that it's listening on port numbers 9050 and 53 on the IP address of the VirtualBox interface (e.g. 192.168.56.1, not localhost!). On a Linux host, you can do this by running netstat -nlp as root.
  6. In the VM, configure the local network interface (the normal one, not TAP). Do not use DHCP; only set the IP address (e.g. 192.168.56.2). At this point, is should be possible to ping the guest from the host, and the reverse.
  7. On the guest, create and configure the TUN device for tun2socks, as is described in SSH tunneling example above. Additionally, set the default gateway (10.0.0.2) as part of interface configuration, and use Tor's DNS server, e.g. 192.168.56.1.
  8. Then finally start tun2socks in the guest, similarly to how it is done in the SSH example above. However, instead of using 127.0.0.1:8080 as the SOCKS server, use Tor's SOCKS server running on the host, e.g. 192.168.56.1:9050. Note that you don't have to manually configure any routes; the default route on the TUN interface is all that is needed. This is because the SOCKS and DNS servers are on the local network, so you don't have to override the default tun2socks route.
All traffic from the VM should now be going through TOR. TCP connections will be intercepted by tun2socks and will be sent through Tor's SOCKS server; DNS queries will be sent by the guest's OS directly to Tor's DNS server. UDP will not work because Tor doesn't support UDP.
This configuration has been tested using a Linux host and a Windows XP guest; however, it should work with any OS combination assuming the relevant software (tor, tun2socks) is supported. In particular, you're limited to Linux and Windows guests.
NOTE: Tor will issue warnings that IP addresses come without hostnames: "Warning: Your application (using socks5 to port 80) is giving Tor only an IP address....". This is normal and you might be able to silence it by adding these to torrc: SafeSocks 0 TestSocks 0 WarnUnsafeSocks 0 

from  https://code.google.com/archive/p/badvpn/wikis/tun2socks.wiki

在习近平的眼里,十四亿中国人是可以被驱赶的牲口

$
0
0

毛泽东连他周围视同手足的同乡、同志、战友、兄弟都能毫不留情的进行杀害消灭,那么对于其他老百姓就可想而知了。4000万人活活被饿死,他连眼睛眨都不眨一下,几千万人被他害死整死,他的身子没有抖擞过一下。为了一个独裁者的面子,他可以让数千万人失去面子,都被打成了“地富反坏右”的敌人。数亿人在中共党魁眼里只是个可以随时随地抹去的数字,是一群群奴隶,是草芥,是蝼蚁,那七百万香港人更不当一回事了。

这个口口声声要“为人民服务”的政党,这个口口声声自称是“人民公仆”的政府,这个念念不忘为人民群众办事的习近平,再看看他上台之后短短几年里的所作所为,就再清楚不过了。

习近平的亲信都是他的心腹打手,他所提拔的这些官员,不是靠吹吹拍拍上台的马屁精,就是心狠手辣的刽子手。北京市委书记蔡奇就是这样一个人物,他上任后立即放了三把火:驱低端、拆招牌、煤改气。搞得天怒人怨,人心惶惶。尤其是把低端人口烧得面目全非,在大冬天严寒季节里竟不顾别人死活,一道命令下来,3天内要把3百多万低端人口驱逐出京。并强令流氓般的警察把这些人的店铺和家一一捣毁,逼着他们无家可归。这些小百姓辛辛苦苦积累起来的财富和物质,一下子就化为了乌有。热闹的小区立即被夷为平地,他们手里提着剩下的物品,站在寒风中,不知何处才是他们的归宿?!

北方有这个蔡奇恶吏,南方也出了个恶吏叫刘奇,更是干出了令人发指丧天害理断子绝孙的事!两个“奇”南北呼应,一个比一个更“出奇”,一个比一个更歹毒凶狠。蔡奇驱的是低端人口,刘奇驱的是死去的人;前者要让活着的人难受,后者要让死去的人受罪,死了也要把你折腾一番:总之就是不让人好死好活。

刘奇是江西省省委书记和省人大常委会主任,上任才三个月,就放了这把奇怪之火。为了对习的效忠,他把手伸向了死人,以殡葬改革名义,把百姓家里给老人送终的棺材集中起来,然后用钢铁履带车猛砸猛拆。有些老人刚死去,全家人正忙着为死者入殓埋葬办丧事。那些如狼似虎的警察竟把已经埋进棺材里的死人拖出来,强行火化。此时全家人正为失去亲人而号陶大哭,但是这些豺狼竟不顾别人的感情,在众目睽睽之下抢夺死人!

俗话说掘坟毁尸是会遭到天劈雷打的,一般人不敢动手。但是共产党是唯物主义者,不信这一套,他们什么坏事都干得出来。

中共的邪恶在于:只要你想得到,它没有做不到的,而且,你没有想到的,他也会依然做得到,那是一个无缝不钻,无孔不入,无恶不作的恶魔组织。

估计刘奇此前在浙江和宁波任职期间,拆教堂、拆十字架,迫害基督徒一定不会少干。

而习近平干出来的坏事更是惊天动地!为了召开国际上只有几十个头头参加的会议,他可以把杭州青岛厦门的所有居民都驱赶出城。

2016年9月4日20国集团领导人第11次峰会在杭州举行,简称G20峰会。这只不过是一次极为普通的国际经济合作交流论坛而已,会议只举行两天。但习近平为了撑他要做世界领袖的面子,竟斥资三千亿,来打造这只有20个国家领导人参加为期两天的会场。在以保证安全的名义下,下令把全城市民都驱赶出杭州市,天哪杭州的人口有一千万啊!习近平一道命令,这一千万人不见了,杭州变成了一座空城!

2017年厦门召开金砖国家峰会,也是投资上千亿,全城戒严,清空全市人口,这次会议只开了一天,只有五个国家的领导人参加,哪五个:中国、俄罗斯、南非、印度、巴西。

天哪,为了在五个国家领导人面前摆阔气,撑面子,不惜耗费一千亿来打造会场,全厦门市戒严,驱赶人口!

2018年在青岛召开的“上合会议”,又是耗资上千亿,什么叫上合峰会,它的全称是“上海合作组织成员国元首理事会”,简称“上海五国”会议,后来有新成员国参加,变成了8个国家,它们是中国、俄罗斯、哈萨克斯坦、吉尔吉斯斯坦、塔吉克斯坦、乌兹别克斯坦、巴基斯坦、印度。基本上都是中亚和南亚的亚洲国家。就为了这8个国家的头头,习近平挥资千亿元来显示他的威风和称霸世界的野心。

青岛有一千万人口,为了所谓的安全,习近平也把这一千万人口都驱赶干净,青岛一时变成了空城!

会议举行期间,耗资五十亿元的灯光和烟火将为它们绽放,十万警察将为它们护航,南北大菜等着它们品尝,半径三百公里以内的企业停产、数百万工人至少七天没有经济来源……青岛的美丽与中国百姓无关,只要让这八个国家的元首玩得开心,吃得舒心,看的高兴,哪管中国老百姓的死与活!

2017年10月31日习近平带领6名中央委员来到上海中共一大会址,只不过在血红的党旗前举了举手,装模作样宣了宣誓。就为了这七个人,上海那条15公里长贯穿东西的通衢大道被封闭,川流不息的车流不见了,会址周围数百米居民家被清空了……

中国人就像被牲口驱赶,一千万人可以在瞬间消失,这就是在习近平统治下的处境!

习近平对自己的同胞如此,那么对于中国最坏的香港和有三分之二坏人的香港人能好得了吗?习近平这个“大好人”能坐下来与坏人交谈吗?

这样的一个“狂妄自大、目中无人、惟我独尊、老子天下第一”的大独裁者,他会低下身子去和香港抗议者面对面,对话吗?

川普大爷你是否有点太天真了?!


何清漣:研究中國的大外宣政策是台灣的責任

$
0
0


最近,由於北京針對香港抗議發動輿論戰,結果暴露了大外宣的一個新專案,政府出資購買推廣者,專門在海外Facebook、Twitter、Youtube等社交媒體上開設帳號,傳播中共抹黑香港抗議的資訊。8月19日,Twitter Inc.和Facebook Inc.的代表表示,一些帳戶被認為牽涉中國破壞香港反政府抗議活動的努力,因此暫時關停。從這兩家社交媒體公司問世以來,這是首次將中國視為一個虛假資訊活動來源予以暫時關停。

中共的網路大外宣是個研究盲點

2009年以前及此後的約五、六年當中,中國大外宣的重點主要是經營平面媒體及一些網站。研究者可以通過追索註冊者身份與資金來源發現其背景,確定媒體背後的出資方是誰,以此判斷媒體屬性。但大外宣進駐海外社交媒體方面卻是個研究盲點,因為Facebook的總裁紮克伯格一直希望進入中國,Twitter公司與中國的關係也很友好,大中國區的總裁一度任命了有軍方背景的中國高科技精英陳葵女士。因此,即使在2017年3月中國商人郭文貴利用所謂曝料發動「推特革命」,5月份中共醒過神來派出大量水軍與郭粉對峙,推特也從未干預過這種極不正常的社交媒體運作,更未公佈雙方各有多少帳號。Facebook倒是一度取消了郭的號,從而將中文臉書的虛假資訊與烏煙瘴氣減少了一點。
社交媒體的出現不過十餘年,目前還是一個無規則之地。(湯森路透)
這次Twitter表示,已暫停936個與源自中國的一項「國家支援重大資訊行動」相關的帳戶;Facebook表示,從Twitter獲得消息後,已刪除五個帳戶和七個公共主頁,這些帳戶和頁面觸達的帳戶超過1.5萬個,還有三個成員超過2,000人的小組。但事實上,有中共政府背景的帳號遠不止這些。
Twitter、Facebook與Google這次宣佈關閉與中國政府有關的自媒體,我相信只是其中一部分,真正的數字,這些公司應該會掌握比較接近的數字,但如果他們不開放這些數字,外界無法拿到。這些帳號在社交媒體上的操縱輿論能力及其影響,只有基於這些資料相關的資料上分析,才能夠做出分析。以Twitter為例,推特上估計中共水軍帳戶至少有20萬個,作為Twitter的最小語種用戶群來說,這個數量足以改變中文推特圈的輿論生態。

中文世界的紅色滲透研究,臺灣有責任深層掘進

社交媒體的出現不過十餘年,目前還是一個無規則之地。像Facebook(臉書)、Instagram、YouTube、微信等網站既成為人們獲取大量資訊的管道,也成為人們的聊天與聯繫工具。這些社交網站無可否認地充滿了陷阱,在其中魚目混珠、渾水摸魚的大有人在。
由於社交媒體曾在伊朗大選、阿拉伯之春中發揮過重要的政治作用,還由於各種犯罪者在社交媒體上釣魚並屢屢成功,各國政府都有程度不等的介入管理,方式主要是督促相關公司自我監管,目前,有關社交網站上出現的內容,主要依賴于網站的自行監管,像YouTube和 Facebook這些網站都有自己的規則,規定不能上傳的內容包括虛假新聞、仇恨或極端主義言論,以及可能危害人們身心健康的內容。政府更多地是監管社交媒體公司。比如英國準備設立一個獨立監管機構,對在社交平臺上出現危害社會和公眾內容的公司採取懲罰性措施,包括巨額罰款和停止其經營業務。
中國政府對社交媒體監管相當嚴格,被認為是干預言論自由的典型;但同時又派出官方媒體或採用外包的方式購買水軍攪亂他國的社交媒體,為了特定目的製造假新聞。這種對內對外分裂式的政府行為非常罕見——俄羅斯有類似行為,但規模遠小於中國。對於這種行為,聽之任之就是縱容。
中國政府對国内社交媒體的監管相當嚴格,但同時又派出官方媒體或採用外包的方式購買水軍攪亂他國的社交媒體。(湯森路透)
中國建立大外宣體系向全世界進行紅色滲透,第一大語種當然是中文世界,這個體系已經通過各國的中文媒體建成;第二大語種是英文,美國、澳大利亞、加拿大等國的防範主要在這個語種方面,對大外宣滲透華文媒體並不真關心,認為就算滲透,影響也是邊緣性的。世界上講中文為主的區域,除了中國本土之外,還有香港、臺灣、新加坡等地。香港與新加坡不可能投入資金人力去研究中國對這些地區的滲透,而我那本《紅色滲透:中國媒體在全球擴張的真相》由於初稿成書於2012年,因為是個人研究,無法獲得網路滲透的詳實資訊。交付出版前雖然對2012年以後的資料有大量補充,但主要還是集中於中共對平面媒體及相關網站的控制與滲透。
這一遺憾,在出版前已經有臺灣大學傳媒研究所教授張錦華女士指出,我告知研究所謂假新聞由大陸輸出,我一人之力難以完成。今年5月我在臺灣為本書做推廣時,也有人提出這本書並沒有研究臺灣從去年開始出現的假新聞與中共的關係。我當時回答說,這些假新聞的出現,我相信背後有中共的手。
但是,做研究不能全憑推論,網路資料的獲得,遠遠超出了我這位個人研究者的能力,這需要有網路公司的配合與政府力量介入,我希望臺灣相關部門能夠投入資金、人力專門做這項研究。近日,我看到臺灣淡江大學中國大陸研究所助理教授黃兆年在一篇文章中指出,除了經濟吸納之外,根據新近研究,北京對臺灣媒體施加影響的方法,還包括「規範擴散」(norm diffusion)、「假訊息輸出」等途徑,亦即:除了資金滲透之外,其實還有文化滲透與資訊滲透。我認為這個研究方向非常正確。如同我今年5月在臺灣的多場公開演講中所談過的那樣:《紅色滲透》一書不是專門研究臺灣,在研究中共大外宣體系建立方面,只算是拓荒之作,每一章涉及的專題都值得深層掘進,尤其是中共利用財力與科技力在網路滲透這一方面,並不是任何個人有能力完成的研究課題。
中共利用財力與科技力在網路滲透這一方面,並不是任何個人有能力完成的研究課題。(湯森路透)
※作者為中國湖南邵陽人、作家、中國經濟社會學者。現今流亡美國,曾任職於湖南財經學院、暨南大學和《深圳法制報》報社。長期從事中國當代經濟社會問題研究。著有《中國:潰而不崩》、《中國的陷阱》、《霧鎖中國:中國大陸控制媒體大揭密》等書

川普大爷面对的习近平究竟是个什么东西?

$
0
0


习近平在中美谈判中两次毁约,为什么,因为他是永远伟大光荣正确的,刘鹤与美国代表团所签订的协议不合他的口味,所以要取消,所以要说话不算数。

因为要自封为光荣正确伟大,所以要不断地开展阶级斗争,只有把别人斗成王八蛋臭狗屎,才能树立起他的伟大来。为此它要不断地找假想敌,今天斗这个明天斗那个,把别人都斗倒斗垮了,他们才能像毛泽东那样“与天斗,其乐无穷;与地斗,其乐无穷;与人斗,其乐无穷”!斗人成了中共和党魁们最快乐的事情。习近平继承了毛泽东的阶级斗争衣钵,在他父亲的陵园中矗着一块醒目的石碑,碑文是“战斗一生,快乐一生;天天奋斗,天天快乐。”

所以习近平上台后,他斗人从来没有停止过:他斗贪官,斗教授,斗知识分子,斗律师,斗异议人士,斗访民,斗学生,斗低端人口……对外斗美帝,斗日本,斗越南,斗印度,斗韩国,斗台湾,斗加拿大……只要对中共不利的,哪怕没有影响过他们,他们也要斗:哪个国家接见达赖喇嘛、蔡英文,他们就斗哪个国家;瑞典把诺贝尔和平奖颁发给了刘晓波,中国政府就抗议这是“严重干涉中国内政和司法主权”行为,开始制裁瑞典政府。当瑞典把文学奖颁发给了莫言后,他是党内人士,所以中共就特别高兴。就连从小就生长在台湾的小演员因为举了一面中华民国的国旗,就要打压和制裁这个小演员……

而毛泽东却可以接见红色高棉大屠杀的刽子手波尔布特,还称赞他杀了柬埔寨两百万人杀得好;习近平政府可以接见国际恐怖组织塔利班……中共就这么霸道:只许他们在世界各地放火,不许别人在自己地盘上点灯。

毛泽东扬言要把世界管起来,习近平却是要把世界关起来。

他那每天挂在嘴边的“不忘初心,牢记使命”,就像一声声战斗的嚎叫,从来没有停止过。一旦他把你瞄准为假想敌,那你就永远是他中共的敌人,永远是中共的反而教员,绝对不会放过你。

中共把美国当敌人并不是最近二十多年才开始的,也不是1949后开始的,早在1946年12月中共策动北平地下党,制造了一起沈崇被美军强奸案就开始了。这是中共策划的造假案件,沈崇事件传出后,中共挑动北平、天津、上海、南京、武汉、重庆等全国数十个大中城市学生和各界人士约50万人,举行声势浩大的示威游行,抗议美军暴行,要求美军滚出中国,废除《中美商约》等。接着又开展了 “反饥饿、反内战,反迫害”为口号的反国民党运动。从那时起“打倒美帝”口号不绝于耳。但是他们对于苏军进入东北大肆强奸中国妇女和大拆工厂机器,以战利品名义掠夺运往苏联时,却一声不吭,没有放过一声屁! 

中共不是不知道,美军在抗日援华的期间,“飞虎队”曾穿越世界第一高峰喜马拉雅山,打通了一条从缅甸进入中国内地的“驼峰航线”,美军先后投入2100架飞机,运送了85万吨战略物资,为此美军共损失飞机1500架,牺牲优秀飞行员近3000人。

 但是中共为了斗争需要,可以背信弃义、忘恩负义,它可以把牺牲的3000名美军飞行员像数字一样从人们的记忆中抹去,但是却对一个美军所谓“强奸”了北平女学生展开了猛烈的攻击。甚至把美军对华的援助反咬一口,称美帝国主义居心叵测,不按好心!

美国人一定搞不明白,为什么美国人对中国这么好,还要反对我们?其实道理很简单:中共一旦把你当做敌人,就变成了他们打击的活靶子了。你做的所有好事,在他们的眼里都是坏事,好事也是坏事,“打倒美帝国主义”口号七十多年以来有过变化吗?没有。

他们甚至有几句更绝的口号,在文革中流传很广,这口号叫做“宁要社会主义的草,不要资本主义的苗”;“宁要社会主义晚点,不要资本主义正点”;“宁要贫困的社会主义,不要富裕的资本主义”!在爱国反日期间,更有吓人的口号:“宁可大陆不长草,也要收复钓鱼岛”;“哪怕华夏遍地坟,也要杀光日本人”。如今又出了一首:“宁可中国人人苦,也要搞垮特朗普”!

所以现在许多的亲共派和海外小粉红,“宁被习大大害死,也不愿在美国活得舒坦”。而习近平更是这样:他宁可全家被毛泽东迫害,甚至已经到了死亡的边缘,也要把毛泽东当作比父亲还父亲的偶像崇拜!

所以在中国,要把一切的事物都颠倒过来看,好人在魔鬼的眼里就是坏人,流氓地痞恶霸刽子手在魔鬼的眼里就是好人!

当川普一再声明香港是中国问题,美国不会去插手的时候,他想躲都躲不过。中共称这是美国幕后插手指使的。川普大爷真是 “哑巴吃黄连,有苦说不出”。“好心没好报!”在习近平的眼里,“你的好心就是亡我之心不死的坏人!”


川普大爷别太天真了,该清醒了

全世界的目光都聚焦在川普和习近平的身上,人们不仅在关注他们,而且在人们头脑里存在着许许多多疑问:

一个是信仰上帝把手放在圣经上宣誓的美国总统;一个是疯狂拆教堂拆十字架点火烧圣经,不许中国存在宗教信仰,连学生过圣诞节都禁止,甚至要把14亿人的思想统一成习思想的中共党魁,两人竟拥抱在一起成了好朋友?

一个集善于一身的美国总统;一个集恶于一身准备毁灭全人类的混世魔王,两人竟握手成了知己朋友?

一个是建国只有两百多年历史,却已经成为当代最伟大强国的美国总统;一个是统治着五千年悠久历史,还打着一百年前男人后脑勺拖着辫子,女人裹着小脚的标记,具有深厚封建落后色彩,却在国家变成为世界第二大经济体后,狂妄自大,目空一切,念念不忘初心,想当红色皇朝终身帝王。现代人与开历史倒车的反动者,竟一见钟情变成大好人了?

一个声称永远不搞社会主义的美国总统;一个是不但要走社会主义道路,而且要通向那虚无缥缈的共产主义之路的中共党魁,两人竟称兄道弟变成了朋友?

一个是以普世价值和以民主自由为理念,建立世界秩序的美国总统;一个是用专制独裁极权体制推行它的人类命运共同体的红色帝国头子,两人走到了一起突然变成了朋友?

一个是处处受到法律和选民约束,在左派和媒体的围攻下,依然充满自信的美国总统;一个是无法无天,把宪法和法律踩在脚下,想干什么就干什么,却又能在阿谀奉承的包围圈里获得“定于一尊”称号的流氓总头领。黑白两道走到一起携手成朋友了?

一个是用强大的实力在二战中左右开弓,西边战胜了已经占领整个欧洲的纳粹希特勒,东边战胜了已经占领整个太平洋地区的日本军国主义,并把这两个国家变成当代强国以及和平民主国家的美国领导人:一个是靠金钱收买和贿赂,靠离间撬墙挖墙角拉拢腐蚀穷国落后国家,壮大在国际组织上的支持席位的伪善统领者,却变成了志同道合的好朋友?

一个是靠人民的智慧和创造力,推动科学技术向更高目标发展的美国总统;一个是千方百计压缩人民的思想空间,窒息和封堵人民创新渠道,只容许习大大一个声音一个话语一种思想,然后靠偷窃和非法手段把别人的拥有变成自己所有,还要自吹去占领科学技术高峰的牛皮小学博士。美国总统和牛皮小学博士变成了你好我好的朋友了?

一个对自己人民充满信心,让人人都可以拥有枪支进行自卫的美国总统;一个是拥有坦克枪炮,把国家军队国家机器变成习家军私人武装,专门来镇压维稳恫吓对付老百姓的大独裁者,两人竟举杯相碰变成了酒肉朋友了?

一个是随时随地深入群众之中在万人簇拥下抱有坚定信念的美国总统;一个是嘲讽苏联没有一个男子汉,而自己却处处要清空城市居民,出访要驱赶居民到百里之外,天津大爆炸派了一个女委员去视察,自己为什么不去,哪怕是坐在飞机上俯瞰一下爆炸的惨景,这个连妇人都不如却要挺着大肚子装做男子汉的胆小鬼,总统和胆小鬼竟握手言欢成了朋友了?

一个是以诚实信任为已任,平等待人以礼取人以理服人的美国总统;一个是以勾心斗角鬼城伎俩靠欺骗靠撒谎专门斗人为生的世界角斗士,两人竟握手言欢成为朋友了。

一个是对自己的同胞负责,一切为自己的人民着想,为建立强大的美国的总统;一个是把人民当成可以驱赶的奴隶,把中国人民创造的财富大把大把的抛向世界各国的中共汉奸卖国贼,总统和卖国贼竟携手走到了一起成了朋友?

一个是敢说敢做敢担当,并用实际行动来一一兑现的美国总统;一个是好话说尽坏事做绝的伪君子,总统和伪君子握手变成了朋友?

一个是腰缠万贯不要国家一分薪水全心全意为人民服务的美国总统;一个是对人民死活都不顾的专制暴君——他亲自害死了诺贝尔和平奖得主刘晓波;今年中国南方遇到了百年不遇的大洪水,他置若罔闻,躲到过去曾是北大荒的黑龙江农场视察去了,;如今香港数百万群众投入反送中抗议浪潮,他躲到西北去了,一个美国总统竟与视人民为虫蚁为草芥的暴君“一见钟情”好上了。

一个是为国为民精打细算,召开国际会议,宴请外国政要,都是简单的便餐,一吃了事;一个是撑面子讲排场,为了招待几个国家领导人,可以大笔一挥斥资千亿,打造奢侈豪华会址的败国子,美国总统竟与暴殄天物的独夫民贼,结成深情的友谊了。

一个是为弱者出声,接见被专制极权迫害下异议人士妇女代表的美国总统;一个是把中国女大学生当作妓女,送给非洲黑人作为性陪读,山东大学快成为非洲黑人的慰安所,这个向非洲黑人大撒币又把女大学生当慰安妇的流氓总书记,竟被美国总统当作朋友了?

……

就在我写这篇文章快将结尾时,又传来了轰动性消息,川普又出重拳了。8月23日宣布对以前已经加征的所有中国5500亿商品再加征5%的关税。川普被逼上连续战斗反击的道路。

川普终于清醒了,也许是……

但是不得不提醒的是:

虽然现在的川普政府已经把中共和中国及中国人民区分了开来,但是切莫走向另一个极端。因为现在的中国人是经过中共七十年洗脑后,成了中共的驯民愚民氓民的,中国人民几乎与中共已经融为一体了。那些八千万党员及其家属子女,千百万的军警宪特,几百万的中共大大小小官僚及其家属,他们就是中共的附体,如果把他们烧成灰,他们也会很高兴,因为快去见马克思了,连骨灰都是红色的。再看看这些在国外大陆留学生的表现,曾喝着狼奶长大的孩子,在西方民主自由环境的薰陶下,几乎没有改变豺狼的本性,一旦条件成熟,机会到来,他们又将是一群打砸抢烧杀的红卫兵暴徒。

中国的网民曾形容中国腐败的官员:“如果把中共的官员都排成行,说他们全是贪官,有冤枉的;但是如果隔一个挑一个贪官,就有漏网的。”把这句话应用到今天中共在国外的留学生,也很合适,“如果把所有的大陆留学生都当间谍来抓,那是有冤枉的;如果把他们排成行,隔一个抓一个间谍,那一定有漏网的。”

从中就能估计出大陆出来到国外留学的留学生中,究竟有多少间谍、特务、情报员、中共线人,估计在80—90%。

这次香港送中事件发生后,澳大利亚和加拿大的中国留学生疯狂攻击和暴打香港留学生,甚至公开叫骂最肮脏的话语“操你妈×”,就可以知道中共的猖狂已经到了令人发指地步!

所以奉劝川普大爷以后双方打口水战,切莫再说习近平如何如何的好,彼此是好朋友的话,也不要再提中国人民如何是个伟大的民族,听了会让人肉麻起鸡皮疙瘩的。

当然你如果认为这只是一种策略和手段,可以像灌迷魂汤一样,能把习近平灌得五迷三倒,晕头转向,那就请继续使用这种武器。就像现在那样,在你大灌特灌一系列的迷魂汤后,突然来了这一猛击——再度加征关税,致使习近平狼狈不堪,不知所措。那就是一种高招,川普实在是高!

当香港818那天170万人上街的时候,习近平却躲到西北去了,他到甘肃敦煌莫高窟佛像前逛了逛,那么,这个暴君他会放下屠刀立地成佛吗?

就在他装模作样深入农户之中时,早就安排好的人一阵高喊“总书记万岁!”“习主席万岁!”

可见习近平做的不是“中国梦”,做的是二十一世纪的“帝王梦”,至今还沉浸在“万岁爷”的“黄粱美梦”之中!

2019-8-28

想要美企離開中國,川普手中有哪些強大王牌可打?

$
0
0

另一方面,依據路透社報導,川普此言賭注極高。根據研究機構榮鼎集團(Rhodium Group)估計,美國企業1990年至2017年共在中國投資2560億美元,而中國公司只在美國投入1400億美元。
在美國不像中國有中央計畫經濟的情況下,川普恐得採取法律行動才能迫使美國企業照他意思行動。川普手上確實握有一些不用國會批准就能打出的強大王牌。
一、徵收更多關稅
川普可以進一步擴大目前行動調高關稅,此舉將擠壓企業獲利,讓在中國生產不再划算。
川普今天宣布,針對2500億美元中國銷美商品加徵關稅稅率,將從10月1日起由現行的25%提升至30%,項目包括原物料、機械及成品。
他還說,原定將對剩餘3000億美元中國商品加徵的關稅,稅率也將由10%提高至15%。其中約一半的商品延遲至12月15日才課以關稅,其餘將按照原定日期9月1日生效。
除了從中國供應商購買零件變得更昂貴外,關稅增加還會懲罰透過中國合資企業生產商品的美國公司。
二、國家緊急狀態
川普也能像對付伊朗那樣下令對中國祭出制裁,這將牽涉依1977年「國際緊急經濟權力法」(IEEPA)宣布國家進入緊急狀態。
《自由時報》報導,此法案授權美國總統基於外國緊急情況,得限制美國特定企業或產業領域的活動,例如川普可以認定中國的技術竊取為「緊急狀態」,限制美企與中國的特定交易,如購買中國科技產品等。

美國曾以此對付過伊朗,凍結後者在美資產,川普也曾墨西哥移民問題列為緊急狀態,揚言要對墨西哥加徵關稅,但後來並未施行;此做法對付中國的副作用是經濟傷害及中國報復等。
前聯邦官員及法律專家表示,一旦宣布緊急狀態,這項法律會授予川普廣泛的權力,能阻止個別公司或甚至整個經濟產業活動。
范德比大學(Vanderbilt)法學院國際法律研究計畫主任梅爾(Tim Meyer)舉例表示,透過聲明中國竊取美國公司的智慧財產構成國家緊急狀態,川普能夠下令美國企業避開特定交易,例如採購中國科技產品。
曾負責制裁事務的前國務院高級官員哈洛(Peter Harrell)表示,動用「國際緊急經濟權力法」恐怕會不小心傷害美國經濟。美國官員將需要衡量中國報復的影響,以及美國企業會如何受到牽動。
哈佛法學院國際貿易教授伍人英(Mark Wu)則表示,援引「國際緊急經濟權力法」也可能在美國法院引發法律戰。
三、聯邦採購限制
華府智庫戰略暨國際研究中心(CSIS)資深顧問芮恩希(Bill Reinsch)表示,另一個毋須國會行動的選項是禁止在中國也有營運的美國企業競爭聯邦合約。
這類做法可能會鎖定特定產業,因為概括性命令會衝擊像波音(Boeing)這樣的公司。波音不僅是五角大廈重要武器製造商,還是美國最大出口商。
波音去年12月在中國開設首家737型客機完工交機廠,這項策略性投資目的為在銷售量上領先歐洲宿敵空中巴士(Airbus)。隨著中國航空市場快速成長,料將在未來10年超越美國登上全球最大航空市場寶座,這兩家公司都試圖擴展在中國的版圖並爭奪訂單。
四、1917年「對敵貿易法」
雖然非常不可能實施,但更激烈的做法,非動用美國國會在第一次世界大戰期間通過的《對敵貿易法》(Trading with the Enemy Act,縮寫為TWEA)莫屬。
《風傳媒》報導,這是美國國會在一戰期間頒布,賦予總統在「戰爭時期」監督或限制美國與其敵國之間所有貿易的權力。一戰期間,時任總統威爾遜(Thomas Woodrow Wilson)運用TWEA設立外國財產管理局,沒收大量德國移民和企業財產,如拜耳化學公司(Bayer)。截至2018年,古巴是唯一受到TWEA限制的國家。
伍人英表示,這項法律允許美國總統管制並懲處與美國陷入戰爭國家的貿易,但川普不太可能動用此法,因為這會使美中緊張局勢劇烈升高。他說:「鑒於總統有時會吹捧自己與中國領導人習近平的友誼及尊敬,宣告中國是與美國處於交戰狀態的敵對勢力會是更加激烈的一步。」
「這相當於公開宣戰,而國際緊急經濟權力法就可以讓川普政府在不用耗費像上述作法那麼大的外交成本情況下,採取類似的行動。」

"行万里路如读万卷书"新解

$
0
0


这句名言,是反封闭在寻章摘句的迂腐中阅读,应开放去读大千世界这百科全书,例如苏格兰战败将军,逃亡困卧在废墟,见蜘蛛网被风雨数次击破后,蜘蛛百折不挠仍筑起了蛛网,使战败将军受到启发,重整旗鼓而转败为胜,他读蜘蛛筑网受启悟。世间万亊万物,醞藏着丰富的智识与哲理,哪是用教条灌满头脑,学问就是塞满书卷的书橱哩?
古人以万里路对比万卷书,实是叫人从死的书卷跳入鲜活的生活与人生,读人生提炼的书本文字是读,读大千世界更是读,关键在读,行万里路不去读,或只读点科技,而忽略社会世界,制度伦理,某些行万里留学者,他的万卷书只局限于技术,不读制度,将自已变成工具化人格,斯坦福大学那35岁便成了终身教授的张首晟,还是距诺奖最近的科学家,今年在孟晚舟被捕时自杀,他这读了万卷书又行了万里路的失败者,不值得新老读书人思考吗?
张首晟以单一科技的偏食为食,抹了一层民族主义奶酪中毒而死,不值得行万里路读书者思考吗?
有朋友不一定有友谊,有婚姻不一定有爱情
因为,不是友谊结成的朋友,是酒肉或利害结成的团伙。哪有纯真友谊与爱情呢?
笔者认为宋代欧阳修论朋党.虽是说朝廷里的那些事儿,今人已不读他的论文,引来也可令人一开眼界与襟怀,他说:
"臣闻朋党之说,自古有之,惟幸人君辨其君子小人而已。大凡君子与君子以同道为朋,小人与小人以同利为朋,此自然之理也。
 然臣谓小人无朋,惟君子则有之。其故何哉?小人所好者禄利也,所贪者财货也。当其同利之时,暂相党引以为朋者,伪也;及其见利而争先,或利尽而交疏,则反相贼害,虽其兄弟亲戚,不能自保。故臣谓小人无朋,其暂为朋者,伪也。"
他这段文章,已深邃到从朋到党由友到党的解剖了。
他们中共前30年斗权很血惺,后30年争钱很残酷,哪还见君子之朋,岂非尽逐小人之利吗?中共那9000万之众里,应有君子,却在众多同利的小人包围中,利尽而相斗相害中,至今,还未走出那你死我活的老潜规则呢。

梁京:特朗普的伟大决断

$
0
0


上周,我们见证了21世纪最重要的历史性时刻之一,那就是美国总统特朗普决定把美中经济战升级到最高水平,也就是完全以对待敌国的方式来全面制裁中国。这一历史决断的重要性,堪与百年前威尔逊总统决定参加第一次世界大战相比,也堪与罗斯福总统决定参与第二次世界大战相比,也就是说,这一历史性的决断,将会对21世纪的全球秩序重建发生根本性的影响。 
特朗普的这一决断,是一个伟大的历史性决断。我的主要理由就是,特朗普的这一决断恰恰不是增加全球秩序重建的风险和代价,而是减少这种风险和代价。

为甚么这样说呢?随著中国崛起和美国相对衰落,全球秩序正在瓦解,这是一个不争的基本事实,同样不争的事实就是,美中对抗将主导和决定21世纪全球秩序重建的过程和结果。作为中国人,我当然希望中国能在这个过程中扮演一个非常积极的角色,为人类文明应对21世纪的重大挑战做出辉煌贡献。但我不能不面对的事实就是,中国在美国帮助下崛起之后,虽处于空前有利的国际环境,却选择了一条自毁和毁人的邪路。习近平不仅没能把中国从这条邪路上领出来,反而在这条邪路上越走越快、越走越远,不仅置中国于险境,也把美国和整个文明世界置于严重的险境。

对这一危局,美国国民和精英已越来越清醒,但有识之士也看到,中国已坐大,美国养虎为患、尾大不掉,无论谁来当美国总统,都要面对难以应对的中国挑战,美国和整个世界都不可避免为此付出巨大代价。最重要的原因,就是习近平自以为中国不仅在军事上,而且在经济上,都具备了与美国同归于尽的能力,有实力以「玉石俱焚」来要挟美国,令美国不断做出原则性让步和妥协,实现习本身的「中国梦」。

在这个历史的关键时刻,无数人的命运将取决于特朗普和习近平两人性格和智慧的较量。虽然我从未怀疑邪不压正、中国最终会输,但这并不意味著美国一定会赢,这不仅是因为特朗普本人有严重缺陷,而且美国自身的危机也非常深重。我以为自特朗普上任以来,美中对抗发生的一件十分幸运的事情就是,习近平在与特朗普的博弈中,犯了致命错误,而特朗普则敏捷地抓住了习近平露出的每一个破绽。

习近平的主要破绽其实并非他对特朗普个人以及美国国情做出了严重误判,而是他在国内的倒行逆施令自己彻底丧失了政治权威,以至很难像希特勒那样全面动员中国的国力,包括军力来支撑他与美国「同归于尽」的威慑。而特朗普在与习近平的博弈中,不仅对中国的威胁有了更全面和深入的认识,对习近平的性格弱点及其政治困境、对中国经济的死穴也都有了非常透彻的了解。也就是说,特朗普做出了这样的判断,习的中国不可能以核战来威慑美国,而此时不果断出手给习致命一击,美国就可能失去历史性的时机。
-----------------

对落水狗就是要痛下杀手。

OpenShift SDN Encrypted Tunnel

$
0
0


OpenShift SDN Ecnrypted tunnel will create a VPN mesh between OpenShift cluster SDNs in such a way that IP packets become routable between pods across SDNs.
The archietcture of the tunnel is depicted in this diagram:
vpn mesh
The process works as follows
SETUP PHASE:
  1. a tun device is created by the tunnel daemon set
  2. the tun is wired to the bridge so that ip packets destined to the CIDR of the other cluster are routed to the tunnel.
TRANSMIT PHASE:
  1. a packet is put in the bridge with destination to the CIDR of one of the nodes of the other cluster
  2. the flow rules send the packet to the tunnel
  3. the tunnel daemonset process manages the wired side of the tunnel and sends the UDP-encapsulated and encrypted packet to the correct VIP of the other cluster
RECEIVE PHASE:
  1. A UDP encapsulated and encrypted packet is received by the VIP and sent to the corresponding tunnel ds process
  2. the tunnel daemonset process extracts and decrypts the packet from the UDP envelope and puts it in the tun device.
  3. the packet ends up in the bridge.
  4. the bridge examines the destination, which will be local to the node, and delivers the packet immediately.
The routing of the packets works as described in this diagram:
routing

Service Proxying

Service Proxying is the ability to load balance connection to Kubernetes services to pods. In this case we want to be able to load abalnce conenction to a service of a connected Kubernetes cluster to the pods of this cluster. To do so we use IPVS managed by kube-router, the architecture is the following:
service-proxying

Discovery

Discovery is the ability to discover Kuberneets service IPs by quering a DNS. We define the convention that each cluster has a domain of this pattern .cluster., besides the usual .cluster.local. We use coredns to setup a DNS server with the followign architecture:
coredns
Pods that need to use that DNS need the following in their template:
  dnsConfig:
nameservers:
-
searches:
- svc.cluster.local
- cluster.local
dnsPolicy: None

Installation

These instructions will help you install the encrypted tunnel, service proxying and discovery on your OpenShift clusters.

Install wireguard

Wireguard needs to be installed in each of the nodes of your clusters.
For each of your clusters run the following:
ansible nodes -i  -m shell -a "curl -Lo /etc/yum.repos.d/wireguard.repo https://copr.fedorainfracloud.org/coprs/jdoss/wireguard/repo/epel-7/jdoss-wireguard-epel-7.repo"
ansible nodes -i -m shell -a "wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm"
ansible nodes -i -m shell -a "yum install -y epel-release-latest-7.noarch.rpm"
ansible nodes -i -m shell -a "yum install -y wireguard-dkms wireguard-tools"

Run the installation playbook

See an example of the inventory here and customize it for your clusters. Here is a minimum inventory:
clusters:
- name:
url:
username:
password:
- name:
url:
username:
password:
Other optional inventory variables are:
Variable NameDefaultDescription
tunnel_modewireguardselects the tunnel mode. Currently only wireguard is supported.
namespacesdn-tunnelnamespace in which the sdn-tunnel objects will be created
appnamesdn-tunnelname and label shared by all the created resources
tunnel_port5555UDP port used to create the the tunnel
image_sdn_tunnelquay.io/raffaelespazzoli/openshift-sdn-tunnel:latestimage used by the sdn tunnel container
service_typeLoadBalancertype of the service used to create the tunnel, supported values are LoadBalancer and NodePort
coredns_imagequay.io/raffaelespazzoli/coredns:latestthe image to be used for the coredns pod
service_account_namesdn-tunnelthe service account used by the sdn-tunnel pod
image_kube_routerquay.io/raffaelespazzoli/kube-router:latestimage to be used for the kube-router container
Run the playbook:
ansible-playbook -i  ./ansible/playbooks/deploy-wireguard/config.yaml

Test

We are going to create two pods in two different clusters and test the connectivity.
Login to the clusters and save the context in a variable:
oc login --username= --password=
CLUSTER1=$(oc config current-context)
oc login --username= --password=
CLUSTER2=$(oc config current-context)
Create the projects and the test pods:
oc --context=$CLUSTER1 new-project test-sdn-tunnel
oc --context=$CLUSTER2 new-project test-sdn-tunnel
oc --context=$CLUSTER1 apply -n test-sdn-tunnel -f ./samples/test-app.yaml
oc --context=$CLUSTER2 apply -n test-sdn-tunnel -f ./samples/test-app.yaml
After a while the pod will be up and running. Collect the info needed for the test:
CLUSTER1_NAME=
CLUSTER2_NAME=
POD1=$(oc --context $CLUSTER1 get pod -n test-sdn-tunnel | grep Running | awk '{print $1}')
POD2=$(oc --context $CLUSTER2 get pod -n test-sdn-tunnel | grep Running | awk '{print $1}')
POD1_IP=$(oc --context $CLUSTER1 get pod $POD1 -n test-sdn-tunnel -o jsonpath='{.status.podIP}')
POD2_IP=$(oc --context $CLUSTER2 get pod $POD2 -n test-sdn-tunnel -o jsonpath='{.status.podIP}')
SVC1_IP=$(oc --context $CLUSTER1 get svc -n test-sdn-tunnel | grep httpd | awk '{print $3}')
SVC2_IP=$(oc --context $CLUSTER2 get svc -n test-sdn-tunnel | grep httpd | awk '{print $3}')
DNS1_IP=$(oc --context $CLUSTER1 get svc -n sdn-tunnel | grep coredns | awk '{print $3}')
DNS2_IP=$(oc --context $CLUSTER2 get svc -n sdn-tunnel | grep coredns | awk '{print $3}')
Let's test simple pod to pod connectivity:
oc --context $CLUSTER1 exec $POD1 -n test-sdn-tunnel -- curl http://$POD2_IP:8080
oc --context $CLUSTER2 exec $POD2 -n test-sdn-tunnel -- curl http://$POD1_IP:8080
Let's test connectivity via the services:
oc --context $CLUSTER1 exec $POD1 -n test-sdn-tunnel -- curl http://$SVC2_IP:8080
oc --context $CLUSTER2 exec $POD2 -n test-sdn-tunnel -- curl http://$SVC1_IP:8080
To test connectivity via name resolution we need to inform the pod on how to resolve the names:
oc --context $CLUSTER1 patch deployment httpd -n test-sdn-tunnel -p '{"spec":{"template":{"spec":{"dnsPolicy": "None", "dnsConfig":{"nameservers":["'$DNS1_IP'"], "searches":["svc.cluster.local","cluster.local"]}}}}}'
oc --context $CLUSTER2 patch deployment httpd -n test-sdn-tunnel -p '{"spec":{"template":{"spec":{"dnsPolicy": "None", "dnsConfig":{"nameservers":["'$DNS2_IP'"], "searches":["svc.cluster.local","cluster.local"]}}}}}'
This will cause the pod to be redeployed, so we need to capture the new IPs:
POD1=$(oc --context $CLUSTER1 get pod -n test-sdn-tunnel | grep Running | awk '{print $1}')
POD2=$(oc --context $CLUSTER2 get pod -n test-sdn-tunnel | grep Running | awk '{print $1}')
from https://github.com/raffaelespazzoli/openshift-sdn-encrypted-tunnel
Viewing all 20528 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>