All of the following information is based on go version go1.17.1 darwin/amd64.
| GOOS | Out of the Box |
|---|---|
aix |
✅ |
android |
✅ |
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "net" | |
| "strings" | |
| ) |
| package main | |
| import ( | |
| "exec" | |
| "log" | |
| "os" | |
| "syscall" | |
| "unsafe" | |
| ) |
Android provide LocalServerSocket and LocalSocket to create Unix domain sockets for local interprocess communication (IPC). Unix socket address can behave in three types[1],
LocalServerSocket provide two public constructors for create socket in Linux abstract namespace[2] and create socket using file descriptor that's already been created and bound[3].
| #include <stdio.h> | |
| #include <string.h> | |
| #include <sys/types.h> | |
| #include <sys/socket.h> | |
| #include <arpa/inet.h> | |
| void ping(int s, char *message) | |
| { | |
| char buf[8192]; |
| # 生成 dhparam.pem 文件, 在命令行执行任一方法: | |
| # 方法1: 很慢 | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 | |
| # 方法2: 较快 | |
| # 与方法1无明显区别. 2048位也足够用, 4096更强 | |
| openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096 |
| [Interface] | |
| Address = 10.200.200.3/32 | |
| PrivateKey = [Client's private key] | |
| DNS = 8.8.8.8 | |
| [Peer] | |
| PublicKey = [Server's public key] | |
| PresharedKey = [Pre-shared key, same for server and client] | |
| Endpoint = [Server Addr:Server Port] | |
| AllowedIPs = 0.0.0.0/0 |
| apt-get remove docker docker-engine docker.io containerd runc | |
| apt-get install ca-certificates curl gnupg lsb-release | |
| mkdir -p /etc/apt/keyrings | |
| curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg | |
| echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| apt update | |
| apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin |