https://www.gravatar.com/avatar/f819a092b23cb25a09f87436f68df217?s=240&d=mp

Ang Gao

Software Engineer @ TripAdvisor, CS Ph.D @ University College Cork

Matplotlib Basic

1 2 3 4 import matplotlib.pyplot as plt plt.figure(figsize=(10, 10), dpi=100) plt.plot([1, 2, 3, 4, 5, 6 ,7], [17,17,18,15,11,11,13]) plt.show() 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 import matplotlib.pyplot as plt import random x = range(50) weather = [random.uniform(15, 18) for i in x] plt.figure(figsize=(20, 10), dpi=100) plt.plot(x, weather) x_ticks_label = [f"11:{i}" for i in x] y_ticks = range(50) plt.

Install Arch Linux in virtualbox

Pre-installation Acquire an installation image Arch is a “rolling release” distribution, download the .iso file from its offical site. Create VM Create a vm in virtualbox, make sure enable EFI in the motherboard. We will use use UEFI instead of the older BIOS spec to boot the VM. Verify the boot mode To verify the boot mode, list the efivars directory: 1 # ls /sys/firmware/efi/efivars If the command shows the directory without error, then the system is booted in UEFI mode.

KEDA for custom metrics based HPA

KEDA is a Kubernetes-based Event Driven Autoscaler. With KEDA, you can drive the scaling of any container in Kubernetes based on the number of events needing to be processed. The following demo is based on the examples here Install KEDA Follow setups in KEDA docs I used Helm 3 method 1 2 kubectl create namespace keda helm install keda kedacore/keda --namespace keda Install Prometheus 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 apiVersion: rbac.

Service Mesh01

微服务架构的特性 围绕业务构建团队 Conway’s Law Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the organization’s communication structure. 去中心化的数据管理 Fallacies of distributed computing The network is reliable; Latency is zero; Bandwidth is infinite; The network is secure; Topology doesn’t change;

Setup Kubernetes Cluster with Kind

Intro kind is a tool for running local Kubernetes clusters using Docker container “nodes”. kind was primarily designed for testing Kubernetes itself, but may be used for local development or CI. Setup Golang development Install Go tools. Follow docs. Config $GOROOT and $GOPATH $GOROOT is for compiler/tools that comes from go installation. This should be configured to the go directory that was installed. $GOPATH is for your own go projects / 3rd party libraries (downloaded with “go get”).