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
# 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 |
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 | |
# 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};; |
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 | |
#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 |
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
- hosts: all | |
gather_facts: false | |
become: yes | |
vars: | |
target_host: target.host.enterprise.com | |
target_user: /home/targetuser/.ssh/known_hosts | |
separator: / | |
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
#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 |
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 | |
#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 |
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
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): |
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
#!/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' |
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
mqtt: | |
host: tasks.hivemq-broker | |
cameras: | |
front_door: | |
ffmpeg: | |
inputs: | |
- path: rtsp://admin:[email protected]:554/live | |
roles: | |
- detect | |
- rtmp |
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
#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' |
NewerOlder