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 / 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
@crazytaxii
crazytaxii / golang-devenv.sh
Last active June 6, 2021 14:01
Setting up a Golang development environment quickly!
#!/bin/bash
set -e
install_docker() {
sudo yum install yum-utils -y
sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io -y
sudo systemctl is-active --quiet docker || sudo systemctl start docker
@crazytaxii
crazytaxii / kubeadm-prerequisites.sh
Last active August 1, 2023 01:51
Preparing for installing kubeadm.
#!/bin/bash
set -e
CNI_VERSION="v1.3.0"
ARCH="amd64"
CRICTL_VERSION="v1.27.1"
setup_color() {
# Only use colors if connected to a terminal
if ! is_tty; then
@crazytaxii
crazytaxii / nfs.sh
Last active January 12, 2021 07:04
Deploying local nfs service for testing.
#!/bin/bash
set -e
# Default settings
NFS_DATA_DEV=${NFS_DATA_DEV:-/dev/sdb}
NFS_DATA_DIR=${NFS_DATA_DIR:-/nfs/data}
install_dep() {
sudo yum install nfs-utils -y
}
@crazytaxii
crazytaxii / nsq-depoy.sh
Last active November 4, 2020 07:52
nsq-deploy.sh
#!/bin/bash
set -e
download_nsq() {
wget -O /tmp/nsq-1.2.0.linux-amd64.go1.12.9.tar.gz https://github.com/nsqio/nsq/releases/download/v1.2.0/nsq-1.2.0.linux-amd64.go1.12.9.tar.gz
tar xvzf /tmp/nsq-1.2.0.linux-amd64.go1.12.9.tar.gz -C /tmp/
mv /tmp/nsq-1.2.0.linux-amd64.go1.12.9/bin/* /usr/local/bin
rm -rf /tmp/nsq-1.2.0.linux-amd64.go1.12.9
}