Go (Golang) GOOS and GOARCH
All of the following information is based on go version go1.17.1 darwin/amd64
.
GOOS Values
GOOS | Out of the Box |
---|---|
aix |
✅ |
android |
✅ |
package main | |
import ( | |
"database/sql" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"log" | |
"net/http" | |
"os" |
All of the following information is based on go version go1.17.1 darwin/amd64
.
GOOS | Out of the Box |
---|---|
aix |
✅ |
android |
✅ |
#!/bin/bash | |
set -e | |
set -o pipefail | |
dd if=/dev/zero of=/dev/sda bs=1024 count=10 | |
dd if=/dev/zero of=/dev/sdb bs=1024 count=10 | |
RAM=$(free -m | awk '/Mem:/{print $2}') |
package main | |
import ( | |
"crypto/cipher" | |
) | |
type ecb struct { | |
b cipher.Block | |
blockSize int | |
} |
/** | |
Create pagebreaks in exported Obsidian PDFs. | |
Example: | |
# Heading 1 | |
Lorem Ipsum is simply dummy text of the printing and typesetting industry. | |
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, | |
when an unknown printer took a galley of type and scrambled it to make a type |
backend per_ip_rates | |
stick-table type ip size 1m expire 10m store http_req_rate(10s) |
``` | |
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=443:proto=tcp:toport=8443 --permanent | |
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=443:proto=tcp:toport=8443 | |
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=80:proto=tcp:toport=8080 --permanent | |
$ sudo firewall-cmd --zone=trusted --add-forward-port=port=80:proto=tcp:toport=8080 | |
$ sudo firewall-cmd --zone=trusted --add-service=https --permanent | |
$ sudo firewall-cmd --zone=trusted --add-service=https | |
$ sudo firewall-cmd --zone=trusted --add-service=http --permanent | |
$ sudo firewall-cmd --zone=trusted --add-service=http | |
$ sudo firewall-cmd --zone=trusted --add-masquerade |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"time" | |
redis "gopkg.in/redis.v6" | |
) |
package main | |
// operation is a clean up function on shutting down | |
type operation func(ctx context.Context) error | |
// gracefulShutdown waits for termination syscalls and doing clean up operations after received it | |
func gracefulShutdown(ctx context.Context, timeout time.Duration, ops map[string]operation) <-chan struct{} { | |
wait := make(chan struct{}) | |
go func() { | |
s := make(chan os.Signal, 1) |
package main | |
import ( | |
"crypto/rand" | |
"encoding/base64" | |
"fmt" | |
"io" | |
"math/big" | |
) |