Skip to content

Instantly share code, notes, and snippets.

@mbentley
mbentley / validate_cert_chain.sh
Created September 12, 2018 20:13
Validate the proper certificates are present
#!/bin/bash
set -e
# set the paths for certificates
ROOT_CERT="${HOME}/Downloads/certs/DigiCertGlobalRootCA.cer"
INTERMEDIATE_CERT="${HOME}/Downloads/certs/DigiCertSHA2SecureServerIntermediateCA.cer"
SERVER_CERT="${HOME}/Downloads/certs/myservercert.cer"
# function to get the issuer
#!/bin/sh
IMAGE="${1:-}"
TAG="${2:-}"
if [ -z "${IMAGE}" ]
then
echo "Missing IMAGE"
echo "Usage: ${0} namespace/repo tag"
exit 1
@mbentley
mbentley / check_cert_chain.sh
Created August 29, 2019 18:09
Verify certificate chain is complete
#!/bin/bash
set -e
# set the paths for certificates
ROOT_CERT="${HOME}/Downloads/certs/DigiCertGlobalRootCA.cer"
INTERMEDIATE_CERT="${HOME}/Downloads/certs/DigiCertSHA2SecureServerIntermediateCA.cer"
SERVER_CERT="${HOME}/Downloads/certs/dfwdtrlabawsw.ds.dtveng.net.cer"
# function to get the issuer
@mbentley
mbentley / haproxy.conf
Last active March 16, 2025 16:33
HAProxy SNI Example
global
log /dev/log local0
log /dev/log local1 notice
defaults
log global
mode tcp
option tcplog
option dontlognull
timeout connect 5s
@mbentley
mbentley / omada_api.ps1
Last active January 4, 2025 20:20
Example API Calls Using Powershell and Bash/curl for Omada Controller (last validated on 5.12.7)
### PowerShell Example
# set variables
$OMADA_URL = "https://omada.example.com:8043"
$USERNAME = "admin"
$PASSWORD = "test12345"
# get controller id from the API
$CONTROLLER_ID = (Invoke-RestMethod -Uri "${OMADA_URL}/api/info" -Method Get -UseBasicParsing).result.omadacId
# set the login request body as json
@mbentley
mbentley / pystone.py
Created January 27, 2023 11:13
Pystone 1.3 - Update to address removal of clock
#! /usr/bin/env python3
"""
"PYSTONE" Benchmark Program
Version: Python/1.3 (corresponds to C/1.1 plus 3 Pystone fixes)
Author: Reinhold P. Weicker, CACM Vol 27, No 10, 10/84 pg. 1013.
Translated from ADA to C by Rick Richardson.