Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike Riebart

View GitHub Profile
@Riebart
Riebart / contentdump.py
Created Nov 2, 2021
Brief mitmdump module for dumping content of responses to a file, and keeping track of what files are which URIs in a map JSON.
View contentdump.py
"""
Mitmdump extension script that can be used to dump content to disk in a way that can be processed after the fact by arbitrary tools.
"""
import time
import uuid
import json
import os.path
from mitmproxy import http
@Riebart
Riebart / ffmpeg_multitrack_audio.sh
Created Oct 19, 2021
ffmpeg Record multichannel audio from multiple sources to a single file
View ffmpeg_multitrack_audio.sh
#!/bin/bash
# get device names from: ffmpeg -list_devices true -f dshow -i dummy
ffmpeg \
-f dshow -ac 1 -i audio="Audio Input Device A" \
-f dshow -ac 1 -i audio="Audio Input Device B" \
-ac 2 -filter_complex "[0:a][1:a]amerge[outA]" -map "[outA]:a" multitrack_out.wav
@Riebart
Riebart / test_ciphers.sh
Created Oct 2, 2021
Remote SSL Cipher Test
View test_ciphers.sh
#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
@Riebart
Riebart / gs_pdf_squash.sh
Created Jun 7, 2021
Squashing a PDF with ghostscript
View gs_pdf_squash.sh
#!/bin/bash
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf PDFsam_merge.pdf
View SurveyDDA.ps1
#
# These variables are device properties. For people who are very
# curious about this, you can download the Windows Driver Kit headers and
# look for pciprop.h. All of these are contained in that file.
#
$devpkey_PciDevice_DeviceType = "{3AB22E31-8264-4b4e-9AF5-A8D2D8E33E62} 1"
$devpkey_PciDevice_RequiresReservedMemoryRegion = "{3AB22E31-8264-4b4e-9AF5-A8D2D8E33E62} 34"
$devpkey_PciDevice_AcsCompatibleUpHierarchy = "{3AB22E31-8264-4b4e-9AF5-A8D2D8E33E62} 31"
$devprop_PciDevice_DeviceType_PciConventional = 0
@Riebart
Riebart / read_process_mem.py
Created Jan 29, 2021
Adapted from Stackoverflow, a Python script to dump the memory of a process.
View read_process_mem.py
#!/usr/bin/env python
# Source: https://stackoverflow.com/questions/12977179/reading-living-process-memory-without-interrupting-it
#
# Adapted to be python3
import os
import re
import sys
@Riebart
Riebart / 3dmsearch.py
Last active Sep 1, 2021
Search through 3DMark results for all results for a specific GPU. Search result pagination is done by score.
View 3dmsearch.py
#!/usr/bin/env python3
# GPU Search by string:
# "https://www.3dmark.com/proxycon/ajax/search/gpuname?term=" + s
import json
import requests
import time
import sys
@Riebart
Riebart / reconnect_console.ps1
Created Jan 5, 2021
Disconnect the first active session on Windows and reconnect the console session. Useful for disconnecting RDP to use Steam Streaming.
View reconnect_console.ps1
$session=(query session | select-string Active)[0].ToString().split(" ")[0].substring(1)
Start-Process -verb runas tscon -ArgumentList "$session /dest:console"
@Riebart
Riebart / syslog_levels.md
Created Dec 4, 2020
Documentation on the syslog levels and facilities, and how to use them when building application logging
View syslog_levels.md

Syslog logging levels and parameters

All logs

All logs should contain the following information, preferably encoded in JSON so that it is easily machine-parsable as well as human readable. Graylog can parse JSON, so encoding your fields in that way makes it easy to alert and filter on messaged components.

  • Message: The message should be a plaintext description of the event, optionally including an application-unique code.
  • Impact: This field should describe the impact, if any (there is no impact for debug and informational events), on the state, output, and resiliency of the application. It should be short (one sentence), but contain enough information for someone not familiar with the application to triage the event.
  • Correction: This field should describe any corrective action, if any (there is no corrective action required for debug, informational, and notice level events), that could, or should, be taken to resolve the impacts caused by the event. This should be short (at most two sentences) an
@Riebart
Riebart / code_flows.md
Last active Aug 20, 2021
Thoughts on git branch workflows and microservice code organization
View code_flows.md

Comparing branching and workflow strategies

Summary of existing

There's several existing strategies for deploying and managing development work and release. They each have their own opinions, but roughly cover a few major situations:

  • Developing a new feature
  • Which branches should be, at all times, deployable, tested code
  • Under what conditions a code review or approval is required to merge code into a new branch
  • How many deployment environments (e.g. production only, or staging and production) you intend to have available, and to whom