From bda89777b831c757820a789c1941ba2164a38434 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Sun, 29 Nov 2015 10:02:06 -0800 Subject: Add a few aliases to bash. Some aliases to navigate to different repositories or directories, and a function to run `puppet` on a list of hosts. --- bashrc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 9382d5e..63a96f1 100644 --- a/bashrc +++ b/bashrc @@ -66,15 +66,34 @@ alias gerp="grep --color=auto" alias grep="grep --color=auto" alias pjson="python -mjson.tool" +alias s="cd ~/src/source" +alias eb="cd ~/src/source/eventbus" +alias ops="cd ~/src/twitter-ops" # tmux alias tmux='tmux -2' alias tmuxl='tmux new -A -s local' alias tmuxr='tmux new -A -s remote' +# local stuff +[ -f "${HOME}/.bash_local" ] && source "${HOME}/.bash_local" + function gitme { git config --local user.email "franckcuny@gmail.com" git config --local user.name "Franck Cuny" } -[ -f "${HOME}/.bash_local" ] && source "${HOME}/.bash_local" +function puppet-master { + local hostlist=$1 + if [[ -z "${hostlist}" ]]; then + echo "host list is missing" + return 1 + fi + + batch_size=$(sed -n '$=' "${hostlist}") + if [[ "${batch_size}" -gt 10 ]]; then + batch_size=10 + fi + loony -F "${hostlist}" -t "${batch_size}" run sudo puppet-util run +} + -- cgit 1.4.1