Skip to content

Instantly share code, notes, and snippets.

View mrichman's full-sized avatar

Mark Richman mrichman

View GitHub Profile
@mrichman
mrichman / README.md
Created August 18, 2017 12:17
Install delve debugger on Mac OS X without homebrew

Install delve debugger on Mac OS X without homebrew

mkdir $GOPATH/src/github.com/derekparker
cd $GOPATH/src/github.com/derekparker
git clone https://github.com/derekparker/delve.git
cd delve
CERT=dlv-cert make install
@mrichman
mrichman / info.aspx
Created July 26, 2017 13:50
ASP.NET clone of phpinfo()
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Runtime.InteropServices" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Reflection" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.Drawing" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>System Information</title>
@mrichman
mrichman / gist:61dc568f1a4b8356514d0174bc37c6eb
Created November 30, 2017 22:48
View thumbprint of AWS keypair (*.pem)
openssl pkcs8 -in aws-keypair.pem -nocrypt -topk8 -outform DER | openssl sha1 -c
@mrichman
mrichman / Export-ModuleDocumentation.ps1
Last active September 19, 2017 14:02
Export a PowerShell module's documentation in Markdown format. Files written to temp directory as "<Module>Documentation". The platyPS module can be installed via PowerShell Gallery: Install-Module -Name platyPS.
#requires -module platyPS
<#
.SYNOPSIS
Export a module's documentation in markdown.
.DESCRIPTION
Export a module's documentation in markdown.
@mrichman
mrichman / CreateSpn.ps1
Created August 9, 2017 17:07
Create an Azure SPN for use with a VSTS/TFS Azure RM Endpoint
param
(
[Parameter(Mandatory=$true, HelpMessage="Enter Azure Subscription name. You need to be Subscription Admin to execute the script")]
[string] $subscriptionName,
[Parameter(Mandatory=$true, HelpMessage="Provide a password for SPN application that you would create")]
[string] $password,
[Parameter(Mandatory=$false, HelpMessage="Provide a SPN role assignment")]
[string] $spnRole = "owner",
@mrichman
mrichman / main.go
Last active June 5, 2017 11:29
Resize JPEG image in AWS S3
package main
import (
"bytes"
"os"
"path"
"image/jpeg"
log "github.com/Sirupsen/logrus"
@mrichman
mrichman / main-progress.go
Last active May 24, 2017 11:39
Compute hash of a resource at a URL
package main
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"crypto/sha512"
"crypto/tls"
"encoding/hex"
"flag"
@mrichman
mrichman / AzureSetAppSettings.ps1
Created April 26, 2017 14:52
Set Azure app service specific application settings (not web.config)
<#
.SYNOPSIS
Set Azure app service specific application settings (not web.config)
.DESCRIPTION
Set Azure app service specific application settings (not web.config)
.EXAMPLE
AzureSetAppSettings -ResourceGroupName "cmc-scm-tst-us-e-rg" -WebAppName "888888sisclientweb01"
.EXAMPLE
AzureSetAppSettings -ResourceGroupName "cmc-scm-tst-us-e-rg" -WebAppName "888888sisclientweb01" -Slot "qa"
.PARAMETER ResourceGroupName
@mrichman
mrichman / EdmxDecoder.cs
Created January 14, 2015 16:48
EDMX Decoder - Entity Framework 6 Serialized Model Data
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
namespace EdmxDecoder
{
internal class Program
{
private static void Main(string[] args)
@mrichman
mrichman / gist:8f4070d45cb190ddd3ab7d34ea568d1e
Created March 9, 2017 14:57
Convert CNG to older CAPI1 (CryptoAPI)
openssl pkcs12 -in mycert-cng.pfx -out mycert.pem
openssl pkcs12 -export -in mycert.pem -out mycert-cryptoapi.pfx