Skip to content

Instantly share code, notes, and snippets.

@asinghal
asinghal / gist:1a609110c67a2eba7bb4
Created August 7, 2014 20:49
Clean up/ prune old Git branches
git remote prune origin
git checkout master && git branch --merged | grep -v master | sed -e 's/origin\///' | xargs git branch -d
@asinghal
asinghal / affirmation
Created February 8, 2016 15:58
MuleSoft Contributor Agreement Acceptance by Aishwarya Singhal
I, Aishwarya Singhal, have read and do accept the MuleSoft Contributor Agreement
at http://www.mulesoft.org/legal/contributor-agreement.html
Accepted on Mon Feb 08 2016 16:58:07 GMT+0100 (CET)
@asinghal
asinghal / prune_aws_security_groups.md
Last active October 28, 2019 22:08
Clean up AWS Security groups

Commands to get security groups in use and echo names of groups that can not be found in use

Note: Always check manually before deleting security groups. There are various places the groups may be used, and the scripts output may not always be conclusive

aws elb describe-load-balancers --query 'LoadBalancerDescriptions[*].SecurityGroups' --output text | tr '\t' '\n' | sort | uniq > used.txt

aws ec2 describe-instances --query 'Reservations[*].Instances[*].SecurityGroups[*].GroupId' --output text | tr '\t' '\n' | sort | uniq >> used.txt