Skip to content

Instantly share code, notes, and snippets.


Meng Zhuo mengzhuo

View GitHub Profile
mengzhuo /
Last active Jul 16, 2022 — 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
View gist:424ba2d79afa1bcb5bbb57255587db2c
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
View gist:6ae7d7a727c271c076f2f72afe5772b1
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.
View ff.xml
mengzhuo /
Last active Jun 1, 2019 — 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
View vadd.go
package vadd
func addGeneric(dst, src []uint8) {
for i, s := range src {
dst[i] += s
func addVector(dst, src []uint8)
View decode-nostd-base64.go
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 Mar 22, 2018
Simple parallel md5sum compatible to GNU md5sum
View md5sum.go
package main
// go build md5sum.go
// ./md5sum ~/*.log
// # or
// ./md5sum << EOF
import (
mengzhuo / bench.log
Created Dec 20, 2017
ARM64 benchmark
View bench.log
│BenchmarkAmove-4 20000000 102 ns/op 1881.62 MB/s
│BenchmarkBmove-4 50000000 34.5 ns/op 5563.29 MB/s
mengzhuo /
Last active Dec 16, 2017
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