Skip to content

Instantly share code, notes, and snippets.

Kiran Patil klpatil

Block or report user

Report or block klpatil

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View SingleFileBootstrap.aspx
<%@ 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 Oct 22, 2019
Single File ASPX Page
View SinglePage.aspx
<%@ 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 Jul 21, 2019
Active-Collection-SQL
View active-collection.sql
SELECT TOP (1000) [ID
,[Key]
,[Value]
FROM [dbo].[Properties]
WHERE [Key] LIKE '%_RD00155D7621FD%' -- This is our Machinename
View DOT Net Tracing
<?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 Jun 17, 2019
To check TLS version at .NET APP level
View CheckSecurityProtocols.aspx
<%@ 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/>");
View geolocationtest
<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("XFWFOR " + HttpContext.Current.Request.Headers["X-Forwarded-For"]);
Response.Write("<br/>");
View Dianoga.Disable.config
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<pipelines>
<dianogaOptimize>
<patch:delete />
</dianogaOptimize>
<dianogaOptimizeJpeg>
<patch:delete />
</dianogaOptimizeJpeg>
@klpatil
klpatil / SCIndexSnippets.cs
Created Jan 15, 2019
Sitecore Indexing Snippets
View SCIndexSnippets.cs
case "DisableIndex":
stringBuilder.AppendFormat("Sitecore.Configuration.Settings.Indexing.Enabled Status -Before {0} : ",
Sitecore.Configuration.Settings.Indexing.Enabled);
stringBuilder.Append("<br/>");
Sitecore.Configuration.Settings.Indexing.Enabled = false;
stringBuilder.AppendFormat("Sitecore.Configuration.Settings.Indexing.Enabled Status - After {0} : ",
Sitecore.Configuration.Settings.Indexing.Enabled);
stringBuilder.Append("<br/>");
break;
case "EnableIndex":
View IndexRebuild.cs
string dbName = QueryString.Current["database"];
string itemPath = QueryString.Current["itemPath"];
if (!string.IsNullOrWhiteSpace(dbName) && !string.IsNullOrWhiteSpace(itemPath))
{
Sitecore.Data.Database db = Sitecore.Configuration.Factory.GetDatabase(dbName);
if (db != null)
{
rootItem = db.GetItem(itemPath);
if (rootItem != null)
View PrintAccessResultCache.cs
Sitecore.Security.AccessControl.AccessResultCacheRecord aRecord
= arCache.InnerCache.GetValue(arCacheKey) as Sitecore.Security.AccessControl.AccessResultCacheRecord;
if (aRecord != null)
{
Sitecore.Security.AccessControl.AccessResult aResult =
aRecord.Value as Sitecore.Security.AccessControl.AccessResult;
if (aResult != null)
{
Response.Write("Key : " + arCacheKey.AccessRight.Title +
"," + arCache.InnerCache.GetValue(arCacheKey) + ","
You can’t perform that action at this time.