my dotz
0

Configure Feed

Select the types of activity you want to include in your feed.

Add jws utils

+60
+26
bin/MACC02VK5ECHTD7/jws-fetch
··· 1 + #!/bin/sh 2 + 3 + date=$(date +%s) 4 + for r in us-east-1 us-west-2; do 5 + for p in browse cgraph; do 6 + for e in test stage prod; do 7 + dir="/tmp/jws/${r}/${p}/${e}" 8 + mkdir -p "$dir" 9 + echo "Fetching ${r}/${p}/${e}" 10 + aws ec2 describe-instances --profile "${p}_${e}" --region "$r" --output text --query "Reservations[*].Instances[*].{ 11 + Instance:InstanceId, 12 + Type:InstanceType, 13 + AZ:Placement.AvailabilityZone, 14 + Name:Tags[?Key==\`Name\`]|[0].Value, 15 + pubIP:PublicIpAddress, 16 + IP:PrivateIpAddress, 17 + State:State.Name 18 + }" | sed "s/$/ ${p}_${e}/" > "$dir/$date" & 19 + # add profile to end for easy greppin' 20 + # link current for other scripts 21 + ln -fs "$dir/$date" "$dir/current" 22 + done 23 + done 24 + done 25 + 26 + wait
+9
bin/MACC02VK5ECHTD7/jws-grep
··· 1 + #!/bin/sh 2 + 3 + stuff=$(cat /tmp/jws/*/*/*/current) 4 + 5 + for i in $@; do 6 + stuff=$(echo "$stuff" | grep -i $i) 7 + done 8 + 9 + echo "$stuff"
+25
bin/MACC02VK5ECHTD7/jws-ssh
··· 1 + #!/bin/sh 2 + # input: us-east-1a 172.29.71.236 i-0a7eb3896d61b4d22 Krakencld-app-ASG-A running m5.large None browse_test 3 + # ssh's to hosts listed from jws-grep output 4 + 5 + if ! [ -z "$1" ]; then 6 + echo "This script cannot be used interactively" 7 + exit 1 8 + fi 9 + 10 + 11 + tmux set default-shell "/bin/sh" 12 + # tmux new-window 'sleep 0.1' 13 + while IFS='$\n' read -r i; do 14 + ip=$(echo "$i" | awk '{print $2}') 15 + tmux split-window "ssh $ip" 16 + tmux select-layout tiled 17 + done 18 + tmux set -u default-shell 19 + # tmux select-layout tiled 20 + # tmux setw synchronize-panes on 21 + 22 + # todo? 23 + # if one result, directly ssh 24 + # if more than one result, do new window tmux madness 25 +