Skip to content

Instantly share code, notes, and snippets.

View ProNotion's full-sized avatar

ProNotion

  • Prolific Notion Ltd
  • Plymouth, UK
View GitHub Profile
  1. Decide on a subdomain to use with ngrok. This makes the whole process easier.
  2. Open up a Command Prompt in Administrator mode and run the following command to register the URL with HTTP.sys replacing "modernie" with your subdomain and ##### with your VisualStudio/IISExpress application's port.
netsh http add urlacl url=http://modernie.ngrok.com:##### user=everyone
  1. Edit your applicationhost.config. The easiest way to is start up the site and right-click the IISExpress icon in the System Tray. Click "Show All Applications" and select your website running at localhost:#####. Click the path next to "Config" to open the file in an editor.
  2. Search for you site's <bindings> configuration. The easiest way is to search for *:#####:localhost, which should bring you to the <bindings> section for your site. Edit them to include the following:
@ProNotion
ProNotion / ngroktunnel.bat
Last active November 30, 2016 19:15
Setup and start IISExpress site then open an ngrok tunnel to it and launch in default browser
rem *********************************************************************
rem This bat file will SETup a site in IIS Express, open a tunnel with ngrok and launch
rem the site in the users default web browser
rem
rem tunnel.bat Path SiteName
rem - Path The path to the root folder for the site
rem - SiteName The name of the site to use for the tunnel and in IIS Express site
rem ***********************************************************************
@echo off
@ProNotion
ProNotion / ISO3166-Country-List-Table.sq
Created January 21, 2016 12:01
TSQL ISO3166 Country List Table
PRINT 'Checking for existence of table ''countries'''
/****** Object: Table [dbo].[Countries] Script Date: 11/09/2006 16:58:01 ******/
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Countries]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[Countries]
PRINT 'Existing table ''countries'' dropped!'
GO
/****** Object: Table [dbo].[Countries] Script Date: 11/09/2006 16:58:01 ******/
@ProNotion
ProNotion / gist:e8bd06769af087d7412fd015489312ad
Created May 12, 2016 12:25
How to Delete Files which exceed 255 Characters on Windows e.g. long filenames
robocopy /PURGE <empty_dir> <directory_to_remove>
@ProNotion
ProNotion / gist:a2c3fdd29ab63b737f10776394978140
Created May 12, 2016 12:25
How to Delete Files which exceed 255 Characters on Windows e.g. long filenames
robocopy /PURGE <empty_dir> <directory_to_remove>
@ProNotion
ProNotion / Purge Long Folder Structures
Last active May 12, 2016 18:07
How to Delete Files which exceed 255 Characters on Windows e.g. long filenames
robocopy /PURGE <empty_dir> <directory_to_remove>
@ProNotion
ProNotion / IIS_Sites_With_SSL.ps1
Created February 13, 2018 09:04
List all sites in IIS with SSL Bindings
import-module WebAdministration
Write-Host "`n Listing sites with SSL bindings"
Write-Host "**********************************`n"
ls IIS:\SslBindings | Foreach {
Write-Host " - $($_.Host)"
}
Write-Host "`n**********************************"
@ProNotion
ProNotion / gist:878fe157ff9ff025742ca6776c0fce48
Created June 15, 2018 09:23
Adds ForceRedirect column to UrlTracker table
ALTER TABLE icUrlTracker ADD ForceRedirect BIT DEFAULT 0 NOT NULL
@ProNotion
ProNotion / MigrateUmbracoRedirectsToUrlTracker
Last active June 15, 2018 09:53
Migrates records from the umbracoRedirectUrl table to the icUrlTracker table
INSERT INTO [icUrlTracker] (OldUrl, RedirectNodeId, Notes)
SELECT
RIGHT(url, LEN(url) - 1),
(SELECT TOP (1)
id
FROM umbracoNode
WHERE (uniqueID = umbracoRedirectUrl.contentKey))
AS NodeId,
'Import from umbracoRedirectUrl table' AS Note
FROM umbracoRedirectUrl
######## Phil's dev VM boxstarter script ########
###############
#### NOTES ####
###############
## After a restart/reconnect, even though it shows the login screen, boxstarter is still working
### NOTES when kicking off remotely from host to VM, fails on Configuring CredSSP settings
## check http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/30/understanding-powershell-remote-management.aspx