Skip to content

Instantly share code, notes, and snippets.

🇨🇳

Meng Zhuo mengzhuo

🇨🇳
View GitHub Profile
@mengzhuo
mengzhuo / build.sh
Last active Jun 1, 2019 — forked from julianxhokaxhiu/build.sh
How to build minimal ARM QEMU Static from sources with EXECVE
View build.sh
#!/bin/bash
#
# IMPORTANT!
# 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 (
"encoding/base64"
"fmt"
)
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
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 (
"crypto/md5"
"fmt"
@mengzhuo
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
mengzhuo / scw_bench.sh
Last active Dec 16, 2017
scw bench go source
View scw_bench.sh
#!/bin/bassh
set -e
apt-get update -y -qq
apt-get install build-essential git golang -y -qq
git clone https://go.googlesource.com/go godev --depth=50
GODEV=$HOME/godev
cd $GODEV/src
@mengzhuo
mengzhuo / ntp_offset_test.go
Last active Apr 15, 2018
Test NTP offset from NIST
View ntp_offset_test.go
package main
import (
"fmt"
"io"
"log"
"os"
"github.com/beevik/ntp"
)
@mengzhuo
mengzhuo / fib_test.go
Created Jun 12, 2017
Fibnacci by Quick Pow Matrix
View fib_test.go
package mfib
import "testing"
func TestFib(t *testing.T) {
target := []struct{ a, b int }{
{1, 1},
{2, 1},
{3, 2},
{4, 3},
@mengzhuo
mengzhuo / 00README
Created Dec 28, 2015
Generic LRU cache in Go
View 00README
Retired in favor of https://godoc.org/github.com/larsmans/algo/container/lru
@mengzhuo
mengzhuo / .vimrc
Last active Sep 9, 2018
Vimrc of mine
View .vimrc
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
You can’t perform that action at this time.