Skip to content

Instantly share code, notes, and snippets.

View crazytaxii's full-sized avatar
🎯
DO IT

HF crazytaxii

🎯
DO IT
View GitHub Profile
@crazytaxii
crazytaxii / diff.go
Last active March 11, 2025 16:07
Diff 2 directories.
//go:build linux || darwin
package main
import (
"crypto/sha256"
"encoding/hex"
"fmt"
"io"
"log"
@crazytaxii
crazytaxii / deploy-containerd-only.sh
Last active March 5, 2025 15:43
Deploy containerd only
#!/bin/bash
CONTAINERD_VERSION="1.7.26"
RUNC_VERSION="1.2.5"
NERDCTL_VERSION="1.7.6"
main() {
sudo yum update -y
ARCH=$(uname -m | sed -e 's/aarch64/arm64/' -e 's/x86_64/amd64/')
@crazytaxii
crazytaxii / prototag.go
Created December 11, 2024 09:05
Inject protobuf tag to struct definition in go file.
package main
import (
"bufio"
"bytes"
"fmt"
"log"
"os"
)
@crazytaxii
crazytaxii / deploy-nfs-csi.sh
Last active September 25, 2024 06:22
Deploy NFS server and CSI on Kubernetes
#!/bin/bash
set -e
DRIVER_VERSION="v4.8.0"
main() {
# deploy nfs server
kubectl create -f https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/master/deploy/example/nfs-provisioner/nfs-server.yaml
# deploy nfs csi driver
@crazytaxii
crazytaxii / deepflow-server-image-building.md
Last active January 15, 2024 03:28
Build DeepFlow server image

Clone DeepFlow git repositry https://github.com/deepflowio/deepflow and make your change.

Add a new Dockerfile for building DeepFlow server:

$ cat <<EOF > ./server/Dockerfile.ci
FROM crazytaxii/deepflow-builder:latest AS builder

COPY . /go/deepflow
@crazytaxii
crazytaxii / install-etcd.sh
Created January 10, 2022 06:09
Install etcd
#!/bin/bash
set -e
GOOGLE_URL=https://storage.googleapis.com/etcd
GITHUB_URL=https://github.com/etcd-io/etcd/releases/download
DOWNLOAD_URL=${GOOGLE_URL}
main() {
os=linux
if [[ "$(uname -s)" == "Darwin" ]]; then
@crazytaxii
crazytaxii / upgrade_centos_kernel.sh
Created January 9, 2022 16:07
Upgrade CentOS Linux kernel to latest
#!/bin/bash
set -e
main() {
yum update -y
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
sudo grub2-set-default 0
@crazytaxii
crazytaxii / ceph3nodes.sh
Last active December 22, 2021 05:26
Deploy 3 nodes Ceph cluster for testing.
#!/bin/bash
set -e
CEPH_VER=${CEPH_VER:-"15.2.1"}
OSD_DEV=${OSD_DEV:-/dev/sdb}
ssh_test() {
if [[ $(ssh root@$1 exit) -ne 0 ]]
then
echo "failed to login $1 as root" && exit 1
@crazytaxii
crazytaxii / install_cmake_from_source.md
Last active May 17, 2021 15:48
Compile and install cmake from source

Install cmake from source

Download cmake from https://cmake.org/download/

$ wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Build from source and install

@crazytaxii
crazytaxii / install_gcc_from_source.md
Last active May 17, 2021 15:08
Compile and install gcc 4.9.0 from source