Skip to content

Instantly share code, notes, and snippets.

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

John Bevan JohnLBevan

🏠
Working from home
View GitHub Profile
@ausfestivus
ausfestivus / AzureRegionData.md
Last active April 19, 2024 21:03
A list of the Azure regions

List of Azure Regions

A list of all the region names and locations for Azure

Creating the list

You can recreate the list anytime using this command:

az account list-locations -o table
@mklement0
mklement0 / Test-WinCredential.ps1
Last active April 18, 2024 01:33
Test-WinCredential: PowerShell function for validating Windows domain / local user credentials.
<#
Prerequisites: Windows PowerShell 5.1, PowerShell (Core) (v6+) - MAY work in earlier versions
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD and INSTANT DEFINITION OF THE FUNCTION:
irm https://gist.github.com/mklement0/83e8e6a2b39ecec7b0a14a8e631769ce/raw/Test-WinCredential.ps1 | iex
@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork git@github...my-fork.git
@9to5IT
9to5IT / Script_Template.ps1
Last active April 9, 2024 14:01
PowerShell: Script Template
#requires -version 2
<#
.SYNOPSIS
<Overview of script>
.DESCRIPTION
<Brief description of script>
.PARAMETER <Parameter_Name>
<Brief description of parameter input required. Repeat this attribute if required>
@FlogDonkey
FlogDonkey / Move TempDB.sql
Last active April 9, 2024 12:20
New and improved Move TempDB script. Captures xp_cmdshell value before execution and resets it post-execution. Allows for dynamic drive allocation in case of company policy of leaving some set percent of drive available for future growth. Also includes improved error handling and validation, as well as a @debug mode, allowing us to run the scrip…
/*
Snippet is nuts and bolts for creating/moving to an isolated tempdb drive.
After you run this, SQL Server must be restarted for it to take effect
*/
DECLARE @DriveSizeGB INT = 40
,@FileCount INT = 9
,@InstanceCount TINYINT = 1
,@VolumeBuffer DECIMAL(8, 2) = .8 /* Set to amount of volume TempDB can fill. */
,@RowID INT
,@FileSize VARCHAR(10)
@gene1wood
gene1wood / bitwarden-amazon-aws-credential-setup.md
Last active March 22, 2024 22:53
How to get BitWarden to differentiate between amazon.com consumer retail logins, AWS root logins and AWS IAM user logins

Here's how to get BitWarden to treat these three different types of Amazon logins as separate

  • amazon.com consumer retail business login
  • AWS root user login (AWS logins that use an email address)
  • AWS IAM user login (AWS logins that use a username)

amazon.com consumer retail

  • Set URI 1 to Exact with a value of

    https://www.amazon.com/ap/signin?_encoding=UTF8&ignoreAuthState=1&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2F%3Fref_%3Dnav_custrec_signin&switch_account=

@nohwnd
nohwnd / Uninstall-Pester.ps1
Last active March 14, 2024 13:57
Remove built-in version of Pester 3 (or -All) from Windows 10 Program Files and Program Files (x86).
#Requires -RunAsAdministrator
function Uninstall-Pester ([switch]$All) {
if ([IntPtr]::Size * 8 -ne 64) { throw "Run this script from 64bit PowerShell." }
#Requires -RunAsAdministrator
$pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) {
$path = "$programFiles\WindowsPowerShell\Modules\Pester"
if ($null -ne $programFiles -and (Test-Path $path)) {
if ($All) {
@gubatron
gubatron / multiple-deploy-keys-multiple-private-repos-github-ssh-config.md
Last active March 12, 2024 07:34
How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

How to configure multiple deploy keys for different private github repositories on the same computer without using ssh-agent

Let's say alice is a github.com user, with 2 or more private repositories repoN. For this example we'll work with just two repositories named repo1 and repo2

https://github.com/alice/repo1

https://github.com/alice/repo2

You need to be to pull from these repositories without entering a passwords probably on a server, or on multiple servers.

@pio2pio
pio2pio / main.tf
Created May 25, 2020 12:11
Terraform template remove empty lines and comment lines starting with '#' symbol
variable "match_comment" { default = "/(?U)(?m)(?s)(^#.*$)/" }
variable "match_empty_line" { default = "/(?m)(?s)(^[\r\n])/" }
resource "helm_release" "myapp" {
name = "myapp"
chart = "${path.module}/charts/myapp"
values = [
replace(
replace(
templatefile("${path.module}/templates/values-override.yaml.tpl", {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
[String]
$PrivateLinkDnsForwarderIpAddress
)
$privatelinkDomains = @("azure-automation.net",
"database.windows.net",
"sql.azuresynapse.net",