Skip to content

Instantly share code, notes, and snippets.

@mochsner
mochsner / oauth2-mc.js
Created June 22, 2022 16:52
OAuth2-MirthConnect
// Random helpers
// globalMap.put('OS_TYPE', 'WINDOWS');
//globalChannelMap.put('name','val');
logger.info('STARTING TO SEND (WZ-DEST)');
function logChannelMap(key)
{
logger.info(key+':'+globalChannelMap.get(key));
}
@mochsner
mochsner / ub20-setup.sh
Last active August 7, 2023 18:29
setup.sh for ubuntu desktop and servers
#!/bin/bash
# Note: https://stackoverflow.com/questions/4642915/passing-parameters-to-bash-when-executing-a-script-fetched-by-curl
# Run this script for a SERVER via :
# curl https://gist.githubusercontent.com/mochsner/c5f377d7e23a644d41113fb59a265288/raw/setup.sh | sudo bash -s -- 1
# DESKTOP:
# curl https://gist.githubusercontent.com/mochsner/c5f377d7e23a644d41113fb59a265288/raw/setup.sh | sudo bash -s -- 0
# https://support.system76.com/articles/system76-driver/
is_server = $1
@mochsner
mochsner / single-page-pdf-base64.txt
Created March 18, 2022 00:13
base64-encoded-single-page-pdf
JVBERi0xLjcNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIvTGFuZyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDE1IDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0cnVlPj4vTWV0YWRhdGEgMjcgMCBSL1ZpZXdlclByZWZlcmVuY2VzIDI4IDAgUj4+DQplbmRvYmoNCjIgMCBvYmoNCjw8L1R5cGUvUGFnZXMvQ291bnQgMS9LaWRzWyAzIDAgUl0gPj4NCmVuZG9iag0KMyAwIG9iag0KPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9Gb250PDwvRjEgNSAwIFIvRjIgOSAwIFI+Pi9FeHRHU3RhdGU8PC9HUzcgNyAwIFIvR1M4IDggMCBSPj4vUHJvY1NldFsvUERGL1RleHQvSW1hZ2VCL0ltYWdlQy9JbWFnZUldID4+L01lZGlhQm94WyAwIDAgNjEyIDc5Ml0gL0NvbnRlbnRzIDQgMCBSL0dyb3VwPDwvVHlwZS9Hcm91cC9TL1RyYW5zcGFyZW5jeS9DUy9EZXZpY2VSR0I+Pi9UYWJzL1MvU3RydWN0UGFyZW50cyAwPj4NCmVuZG9iag0KNCAwIG9iag0KPDwvRmlsdGVyL0ZsYXRlRGVjb2RlL0xlbmd0aCAzMTE+Pg0Kc3RyZWFtDQp4nK2TQUvDMBTH74F8h3dMhKV5Sds0MHpouw2F4sSCB/EwZp2CTmz3/fFlehBZYIwWGvLakN/vT14gWcN8nrT1dQO6LKFqavjiTCsdHo8GNOQ0Om9g6Dl7uII9Z1XHWbJEQFQ6he6FM6R1GhCcUdqk4LRXGf35oHWrewe7kfaE3bEqfqsVZ4+ilTMrNsMWJGpxu30d9zIV/SCfoLvhbEGcO87OFTInhNCmyv/1OWr80OfaZlV5EepUdrRO5XmEJUaJKKALeftRenEA6cRazlLRhGEJE2YusrgIhXbp
@mochsner
mochsner / smart-edit-checkboxes.scss
Created November 3, 2021 05:45
smart-edit-checkboxes.scss
/* Gist to generate checklists with decreasing intensity in edit mode on Obisidian.md */
$color:(
1: #000000,
);
$variations: (
1: 30%,
2: 50%,
3: 70%,
4: 75%,
5: 80%,
@mochsner
mochsner / git-snippets.txt
Last active September 2, 2021 01:41
Git Snippets
# diff branches
git diff --name-only branch_1...branch_2
# Get a tree view of all commits / branches
git log --oneline --graph --decorate --all
@mochsner
mochsner / get-branch-subdir.sh
Created August 31, 2021 19:29
Git Bash: Get Branch of All Subdirs
# Taken from: https://stackoverflow.com/questions/49281685/
for i in */; do \
(cd $i && echo -n "${i}: " && git rev-parse --abbrev-ref HEAD); \
done
@mochsner
mochsner / flex-img-wrap.markdown
Last active July 22, 2021 15:18
Flex Img Wrap 2 (Sandbox)

Keybase proof

I hereby claim:

  • I am mochsner on github.
  • I am mochsner (https://keybase.io/mochsner) on keybase.
  • I have a public key ASBFddyZa-GfeRnpHuL9MYfuLb5eFEcrvb5q9Eh8cdKHlQo

To claim this, I am signing this object:

@mochsner
mochsner / Windows-Hard-Map-Caps-To-CTRL.bat
Last active September 2, 2021 01:42
Windows 10 Map CAPS to CTRL
# Set CAPS LOCK = Ctrl (Vim/Emacs), then restart computer
$hexified = "00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00".Split(',') | % { "0x$_"};
$kbLayout = 'HKLM:\System\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified);