Skip to content

Instantly share code, notes, and snippets.

View nshores's full-sized avatar
🏠
Working from home

Nick Shores nshores

🏠
Working from home
View GitHub Profile
@nshores
nshores / .zshrc
Created November 1, 2022 00:25
.zshrc
# Enabl/ Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
#!/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};;
#!/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
@nshores
nshores / update_ssh_host_key.yml
Created November 3, 2021 04:54
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: /
@nshores
nshores / vmdk_dupes.ps1
Created October 5, 2021 00:04
vmdk_duptes.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
@nshores
nshores / sysmon.sh
Created July 27, 2021 23:17
sysmon
#!/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 July 8, 2021 18:46
tinder prep.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):
@nshores
nshores / get_az_vm.py
Created July 1, 2021 18:42
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'
@nshores
nshores / frigate_config.yml
Created June 16, 2021 05:32
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 April 27, 2021 21:18
update vm disks in azure
#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'