add the follow line to /etc/resolv.conf will let linux use tcp to resolve the hostname
options use-vc
requires glibc >= 2.14
example:
options timeout:1 attempts:3 use-vc
nameserver 8.8.8.8
#!/bin/bash | |
# refer to http://www.sajalkayan.com/post/go-android-binary.html | |
export GOMOBILE="$GOPATH/pkg/gomobile" | |
export GOOS=android | |
export GOARCH=arm | |
export CC=$GOMOBILE/android-ndk-r12b/arm/bin/arm-linux-androideabi-clang | |
export CXX=$GOMOBILE/android-ndk-r12b/arm/bin/arm-linux-androideabi-clang++ | |
export CGO_ENABLED=1 | |
export GOARM=7 | |
go build -p=8 -pkgdir=$GOMOBILE/pkg_android_arm -tags="" -ldflags="-extldflags=-pie" "$@" |
add the follow line to /etc/resolv.conf will let linux use tcp to resolve the hostname
options use-vc
requires glibc >= 2.14
example:
options timeout:1 attempts:3 use-vc
nameserver 8.8.8.8
#!python | |
import zipfile | |
import os | |
def unzip(filename, output_dir=".", filename_encode="gbk"): | |
fp = zipfile.ZipFile(filename, "r") | |
# get name list |
package main | |
import ( | |
//"net" | |
//"net/http" | |
"fmt" | |
"log" | |
//"os" | |
"flag" | |
"os/exec" |
#!/bin/bash | |
# speed check url | |
url="https://httpbin.org/bytes/10240" | |
let i=0 | |
timeout=3 | |
while true | |
do | |
#ping -c 1 114.114.114.114 >/dev/null 2>&1 | |
package main | |
import ( | |
"bytes" | |
"fmt" | |
"github.com/miekg/dns" | |
"io/ioutil" | |
"log" | |
"net/http" | |
) |
from twisted.internet import reactor, protocol | |
class EchoClient(protocol.Protocol): | |
def connectionMade(self): | |
reactor.callLater(0, self.send_data, "1111") | |
def send_data(self, data): | |
self.transport.write(data) | |
reactor.callLater(0, self.send_data, "1111") |
#!python | |
""" | |
a socks server implemented by twisted | |
support socks4/4a, socks5 protocol | |
only support CONNECT command | |
# | |
""" | |
from twisted.internet.protocol import Protocol |
#ifdef WIN32 | |
#include <winsock2.h> | |
#include <Ws2tcpip.h> | |
#include <string.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
int inet_pton4(const char *src, char *dst); | |
int inet_pton6(const char *src, char *dst); | |
int inet_pton(int af, const char *src, char *dst) |
package main | |
import ( | |
"fmt" | |
"os" | |
"strconv" | |
) | |
var count int | |
func hanoi(n int, a, b, c string){ | |
if n == 1{ | |
count++ |