From 5c476c7950f4e64c541ffbe96264d3440ed4b80d Mon Sep 17 00:00:00 2001 From: Gea-Suan Lin Date: Sun, 11 Sep 2016 03:34:37 +0800 Subject: [PATCH] Add db.warmup. --- .bashrc | 4 ++++ .zshrc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.bashrc b/.bashrc index ffc6157..9601b4a 100644 --- a/.bashrc +++ b/.bashrc @@ -29,6 +29,10 @@ alias smic="sudo env -i PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ alias ssh="ssh -C -e none -v" alias t="telnet" # +function db.warmup() { + pt-find --charset=utf8 --print -h $1 | xargs -t -P8 -I% -n1 sh -c "echo 'SELECT COUNT(*) FROM %;' | mysql -h $1 > /dev/null" +} +# export BLOCKSIZE="k" export EDITOR="vim" export GIT_PAGER="less" diff --git a/.zshrc b/.zshrc index 9bb2730..e36c2c1 100644 --- a/.zshrc +++ b/.zshrc @@ -27,6 +27,10 @@ alias "smic=sudo make install clean" alias "ssh=ssh -C -e none -v" alias "t=telnet" # +db.warmup() { + pt-find --charset=utf8 --print -h $1 | xargs -t -P8 -I% -n1 sh -c "echo 'SELECT COUNT(*) FROM %;' | mysql -h $1 > /dev/null" +} +# if [[ -x /usr/bin/xdg-open ]]; then alias "o=xdg-open" fi