Skip to content

Instantly share code, notes, and snippets.

View rssws's full-sized avatar

Zhongpin Wang rssws

View GitHub Profile
@rssws
rssws / server_backup.bash
Created March 8, 2021 21:29
Backup script using rsync and tar. Automatically delete old backups when space not sufficient.
###################
# settings
backup_dir=<path to the backup directory> # e.g. /root/backup
remote_server=<example.com> # ip address or server name set in ssh config, same as using the ssh or scp
server_name=<server_name> # a tag for the log purpose and will be the backup folder name
###################
startTime=$(date +%s)
# define color
@rssws
rssws / install-k8s-flannel-debian+ubuntu.bash
Last active June 28, 2024 06:55
Install k8s + flannel on debian / ubuntu for master / worker node
install_docker () {
distro=$(cat /etc/*-release | grep DISTRIB_ID | awk -F '=' '{print $2}' | awk '{print tolower($0)}')
distroList=("debian" "ubuntu")
if [[ -n "${distro}" ]]; then
if [[ " ${distroList[*]} " =~ " ${distro} " ]]; then
echo "Installing kubernetes on $distro"
else
echo "Upsupported system distro: ${distro}"
echo "<distro> must be one of: ${distroList[*]}"