Skip to content

Instantly share code, notes, and snippets.

View watbulb's full-sized avatar
:shipit:

Dayton watbulb

:shipit:
  • Calgary, Canada
View GitHub Profile
@watbulb
watbulb / karp_frobenius_approximation.py
Created June 15, 2024 06:04
Rabin-Karp Frobenius Approximation of Sub-Matrices Matches
#!/usr/bin/env python3
"""
Copyright Dayton Pidhirney
"""
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as patches
# Sliding Window for Submatrices
@watbulb
watbulb / csv_matrix_to_image.py
Last active June 13, 2024 07:58
CSV 3D data matrix to normalized pixel matrix
#!/usr/bin/env python3
import csv
import numpy as np
import matplotlib as mpl
from PIL import Image
MATRIX_SIZE = 64
NORMALIZE_BIAS = 255 # 0.0 - 1.0
Z_DEPTH = 3
@watbulb
watbulb / j3455_sidechannel.c
Last active May 27, 2024 20:06
a simple spectre FLUSH+RELOAD cache-hit side-channel demo (tuned for Intel J3455)
/*
* Simple Spectre FLUSH+RELOAD Cache Side-Channel
* Copyright @watbulb (Dayton Pidhirney)
*/
#include <stdint.h>
#include <stdio.h>
#include <x86intrin.h>
// Intel(R) Celeron(R) CPU J3455 @ 1.50GHz
@watbulb
watbulb / arm64_msr.py
Created November 6, 2023 00:57
arm64_msr.py
import struct
Op0_shift = 19
Op1_shift = 16
CRn_shift = 12
CRm_shift = 8
Op2_shift = 5
MAX_OP0 = 3
MAX_OP1 = 7
@watbulb
watbulb / git-recover-reset-hard.txt
Created November 22, 2020 04:15
recovering uncommitted changes from a git reset --hard (godbless)
for blob in $(git fsck --lost-found | cut -d' ' -f3); do
git cat-file -p $blob > $blob.txt
done
@watbulb
watbulb / get-ps5-stock.sh
Created November 15, 2020 08:09
Simple posix shell script to check PS5 availability against multiple stores (curl & pup). Extend as appropriate.
#!/bin/bash
# Simple script to check PS5 availability against multiple stores
# @watbulb
[[ -n $DEBUG ]] && set -x || :
set -e -o posix
AGENT="Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:59.0) Gecko/20100101 Firefox/59.0"
declare -a STORES=(
# Bestbuy (bestbuy.html)
https://www.bestbuy.ca/en-ca/product/playstation-5-digital-edition-console-online-only/14962184
@watbulb
watbulb / Dockerfile.libelfmaster
Created May 18, 2020 21:01
libelfmaster docker image
### libelfmaster docker based image ###
# Build: docker build -t "libelfmaster:latest" -f Dockerfile.libelfmaster .
# Run: docker run --rm -it -v ${PWD}/data:/tmp/data "libelfmaster:latest"
#
# Maintainer: https://github.com/watbulb
###
FROM ubuntu:latest
# Environment
ENV INSTALL_PREFIX=/opt/elfmaster
@watbulb
watbulb / Dockerfile.elfutils
Last active May 17, 2020 04:22
elfutils docker based image (0.179)
# elfutils docker based image
# Maintainer: https://github.com/watbulb
FROM ubuntu:latest
ENV LD_LIBRARY_PATH=/usr/local/lib
# Working directory and root
ENV BASE=/root
WORKDIR ${BASE}
@watbulb
watbulb / gist:b3a731bd1b325046c40351d62c94c68c
Created November 12, 2019 22:03
Catalina (10.15.1) apple root sandboxed processes during idle
[+] Sandboxed Root Processes:
80:/usr/sbin/systemstats
82:endpointsecurityd
89:/usr/libexec/logd
98:/System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework/Support/mds
104:/usr/libexec/coreduetd
107:/usr/libexec/opendirectoryd
108:/System/Library/PrivateFrameworks/ApplePushService.framework/apsd
114:/usr/sbin/securityd
@watbulb
watbulb / dib2bmp.py
Last active December 10, 2020 22:43
Universal Device Independant Bitmap (DIB) to BMP Converter
#!/usr/bin/env python3
'''
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.
Universal DIB to BMP converter. <d$pid>
'''
import sys