Skip to content

Instantly share code, notes, and snippets.

View craignicholson's full-sized avatar
🌴
On vacation

Craig Nicholson craignicholson

🌴
On vacation
View GitHub Profile
@craignicholson
craignicholson / boxstarter.ps1
Created September 21, 2017 00:13 — 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:
@craignicholson
craignicholson / example.cs
Last active January 28, 2018 03:00
Generic Function to write and outage out to xml, for soap requests
private static bool WriteXml(object outageEvents, string fileMessage)
{
try
{
var serializer = new XmlSerializer(outageEvents.GetType());
string xml;
using (var sww = new StringWriter())
{
using (var writer = XmlWriter.Create(sww))
{
@craignicholson
craignicholson / Dot_Net_Config_Compare_Sync.ps1
Created May 16, 2018 16:23
User Powershell to Merge AppSettings from a production .config and a newly installed config
# I stumble around in PowerShell b/c I learn by doing
# back up the current config before install
# Pre-Install make a copy of the config
# Copy-Item J:\ElectSolve\WindowsServices\ServiceOrderService\ServiceOrderService.exe.config J:\ElectSolve\WindowsServices\ServiceOrderService\ServiceOrderService.exe.config.backup
# Post Install Loop over current config
# replace all connection strings and app.Values with the values from config.backup
# Notify us if there is a key which was not in the config.backup, a new key
@craignicholson
craignicholson / Vagrantfile
Created June 30, 2018 12:52 — forked from lizrice/Vagrantfile
Vagrant file for setting up a single-node Kubernetes cluster that I can access from my desktop. Read more: https://medium.com/@lizrice/kubernetes-in-vagrant-with-kubeadm-21979ded6c63
# -*- mode: ruby -*-
# vi: set ft=ruby :
# This script to install Kubernetes will get executed after we have provisioned the box
$script = <<-SCRIPT
# Install kubernetes
apt-get update && apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
cat <<EOF >/etc/apt/sources.list.d/kubernetes.list