Skip to content

Instantly share code, notes, and snippets.

View BennieCopeland's full-sized avatar

Bennie Copeland BennieCopeland

View GitHub Profile
@BennieCopeland
BennieCopeland / add-dod-certs.sh
Last active July 13, 2023 06:48 — forked from AfroThundr3007730/add-dod-certs.sh
Import DoD root certificates into linux CA store
#!/bin/bash
# Import DoD root certificates into linux CA store
main() {
# Location of bundle from DISA site
url='https://public.cyber.mil/pki-pke/pkipke-document-library/'
bundle=$(curl -s $url | awk -F '"' 'tolower($2) ~ /dod.zip/ {print $2}')
#bundle=https://dl.dod.cyber.mil/wp-content/uploads/pki-pke/zip/certificates_pkcs7_v5-6_dod.zip
# Set cert directory and update command based on OS
@BennieCopeland
BennieCopeland / Generators.fs
Last active September 7, 2023 07:54
FsCheck Generators pattern
#r "nuget:FsCheck.Xunit"
// Domain types from production code
module Types =
open System
type EmailAddress = private EmailAddress of string
module EmailAddress =
let fromString str =
if not <| String.IsNullOrWhiteSpace str
@BennieCopeland
BennieCopeland / 01 EmailAddress.cs
Last active February 26, 2024 07:36
C# Discriminated Union pattern
public record EmailAddress
{
public const int MaxSize = 255;
private readonly string _value;
private EmailAddress(string value) => _value = value;
public static EmailAddress FromString(string value)
{
if (string.IsNullOrWhiteSpace(value))