Skip to content

Instantly share code, notes, and snippets.

@deeja
deeja / RouteTableEntries.aspx
Last active June 15, 2017 15:59
Route Table Entry viewer - Useful for viewing MVC routes that have been added to the RouteTable - Built for Sitecore
<%@ Page Language="C#" Debug="true" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>RouteTable entries</title>
<style>
table, th, td {
@deeja
deeja / VINValidator.cs
Created February 14, 2018 13:38
VIN validator C#
//Algorithm taken from the wikipedia page https://en.wikipedia.org/wiki/Vehicle_identification_number#Check-digit_calculation
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string vin = "1VWBP7A37DC046870";
@deeja
deeja / Install-Solr.ps1
Created April 29, 2019 10:34 — forked from jermdavis/Install-Solr.ps1
A PowerShell script to help installing Solr as a service - See https://jermdavis.wordpress.com/2017/10/30/low-effort-solr-installs/ for details
Param(
$solrVersion = "6.6.2",
$installFolder = "c:\solr",
$solrPort = "8983",
$solrHost = "solr",
$solrSSL = $true,
$nssmVersion = "2.24",
$JREVersion = "1.8.0_151"
)
@deeja
deeja / SlackTeamNamesAndPhotos
Last active May 3, 2019 14:58
When you want an output of the members' names and photos of your slack team
//// SLACK group listing of people and photos!
/* Get the names and photos of the people in your slack group and prints to A4!
Instructions:
- Go to the web version of your slack channel
- Open the "Channel Details" tab
- Expand "members"
- Click the "See all people"
- Copy and paste this script into your JS console
- Scroll the members list up and down until all the members have been added to the array. You can see the count in the console
- Type show() to Show or print() to Print
@deeja
deeja / FindLessThan.cs
Created June 13, 2019 09:58
A Binary Search for the count of items that are less than a specified value
using System;
public class FindLessThanInOrderedList
{
public int ArrayCalls { get; private set; }
public int FindLessThanBinarySearch(int[] numbers, int lessThan, int startIndex = 0, int endIndex = -1)
{
if (endIndex == -1) endIndex = numbers.Length - 1;
if (endIndex - startIndex < 2)
@deeja
deeja / RaspberryPi-SSH-Bluetooth.md
Created October 7, 2019 20:56
The rapsberry pi part of connecting to a Raspberry Pi via Bluetooth SSH

Copied from https://hacks.mozilla.org/2017/02/headless-raspberry-pi-configuration-over-bluetooth/

Editing the image

Once you have the image mounted, and you are at the command prompt, you can start editing the configuration files necessary to get us going.

Let’s start by creating the main script that will set up and establish the default Bluetooth services and serial port you will connect to on startup.

You’ll create this file in the /home/pi directory, like so:

$ sudo nano /home/pi/btserial.sh
@deeja
deeja / RapsberryPi-Bluetooth-SSH-ConnectFromWindows.md
Created October 7, 2019 20:59
The second part of connecting to SSH using bluetooth (from windows)

Copied from https://www.instructables.com/id/Raspberry-Pi-Bluetooth-to-PuTTY-on-Windows-10/ First part: https://gist.github.com/deeja/83f50fb893383ba328e06769a1e6d44d

Step 1: Configure Raspberry Pi for Bluetooth.

First configure you Raspberry Pi for Bluetooth shell access, by following the directions in Patrick Hundal's article Headless Raspberry Pi configuration over Bluetooth.

Notes on this process:

As an alternative to SD Card pre-configuration, the method I used was to enable the Pi's serial port, login using the PuTTY terminal program via a USB to serial converter, and configure the Pi's system whilst it ran on the target hardware. There are many other instructional articles available on this topic.

@deeja
deeja / DeploySitecoreArm.ps1
Last active October 15, 2019 09:45
Sitecore installation from XP ARM notes
# Taken from Sitecore-Azure-Quickstart-Templates
$ErrorActionPreference = "Stop" # So it just doesn't keep going if something goes wrong.
# Specify the parameters for the deployment
$ArmTemplateUrl = "https://raw.githubusercontent.com/Sitecore/Sitecore-Azure-Quickstart-Templates/master/Sitecore%209.0.2/XPSingle/azuredeploy.json"
$ArmParametersPath = $PSScriptRoot + "\azuredeploy.parameters.json"
$licenseFilePath = $PSScriptRoot + "\license.xml"
# Specify the certificate file path and password if you want to deploy Sitecore 9.0 XP or XDB configurations
$certificateFilePath = $PSScriptRoot + "\DEV-Cert.pfx"
@deeja
deeja / AzurePowershellSetConnectionStrings.ps1
Created October 16, 2019 15:18
Azure Powershell Set ConnectionStrings and App Settings
function UpdateConnectionStrings {
param(
[string]$ResourceGroup,
[string]$WebAppName,
[string]$Slot,
[hashtable]$ConnectionStrings,
[hashtable]$AppSettings
)
Write-Host "Loading Existing Connectionstrings"
@deeja
deeja / AWS-Iot-Blinkt.py
Created October 16, 2019 22:46
AWS IoT pushing through led colours on the Pi Zero Blinkt
# Need to set the policies for the subscribe and client ID within AWS
from AWSIoTPythonSDK.MQTTLib import AWSIoTMQTTClient
import logging
import time
import argparse
import json
# > pip install blinkt
import blinkt