Skip to content

Instantly share code, notes, and snippets.

View klpatil's full-sized avatar

Kiran Patil klpatil

View GitHub Profile
@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 -->
<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 / 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">
@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 / 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 / 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 / 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 / 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
<?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 / CheckSecurityProtocols.aspx
Last active June 17, 2019 22:17
To check TLS version at .NET APP level
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="Sitecore.Configuration" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Net" %>
<%
/* https://stackoverflow.com/questions/28286086/default-securityprotocol-in-net-4-5 */
// print initial status
Response.Write("Runtime: " + System.Diagnostics.FileVersionInfo.GetVersionInfo(typeof(int).Assembly.Location).ProductVersion);
Response.Write("<br/>");