Skip to content

Instantly share code, notes, and snippets.

@w3bward
w3bward / New-SmoRenewableToken.ps1
Created April 21, 2022 16:14
A PowerShell class to implement the interface Microsoft.SqlServer.Management.Common.IRenewableToken
$ResourceUrl = 'https://database.windows.net'
class SmoRenewableToken : Microsoft.SqlServer.Management.Common.IRenewableToken {
[string]$Resource
[string]$Tenant
[DateTimeOffset]$TokenExpiry
[string]$UserId
[string] hidden $Token
SmoRenewableToken(
@w3bward
w3bward / variables_complex1.tf
Last active March 19, 2022 17:19
You can use jsonencode to pass complex types to your local-exec commands
terraform {
required_version = ">= 1.1.6"
}
locals {
my_var = "12\" = 1'"
my_var2 = [
"Cat",
"Dog",
"Cow",
@w3bward
w3bward / variables_good1.tf
Last active March 19, 2022 17:20
The environment argument is a safer way to pass values to local-exec scripts
terraform {
required_version = ">= 1.1.6"
}
locals {
my_var = "12\" = 1'"
}
resource "null_resource" "good_example" {
triggers = {
@w3bward
w3bward / variables_bad2.tf
Created March 18, 2022 19:07
This is why not to use string interpolation...
terraform {
required_version = ">= 1.1.6"
}
locals {
my_var = "12\" = 1'"
}
resource "null_resource" "bad_example" {
triggers = {
@w3bward
w3bward / variables_bad1.tf
Last active March 18, 2022 18:41
This technically works, but is bad in practice
terraform {
required_version = ">= 1.1.6"
}
locals {
my_var = "something"
}
resource "null_resource" "bad_example" {
triggers = {
@w3bward
w3bward / WaterPurifier.cfg
Created February 23, 2019 16:42
Updated config for the Universal Storage 2 water purifier to make it function properly as a recycler for USI LS
// Universal Storage 2 by Paul Kingtiger, Daishi and DMagic.
// See packaged file for license information
// This file is best viewed with notepad++ https://notepad-plus-plus.org/
// Using the KSP Module Manager language file included in the mod.
// name = USWaterPurifier
PART:NEEDS[Kerbalism|TacLifeSupport|USILifeSupport]
{