Skip to content

Instantly share code, notes, and snippets.

View hermanussen's full-sized avatar

Robin Hermanussen hermanussen

View GitHub Profile
@hermanussen
hermanussen / SitecoreChecks.aspx
Created October 3, 2015 14:37
This is a simple page that can be dropped into a Sitecore CM or CD server so you can easily monitor its health.
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Diagnostics" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="Sitecore.ContentSearch" %>
<%@ Import Namespace="Sitecore.Data" %>
<%@ Import Namespace="Sitecore.Data.Items" %>
<script runat="server">
#region Configure actual checks here
@echo off
REM Enable .NET framework that is compatible with Sitecore Support Package generator
Dism /online /Enable-Feature /FeatureName:NetFx3 /All
REM Start ClickOnce application for Sitecore Support Package generator
start http://dl.sitecore.net/updater/sspg/SSPG.application
pause
@echo off
set logFolderPath=[path to your logs folder with ending backslash]
for /f “tokens=*” %%a in (‘dir %logFolderPath%log.*.txt /b /od’) do set newest=%%a
start baretail.exe “%logFolderPath%%newest%”
SELECT concat('insert into wp_posts (post_author, post_date, post_date_gmt, post_content, post_title, post_excerpt, post_status, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_content_filtered, post_parent, guid, menu_order, post_type, post_mime_type, comment_count)
values (1, \'', created, '\', \'', created, '\', \'', replace(cast(`introtext` as char(99999)), '\'', '\'\''), replace(cast(`fulltext` as char(99999)), '\'', '\'\''), '\', \'', replace(title, '\'', '\'\''), '\', \'\', \'publish\', \'closed\', \'closed\', \'\', \'', alias, '\', \'\', \'\', \'', modified, '\', \'', modified, '\', \'\', 0, \'[your_site_url]/uncategorized/', alias, '/\', 300, \'post\', \'\', 0);')
FROM `jos_content`
WHERE `created` > '2014-10-06 00:00:00' and parentid = 0
ORDER BY `created` desc
@hermanussen
hermanussen / CrawlSitecoreReleaseNotesForPatches.ps1
Created January 18, 2017 16:12
This script crawls the release notes for Sitecore releases on dev.sitecore.net
# 1. This script crawls the release notes for Sitecore releases on dev.sitecore.net
# 2. It will then generate a file called searchfixedpatches.html
# 3. Open the generated file in your browser and you will be able to search for Sitecore support patch numbers
# Robin Hermanussen - 2017
# Use this script at your own risk
$ScriptPath = Split-Path -parent $MyInvocation.MyCommand.Definition
<%@ Page Language="C#" AutoEventWireup="true"%>
<%@ Import Namespace="System.Collections.Generic" %>
<%@ Import Namespace="System.Linq" %>
<% DataBind(); %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Languages in Venn chart</title>
</head>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sitecore.Web.UI.WebControls;
using System.Web.UI;
using System.Net;
using Sitecore.Data.Fields;
namespace InlineImageRenderer
<%@ Register TagPrefix="sc" Namespace="InlineImageRenderer" Assembly="InlineImageRenderer" %>
<sc:InlineImage runat="server" Field="Banner Image" MaxWidth="50" />
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Linq" %>
<%
if ("POST".Equals(Request.HttpMethod))
{
Sitecore.Data.Items.Item item = Sitecore.Context.Database.GetItem(Sitecore.Data.ID.Parse(Request["id"]));
if (item.Parent != null)
{
Response.Write(string.Format("<ul><li><a href=\"{0}\">{1}</a></li></ul>", item.ParentID, item.DisplayName));
}