Skip to content

Instantly share code, notes, and snippets.

View brandonmartinez's full-sized avatar

Brandon Martinez brandonmartinez

View GitHub Profile
@brandonmartinez
brandonmartinez / azure-advisor-zone-resiliency-workbook.json
Last active July 17, 2025 18:50
A workbook to import into Azure Advisor to show resources that need zone resiliency enabled.
{
"_disclaimer": "This content is provided \"as is\", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the authors be liable for any claim, damages, or other liability arising from the use of this content. Use of this content is at your own risk. It is your responsibility to ensure compliance with all applicable laws, regulations, and internal policies. This content is licensed under the MIT License.",
"version": "Notebook/1.0",
"items": [
{
"type": 9,
"content": {
"version": "KqlParameterItem/1.0",
"parameters": [
{
@brandonmartinez
brandonmartinez / azure-vm-capacity-reservation-check-and-reserve.sh
Created May 28, 2025 15:50
Attempts to reserve capacity across Azure zones for a selected VM SKU.
#!/bin/bash
# -----------------------------------------------------------------------------
# DISCLAIMER:
# This script is provided as a sample for informational purposes only.
# There is no guarantee of fitness for a particular purpose, and it may not be
# suitable for use in production environments. Use at your own risk.
# The authors and distributors accept no liability for any damages or losses
# resulting from the use or misuse of this script. Review, test, and modify
# as needed before deploying in any environment.
# Based on: https://github.com/Klipper3d/klipper/blob/master/config/printer-creality-ender3-s1plus-2022.cfg
# This file contains pin mappings for the stock 2022 Creality Ender 3
# S1 Plus. To use this config check the STM32 Chip on the Mainboard,
# during "make menuconfig" select accordingly either the
# STM32F103 with "28KiB bootloader" or the STM32F401 with
# "64KiB bootloader" and serial (on USART1 PA10/PA9) for both.
# For a direct serial connection, in "make menuconfig" select
# "Enable extra low-level configuration options" and Serial
# (on USART2 PA3/PA2), which is on the 10 pin IDC cable used
@brandonmartinez
brandonmartinez / UserScripts-UltimateGuitar-CopyTabToClipboard.js
Created January 9, 2025 19:31
A user script to copy the contents of an ultimate guitar tab to your clipboard.
// ==UserScript==
// @name Copy Tab to Clipboard
// @namespace https://tabs.ultimate-guitar.com/
// @version 1.1
// @description Adds a button to copy tab to clipboard
// @author Brandon Martinez
// @match https://tabs.ultimate-guitar.com/*
// @require https://code.jquery.com/jquery-3.7.1.slim.min.js
// @grant GM_setClipboard
// ==/UserScript==
@brandonmartinez
brandonmartinez / zen.toml
Created July 15, 2024 05:51
My personal ohmyposh.dev configuration
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
version = 2
final_space = true
console_title_template = '{{ .Shell }} in {{ .Folder }}'
[[blocks]]
type = 'prompt'
alignment = 'left'
newline = true
@brandonmartinez
brandonmartinez / disable-storage-accounts-shared-key-access.sh
Created April 29, 2024 14:59
Disables shared key access on all storage accounts in the given subscription.
#!/usr/bin/env bash
# Be sure to run az login before running
# run this script with a single parameter which is the subscription ID
# Exit if SUBSCRIPTION_ID is empty
if [ -z "$1" ]; then
echo "Please provide a valid subscription ID as the first parameter."
exit 1
fi
@brandonmartinez
brandonmartinez / CreatedAndRecordDateCleanup.sh
Created November 19, 2023 19:38
A script that will take videos named in the YYYY-MM-DD-HH-mm-ss* format and use that to update the file created date time and EXIF created date times. Meant to run on macOS (due to `touch` and `stat` differences from linux).
#!/bin/zsh
DEBUG=${DEBUG:-false}
fullpath=$1
log_header() {
RED=$(tput setaf 1)
WHITE=$(tput setaf 7)
RESET=$(tput sgr0)
@brandonmartinez
brandonmartinez / printer-Ender3S1Plus.cfg
Last active March 13, 2025 05:08
My klipper printer.cfg for the Ender 3 S1 Plus
# Based on: https://github.com/Klipper3d/klipper/blob/master/config/printer-creality-ender3-s1plus-2022.cfg
# This file contains pin mappings for the stock 2022 Creality Ender 3
# S1 Plus. To use this config check the STM32 Chip on the Mainboard,
# during "make menuconfig" select accordingly either the
# STM32F103 with "28KiB bootloader" or the STM32F401 with
# "64KiB bootloader" and serial (on USART1 PA10/PA9) for both.
# For a direct serial connection, in "make menuconfig" select
# "Enable extra low-level configuration options" and Serial
# (on USART2 PA3/PA2), which is on the 10 pin IDC cable used
@brandonmartinez
brandonmartinez / StabilizeVideosInFolder.sh
Created July 30, 2022 05:57
Search a folder for MP4 files and stabilize them with ffmpeg and vid.stab.
#!/bin/sh
####################################################################################
# This script searches the passed in directory for video files (*.mp4, *.mov, *.m4v)
# and stabilizes them using ffmpeg and libvidstab (required before running). It will
# create a transform file (*.trf), then use the information to create a new video
# with a `-stabilized` suffix.
#
# Based on https://www.paulirish.com/2021/video-stabilization-with-ffmpeg-and-vidstab/
####################################################################################
@brandonmartinez
brandonmartinez / portal.azure.com.hideuserinformation.user.js
Last active March 4, 2022 19:51
Tampermonkey | Azure Portal | Hide User Information
// ==UserScript==
// @name Azure Portal | Hide User Information
// @version 0.1
// @description Hides the signed in user name and avatar in the Azure portal.
// @author Brandon Martinez
// @grant none
// @include https://portal.azure.com/*
// @include https://ms.portal.azure.com/*
// ==/UserScript==