Skip to content

Instantly share code, notes, and snippets.

View xt0rted's full-sized avatar
πŸ›
Finding all the bugs

Brian Surowiec xt0rted

πŸ›
Finding all the bugs
View GitHub Profile
@xt0rted
xt0rted / ApplicationInsightsDeployment.ps1
Created June 7, 2018 03:33
Application Insights & Raygun deplotments
# Sample usage .\CreateReleaseAnnotation.ps1 -applicationId "<appId>" -apiKey "<apiKey>" -releaseName "<releaseName>" -releaseProperties @{"ReleaseDescription"="Release with annotation";"TriggerBy"="John Doe"} -eventDateTime "2016-07-07T06:23:44"
param(
[parameter(Mandatory = $true)][string]$applicationId,
[parameter(Mandatory = $true)][string]$apiKey,
[parameter(Mandatory = $true)][string]$releaseName,
[parameter(Mandatory = $false)]$releaseProperties,
[parameter(Mandatory = $false)][DateTime]$eventDateTime
)
# background info on how fwlink works: After you submit a web request, many sites redirect through a series of intermediate pages before you finally land on the destination page.
[core]
# this actually opens in Notepad2
editor = notepad.exe
[alias]
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f"
bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f"
shove = push origin --force
tug = pull upstream master
@xt0rted
xt0rted / settings.reg
Last active May 4, 2018 22:40
Disable old versions of SSL and TLS on Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0]
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 2.0\Server]
"Enabled"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\SSL 3.0]
@xt0rted
xt0rted / Functions.cs
Last active January 23, 2019 09:30
.net core 2.0 webjob skeleton
namespace MyAwesomeProgram
{
using System.Threading.Tasks;
using Microsoft.Azure.WebJobs;
using Microsoft.Extensions.Logging;
[Disable("MYWEBJOB_DISABLED")]
public class Functions
{
@xt0rted
xt0rted / EntityFrameworkExceptionTelemetryInitializer.cs
Last active February 3, 2021 14:41
Entity Framework exception telemetry for Application Insights
using System.Data.Entity.Validation;
using System.Linq;
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
public class EntityFrameworkExceptionTelemetryInitializer : ITelemetryInitializer
{
public void Initialize(ITelemetry telemetry)
root = true
[*]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
@xt0rted
xt0rted / applicationHost.xdt
Created October 15, 2017 01:12
applicationHost.xdt for Kudu to force HTTPS & remove custom/server headers
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location path="%XDT_SITENAME%" xdt:Transform="InsertIfMissing" xdt:Locator="Match(path)">
<system.webServer xdt:Transform="InsertIfMissing">
<applicationInitialization xdt:Transform="InsertIfMissing">
<add initializationPage="/" xdt:Transform="InsertIfMissing" />
</applicationInitialization>
<httpProtocol xdt:Transform="InsertIfMissing">
<customHeaders xdt:Transform="InsertIfMissing">
@xt0rted
xt0rted / console.reg
Created June 28, 2017 02:05
Monokai console theme
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Console]
"ColorTable00"=dword:003e4849
"ColorTable01"=dword:00969483
"ColorTable02"=dword:002ee2a6
"ColorTable03"=dword:00efd966
"ColorTable04"=dword:007226f9
"ColorTable05"=dword:007226f9
"ColorTable06"=dword:0074dbe6
@xt0rted
xt0rted / ArrayHelpers.cs
Created August 6, 2016 00:54 — forked from CodesInChaos/ArrayHelpers.cs
Base58 encoding in C# (Used for BitCoin addresses)
using System;
using System.Diagnostics.Contracts;
using System.Linq;
namespace Merkator.Tools
{
public class ArrayHelpers
{
public static T[] ConcatArrays<T>(params T[][] arrays)
{