This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
database_name=$1 | |
input_file=$2 | |
output_file=$3 | |
temp_file=$(mktemp) | |
sed '/SET @@SESSION.GTID_NEXT=/d' "$input_file" > "$temp_file" | |
awk '{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
subscription=$1 | |
if [[ -n $2 ]]; then | |
vm_name=$2 | |
fi | |
if [[ -n $3 ]]; then | |
vm_username=$3 | |
fi | |
if [[ -n $4 ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
total=0 | |
while :; do | |
start_line=$(cat $1 | grep -m 1 -n -B 4 'Table_map: `mysql`.`heartbeat` mapped to number 150' | grep 'BEGIN' | awk -F'-' '{print $1}') | |
end_line=$(cat $1 | grep -m 1 -n -A 12 'Table_map: `mysql`.`heartbeat` mapped to number 150' | grep 'COMMIT\/\*!\*\/;' | awk -F'-' '{print $1}') | |
if [[ ! -z "$start_line" ]]; then | |
((lines=end_line-start_line)) | |
((total+=lines)) | |
echo "from $start_line to $end_line, $lines removed, total $total" | |
sed -i "${start_line},${end_line}d" $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"mode": "Indexed", | |
"policyRule": { | |
"if": { | |
"allOf": [ | |
{ | |
"field": "type", | |
"notequals": "Microsoft.Resources/subscriptions/resourceGroups" | |
}, | |
{ |