Skip to content

Instantly share code, notes, and snippets.

View MichaelLeeHobbs's full-sized avatar

Michael Hobbs MichaelLeeHobbs

  • United States
View GitHub Profile
@deadbits
deadbits / Instruction-Bypass.yara
Last active October 31, 2024 07:21
Prompt injection datasets
rule Instruction_Bypass: PromptInjection
{
meta:
category = "Instruction Bypass"
description = "Detects phrases used to ignore, disregard, or bypass instructions."
strings:
$bypass_phrase = /(Ignore|Disregard|Skip|Forget|Neglect|Overlook|Omit|Bypass|Pay no attention to|Do not follow|Do not obey)\\s*(prior|previous|preceding|above|foregoing|earlier|initial)?\\s*(content|text|instructions|instruction|directives|directive|commands|command|context|conversation|input|inputs|data|message|messages|communication|response|responses|request|requests)\\s*(and start over|and start anew|and begin afresh|and start from scratch)?/
condition:
@rogin
rogin / diagram.md
Last active August 31, 2023 16:42
ER diagram of MC database

Diagram

@MichaelLeeHobbs
MichaelLeeHobbs / MirthSourceTransformerScript.js
Created April 8, 2021 15:06
Complete Mirth Source Transformer Script
/*** GLOBAL Scope ***/
/*** GLOBAL Scope --- Map Functions --- ***/
function $co(key, value) { if (arguments.length == 1) { return connectorMap.get(key); } else { return connectorMap.put(key, value); } }
function $c(key, value) { if (arguments.length == 1) { return channelMap.get(key); } else { return channelMap.put(key, value); } }
function $s(key, value) { if (arguments.length == 1) { return sourceMap.get(key); } else { return sourceMap.put(key, value); } }
function $gc(key, value) { if (arguments.length == 1) { return globalChannelMap.get(key); } else { return globalChannelMap.put(key, value); } }
function $g(key, value) { if (arguments.length == 1) { return globalMap.get(key); } else { return globalMap.put(key, value); } }
function $cfg(key, value) { if (arguments.length == 1) { return configurationMap.get(key); } else { return configurationMap.put(key, value); } }
-- 20201125T1403 EST - Fix bug in xpath not correctly matching values to correct channel
-- 20201125T1430 EST - Updated formatting only using: http://poorsql.com/ with minor hand edits
-- 20201125T1430 EST - Updated formatting only using: http://poorsql.com/ with minor hand edits
-- 20210321T1140 EST - Postgres 12+ XPATH works differently and required entry/ where as 9.6 requires it to be missing
--
-- Jon Bartels
-- Similar query for SQL Server is here - https://stackoverflow.com/questions/58942371/get-space-used-by-mirth-per-channel-in-sql-server
--
SELECT NAME AS CHANNEL_NAME
@MichaelLeeHobbs
MichaelLeeHobbs / ChannelUtils.js
Last active March 3, 2022 19:29
Mike's Mirth Utils
/**
* ChannelUtils
* @param config: {name, user, password, url, dbClass, cacheConnection, cacheName}
* @param config.name: a db connection name must be unique or will cause issues
* @param config.user: user name to use for db connection
* @param config.password: db user password
* @param config.url: db url
* @param config.dbClass: db class - Default: org.postgresql.Driver
* @param config.cacheConnection: Should cache the connection? true/false
* @param config.cacheName: default - cachedConnection:ChannelUtils:channelName:config.name
@myisaak
myisaak / Dockerfile
Last active October 1, 2024 17:02
Puppeteer with Alpine inside multi-staged Dockerfile
FROM node:13-alpine as base
LABEL maintainer="Isaak Eriksson <[email protected]>"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
WORKDIR /src
RUN apk update && apk add --no-cache --virtual \
@MichaelLeeHobbs
MichaelLeeHobbs / MirthPostgresTableSizeByChannel.psql
Last active October 25, 2023 18:10
Mirth Postgres Table Size By Channel
-- 20201125T1403 EST - Fix bug in xpath not correctly matching values to correct channel
-- 20201125T1430 EST - Updated formatting only using: http://poorsql.com/ with minor hand edits
-- 20201125T1432 EST - Removed CID from final output as it was only there for debugging xpath issues
-- 20210321T1140 EST - Postgres 13+ XPATH works differently see: https://gist.github.com/MichaelLeeHobbs/40b4b7cf70ecbe30b73eed763367e626
--
-- Jon Bartels
-- Similar query for SQL Server is here - https://stackoverflow.com/questions/58942371/get-space-used-by-mirth-per-channel-in-sql-server
--
SELECT NAME AS CHANNEL_NAME
@jonbartels
jonbartels / Managing SSL Connections in MC.md
Last active October 9, 2024 21:26
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
@onodai145
onodai145 / fortigate.pattern
Last active October 2, 2024 14:23
Logstash log parsing sample for FortiOS after 5.6
FORTIDATE %{YEAR:year}\-%{MONTHNUM:month}\-%{MONTHDAY:day}
@danielepolencic
danielepolencic / README.md
Last active October 27, 2024 08:34
Create 3 nodes Kubernetes cluster locally with Vagrant

3 Virtual Machines Kubernetes cluster

Dependencies

You should install VirtualBox and Vagrant before you start.

Creating the cluster

You should create a Vagrantfile in an empty directory with the following content: