Skip to content

Instantly share code, notes, and snippets.

View mpomery's full-sized avatar

Mitchell Pomery mpomery

View GitHub Profile
# based on https://github.com/amber-sixel/PythonCatPrinter.git
# can be used as a raw postscript printer (a4, one page only) on port 9100
#
# status : curl --location --request GET 'localhost:5000'
#
# curl --location --request POST 'localhost:5000' \
# --form 'image=@"/image.jpg"' \ #optional
# --form 'text="hello world"' \ #optional
# --form 'size="48"' \ #optional
# From https://gist.github.com/phawk/b2b3f1e28f8ffc33b396
# Save this in ~/.screenrc
# Use bash
shell /bin/bash
autodetach on
# Big scrollback
@mpomery
mpomery / gist:01bffc752cc8dc2f304e61b8a402e89c
Created October 22, 2019 22:01
Script for determining unity controller numbers
/*
Good script for ficuring out joystick numbers
*/
for (int action = (int)KeyCode.Backspace; action <= (int)KeyCode.Joystick8Button19; action++)
{
if (Input.GetKeyDown((KeyCode)action) && ((KeyCode)action).ToString().Contains("Joystick"))
{
var controllerNumber = ((KeyCode)action).ToString().Substring(8, 2);
import json
import boto3
import os
import logging
import time
import re
sts = boto3.client('sts')
role_name = ''
import json
import boto3
import os
import logging
import time
import re
logger = logging.getLogger()
logger.setLevel(logging.INFO)

Keybase proof

I hereby claim:

  • I am mpomery on github.
  • I am mitchpommers (https://keybase.io/mitchpommers) on keybase.
  • I have a public key ASCR1A_oDd66WMKWfOKy_FPuxcxJFLQgLGp9ZZDlnW1buAo

To claim this, I am signing this object:

@mpomery
mpomery / watcher-lack_of_data.json
Last active January 21, 2019 10:42
An elasticsearch watcher that looks for a lack of data. Good to see if something has stopped happening.
{
"metadata": {
"_NOTE_": "Alerts are sent if you fall below the thresholds. Set both to the same number if you only want critical messages",
"WarningThreshold": 10,
"CriticalThreshold": 5
},
"trigger": {
"schedule": {
"interval": "5m"
}
@mpomery
mpomery / DPAPI-Encryption.ps1
Created August 15, 2018 08:47
DPAPI Encryption/Decryption
function Get-DpapiEncryptedValue([string] $valueToEncrypt) {
Add-Type -AssemblyName System.Security
$clearBytes = [System.Text.Encoding]::UTF8.GetBytes($valueToEncrypt)
$encryptedBytes = [System.Security.Cryptography.ProtectedData]::Protect($clearBytes, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine)
return [System.Convert]::ToBase64String($encryptedBytes)
}
function Get-DpapiDecryptedValue([string] $valueToDecrypt) {
Add-Type -AssemblyName System.Security
$clearBytes = [System.Convert]::FromBase64String($valueToDecrypt)