Skip to content

Instantly share code, notes, and snippets.

View ernstae's full-sized avatar

Andrew Ernst ernstae

View GitHub Profile
@ernstae
ernstae / sys-group-replication-healthcheck-proxysql.sql
Created September 23, 2020 01:12
MySQL Group Replication Health Check for ProxySQL
USE sys;
SET sql_log_bin=0;
SET @prior_read_only_status = (SELECT @@global.super_read_only);
SET GLOBAL super_read_only=(SELECT IF(@prior_read_only_status = 1, 0, @prior_read_only_status));
DELIMITER $$
DROP FUNCTION IF EXISTS my_id;$$
@ernstae
ernstae / azure_get_public_ips.sh
Last active May 19, 2023 06:26
Get All Subscriptions Azure Public IP Addresses
#!/bin/bash
# Quick for loop to get all public IP addresses for all subscriptions in Azure (that you have access to)
for account in $(az account list --output json | jq -r '.[] | .id')
do
echo "Subscription: $account"
az account set --subscription ${account}
az network public-ip list --output json | jq -rc '.[] | select(.ipAddress != null) | {name, ipAddress, resourceGroup}'
done

Keybase proof

I hereby claim:

  • I am ernstae on github.
  • I am ernstae (https://keybase.io/ernstae) on keybase.
  • I have a public key ASAdckSrYG1pkhBRxFflRyaN3tK1GugSR1hOrsFDWmyAsAo

To claim this, I am signing this object:

#!/bin/bash
# author: ernstae@github.com
# purpose: for all the StorNext LUNs, find the dm- device name based on the output of the multipath command
for x in $(cvlabel -L | grep meta | awk {'print $1'}); do multipath -ll $x | sed -n 1p | awk {'print $3'} ; done;
@ernstae
ernstae / snsm_cancel_requests.sh
Last active September 10, 2015 01:20
StorNext cancel mount requests of MSM
#!/bin/bash
# author: ernstae@github.com
# purpose: cancel all requests that are pending of type 14 (mount) with a StorNext Storage Manager system
for req_id in $(vsgetreqids | cut -d'~' -f1)
do
vscancelreq -c 14 ${req_id}
done