Skip to content

Instantly share code, notes, and snippets.

@pqlx
pqlx / pingcheck.py
Created June 7, 2018 11:53
script to quickly filter out domains that either don't exist or are down
import subprocess, sys, os
dev_null = open(os.devnull, 'w')
up = []
with open(sys.argv[1], 'r') as handle:
while True:
This file has been truncated, but you can view the full file.
[
{
"children": [
{
"children": [],
"name": "ALGORITHMS - ROBERT SEDGEWICK.pdf",
"size": "4.6M",
"type": "file"
},
{
@pqlx
pqlx / extract_protobufs_pokeone.cs
Created August 3, 2018 14:59
get almost perfect .proto files back
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using ProtoBuf;
using MAPAPI;
@pqlx
pqlx / scrape.py
Created October 19, 2018 22:49
project euler scraper + template generator
from bs4 import BeautifulSoup
import re
import textwrap
class Problem(object):
def __init__(self, problem_element):
self.number = None
self.title = None
@pqlx
pqlx / hook.php
Last active November 3, 2018 21:47
hook functions in php
<?php
/*
Dirty hacks to not get into an infinite recusion when using
*/
foreach(
["file_put_contents",
"debug_backtrace",
"func_get_args",
"call_user_func_array"] as $safe)
@pqlx
pqlx / hashcracker.py
Created November 24, 2018 19:59
Small hash cracker (not to be taken seriously, use hashcat or JTR)
from typing import *
from typing import BinaryIO
import hashlib
class HashCracker(object):
supported_algos = hashlib.algorithms_available
@classmethod
def crack_hash(cls: type, algo: str, ciphertext: AnyStr, plaintext_pool: Iterable[bytes]) -> bytes:
import socket
import itertools
import string
import sys
from multiprocessing.dummy import Pool as ThreadPool
import json
# Don't judge me ;)
# wget http://data.iana.org/TLD/tlds-alpha-by-domain.txt -O tlds.txt
# python -c "import re;h=open('tlds.txt').readlines(); print([x for x in h if len(x) == 3])" | sed -e "s/\\\\n//g" | tr '[:upper:]' '[:lower:]'
from typing import *
import numpy as np
def generate_fibonacci_function(degree: int, starting_values: List[int]):
solutions = np.roots([1, *([-1]*degree)])
def gen_coefficents(n):
return [s**n for s in solutions]
@pqlx
pqlx / libgen.py
Last active February 26, 2020 14:16
import os
import sys
import logging
import urllib.parse
import math
from multiprocessing.pool import ThreadPool
import requests
from bs4 import BeautifulSoup
from tabulate import tabulate
from slugify import slugify
# -*- coding: utf-8 -*-
(lambda __OOO00O0O00OOO00OO, __OOO0OOO0O00OOO0OO: [[(lambda __OOOOO000O00OO000O: ([[(merge_sort(operand, 0, (len(operand) - 1)), [(pprint.pprint(operand), __OOOOO000O00OO000O())[1] for __OOO00O0O00OOO00OO[''.join([chr((ord(__lll11l) ^ ord(__1l111l))) for (__lll11l, __1l111l) in zip('\x9dWPÏ\x03h', 'í\'"¦m\x1c')])] in [__import__(''.join([chr((ord(__1ll111) ^ ord(__l1l11l))) for (__1ll111, __l1l11l) in zip('\x1f\x14k\x8f»ã', 'od\x19æÕ\x97')]), __OOO00O0O00OOO00OO, __OOO00O0O00OOO00OO)]][0])[1] for __OOO00O0O00OOO00OO[''.join([chr((ord(__11lll1) ^ ord(__lll1l1))) for (__11lll1, __lll1l1) in zip('\x0bÐÂ[\x93Ë\x8f', 'd\xa0§)ò¥ë')])] in [[int(OO0OOOO000OO0O00O) for __OOO00O0O00OOO00OO[''.join([chr((ord(__111ll1) ^ ord(__1ll111))) for (__111ll1, __1ll111) in zip('¹\x0eX\x8aÐt§D<_\x13\x00\x15#±Qª', 'öAhÅ\x9f;èt\x0co\\O%l\x81aå')])] in sys.argv[1:]]]][0] for __OOO00O0O00OOO00OO[''.join([chr((ord(__11111l) ^ ord(__l1ll11))) for (__11111l, __l1ll11) in zip('¿j\r', 'Ì\x13~')])] in [__import__(''.