Skip to content

Instantly share code, notes, and snippets.

View dustinmoris's full-sized avatar
{ while (coffee) yield code; }

Dustin Moris Gorski dustinmoris

{ while (coffee) yield code; }
View GitHub Profile
@dustinmoris
dustinmoris / pubkey.json
Created January 4, 2024 16:25
pubkey.json
{"keys":[{"kty":"RSA","use":"sig","kid":"F7117590762BA074F43AC35FF3A5ED76","e":"AQAB","n":"jHZD6Cc1zay9MQn82lj91Kgg6SnNEm6NvKIIwuvuEanfWpOY84eNJcr9D7X5fvu4kzcbnH2eRsx94QzPZUydDZODIPnzMkP1tuTSfmFJNnHzyso_CLe_8Mpbk_xnhxHF30_L0Emk8T8c5SRTa0XBnIpIst_RXbAQS6Sm-wLGFgRQJutAof6kHBfnSOcPXwFv5K-QTA6J4cAEFBqyO1zsjx7Ol1gGeAto7bd4CBoltmaOThhjIuFHG73P0tKxMD37vW--9BSlqOn6VCBI4EjYhln942PQG1vjaxIglMSG03P8WHEkonqZ30z-eO6IMXbwT6EhrhQDyj6_N0VDqJfuVQ","alg":"RS256"},{"kty":"RSA","use":"sig","kid":"97050147BCB2E0D59C6917F80C84C130","e":"AQAB","n":"mRkBgZG6WfqgOmJLrl4L-GbehCObuDdSzeiir5N6uhNH5ROiZRgcl9HULZ4lO20Ogf1Sqog39NmzpWcaJkX1A75VQxG2czqwX5SRZX2CyEi5pBXk4o_nMyv7sQGlNvZh9u9KMA90tsnGbZ0iJIWigWGKdzi2a7iv0RlxfEa4dYIp4X-YE0nvdOlJqs9Jn7DdDjBsbUU89bEL6JBxuofz_MAqxCjGJ3U5h-Tr36XhpxxWm9xxE5OwnO2Oi9nZpDe7g2jdH5KQglWX49r4SzA7VWBRPWXPeB7CpnHAh61rxeGRH1xIbSfAAxk8R36tUhIf0WD2LpEMKeBFZRAF51t_9w","alg":"RS256"}]}
@dustinmoris
dustinmoris / oidc-test.json
Last active January 4, 2024 17:03
oidc-test.json
{
"issuer": "https://dev.openxdr.binarydefense.io/identity",
"jwks_uri": "https://dev.openxdr.binarydefense.io/identity/.well-known/openid-configuration/jwks",
"authorization_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/authorize",
"token_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/token",
"userinfo_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/userinfo",
"end_session_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/endsession",
"check_session_iframe": "https://dev.openxdr.binarydefense.io/identity/connect/checksession",
"revocation_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/revocation",
"introspection_endpoint": "https://dev.openxdr.binarydefense.io/identity/connect/introspect",
@dustinmoris
dustinmoris / bmac.svg
Last active September 4, 2020 10:56
Buy Me A Coffee SVG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dustinmoris
dustinmoris / Program.fs
Last active June 9, 2020 14:37
Isaac Problem
namespace GiraffeApp
open Microsoft.AspNetCore.Hosting
open Microsoft.AspNetCore.Builder
open Microsoft.Extensions.Hosting
open Giraffe
open System.Threading.Tasks
module Program =
let earlyReturn : HttpFunc = Some >> Task.FromResult
@dustinmoris
dustinmoris / simpleproxy.sh
Created September 16, 2016 12:57
Launch EC2 with Simpleproxy
sudo apt-get install simpleproxy -y
sudo bash -c 'echo "simpleproxy -vd -L 0.0.0.0:9999 -R 52.17.77.124:31156" > /etc/rc.local'
sudo bash -c 'echo "exit 0" >> /etc/rc.local'
@dustinmoris
dustinmoris / CalcRSAd.fs
Last active September 13, 2016 20:40
Calculate RSA d parameter
let rec eGCD a b =
if a = 0 then b, 0, 1
else
let gcd, x, y = eGCD (b % a) a
gcd, y - (b / a) * x, x
let calcRSAd e n =
let gcd, x, _ = eGCD e n
if gcd = 1 then x + n
else failwith "e and n must be coprime."
@dustinmoris
dustinmoris / load-testing.sh
Last active September 16, 2016 12:57
Launch EC2 instance for Docker load testing
#!/bin/bash
# Install Docker
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install apparmor
@dustinmoris
dustinmoris / Dockerfile
Last active September 1, 2016 11:26
Dockerfile to create an Ubuntu 14.04 image with latest Mono and FSharp support
FROM ubuntu:14.04
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
RUN echo "deb http://download.mono-project.com/repo/debian wheezy main" | tee /etc/apt/sources.list.d/mono-xamarin.list
RUN echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | tee -a /etc/apt/sources.list.d/mono-xamarin.list
RUN apt-get update -y
RUN apt-get install mono-complete -y
@dustinmoris
dustinmoris / Useful-Docker-Commands.sh
Last active September 1, 2016 10:09
Useful Docker commands
# Remove all exited Docker containers with one line
docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs docker rm
# Remove all images
docker images -q | xargs docker rmi --force
@dustinmoris
dustinmoris / Install-Docker.sh
Last active September 1, 2016 12:28
Install Docker on fresh Ubuntu 14.04 Server on startup
#!/bin/bash
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo bash -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install apparmor
sudo apt-get install docker-engine -y
sudo service docker start