Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nick Shores nshores

🏠
Working from home
View GitHub Profile
View find_misconfigured_autoscaler.sh
#!/bin/bash
# Example usage: ./find_misconfigured_autoscaler.sh -p autogrid-dev -r us-east-2
# Your kubeconfig needs to have all of the AG clusters in it, and the names context must match AWS
# set the F flag to true to fix ASG tagging (brute force method)
while getopts p:r:c:f: flag
do
case "${flag}" in
p) AWS_PROFILE=${OPTARG};;
r) REGIONS=${OPTARG};;
c) CLUSTER_TARGET=${OPTARG};;
View generate_aws_subnet_list_.sh
#!/bin/bash
#This script will generate a list of various subnet attributes from an input value of a list of aws profile's. Each profile will be used to crawl the region for all available subnets, and output details to CSV.
#Example input: ./generate_aws_subnet_list_.sh "autogrid-dev autogrid-prod"
AWS_PROFILE=$1
echo "Current AWS_PROFILE: $AWS_PROFILE"
for profile in $AWS_PROFILE; do
echo "Changing Profile to $profile"
export AWS_PROFILE=$profile
#Get regions if we haven't already
View update_ssh_host_key.yml
- hosts: all
gather_facts: false
become: yes
vars:
target_host: target.host.enterprise.com
target_user: /home/targetuser/.ssh/known_hosts
separator: /
View vmdk_dupes.ps1
#https://blog.milla-online.de/duplicate-disk-uuids-and-how-to-get-rid-of-it-hopefully
# get all hard disks
Write-Host "Get all hard disks... " -NoNewline
$alldisks = Get-VM | Get-HardDisk
Write-Host ("Found " + $alldisks.Count)
# filter disks for duplicate uuids and show the "disk.enableUUID" parameter
Write-Host "Filter for duplicate uuids... " -NoNewline
$diskswithduplicateuuids = $alldisks | Select-Object -Property Parent,Name,@{N="Disk-Uuid";E={$_.ExtensionData.Backing.Uuid}} | Group-Object -Property Disk-Uuid | Where-Object -FilterScript { $_.Count -ne 1 } | Select-Object -ExpandProperty Group
View sysmon.sh
#!/bin/bash
#hahriar Shovon
#@Github https://github.com/shovon8/sysmon
printf "%-10s%-15s%-15s%s\n" "PID" "OWNER" "MEMORY" "COMMAND"
function sysmon_main() {
RAWIN=$(ps -o pid,user,%mem,command ax | grep -v PID | awk '/[0-9]*/{print $1 ":" $2 ":" $4}')
for i in $RAWIN
do
@nshores
nshores / tinder.py
Created Jul 8, 2021
tinder prep.py
View tinder.py
string = "Horse Apple Cake"
print(string)
#Find check if a substring is contained
#The find method returns -1 if no match, and the index where the substring starts otherwise
word = 'hello'
search = (word.find('ll'))
if (word.find('ll') != -1):
View get_az_vm.py
#!/usr/bin/env python
from azure.common.credentials import ServicePrincipalCredentials
from azure.mgmt.compute import ComputeManagementClient
import json
from json2html import *
# Tenant ID for your Azure subscription
TENANT_ID = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX'
View frigate_config.yml
mqtt:
host: tasks.hivemq-broker
cameras:
front_door:
ffmpeg:
inputs:
- path: rtsp://admin:4118nick@192.168.99.148:554/live
roles:
- detect
- rtmp
@nshores
nshores / az_update_vm_disk.ps1
Created Apr 27, 2021
update vm disks in azure
View az_update_vm_disk.ps1
#select sub
Select-AzSubscription -Subscription 95a20cd8-ca92-4b1e-9d7a-f9ca650b8811
# Name of the resource group that contains the VM
$rgName = 'AMS-prd'
# Choose between Standard_LRS, StandardSSD_LRS and Premium_LRS based on your scenario
$storageType = 'Premium_LRS'
@nshores
nshores / azurerm_netapp_volume_debug
Created Mar 1, 2021
azurerm_netapp_volume_debug
View azurerm_netapp_volume_debug
(and 3 more similar warnings elsewhere)
Error: rpc error: code = Unavailable desc = transport is closing
Error: rpc error: code = Unavailable desc = transport is closing