Skip to content

Instantly share code, notes, and snippets.

@jonbartels
jonbartels / mirth-cert-report.sql
Last active January 3, 2024 14:25
Report on SSL Certificate Usage in Mirth Connect
with channel_xml as (
select
name,
xmlparse(document channel) as channel_xml
from channel c
)
, destination_connector_xml as (
SELECT
name as channel_name,
unnest(xpath('//destinationConnectors/connector/name/text()', channel_xml))::TEXT as connector_name,
@jonbartels
jonbartels / Managing SSL Connections in MC.md
Last active April 11, 2024 19:47
Mirth Connect has many ways to manage SSL connections. This gist provides a primer on how to manage them. Edits, contributions, and corrections are appreciated!

Mirth Connect is awesome! One common question on the forums and Slack is how to manage SSL connctions. These questions mainly focus on HTTPS but also include TCP connections.

The quick rundown is:

  1. The built-in MC HTTP Sender connector will do HTTPS if:
  • The endpoint has a certificate which is signed by a CA already present in the JVM truststore and has the right DN or SAN for the hostname. This is logically equivalent to the "green check" if you open the URL in a browser.
  • The certificate has been added to the truststore for the JVM that MC is running under
  • Changes to DNS or host files allow a hostname to match the DN or SAN already present in the cert (not reccomended)
  • The connector may flag these connections with a warning or red x. Test the channel first as the validator makes assumptions about SSL that may not apply in this case.
  1. The built-in MC HTTP Listener connector will not do SSL directly. A plugin or a proxy is necessary.
  • Tony Germano has a plugin implemented for SSL l
@ErikSwan
ErikSwan / The American Inferno.md
Last active March 17, 2023 03:21
Text of "The American Inferno", a book by (fictional) author Evelyn Miller in the game Red Dead Redemption 2. Actual author unknown.

The American Inferno

Chapter II

In the end, what has a man but his thoughts? I would postulate further, what has a man to stand for, but his thoughts? His actions, perhaps? I know precious little of actions. Lions, donkeys, hyenas. They all act. So is that what we are? No. We are more and less than the beasts. We are thoughts. We are actions and the reflections upon those actions. Yet, we are also not merely reflections. We are not mirrors.

That is the preserve of spirits, of the gods. We are actions and the thoughts upon actions. Neither one nor other. We are free neither from action, nor from thought. Our humanity can only be understood if we embrace both the animal and the god within us. As humans, we must nourish both, yet America is a land of action. A place fixated not on ideas, not on the redemptive power of thought but on the obliteration of the intellect.

It is a place wherein mankind has attempted to deny half of his being, and in pursuing freedom has attempted to split himself. Much like the

@oldmud0
oldmud0 / gh-pages-old.md
Created May 1, 2018 22:16
Old GitHub Pages IP addresses for A records

On May 1, 2018, GitHub changed the suggested IP addresses to put on the A records for domains that use GitHub Pages. The new ones now support HTTPS for custom domains, but the old ones did not. Here are the old ones for historical purposes:

  • 192.30.252.153
  • 192.30.252.154

Here are the new ones:

  • 185.199.108.153
  • 185.199.109.153
  • 185.199.110.153
@TurekBot
TurekBot / build.gradle
Created January 10, 2018 17:46
Gradle Shadow Example
group 'com.github.yourusername'
version '1.0-SNAPSHOT'
//These are dependencies that have to do with just the build. See: https://stackoverflow.com/a/23627293/5432315
buildscript {
repositories {
jcenter()
}
dependencies {
//This is necessary to use the gradle shadow plugin
@geeknam
geeknam / cognitoupload.py
Created April 2, 2017 07:13
Upload file to S3 with an authenticated Cognito User
import boto3
import uuid
class CognitoUserFileUploader(object):
def __init__(self, *args, **kwargs):
self.__dict__.update(kwargs)
self.id_token = self.get_cognito_id_token(
self.username, self.refresh_token,
self.device_key, self.client_id
@corbanb
corbanb / pre-request-jwt.js
Last active February 21, 2024 14:47
JWT tokenize - Postman Pre-Request Script
function base64url(source) {
// Encode in classical base64
encodedSource = CryptoJS.enc.Base64.stringify(source);
// Remove padding equal characters
encodedSource = encodedSource.replace(/=+$/, '');
// Replace characters according to base64url specifications
encodedSource = encodedSource.replace(/\+/g, '-');
encodedSource = encodedSource.replace(/\//g, '_');
@krets
krets / slack_leave_bd_channels.py
Last active July 15, 2022 17:39
Quick script to leave a bunch of slack channels with the "bd-" prefix.
#!/usr/bin/env python
import argparse
import requests
import logging
LOG = logging.getLogger("slack_leaver")
class JSONRest(object):
def __init__(self, base_url):
@keeth
keeth / api.tf
Last active January 13, 2021 14:34
Apex + Terraform + AWS Lambda + API Gateway + JSON Encoded Errors + CORS
resource "aws_api_gateway_rest_api" "myApi" {
name = "myApi-${var.env}"
description = "My awesome API (${var.env} environment)"
}
resource "aws_api_gateway_deployment" "myApi" {
depends_on = [
"aws_api_gateway_integration.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post",
"aws_api_gateway_integration_response.myApi_myEndpoint_post_400",