Skip to content

Instantly share code, notes, and snippets.

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

Justin Ploegert ploegert

💭
¯\_(ツ)_/¯
View GitHub Profile
#!/bin/bash
#=============================================================#
# Name: CertGenerator #
# Description: Create a self-signed SSL Certificates #
# Author: justin.j.ploegert@jci.com #
# USAGE: #
# chmod +x ./certGen.sh
#===================================================================
# To Generate certificate with specified password in a pfx
@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 / Merge_Git-Repos.ps1
Last active August 12, 2021 18:24
Merge two Git Repos into destination repo
function Write-Log {
param([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][AllowEmptyString()][string]$Message)
Write-Verbose -Verbose ("[{0:s}] {1}`r`n" -f (get-date), $Message)
}
function Write-VLog {
param([Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true)][AllowEmptyString()][string]$Message)
Write-Verbose ("[{0:s}] {1}`r`n" -f (get-date), $Message)
}
function Write-Info {
@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 / Run-AsAdmin.ps1
Created September 12, 2016 17:20
Powershell Run as Admin
# Get the ID and security principal of the current user account
$myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent();
$myWindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myWindowsID);
# Get the security principal for the administrator role
$adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator;
# Check to see if we are currently running as an administrator
if ($myWindowsPrincipal.IsInRole($adminRole))
{
@ploegert
ploegert / Setup-PoshProfile.ps1
Created September 12, 2016 16:28
Setup Powershell Profile
cd $env:USERPROFILE\Documents
md WindowsPowerShell -ErrorAction SilentlyContinue
cd WindowsPowerShell
if (-not (test-path ".\Microsoft.PowerShell_profile.ps1"))
{ new-item -ItemType File -Name Microsoft.PowerShell_profile.ps1 -ErrorAction SilentlyContinue }
#powershell_ise.exe .\Microsoft.PowerShell_profile.ps1
start "C:\Program Files (x86)\Microsoft VS Code\Code.exe" ".\Microsoft.PowerShell_profile.ps1"
@ploegert
ploegert / Mount-SerialPort-MacOSx.sh
Created March 14, 2016 20:01
MacOS command to mount a serial port
flashing on mac:
#get list of devices connected
ls -l /dev/cu*usb*
ls -l /dev/tty*usb*
#Get Terminal output
sudo cu -l ls -l /dev/cu*usb* -s 115200
#Reset DSC
function Flush-DSCConfig
{
#List current DSC Docs:
Get-ChildItem -Path 'C:\Windows\System32\Configuration' -File -Force
#Remove All Docs:
Remove-DscConfigurationDocument -Stage Current, Pending, Previous -Verbose