Skip to content

Instantly share code, notes, and snippets.

View ElijahGlover's full-sized avatar

Elijah Glover ElijahGlover

View GitHub Profile
# config
$svr = "127.0.0.1,50000"
$db = "moveittransfer"
$root = "C:/MOVEIT"
# connection
$sqlConnection = New-Object System.Data.SqlClient.SqlConnection
$sqlConnection.ConnectionString = "Server=$svr;Database=$db;Integrated Security=True"
$sqlConnection.Open()
{
"proxychain": [
{
"name": "varnish",
"image": "varnish:4.0.3"
}
],
"environments": {
"Production": {
"origin": {
@ElijahGlover
ElijahGlover / gist:e8fde15d03ff4dde8e12
Created March 20, 2015 04:52
IIS Rewrite - Force Requests To Use TLS
$siteName = $OctopusParameters['SiteName']
Add-PSSnapin WebAdministration -ErrorAction SilentlyContinue
Import-Module WebAdministration -ErrorAction SilentlyContinue
Write-Host "Getting allowed server variables..."
$allowedServerVariables = Get-WebConfigurationProperty -PSPath "MACHINE/WEBROOT/APPHOST" -filter "system.webServer/rewrite/allowedServerVariables/add" -Name name
Write-Host "Found $($allowedServerVariables.Length)..."
if ( ($allowedServerVariables -eq $null) -or ( $allowedServerVariables | ?{ $_.Value -eq "HTTPS" } ).Length -eq 0 ) {
@ElijahGlover
ElijahGlover / Default.ps1
Last active August 29, 2015 14:14
Script IIS Rewrite & Configure Request Offloading
Import-Module WebAdministration
function Is64Bit {
[IntPtr]::Size -eq 8
}
function InstallIISRewriteModule(){
$wc = New-Object System.Net.WebClient
$dest = "IISRewrite.msi"
$url
if (Is64Bit){
@ElijahGlover
ElijahGlover / Changes.sql
Last active August 29, 2015 13:57
Replace Node UniqueId On Recycle
CREATE TABLE [dbo].[UCUniqueIdentifiers](
[DeletedId] [uniqueidentifier] NOT NULL,
[PreviousId] [uniqueidentifier] NOT NULL,
CONSTRAINT [PK_UCUniqueIdentifiers]
PRIMARY KEY CLUSTERED ([DeletedId] ASC)
WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]) ON [PRIMARY]
GO
@ElijahGlover
ElijahGlover / ItemEventsApplicationStartupHandler
Created March 27, 2014 04:37
Umbraco Courier Fix For Trashed Content - Proof Of Concept
using Umbraco.Courier.Core;
using Umbraco.Courier.Core.Enums;
using Umbraco.Courier.ItemProviders;
using umbraco.interfaces;
namespace CourierTest
{
public class ItemEventsApplicationStartupHandler : IApplicationStartupHandler
{
public ItemEventsApplicationStartupHandler()