Skip to content

Instantly share code, notes, and snippets.

@Maghraby
Maghraby / aws_autoscaling_multi_ssh.sh
Created February 17, 2017 21:28 — forked from Ahmadposten/aws_autoscaling_multi_ssh.sh
Use tmux to ssh to all instances of an AWS autoscaling group and execute commands simultaneously.
#!/bin/bash
#
# _ _ _
# ____ | | | | | |
# / __ \ __ _| |__ _ __ ___ __ _ __| |_ __ ___ ___| |_ ___ _ __
# / / _` |/ _` | '_ \| '_ ` _ \ / _` |/ _` | '_ \ / _ \/ __| __/ _ \ '_ \
# | | (_| | (_| | | | | | | | | | (_| | (_| | |_) | (_) \__ \ || __/ | | |
# \ \__,_|\__,_|_| |_|_| |_| |_|\__,_|\__,_| .__/ \___/|___/\__\___|_| |_|
# \____/ | |
# |_|
class Array
## Here i want to flatten an array
## by a given number of dimensions if an argument is passed
def my_flatten(n = nil)
n ? multiple_flatten(self, n) : recursive_flatten(self)
end
private
#!/bin/bash
if [ -z $2 ]
then
BRANCH=master
else
BRANCH=$2
fi
git checkout $BRANCH