Last active
December 15, 2025 03:10
-
-
Save lxs137/9ad67c0e766d195494f3df2905853126 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| case "$(uname -m)" in | |
| x86_64) | |
| arch="amd64" | |
| ;; | |
| aarch64) | |
| arch="arm64" | |
| ;; | |
| esac | |
| apt-get update | |
| apt-get install -y htop \ | |
| iotop \ | |
| virtualenv \ | |
| netcat \ | |
| pkg-config \ | |
| libnbd-dev | |
| cat <<EOF > /root/.bash_profile | |
| if [ -f $HOME/.bashrc ]; then | |
| source $HOME/.bashrc | |
| fi | |
| EOF | |
| echo "fs.inotify.max_user_watches = 524288" >> /etc/sysctl.conf | |
| sysctl -p | |
| if [ ! -z "${INSTALL_DOCKER}" ]; then | |
| echo ">>>>>> Setup Docker" | |
| apt-get install -y apt-transport-https \ | |
| ca-certificates \ | |
| curl \ | |
| gnupg \ | |
| lsb-release | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ | |
| $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
| apt-get update | |
| apt-get install -y docker-ce docker-ce-cli containerd.io | |
| else | |
| apt-get install -y buildah podman qemu-user-static | |
| # upgrade podman to latest version | |
| # https://podman.io/docs/installation#ubuntu | |
| sudo mkdir -p /etc/apt/keyrings | |
| curl -fsSL https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/Release.key \ | |
| | gpg --dearmor \ | |
| | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null | |
| echo \ | |
| "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg]\ | |
| https://download.opensuse.org/repositories/devel:kubic:libcontainers:unstable/xUbuntu_$(lsb_release -rs)/ /" \ | |
| | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null | |
| apt-get update -qq | |
| apt-get -qq -y install podman | |
| fi | |
| # kubectl | |
| echo ">>>>>> Setup kubectl" | |
| wget "https://dl.k8s.io/release/v1.34.3/bin/linux/${arch}/kubectl" | |
| chmod ugo+x kubectl | |
| mv kubectl /usr/local/bin/kubectl | |
| # Helm | |
| if [[ "$arch" = "amd64" ]]; then | |
| echo ">>>>>> Setup Helm" | |
| wget http://pkg-mirror.oss-cn-hangzhou.aliyuncs.com/helm-v3.6.3-linux-amd64.tar.gz | |
| mkdir -p helm | |
| tar xvzf helm-v3.6.3-linux-amd64.tar.gz --directory=helm | |
| mv helm/linux-amd64/helm /usr/local/bin/helm | |
| fi | |
| # Golang | |
| echo ">>>>>> Setup Golang" | |
| GO_PKG_NAME="go1.25.4.linux-${arch}.tar.gz" | |
| cd /root && wget https://studygolang.com/dl/golang/${GO_PKG_NAME} | |
| rm -rf /usr/local/go && tar -C /usr/local -xzf ${GO_PKG_NAME} | |
| mkdir -p /root/go | |
| cat <<EOF > /root/.bash_aliases | |
| export PATH=$PATH:/usr/local/go/bin:/root/go/bin | |
| export GOPATH=/root/go | |
| export GOPROXY=https://goproxy.cn | |
| EOF | |
| source /root/.bash_profile | |
| cat <<EOF > /root/.gitconfig | |
| [user] | |
| name = lxs | |
| email = lxs137@hotmail.com | |
| [core] | |
| editor = vim | |
| EOF | |
| # Golang Dev | |
| source /root/.bash_aliases | |
| echo ">>>>>> Setup Golang toolchains" | |
| go install github.com/uudashr/gopkgs/v2/cmd/gopkgs@latest | |
| go install github.com/ramya-rao-a/go-outline@latest | |
| go install github.com/fatih/gomodifytags@latest | |
| go install github.com/haya14busa/goplay/cmd/goplay@latest | |
| go install github.com/go-delve/delve/cmd/dlv@master | |
| go install golang.org/x/tools/gopls@latest | |
| go install github.com/rogpeppe/godef@latest | |
| go install honnef.co/go/tools/cmd/staticcheck@latest | |
| go install sigs.k8s.io/kind@v0.30.0 | |
| echo ">>>>>> Setup bash theme" | |
| git clone https://github.com/ohmybash/oh-my-bash.git ~/.oh-my-bash | |
| cp ~/.oh-my-bash/templates/bashrc.osh-template ~/.bashrc | |
| sed -i 's/OSH_THEME=.*/OSH_THEME="axin"/g' ~/.bashrc | |
| echo 'OMB_PROMPT_SHOW_PYTHON_VENV=true' >> ~/.bashrc | |
| source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment