Skip to content

Instantly share code, notes, and snippets.

View ioistired's full-sized avatar

io ioistired

View GitHub Profile
@b-meson
b-meson / mr_requests.py
Created August 3, 2017 05:22
MuckRock basic API request
import json
import requests
from datetime import datetime
import dateutil.relativedelta
import os
mr_username = ''
mr_pass = ''
api_url = 'https://www.muckrock.com/api_v1/'
This work, excluding the Arch Linux logo, is made available under CC0: https://creativecommons.org/publicdomain/zero/1.0/
from glob import glob
import os
import json
import matplotlib.pyplot as plt
# you'll want to change this path
filepath = r"C:\Users\user\AppData\Roaming\.minecraft\saves\HermitCraftIV\stats\*.json"
HermitUUIDs = {'03c9c1dc63004a36a25e079d18639d41' : 'EvilXisuma', '05e88dce714d4218be77fade8b5dfa3c' : 'Docm77', '18a9faba1977469b8156ed0f1a3c765b' : 'iskall69', '21ef397c3a764eb7aa17a99d3fc658e2' : 'Xisuma', '24453bad63a448138a0c4ecd77f2f696' : 'truesymmetry', '2dd0cc3b08254c3ebd993bf07ef27447' : 'Renthedog', '2f72315024de44ffaeee87c75f7c7a9e' : 'VintageBeef', '3169d985081f4392be6a96cbfba7d9fb' : 'PythonGB', '350c312e4eb849bfa1b68decb3a16f52' : 'Jessassin', '3f28c55908984be19f209fd37ca9cd22' : 'iJevin', '530d0bbfdb2e4384bbb2df14436587d2' : 'ImpulseCam', '53bae456dbbb4c2f8c799e8ec26c8382' : 'joehillssays', '5f15204a490649a9932bce1ad9796ab0' : 'zueljin', '62fec5a318964beb94e036e34898c787' : 'Tango', '641f705aaf484942b1ed882af2070046' : 'Biffa001', '6cdc398bfda7412fa22a16a72021d1bf' : 'WellsGlazes', '7ed3587be65646
@aparrish
aparrish / index.md
Last active March 18, 2026 01:28
Getting credentials for the Mastodon API with Mastodon.py. Code examples released under CC0 https://creativecommons.org/choose/zero/, other text released under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/

Getting credentials for the Mastodon API with Mastodon.py, step by step

Making a bot? Making a bot in Python? Making a bot in Python that uses the Mastodon API? If so, chances are you need to get some credentials. Here's how I did it!

(The following tutorial uses Python 2.7, but if you're using Python 3+ everything should work substantially the same.)

Mastodon.py authentication

I just started using it, but it looks like Mastodon.py is a pretty great library for working with the Mastodon API! However, all of the authentication examples use static files to store credentials, which I don't like—I'm afraid I'll accidentally push them to Github. I like to keep my authentication as close to the actual command that runs the program as possible, so usually I pass them on the command line to the script running my bot. To do this, I need to get the appropriate credentials on their own, as separate strings that I can cut and paste.

@vxgmichel
vxgmichel / aioudp.py
Last active March 16, 2026 20:09
High-level UDP endpoints for asyncio
"""Provide high-level UDP endpoints for asyncio.
Example:
async def main():
# Create a local UDP enpoint
local = await open_local_endpoint('localhost', 8888)
# Create a remote UDP enpoint, pointing to the first one

Making a PDF + Bootable ISO Hybrid Polyglot

If you've not seen my résumé, that is what this post is about, and you should probably look at it first to get an idea of what's happening.

A Tale of Two Files

PDF and ISO9660 are two very different file formats. PDF is actually a surprisingly human-readable (but, sadly, not very human-writable) plain-text format, technically descended from PostScript. PDF is not very forgiving on changes, as it stores tables of offsets to various elements, so it is very difficult to insert or remove content manually without going through a robust PDF manipulation library.

ISO9660 is a disk filesystem, meant to be written once and read many times on many different kinds of hardware. As it is sector-based, it expects data structures to be at particular absolute offsets.

#!/usr/bin/env python3.5
import asyncio
from collections import namedtuple
import functools
import random
Message = namedtuple('Message', 'prefix command params')
Prefix = namedtuple('Prefix', 'nick ident host')
@toobeetootee
toobeetootee / 2b2t_Media.md
Last active April 30, 2026 23:55
Curated list of 2b2t media from across the web

Header Hausemaster Approved

⌚ Updated 4 July 2016
💀 I collect 2b2t resources. I am not responsible for the content/language of external links.
2b2t Websites
@leovoel
leovoel / basic_bot.py
Last active January 25, 2024 04:19
discord.py's basic_bot.py converted to use "cogs".
from discord.ext import commands
description = '''An example bot to showcase the discord.ext.commands extension
module.
There are a number of utility commands being showcased here.'''
# this specifies what extensions to load when the bot starts up
startup_extensions = ["members", "rng"]
@carnal0wnage
carnal0wnage / struts_default_action_mapper_roomwizard.rb
Created November 20, 2015 15:34
Exploit Module for roomwizard II Apache struts vulnerability
##
# This module requires Metasploit: http//metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking