Skip to content

Instantly share code, notes, and snippets.

View ploegert's full-sized avatar
💭
¯\_(ツ)_/¯

Justin Ploegert ploegert

💭
¯\_(ツ)_/¯
View GitHub Profile
@ploegert
ploegert / send-statsd-test-metrics.sh
Created March 22, 2021 14:48 — forked from kirklewis/send-statsd-test-metrics.sh
Generate and send StatsD test metrics
#!/bin/bash
DEFAULT='\033[0m'
HI_CYAN='\033[0;96m'
HI_WHITE='\033[0;93m'
STATSD_HOST=127.0.0.1
STATSD_PORT=8125
api_names=(orders invoice user)
@ploegert
ploegert / git-clearHistory
Created July 28, 2020 18:43 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@ploegert
ploegert / certs.sh
Last active February 17, 2023 20:26 — forked from joakinen/certs.sh
Converting certificates
#!/bin/sh
#Generate & Export to PFX
openssl version -a
$name = "test"
$key = "$name.key"
$crt = "$name.crt"
$pfx = "$name.pfx"
@ploegert
ploegert / OIDC and OAuth2 Flows.md
Created March 21, 2017 17:11 — forked from jawadatgithub/OIDC and OAuth2 Flows.md
Enrich IdentityServer3 Documentation with OIDC (OpenID Connect) and OAuth2 Flows section
Note for community:

A. IdentityServer3 docs, samples and source code use OIDC & OAuth2 terms interchangeably to refer to same thing in many areas. I think that's make sense because OIDC introduced as complement & extension for OAuth2.

B. IdentityServer3, STS, OP, OIDC server, OAuth2 server, CSP, IDP and others: means same thing (software that provide/issue tokens to clients) as explained in [Terminology] (http://identityserver.github.io/Documentation/docs/overview/terminology.html).

C. Grants and flows mean same thing, grant was the common term in OAuth2 specs and flow is the common term in OIDC specs.

D. This document will not focus on custom flow/grant.

E. [Important] Choosing wrong flow leads to security threat.

@ploegert
ploegert / Configure-CapacityMetrics.ps1
Created January 27, 2016 17:50 — forked from RichardSlater/Configure-CapacityMetrics.ps1
Retrieve the latest storage capacity metrics for multiple storage accounts and display in a range of units.
# *************************************************************************************************
# * Configure-CapacityMetrics *
# *************************************************************************************************
# * Description: Configures Capacity metrics *
# * Author: Richard Slater <richard.slater@amido.co.uk> *
# * Date: 2013.02.02 *
# * Prerequisites: WAPPSCmdlets (https://www.windowsazure.com/en-us/manage/downloads/) *
# *************************************************************************************************
Set-StorageServicePropertiesForAnalytics -ServiceName "Blob" -StorageAccountName "<Storage Account Name>" -StorageAccountKey "<Storage Account Key>" -MetricsEnabled -MetricsRetentionPolicyDays 7 -MetricsRetentionPolicyEnabl
@ploegert
ploegert / hubot_service.sh
Created January 8, 2016 17:13 — forked from mattsgarrison/hubot_service.sh
Start/Stop script to manage Hubot with Monit
#!/bin/zsh
### BEGIN INIT INFO
# Provides: hubot
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the hubot service
# Description: starts the Hubot bot for the Campfire rooms
@ploegert
ploegert / Create-WebConfigTransform.ps1
Created November 6, 2015 19:32 — forked from mpicker0/Create-WebConfigTransform.ps1
This PowerShell script runs a Web.config transformation. Visual Studio must be installed, and MSBuild.exe in your path. This is useful for one-off testing.
<#
.SYNOPSIS
Create a configuration transformation
.DESCRIPTION
This script runs an ASP.NET configuration transformation, given a source
configuration and transformation file. MSBuild.exe is assumed to be in
the path, and Visual Studio 2012 should be installed. Modify the path to
Microsoft.Web.Publishing.Tasks.dll if a different version of Visual Studio
is installed.
@ploegert
ploegert / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ploegert
ploegert / Deploy-WebSite.ps1
Created February 20, 2015 20:09 — forked from mmooney/deploy.ps1
Example of how to deploy an azure web site and change Hosting Plan
#Modified and simplified version of https://www.windowsazure.com/en-us/develop/net/common-tasks/continuous-delivery/
#From: #https://gist.github.com/3694398
$subscription = "[SubscriptionName]" #this the name from your .publishsettings file
$service = "[ServiceName]" #this is the name of the cloud service
$storageAccount = "[StorageAccountName]" #this is the name of the storage service
$slot = "production" #staging or production
$package = "[Fully Qualified Path to .cspkg]"
$configuration = "[Fully Qualified path to .cscfg]"
$publishSettingsFile = "[Path to .publishsettings file, relative is OK]"
$timeStampFormat = "g"