Skip to content

Instantly share code, notes, and snippets.

View spencerpogo's full-sized avatar

Spencer Pogorzelski spencerpogo

View GitHub Profile
@spencerpogo
spencerpogo / shorten.py
Created November 6, 2018 03:23
Discord.py Code
# -*- coding: utf-8 -*-
import discord
import requests
import datetime
import traceback
from urllib.parse import urlencode
from urllib.parse import quote_plus
from discord.ext import commands
import os
os.chdir("..")

Keybase proof

I hereby claim:

  • I am scoder12 on github.
  • I am scoder12 (https://keybase.io/scoder12) on keybase.
  • I have a public key ASBAo0vdjGipfomxhMvhOz09gLBkq-f3ktyfepPCHppioAo

To claim this, I am signing this object:

@spencerpogo
spencerpogo / .aliases
Created August 4, 2020 01:05
My shell aliases file
alias "cd.."="cd .."
alias lsa="ls -a"
# For when ubuntu doesn't want to let me use my headphones
alias afr="sudo alsa force-reload"
# taken from the ubuntu default .bashrc
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
alias notify="alert"
alias gc="git commit -am" # Usage: gc "My commit message"
alias gs="git status"
alias gp="git push"
@spencerpogo
spencerpogo / refactor.py
Last active October 15, 2020 16:38
Poor man's go field refactoring tool
#!/usr/bin/env python3
import sys
if len(sys.argv) < 4:
print(
f"Usage: {sys.argv[0]} <Struct type name (no star)> <field name> <field type>"
)
sys.exit(1)
try:
@spencerpogo
spencerpogo / exploit.py
Last active November 28, 2020 01:44
Solution to a printf format string vulnerability PWN challenge from https://johnhammond.org/discord
#!/usr/bin/env python3
# Solution to PWN challenge from Solution to a PWN challenge from https://johnhammond.org/discord
# Binary: printing_you_x64 https://cdn.discordapp.com/attachments/762701400790401044/767773607828652062/printing_you_x64
# Author: Scoder12
# Date: 10/13/20
# License: GNU AFFERO GENERAL PUBLIC LICENSE https://www.gnu.org/licenses/agpl-3.0.txt
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@spencerpogo
spencerpogo / simplediscordcrypt.js
Created February 11, 2021 19:08
Use simplediscordcrypt in web console or on discord
(function fixLocalStorage() {
// https://stackoverflow.com/a/53773662/9196137
// If we create an <iframe> and connect it to our document, its
// contentWindow property will return a new Window object with
// a freshly created `localStorage` property. Once we obtain the
// property descriptor, we can disconnect the <iframe> and let it
// be collected — the getter function itself doesn’t depend on
// anything from its origin realm to work**.
function getLocalStoragePropertyDescriptor() {
@spencerpogo
spencerpogo / SimpleDiscordCrypt.plugin.js
Last active May 5, 2022 17:15
Simple Discord Crypt BetterDiscord Plugin
//META{"name":"SimpleDiscordCrypt","source":"https://github.com/Scoder12/RepoTBD","website":"https://scoder12.ml","authorId":"339943808584384512"}*//
/*@cc_on
@if (@_jscript)
var shell = WScript.CreateObject("WScript.Shell");
var fs = new ActiveXObject("Scripting.FileSystemObject");
var pathPlugins = shell.ExpandEnvironmentStrings("%APPDATA%\\BetterDiscord\\plugins");
var pathSelf = WScript.ScriptFullName;
shell.Popup("It looks like you've mistakenly tried to run me directly. \\n(Don't do that!)", 0, "I'm a plugin for BetterDiscord", 0x30);
if (fs.GetParentFolderName(pathSelf) === fs.GetAbsolutePathName(pathPlugins)) {
@spencerpogo
spencerpogo / fangeo.js
Created March 16, 2021 20:44
Fantasy geopolitics leaderboard compositor. Finds top scoring countries and displays their owner names.
/**
* @author Scoder12 <https://scoder12.ml>
* @description A script to combine multiple fanschool data sources into one table.
* Finds top scoring countries and displays their owner names.
* Useful for finding high-scoring, untaken countries.
* API responses are cached as api_<endpoint> keys on window so that re-running the
* script will not re-request the data.
* @url https://app.fanschool.org/
* @license AGPL-3.0-or-later
* @tutorial Open your fasnschool dashboard and paste this script into the console.
@spencerpogo
spencerpogo / main.go
Created March 31, 2021 21:38
Fuse test
package main
import (
"context"
"flag"
"log"
"syscall"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
@spencerpogo
spencerpogo / json2nix.py
Last active June 10, 2024 06:42
Converts JSON objects into nix (hackishly).
"""Converts JSON objects into nix (hackishly)."""
import sys
import json
INDENT = " " * 2
def strip_comments(t):