Skip to content

Instantly share code, notes, and snippets.

@aastaneh
aastaneh / script.sh
Created May 3, 2018 11:27
a terrible bash script that uses the ARP table to determine IP addresses for running KVM guests on a bridged interface
#!/bin/bash
for vm in $(virsh list --state-running --name); do
echo -n "$vm "
arp | grep $(virsh domiflist $vm | sed '/^$/d' | tail -n1 | awk '{ print $NF}') | awk '{ print $1 }'
done
# $ script.sh
# vm1 192.168.1.100
# vm2 192.168.1.101
@aastaneh
aastaneh / gist:46ceb03150e5284b8a3a
Last active August 29, 2015 14:07
How to swap out AWS ELB Policies for CVE-2014-3566 using AWS CLI Tools
https://aws.amazon.com/security/security-bulletins/CVE-2014-3566-advisory/
says to go into the web interface and change SSL negotiation settings.
What if you have hundreds of ELBs to change? NO BUENO.
Here's how to do it using the CLI tools:
# List Existing Policies
aws elb describe-load-balancer-policies --load-balancer-name $ELBNAME --output text | grep POLICYDESCRIPTIONS