All of the following information is based on go version go1.14.7 darwin/amd64
.
(Bold = supported by go
out of the box, ie. without the help of a C compiler, etc.)
aix
android
#!/bin/bash | |
# UDP: | |
socat UDP4-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683 | |
# TCP: | |
socat TCP4-LISTEN:22,fork,su=nobody TCP6:[2a01:198:79d:1::8]:22 | |
# UDP, IPv6 | |
socat UDP6-LISTEN:5683,fork,su=nobody UDP6:[aaaa::212:4b00:615:a1f7]:5683 |
package secure | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"encoding/hex" | |
"fmt" | |
"crypto/sha512" | |
) |
package bdr_proto; | |
message request { | |
message blob { | |
required string sha256 = 1; // the sha256 checksum of the blob | |
required int32 bsize = 2; // the size of the blob | |
} | |
repeated blob blobarray= 1; | |
} |
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
package main | |
import ( | |
"crypto/tls" | |
"crypto/x509" | |
"fmt" | |
"io" | |
"log" | |
) |
/* | |
This function will help you to convert your object from struct to map[string]interface{} based on your JSON tag in your structs. | |
Example how to use posted in sample_test.go file. | |
*/ | |
func structToMap(item interface{}) map[string]interface{} { | |
res := map[string]interface{}{} | |
if item == nil { | |
return res | |
} |
package main | |
import ( | |
"io" | |
"log" | |
"net" | |
"time" | |
) | |
func reader(r io.Reader) { |
#!/usr/bin/sh | |
apt-get install -y libglib2.0-0 curl gnupg > /dev/null | |
cat <<EOF | gpg --import | |
-----BEGIN PGP PUBLIC KEY BLOCK----- | |
mQINBGCXz3sBEAC0MuPb6suILUH2uzCFrd6McTPNr+QM8fCK0KQ81ezrRiM/Kzbw | |
mCK/Dp8oXs85+3hX5bWfSWgnat4Lflsju7WU7c/VnmR4e263/5/dAt00SL0I14Se | |
skVCOIx3OVaEpjWBZYLTBPf6oE7MY7Y0sQROVeAh+MYJM9E0YE6pDtxNYFWmbVEq | |
9NjFn4YdgGSlDrHmUv2BiWDfNcuRqAkHCmgWHt4BGI6wfX6UvX2rMkybWOl9OsyA |
# /etc/sysctl.d/wireguard.conf | |
net.ipv4.ip_forward=1 | |
net.ipv6.conf.all.forwarding=1 | |
net.ipv6.conf.default.forwarding=1 | |
net.ipv6.conf.eth0.proxy_ndp=1 | |
#/etc/wireguard/wg0.conf (DO virtual machine) | |
[Interface] | |
# The server interface does not actually need an ipv6. | |
# The 2 following must be repeated for each used addres [0, 1] |