Skip to content

Instantly share code, notes, and snippets.

View klpatil's full-sized avatar

Kiran Patil klpatil

View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace autoflush="true" />
<sources>
<source name="System.Net">
<listeners>
<add name="System.Net"/>
</listeners>
</source>
@klpatil
klpatil / active-collection.sql
Created July 21, 2019 05:20
Active-Collection-SQL
SELECT TOP (1000) [ID
,[Key]
,[Value]
FROM [dbo].[Properties]
WHERE [Key] LIKE '%_RD00155D7621FD%' -- This is our Machinename
@klpatil
klpatil / SinglePage.aspx
Created October 22, 2019 03:22
Single File ASPX Page
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<%@ Import Namespace="System" %>
<%--Author : Kiran Patil
Version : 1.0.0.0--%>
<script language="C#" runat="server">
@klpatil
klpatil / SingleFileBootstrap.aspx
Created October 22, 2019 03:26
SingleFileBootstrap
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<%@ Import Namespace="System" %>
<%--Author : Kiran Patil
Version : 1.0.0.0--%>
<script language="C#" runat="server">
@klpatil
klpatil / ResetAdminPassword.aspx
Created January 22, 2020 17:51
Reset SC Password [Provided you have access of Sitecore]
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web.Security" %>
<%--Author : Kiran Patil
Version : 1.0.0.0--%>
@klpatil
klpatil / bse.aspx
Created January 31, 2020 23:59
Gist to validate send email functionality
<script runat="server">
private void SendMail() {
try
{
System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
System.Net.Mail.SmtpClient smtp = new System.Net.Mail.SmtpClient();
message.From = new System.Net.Mail.MailAddress("test@test.com");
message.To.Add(new System.Net.Mail.MailAddress("test@test.com"));
message.Subject = "Test";
message.IsBodyHtml = true; //to make message body as html
@klpatil
klpatil / DBZDemo.aspx
Last active February 13, 2020 21:06
Divide by zero exception
<%@ Page Language="C#" AutoEventWireup="true" Debug="true" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<%@ Import Namespace="System" %>
<%--Author : Kiran Patil
Version : 1.0.0.0--%>
<script language="C#" runat="server">
<script runat="server">
private void PrintInfo() {
Response.Write("Country " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.Country);
Response.Write("<br/>");
Response.Write("AreaCode " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.AreaCode);
Response.Write("<br/>");
Response.Write("City " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.City);
Response.Write("<br/>");
Response.Write("Latitude " + Sitecore.Analytics.Tracker.Current.Interaction.GeoData.Latitude);
Response.Write("<br/>");
@klpatil
klpatil / CD.Web.Config
Created February 15, 2020 05:05
REDISTimeout 9.0.2 Configurations
<httpRuntime .. executionTimeout="110" xdt:Transform="Replace" ../>
<!-- Removed other configuratins for simplicity and good to apply this on CD only -->
@klpatil
klpatil / AnalyticsTracking.config
Created February 15, 2020 05:27
REDISTimeout 9.3 Configurations
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:set="http://www.sitecore.net/xmlconfig/">
<sitecore>
<tracking>
<sharedSessionState>
<config type="Sitecore.Analytics.Tracking.SharedSessionState.SharedSessionStateConfig, Sitecore.Analytics">
<param desc="timeoutBetweenLockAttempts">200</param>
</config>
</sharedSessionState>
</tracking>
</sitecore>