Skip to content

Instantly share code, notes, and snippets.

View mengzhuo's full-sized avatar

Meng Zhuo mengzhuo

View GitHub Profile
mengzhuo /
Last active July 16, 2022 01:55 — forked from djfdyuruiry/
WSL 2 - Enabling systemd

Enable systemd in WSL 2

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of to a new file /tmp/

    cd /tmp
mengzhuo / gist:424ba2d79afa1bcb5bbb57255587db2c
Created July 12, 2022 11:02
EKS node group create failed
Jul 12 07:35:45 kubelet[20691]: I0712 07:35:45.353944 20691 aws.go:1264] Get AWS region from metadata client
Jul 12 07:35:45 kubelet[20691]: I0712 07:35:45.354071 20691 aws.go:1309] Zone not specified in configuration file; querying AWS metadata service
Jul 12 07:35:45 kubelet[20691]: I0712 07:35:45.356846 20691 aws.go:1349] Building AWS cloudprovider
Jul 12 07:35:45 kubelet[20691]: E0712 07:35:45.670856 20691 server.go:294] "Failed to run kubelet" err="failed to run Kubelet: could not init cloud provider \"aws\": error finding instance i-xxxxxxxxxxxxxx: \"error listing AWS instances: \\\"RequestError: send request failed\\\\ncaused by: Post \\\\\\\"\\\\\\\": dial tcp: lookup on no such host\\\"\""
Jul 12 07:35:45 syste
Install required packages
sudo pkg install opensbi u-boot-qemu-riscv64 qemu
Note: emulators/qemu-devel also works.
Download FreeBSD/RISC-V virtual machine image
xz --decompress FreeBSD-14.0-CURRENT-riscv-riscv64.raw.xz
Optionally, extend the image using truncate(1). The root filesystem will grow to fill the free space upon first boot.
mengzhuo /
Last active June 1, 2019 08:16 — forked from julianxhokaxhiu/
How to build minimal ARM QEMU Static from sources with EXECVE
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
# Add Backports repo support
package vadd
func addGeneric(dst, src []uint8) {
for i, s := range src {
dst[i] += s
func addVector(dst, src []uint8)
mengzhuo / decode-nostd-base64.go
Created May 19, 2018 09:33
decode nonstd base64
package main
import (
var table = []byte{'v', 'w', 'x', 'r', 's', 't', 'u', 'o', 'p', 'q', '3', '4', '5', '6', '7', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'y', 'z', '0', '1',
'2', 'P', 'Q', 'R', 'S', 'T', 'K', 'L', 'M', 'N', 'O', 'Z', 'a', 'b', 'c', 'd', 'U', 'V', 'W', 'X', 'Y', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', '8', '9',
'+', '/'}
mengzhuo / md5sum.go
Created March 22, 2018 11:26
Simple parallel md5sum compatible to GNU md5sum
package main
// go build md5sum.go
// ./md5sum ~/*.log
// # or
// ./md5sum << EOF
import (
mengzhuo / bench.log
Created December 20, 2017 08:17
ARM64 benchmark
│BenchmarkAmove-4 20000000 102 ns/op 1881.62 MB/s
│BenchmarkBmove-4 50000000 34.5 ns/op 5563.29 MB/s
mengzhuo /
Last active December 16, 2017 12:46
scw bench go source
set -e
apt-get update -y -qq
apt-get install build-essential git golang -y -qq
git clone godev --depth=50
cd $GODEV/src