Skip to content

Instantly share code, notes, and snippets.

Paul Stovell PaulStovell

Block or report user

Report or block PaulStovell

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@PaulStovell
PaulStovell / Xero Helper.js
Last active Mar 5, 2019
A TamperMonkey script that lets you easily find and match multiple transactions in Xero to reconcile.
View Xero Helper.js
// ==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==
View cla-1.0.md

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

View gist:ca7ba5021ba6aecf72bc

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:

View octopus-docker.md

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 Nov 17, 2015
ASP.NET vNext deployments
View thoughts.md

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

View ADTest.ps1
$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
View gist:731bdcdb6c7bbb5bc2f1
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 ==
View DebugCertificateIssues.md

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.

View gist:14e8a4d253d6018ade2b
Typical Tentacle home directory (C:\Octopus on a web server, for example):
│ DeploymentJournal.xml
│ Tentacle-ApiTest-B.config
├───Applications
│ └───UAT
│ └───Acme.Web
│ ├───3.2.3
│ │ Default.aspx
View Schema.sql
CREATE TABLE [Account] (
[K] INTEGER IDENTITY(1,1) NOT NULL CONSTRAINT [IX_Account_K] UNIQUE CLUSTERED,
[Id] VARCHAR(50) NOT NULL CONSTRAINT [PK_Account_Id] PRIMARY KEY NONCLUSTERED,
[AccountType] VARCHAR(50) NOT NULL,
[Name] NVARCHAR(100) NOT NULL,
[EnvironmentIds] NVARCHAR(MAX) NOT NULL,
[JSON] NVARCHAR(MAX) NOT NULL
)
ALTER TABLE [Account] ADD CONSTRAINT [UQ_AccountUniqueName] UNIQUE([Name])
You can’t perform that action at this time.