This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| #clone the repo | |
| git clone http://git.ipxe.org/ipxe.git | |
| cd ipxe/src | |
| cat >ubuntu-amd64-installer.ipxe <<EOF | |
| #!ipxe | |
| dhcp | |
| echo Starting Ubuntu x64 installer for ${hostname} | |
| set base-url http://archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64 | |
| kernel ${base-url}/linux |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
This is inspired by A half-hour to learn Rust and Zig in 30 minutes.
Your first Go program as a classical "Hello World" is pretty simple:
First we create a workspace for our project:
| apiVersion: eksctl.io/v1alpha5 | |
| kind: ClusterConfig | |
| metadata: | |
| name: eksctl-us-west-2-managed | |
| region: us-west-2 | |
| vpc: | |
| id: vpc-0b953326cd7a2f917 | |
| subnets: |
Install Dafang Hacks on the Wyze Cam.
Once running and all is functional, continue. Set video bitrate to 1500, VBR, 30fps.
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| ) | |
| func main() { |
| #!/usr/bin/env python | |
| import json | |
| from jinja2 import Template | |
| # git clone https://github.com/pingcap/tidb-docker-compose | |
| # cd tidb-docker-compose | |
| # git clone https://github.com/tennix/grafonnet-lib -b table | |
| # python dashboard-to-jsonnet.py > pd.jsonnet | |
| # jsonnet -J grafonnet-lib pd.jsonnet > config/dashboards/generated-pd.json | |
| with open('config/dashboards/pd.json', 'r') as f: | |
| data = json.load(f) |
| apiVersion: apps/v1 | |
| kind: DaemonSet | |
| metadata: | |
| name: docker-root | |
| spec: | |
| selector: | |
| matchLabels: | |
| name: docker-root | |
| template: | |
| metadata: |
| package main | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "crypto/sha256" | |
| "encoding/hex" | |
| "fmt" | |
| "strings" |
| # Kubernetes configuration dirs and system namespace. | |
| # Those are where all the additional config stuff goes | |
| # the kubernetes normally puts in /srv/kubernetes. | |
| # This puts them in a sane location and namespace. | |
| # Editing those values will almost surely break something. | |
| kube_config_dir: /etc/kubernetes | |
| kube_script_dir: "{{ bin_dir }}/kubernetes-scripts" | |
| kube_manifest_dir: "{{ kube_config_dir }}/manifests" | |
| # This is where all the cert scripts and certs will be located |