Skip to content

Instantly share code, notes, and snippets.

View glennsarti's full-sized avatar
✍️
Writing code that's soon to be legacy...

Glenn Sarti glennsarti

✍️
Writing code that's soon to be legacy...
View GitHub Profile
C:\Source\tmp\process_spawn> be ruby test.rb
*** back ticks
hello " world
*** %x
hello " world
*** capture3
hello "\"" world
@glennsarti
glennsarti / Audit Litmus.ps1
Last active October 31, 2019 02:57
Audit modules for litmus
Import-Module powershell-yaml
$repos = @('puppetlabs-accounts',
'puppetlabs-acl',
'puppetlabs-apache',
'puppetlabs-apt',
'puppetlabs-azure',
'puppetlabs-bootstrap',
'puppetlabs-chocolatey',
'puppetlabs-concat',
@glennsarti
glennsarti / install-telstra-nic-trigger.ps1
Created January 29, 2021 06:56
Telstra Network Trigger
#requires -Version 7.0
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $currentPrincipal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Throw "This script must be run elevated!"
Exit 1
}
$BT = Get-Module -name 'BurntToast' -ListAvailable -ErrorAction SilentlyContinue
if ($null -eq $BT) {
@glennsarti
glennsarti / theproblem.yaml
Created September 8, 2021 07:04
TelstraPurpleBlog-DynamicMatrix
os: ['windows-latest', 'ubuntu-latest']
ruby: ['2.4', '2.5', '2.7']
command: ['... run all tests ...']
@glennsarti
glennsarti / server.rb
Last active July 20, 2022 05:51
Run Tasks Mock Server
require 'webrick'
require 'net/http'
require 'json'
require 'securerandom'
POST_PATH_RE = /\/(?'result'pass|fail|random|invalid|none|actual|seccomp|costmgmt)(?:$|-(?'delay'[\d]+))/.freeze
LOGS_PATH_RE = /\/logs\/(?'id'[a-zA-Z\-0-9]+$)/.freeze
$pending_jobs = []
$exit_now = false