Skip to content

Instantly share code, notes, and snippets.

View ca0abinary's full-sized avatar

Jonathan DeMarks ca0abinary

  • SPS Commerce
  • West Plains MO US
View GitHub Profile
@ca0abinary
ca0abinary / websocket-cloudformation.yaml
Last active July 31, 2021 21:23
Creates a really basic websocket service and testing tools
# sample deployment command
# aws cloudformation deploy --template-file template.yaml --capabilities CAPABILITY_NAMED_IAM --stack-name ws-test --profile dev
# sample testing uri
# aws cloudformation describe-stacks --query "Stacks[?contains(@.StackName,'ws-test')].Outputs[0][?OutputKey=='WebSocketURI'].OutputValue" --profile dev | ConvertFrom-Json
# You can test with the test.html produced by the TestHtmlPage output
# or
# npm install -g wscat
# wscat -c $(aws cloudformation describe-stacks --query "Stacks[?contains(@.StackName,'ws-test')].Outputs[0][?OutputKey=='WebSocketURI'].OutputValue" --profile dev | ConvertFrom-Json)
# and paste this test message:
# {"action":"message","message":"Hello, world!"}
@ca0abinary
ca0abinary / Dockerfile
Created September 25, 2021 00:25
Windows 2003 in a docker container
FROM alpine
WORKDIR /root
ADD system.tar.gz /root
RUN apk add --update qemu-system-x86_64 qemu-img spice-server qemu-hw-display-qxl
EXPOSE 80
EXPOSE 3001
ENTRYPOINT ["qemu-system-x86_64", \
"-m", "512", \
"-drive", "file=/root/system.qcow2", \
"--spice", "disable-ticketing=on,addr=0.0.0.0,port=3001", \
@ca0abinary
ca0abinary / pc.py
Created October 1, 2021 16:59
Python multi-thread producer consumer
# Requires python3.9 and
# pip3.9 install --user requests pyodbc threading
# Outputs results.csv
import requests
import pyodbc
import threading
import queue
from time import sleep
@ca0abinary
ca0abinary / Convert-UPN.ps1
Created December 6, 2021 14:47
Convert UPN
Import-Module MSOnline
Connect-MsolService
$upn = "delete-me@geniuscentral.com"
Set-MsolUserPrincipalName -UserPrincipalName $upn -NewUserPrincipalName $upn.Replace("geniuscentral","geniuscentral.onmicrosoft")
add to
https://aad.portal.azure.com/#blade/Microsoft_AAD_IAM/GroupDetailsMenuBlade/Members/groupId/d3992f53-022d-4e63-84a7-0d38b0731011
@ca0abinary
ca0abinary / EbsDirect.py
Created February 2, 2023 21:34
Reads the partition table of an EBS snapshot using Ebs Direct API
# python -m pip install pyreadpartitions
# Update the volume_id to a volume with one or more snapshots you have access to
# Run the script!
from pyreadpartitions import get_disk_partitions_info
def main():
ebs = EbsDirectIO(volume_id='vol-0ec018d77cf9af4dd')
print(f'''
@ca0abinary
ca0abinary / mptz-protocol-re.md
Created August 12, 2022 13:00
Polycom MPTZ Serial Connection Reverse Engineering Notes

Polycom Eagle Eye Protocol RE

MPTZ-6

Serial connection at 9600 8-E-1

Device issues e0 until initialized with 81 40. Initialization code can be sent at any time.

import serial