Skip to content

Instantly share code, notes, and snippets.

View mrichman's full-sized avatar

Mark Richman mrichman

View GitHub Profile
@mrichman
mrichman / Brewfile
Created March 25, 2019 21:28
brew bundle dump
tap "aws/tap"
tap "buo/cask-upgrade"
tap "cjbassi/gotop"
tap "garethr/kubeval"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
@mrichman
mrichman / create-params.py
Created October 31, 2018 13:52
Lambda Function to Create SSM Parameters using SecureString
import boto3
import json
from botocore.vendored import requests
def lambda_handler(event, context):
kms_client = boto3.client('kms')
ssm_client = boto3.client('ssm')
@mrichman
mrichman / main.go
Created July 17, 2018 12:28
Beat up your CPU for 10 seconds
package main
import (
"runtime"
"time"
)
func main() {
n := runtime.NumCPU()
runtime.GOMAXPROCS(n)
@mrichman
mrichman / brake.rb
Last active June 20, 2018 14:41
Batch convert videos into MP4 format using HandBrakeCLI
#!/usr/bin/env ruby
require 'optparse'
# Default options
options = {
verbose: false,
preset: "Fast 1080p30"
}
OptionParser.new do |opt|
@mrichman
mrichman / osx_bootstrap.sh
Last active May 7, 2024 10:58
Bootstrap script for setting up a new OSX machine
#!/usr/bin/env bash
#
# Bootstrap script for setting up a new OSX machine
#
# This should be idempotent so it can be run multiple times.
#
# Some apps don't have a cask and so still need to be installed by hand. These
# include:
#
# - Twitter (app store)
@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 / 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 / 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 / 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>