Skip to content

Instantly share code, notes, and snippets.

View spencerpogo's full-sized avatar

Spencer Pogorzelski spencerpogo

View GitHub Profile
import sys
from elftools.elf.elffile import ELFFile
from elftools.elf.sections import SymbolTableSection
from relocation import RelocationHandler
from elftools.elf.enums import ENUM_RELOC_TYPE_x64
from elftools.elf.constants import SHN_INDICES
from binascii import hexlify
from io import BytesIO
# from pwn import disasm
// ==UserScript==
// @name ReMarkable Upload Button
// @namespace http://tampermonkey.net/
// @version 2023-12-16
// @description Add upload button to ReMarkable web interface
// @author You
// @match http://10.11.99.1/
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @run-at document-body
@spencerpogo
spencerpogo / README.md
Created May 13, 2024 23:44
Canvas Cengage WebAssign open in same tab userscript

If you can sign into webassign by opening a canvas assignment and clicking a button like this: open webassign button

then this userscript will make that button open in the same tab instead of in a new window.

How to use:

  1. Install tampermonkey
  2. Click on it's icon > Create New Script
  3. Paste contents of userscript.js
  4. Change the @match line of the script to start with your canvas instance's URL
@spencerpogo
spencerpogo / README.md
Last active May 1, 2024 05:19
Firefox query YouTube tabs

How to use

  1. Have devtools.chrome.enabled enabled in your about:config
  2. Press Ctrl + Shift + J to open the browser console
  3. Run snippet.js in the resulting console
  4. The result will be a list of [title, videoId] tuples
  5. You can use this no-dependency, synchronous script to export the result to a CSV Using clipboard to enter it makes the console lag, so you can fetch then eval it:

eval(await (await fetch("https://raw.githubusercontent.com/adaltas/node-csv/master/packages/csv-stringify/dist/iife/sync.js")).text())

@spencerpogo
spencerpogo / README.md
Created April 7, 2024 22:00
C interpreter shell script

Shell script to interpret C

I use this script to run C snippets quickly on the commandline, for example to print constants, offsets, or sizes when working in other languages.

If you want to add it to a bin folder, it might be useful to add "$(basename "$0")" "$@" to the bottom and making symbolic links for each function.

@spencerpogo
spencerpogo / README.md
Created December 20, 2023 02:55
drawj2d remarkable notebook output

The drawj2d reMarkable notebook output wasn't working for me, so I wrote a script that patches the output to be in the newer format.

Tested on reMarkable version 3.8.3.1976.

Usage:

First, edit drawj2d command in the python file to match your installation.

python3 drawj2d_rm_patcher.py ./hello.txt Hello
@spencerpogo
spencerpogo / focus.sh
Created January 4, 2023 05:50
i3-resurrect saver
shouldmatchtitle () {
case "$1" in
discord | VSCodium)
return 0
;;
*)
return 1
;;
esac
@spencerpogo
spencerpogo / pwninit.nix
Created May 15, 2022 19:08
pwninit nix
{ pkgs ? import <nixpkgs> { } }:
let
pname = "pwninit";
version = "3.2.0";
in pkgs.rustPlatform.buildRustPackage {
inherit pname version;
src = pkgs.fetchFromGitHub {
owner = "io12";
@spencerpogo
spencerpogo / newterm.sh
Last active June 30, 2021 22:31
newterm.sh - easily spawn new gnome-terminals
#!/bin/bash
set -euo pipefail
shopt -s inherit_errexit
detectshell() {
SCRIPT=$(cat <<'EOF'
import os
from shellingham import detect_shell, ShellDetectionFailure
def get_shell():
@spencerpogo
spencerpogo / README.md
Last active April 14, 2024 21:37
Valutwarden config for docker-compose

Vaultwarden docker-compose nginx

My setup for vaultwarden. Uses a custom certificate authority to sign certificates. Expects vaultwarden.crt and vaultwarden.pem to be in ./crts.

See https://github.com/ttionya/vaultwarden-backup for instructions on how to configure rclone for backups.