Skip to content

Instantly share code, notes, and snippets.

View mattvanstone's full-sized avatar

Matt Van Stone mattvanstone

View GitHub Profile
@mattvanstone
mattvanstone / config.yml
Created January 13, 2021 17:19
CircleCI hack for scheduled workflows that fail with unauthorized status
# This is an example hack for scheduled CircleCI workflows that fail with the status "unauthorized" when
# using a context is configured with any security group other than "all members"
# How to use:
# - Create a CircleCI token and add it to the project environment variables with the name CIRCLE_TOKEN
# - Create a context called "hello" and restrict the security to a specific group. Remove "all members"
# The trigger_job workflow will run daily as the CircleCI system to use your CIRCLE_TOKEN with the API
# to trigger the actual job you want to run. That job will then have access to the context because it
# was executed with your token.
@mattvanstone
mattvanstone / osx_bootstrap.sh
Created April 5, 2020 20:07 — forked from codeinthehole/osx_bootstrap.sh
Script to install stuff I want on a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
2019/11/28 14:40:00 [INFO] Terraform version: 0.12.16
2019/11/28 14:40:00 [INFO] Go runtime version: go1.12.13
2019/11/28 14:40:00 [INFO] CLI args: []string{"c:\\terraform\\terraform1216.exe", "apply"}
2019/11/28 14:40:00 [DEBUG] Attempting to open CLI config file: C:\Users\[redacted]\AppData\Roaming\terraform.rc
2019/11/28 14:40:00 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2019/11/28 14:40:00 [INFO] CLI command args: []string{"apply"}
2019/11/28 14:40:00 [DEBUG] New state was assigned lineage "ad9ae7ac-6fb5-1bf6-8862-ed7aae1a5a87"
2019/11/28 14:40:00 [DEBUG] checking for provisioner in "c:\\terraform"
2019/11/28 14:40:00 [DEBUG] checking for provisioner in ".terraform\\plugins\\windows_amd64"
2019/11/28 14:40:00 [INFO] backend/local: starting Apply operation

Keybase proof

I hereby claim:

  • I am mattvanstone on github.
  • I am mattvanstone (https://keybase.io/mattvanstone) on keybase.
  • I have a public key whose fingerprint is 46EF D83F 28CC 925F 665A 0CD3 05B0 5169 F324 F668

To claim this, I am signing this object:

@mattvanstone
mattvanstone / multidomain-password-reset.ps1
Last active July 13, 2019 17:13
Change the password of multiple Active Directory accounts across multiple domains at once
# Change the password of multiple Active Directory accounts across multiple domains at once.
# Assumes that all of the passwords were the same to begin with.
Write-Host "====================="
Write-Host "Password Reset Script"
Write-Host "====================="
$oldPass = Read-Host -AsSecureString -Prompt "Old password"
$newPass = Read-Host -AsSecureString -Prompt "New password"
$accounts = @(
@mattvanstone
mattvanstone / Get-Remove-VMMemLimit.ps1
Created February 2, 2016 17:17
Get-VMWithMemLimit/Remove-VMMemLimit PowerCLI Functions - Quickly find VMs with memory limits and remove the limit
<#
.SYNOPSIS
Function gets VMs that have memory limits configured.
.DESCRIPTION
Takes a list of vms input from Get-VM and checks each one for a configured memory limit
.PARAMETER vms
The vm(s) to check for memory limits
.EXAMPLE
Get-VM | Get-VMWithMemLimit
.EXAMPLE
@mattvanstone
mattvanstone / Get-DatastoreUsage.ps1
Created February 1, 2016 18:27
Get-DatastoreUsage PowerCLI Function - Get extended datastore provisioning information
<#
.SYNOPSIS
This function calculates useful values such as gigabytes provisioned, percent provisioned, percent free, and gigabytes over-provisioned for datastores. This information is not readily available using existing PowerCLI cmdlets or through the GUI.
.DESCRIPTION
Takes a datastore name or multiple datastore names as input and outputs datastore capacity, provisioned, free space, uncommitted, overcommitted, and percent free
.PARAMETER datastore
a datastore name (string) or multiple datastore names (using wildcards)
.EXAMPLE
Get-DatastoreUsage san-ds-01
.EXAMPLE
@mattvanstone
mattvanstone / set-ssh.ps1
Created January 29, 2016 18:26
Set-SSH PowerCLI Function - Start/Stop the ESXi SSH service from PowerCLI
<#
.SYNOPSIS
Start or stop SSH on an ESXi host
.DESCRIPTION
Takes a hostname or a piped Get-VMHost object starts or stops the SSH service depending on the value of the State parameter
.PARAMETER VMHost
The name of a host to start ssh on or a VMHost object
.PARAMETER State
State to set the SSH service to. Valid values are Start or Stop
.EXAMPLE