Skip to content

Instantly share code, notes, and snippets.

View CGaskell's full-sized avatar

Chris Gaskell CGaskell

View GitHub Profile
@CGaskell
CGaskell / cumulusmx.service
Created February 10, 2021 07:22
Run CumulusMX as service on RaspberryPi
[Unit]
Description=CumulusMX
Documentation=https://cumuluswiki.org/a/Main_Page
After=network-online.target
[Service]
User=root
Group=root
ExecStart=/usr/bin/mono-service -/home/pi/CumulusMX CumulusMX.exe -service
Type=forking
@CGaskell
CGaskell / RedirectToHTTPS.config
Created December 10, 2016 08:16
IIS Rewrite Rule - Redirect HTTP requests To HTTPS
<rewrite>
<rules>
<rule name="Redirect to https" enabled="true" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" negate="false" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTPS}" pattern="off" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Found" />
</rule>
</rules>
@CGaskell
CGaskell / CreateMongoDBService.bat
Created November 25, 2016 08:35
Quick script to create a windows servuice to run Mongo. Paths will need reviewing per install
--rmdir /s D:\MongoDB\Data
mkdir D:\MongoDB\Data\db
mkdir D:\MongoDB\Data\log
copy mongod.conf "D:\MongoDB\"
sc.exe delete MongoDB
sc.exe create MongoDB binPath= "\"%PROGRAMFILES%\MongoDB\Server\3.0\bin\mongod.exe\" --service --config=\"D:\MongoDB\mongod.conf\"" DisplayName= "MongoDB" start= "auto"
@CGaskell
CGaskell / OctopusNotification.html
Created November 17, 2016 10:32
Octopus Deployment Detail Email Template
<html><body style="font-family: arial; font-size: 12px;"><h2>Deployment of #{Octopus.Project.Name} #{Octopus.Release.Number} to #{Octopus.Environment.Name}</h2><p>  <em>Initiated by    #{unless Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.Username}#{/unless}    #{if Octopus.Deployment.CreatedBy.DisplayName}#{Octopus.Deployment.CreatedBy.DisplayName}#{/if}    #{if Octopus.Deployment.CreatedBy.EmailAddress} (<a href="mailto: #{Octopus.Deployment.CreatedBy.EmailAddress}">#{Octopus.Deployment.CreatedBy.EmailAddress}</a>)#{/if}    at #{Octopus.Deployment.Created}</em> <br> <a href="http://[OctoSvrUrl]/app#/projects/#{Octopus.Project.Name}/releases/#{Octopus.Release.Number}">Click here</a> to view the release detail</p>#{if Octopus.Release.Notes}<h3>Release notes</h3><p>#{Octopus.Release.Notes}</p>#{/if}<h3>Deployment process</h3><p>The deployment included the following actions:</p><ul>  #{each action in Octopus.Action}    <li><strong>#{action.Name}</strong> #{if action.Package.NuGetPacka
@CGaskell
CGaskell / MsBuild Publish WebApp
Created November 10, 2016 08:26
MS Build flags to run a publish to disk on a .NET web project. Useful in TC becore using octo.exe -pack to product nuget's
/t:Package /p:_PackageTempDir="c:/published_files/" /p:Configuration="Release" /p:DeleteExistingFiles="True"
@CGaskell
CGaskell / EnumList
Created July 31, 2014 09:48
Sitecore Enum Driven Dropdownlist. Uses [Description] attribute if defined.
using System;
using System.ComponentModel;
using Sitecore.Web.UI.HtmlControls;
namespace DetangledDigital.Sc.FieldTypes
{
/*
*
* @CGaskell
* Custom field type. Renders a dropdown list based on a specified enum.
@CGaskell
CGaskell / AliasRedirector
Created July 30, 2014 09:26
AliasRedirector for Sitecore. `This replaces the built in AliasResolver
using System.Web;
using Sitecore;
using Sitecore.Configuration;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using Sitecore.Links;
using Sitecore.Pipelines.HttpRequest;
using Sitecore.Resources.Media;
namespace DetangledDigital.SC.Pipelines
@CGaskell
CGaskell / gist:8913779
Last active August 29, 2015 13:56
XElementHelper Safely read and cast values provided through the System.Xml.Linq.XElement
namespace DetangledDigital.Services.Helpers
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
// @CGASKELL: Some XElement helpers to assist with safely reading XML
public static class XElementHelper
{