Skip to content

Instantly share code, notes, and snippets.

@christrotter
christrotter / gist:e0f870fb01d8c40aad4494fb66b96a01
Created November 9, 2021 00:12
Arduino Nerf gun - the orange one
/*
So sorry this code has no loops or parameterization, it's terrible, just putting it somewhere that won't get lost.
*/
#include <Bounce2.h>
const int buttonPin = 7; // the number of the pushbutton pin
int buttonState = 0; // variable for reading the pushbutton status
int buttonValue;
Bounce2::Button button = Bounce2::Button();
int chargedLEDs = 0;
<#
Much of this is direct from the Packer documentation:
https://www.packer.io/intro/getting-started/build-image.html#a-windows-example
Everything else from random other blogs.
'PostToSlack' is one of our in-house functions, just sends stuff to a slack channel.
#>
Write-Output "Setting the administrator password to facilitate WinRM config."
@christrotter
christrotter / gist:05f36352d81f57745f27587943c1b3a8
Created March 21, 2018 13:07
Teamcity Sonar powershell script
param (
[Parameter(Mandatory=$true)][string]$projectName,
[Parameter(Mandatory=$true)][string]$projectKey,
[Parameter(Mandatory=$true)][string]$projectVersion,
[Parameter(Mandatory=$true)][string]$sonarUser,
[Parameter(Mandatory=$true)][string]$sonarPass
)
$sonarHost = "http://sonar.domain.com:9000"
$sonarRunnerExe = "C:\tools\sonar\MSBuild.SonarQube.Runner.exe"
@christrotter
christrotter / CanaryInterestingMetrics.ps1
Created September 17, 2017 01:14
Canary-InterestingMetrics
$ErrorActionPreference = "Stop"
$modulePath = $OctopusParameters['Octopus.Action[DeployScripts].Output.Package.InstallationDirectoryPath']
Import-Module AWSPowerShell
Import-Module WebAdministration
Import-Module $modulePath\scripts\modules\Elastico\Elastico.psd1
Import-Module $modulePath\scripts\modules\Elasticsearch\PS-Elasticsearch.psm1
Import-Module $modulePath\scripts\modules\Manager-CanaryFunctions.psm1
Import-Module $modulePath\scripts\modules\FilebeatFunctions.psm1
@christrotter
christrotter / Filebeat-IIS-Setup.ps1
Last active June 7, 2017 17:45
Powershell install of filebeat for IIS in EC2
function PostToSlack {
Param([string]$message)
$wc = New-Object net.webclient
$wc.UploadString("https://hooks.slack.com/services/random/moreRandom", (ConvertTo-Json @{ text = ("$message") }))
}
###################################
### Modules ###
Import-Module WebAdministration
###################################
@christrotter
christrotter / stepTemplate.ps1
Created January 27, 2017 21:50
Octopus Step Template - Nunit
function PostToSlack {
Param([string]$message)
$slackHook = "$SlackChannel"
$wc = New-Object net.webclient
$wc.UploadString($slackHook, (ConvertTo-Json @{ text = ("$message") }))
}
$enviro = "$enviroShortName"
$nUnitDir = "$NUnitWorkingDirectoryPath\tests\$enviro"