Skip to content

Instantly share code, notes, and snippets.

View PaulStovell's full-sized avatar

Paul Stovell PaulStovell

View GitHub Profile
@PaulStovell
PaulStovell / text.md
Last active June 4, 2020 06:35
Microsoft/OSS relationship

This follows from Aaron's post and this set of tweets

Sometimes Microsoft build things that replace or compete with OSS and community alternatives. This upsets a bunch of people and it's been written about plenty.

These two pages in docs.microsoft.com are really nice counter examples - while they show the built-in Microsoft solutions, they also mention other OSS options, and even link to them:

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1

A much better example, Microsoft shipped a replacement for JSON serialization. I think that this page is really good:

@PaulStovell
PaulStovell / IDocument.cs
Last active April 25, 2020 09:51
Nevermore marker interfaces & shims
namespace Nevermore.Contracts
{
public interface IDocument : IId, INamed
{
}
}
@PaulStovell
PaulStovell / Xero Helper.js
Last active March 5, 2019 05:20
A TamperMonkey script that lets you easily find and match multiple transactions in Xero to reconcile.
// ==UserScript==
// @name Xero Bank Rec Helper
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://go.xero.com/Bank/BankRec.aspx*
// @grant none
// ==/UserScript==

The following terms are used throughout this agreement:

  • You - the person or legal entity including its affiliates asked to accept this agreement. An affiliate is any entity that controls or is controlled by the legal entity, or is under common control with it.
  • Project - is an umbrella term that refers to any and all Octopus Deploy open source projects.
  • Contribution - any type of work that is submitted to a Project, including any modifications or additions to existing work.
  • Submitted - conveyed to a Project via a pull request, commit, issue, or any form of electronic, written, or verbal communication with Octopus Deploy, contributors or maintainers.

1. Grant of Copyright License.

Subject to the terms and conditions of this agreement, You grant to the Projects’ maintainers, contributors, users and to Octopus Deploy a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly p

@PaulStovell
PaulStovell / gist:ca7ba5021ba6aecf72bc
Last active March 20, 2016 12:31
Windows Server 2016

Windows Server 2016 comes in three flavours:

  • Full UI
  • Server core
  • Nano

Nano is an exciting change - a disk image is about 700mb, and it boots in a few seconds (IIS serving web requests).

However, it has some limitations. Things it can do:

Octopus + Docker in a nutshell

Currently, Octopus deploys NuGet packages to destination machines, and handles all the orchestration around the deployment.

From an application packaging point of view, a NuGet package is similar to a Docker container image:

  • To build a NuGet package, we take your code, compile it, and bundle the results into a package, and give it a version stamp.
  • To build a Docker image, we take a Dockerfile, and run docker build, and it creates an image with a version stamp

From a deployment orchestation point of view, the two are also very similar:

@PaulStovell
PaulStovell / thoughts.md
Created November 17, 2015 15:51
ASP.NET vNext deployments

Given this scenario:

We have an ASP.NET vNext web app that we build once, and then deploy to 5 separate servers running IIS.

With old ASP.NET it's pretty easy - we can publish it to a folder, then xcopy the files to each IIS server. The publish directory would just contain the views, config files, assets, and a few DLL's in the bin directory. We can clearly say "this is the best way" and not worry about much else.

With vNext, it seems like we have a few options:

Option 1: DNU Publish

$usernameToFind = "ITARI\Administrator"
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$contextType = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$context = New-Object System.DirectoryServices.AccountManagement.PrincipalContext -argumentlist ($contextType)
$user = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity($context, $usernameToFind)
Write-Output $user
Task ID: ServerTasks-241
Task status: Success
Task queued: Friday, 21 August 2015 4:11 PM
Task started: Friday, 21 August 2015 4:11 PM
Task duration: 47 seconds
| == Success: Upgrade Tentacles in Development ==
16:11:56 Info | 1 machines will be upgraded to the latest Tentacle version.
|
| == Success: DWebApp01 ==

Octopus stores the X.509 certificate that it uses to connect with Tentacles in the Octopus database. To make loading the certificate faster, it's also loaded into the Windows Certificate store.

The loading process looks like this:

  1. Does a certificate exist in the store with thumbprint XXXX? Yes: Load it No: Install it

The store is owned by whichever account runs as the Octopus server - this is usually the local system account.