Skip to content

Instantly share code, notes, and snippets.

@jamesrcounts
jamesrcounts / MySqlCommandAdapter.cs
Created October 3, 2014 02:42
IDatabaseToExecuteableQueryAdaptor for MySql
// Note: Connection string must include the following option: Allow User Variables=True
using System;
using System.Data.Common;
using System.Linq;
using ApprovalUtilities.Persistence.Database;
using MySql.Data.MySqlClient;
public class MySqlCommandAdapter : IDatabaseToExecuteableQueryAdaptor
@jamesrcounts
jamesrcounts / Dockerfile
Last active December 19, 2023 11:04
Snippets to illustrate container pipelines in Azure DevOps
FROM microsoft/dotnet:2.2-aspnetcore-runtime-alpine
RUN apk update && apk upgrade --no-cache
WORKDIR /app
COPY ./dist .
ENTRYPOINT ["dotnet", "parrot.dll"]
@jamesrcounts
jamesrcounts / boot.bat
Last active June 26, 2023 06:36
Scripted rabbitmq install
@powershell -ExecutionPolicy unrestricted .\bootmq.ps1
@jamesrcounts
jamesrcounts / azure-create-terraform-backend.sh
Last active May 5, 2023 12:39
Snippets to illustrate getting started with Terraform in Azure DevOps
#!/usr/bin/env bash
set -euo pipefail
ID=$(uuidgen)
LOCATION=westus
RG=terraformrg
# Create unique name for storage account
STORAGE_ACCOUNT=$(echo "terraform-${ID}" | tr '[:upper:]' '[:lower:]' | sed 's/-//g' | cut -c1-24)
#!/usr/bin/env bash
set -euo pipefail
INSTALL_ZSH=${1:-"true"}
USERNAME=${2:-"automatic"}
USER_UID=${3:-"automatic"}
USER_GID=${4:-"automatic"}
UPGRADE_PACKAGES=${5:-"true"}
INSTALL_OH_MYS=${6:-"true"}
ADD_NON_FREE_PACKAGES=${7:-"false"}
Set-ExecutionPolicy -Force RemoteSigned -Scope CurrentUser
Install-WindowsUpdate
choco install Microsoft-Hyper-V-All -source windowsFeatures
choco install Microsoft-Windows-Subsystem-Linux -source windowsfeatures
choco install VirtualMachinePlatform -source WindowsFeatures
choco feature enable -n allowGlobalConfirmation
Install-WindowsUpdate
Set-ExecutionPolicy -Force RemoteSigned -Scope LocalMachine
choco install Microsoft-Hyper-V-All -source windowsFeatures
choco install Microsoft-Windows-Subsystem-Linux -source windowsfeatures
choco feature enable -n allowGlobalConfirmation
choco install googlechrome
choco install vscode
@jamesrcounts
jamesrcounts / starter.txt
Last active March 7, 2020 04:09
Boxstarter: Windows 10
# http://boxstarter.org/package/url?
Disable-BingSearch
Disable-GameBarTips
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-WindowsOptionalFeature -Online -FeatureName containers ?All
choco install Microsoft-Hyper-V-All -source windowsFeatures
@jamesrcounts
jamesrcounts / settings.json
Last active November 28, 2019 14:51
VSCode Settings
{
"files.autoSave": "afterDelay",
"workbench.colorTheme": "Visual Studio Light",
"cSpell.userWords": [
"Kubernetes",
"addin",
"kubectl",
"nuget"
],
"workbench.iconTheme": "material-icon-theme",
@jamesrcounts
jamesrcounts / boxstarter.ps1
Created January 9, 2019 19:58 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt: