Skip to content

Instantly share code, notes, and snippets.

View altmannmarcelo's full-sized avatar

Marcelo Altmann altmannmarcelo

View GitHub Profile
# Many of these are obvious and stupidly simple, but for your reference and copy-pasting pleasure…
# Mextify all (with workaround for pesky samples that contain multi-line RSA key that breaks pt-mext)
for i in $(ls $1/*-mysqladmin); do { (cat $i | sed -e '/\-\-\-\-\-BEGIN\ PUBLIC\ KEY/,+9d' | pt-mext -r -- cat -) > $i.mext && echo $i.mext;} done;
# Inspect given variable through multiple mext samples (revealing ;-))
grep Table_locks_waited *.mext |less -S
#Find contentious tables
ISSUE="199402"
VM_NAME_PREFIX=$ISSUE"_marcelo_altmann_pxc"
for i in {1..3};
do
{
VM_NAME=$VM_NAME_PREFIX"_node_"$i;
lxc-stop -n $VM_NAME;
lxc-destroy -n $VM_NAME;
lxc-create -t centos -n $VM_NAME;
lxc-start -n $VM_NAME;