Skip to content

Instantly share code, notes, and snippets.

View the-eric-kwok's full-sized avatar
😉

EricKwok the-eric-kwok

😉
View GitHub Profile
@the-eric-kwok
the-eric-kwok / ssh_config.md
Last active January 28, 2018 14:08
ssh 配置文件模板

文件存于~/.ssh/

Host xx
    HostName xxx.xxx.com
    User xx
    Port 22
    IdentityFile ~/.ssh/id_rsa
@the-eric-kwok
the-eric-kwok / tab2space.sh
Created January 19, 2018 05:45
convert tabs in text file to spaces
#!/bin/bash
# Set the count of space to 2
SPACES=" "
if [ "$1" == "--help" ]||[ "$1" == "-h" ]||[ -z "$1" ]; then
echo "Function: Transform tabs to spaces."
echo "Usage: tab2space [file]"
exit 1
fi
@the-eric-kwok
the-eric-kwok / auto-backup.sh
Last active January 19, 2018 06:12
auto backup spigot dir
#!/bin/bash
DATE=`date '+%F'` #获取当前日期
DEL-DATE="30" #自动删除30天以前的备份
BACKUP_DIR="./share/spigot_backup" #备份目录
tar -zcvf "$DATE-spigot.tar.gz" ~/spigot
if [ ! -d "$BACKUP_DIR" ]; then
mkdir "$BACKUP_DIR"
fi