Skip to content

Instantly share code, notes, and snippets.

View av1d's full-sized avatar
🎯
Focusing

av1d

🎯
Focusing
View GitHub Profile
@av1d
av1d / scoop.sh
Last active September 27, 2022 05:43
Sort specific file types from wayback_machine_downloader list into a new file for easier searching.
#!/bin/bash
# v0.02 - probably buggy as hell.
# Scrape the good stuff from your WMD lists.
# Outputs to original format and a text file of instantly usable links for wget.
# Create your list with wayback_machine_downloader like so:
# wayback_machine_downloader -sl website.org > infile.txt
# Caveat: a side effect is sometimes what we thought was a file will actually be a 404 or other error page.
# This is due to the way things were fetched by the downloader*. Just because a file is shown doesn't mean it exists,
# but it's also recommended to cycle through the sites' different dates if you can't find something.
@av1d
av1d / organic_random_bot_timer.py
Last active November 20, 2022 03:23
Chose a random time to sleep between certain hours and between two predefined sets of minutes. Useful for avoiding bot detection.
import random, time, os, sys
from datetime import datetime
# Random Organic Bot Timer - v2.0 by av1d
#
# What this does is create random pauses at certain times of the day in an
# attempt to make bots slightly more organic and avoid detection.
# For example, you could have it execute randomly every 5-10 minutes between
# 2 PM and 10 PM, and then at different random intervals between 10 PM and 3 AM.
#
@av1d
av1d / findmisnamed.py
Last active September 11, 2023 20:44
Find misnamed exe and zip files
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import sys
from pathlib import Path
# Looks for exe and zip files which don't have a .exe or .zip or other zipped container extension.
# Results are saved to a text file.
# Can be adapted to any file type, just change the settings below.
@av1d
av1d / wayback.sh
Last active October 23, 2022 07:09
grep commands for filtering wayback_machine_downloader results to find files which are actually saved as 404 errors
# Search downloaded items for files which were 404 as Wayback Downloader may download
# 404 pages as files AND the file may still actually exist on the Wayback Machine at
# a different timestamp. The output will be a list of files you should check manually
# somehow.
#
# wayback_machine_downloader saves the files in a directory like:
# websites/www.gegi.polymtl.ca/electech/marceau/labrv/
# and files will be in that directory, like this:
# websites/www.gegi.polymtl.ca/electech/marceau/labrv/dzzyland.zip
#
@av1d
av1d / defcon.sh
Last active November 12, 2022 04:09
Notify when https://defcon.social/ is updated at all
#!/bin/bash
# v2.0 by av1d
#
# Run these commands once before running this bot:
# curl --insecure https://defcon.social/ > defcon.old
# curl --insecure https://defcon.social/images/fail-odon.png > fail-odon.old
webhook="https://discord.com/put-webhook-here"
@av1d
av1d / Fuck.eBay.ublock
Created November 19, 2022 16:15
Block the announcements advertising spam module from eBay Seller Hub using uBlock
! 2022-11-19 https://www.ebay.com
www.ebay.com###sho-announcements-module
www.ebay.com###sho-announcements-module > .card-old
@av1d
av1d / eBayOauth.php
Created November 24, 2022 06:32
Get eBay OAUTH token from AppID and CertID for Shopping API
<?php
/*
Request OAUTH token from ebay.
Send AppID + CertID base64 encoded with colon between like this, no spaces:
appid:certid
The encoded credentials go in the "Authorization: Basic" header after "Basic".
Example: "Authorization: Basic MY-SUPER-MAGIC-ENCODED-TOKEN".
Resulting token is good for 2 hours. Use for Shopping API, etc.
Warning: it's really bad practice to store credentials in your code. Up to you to fix that.
@av1d
av1d / basic.py
Created November 26, 2022 07:09
The most basic, minimalistic, simplified Discord webhook request in Python
import requests
webhook = "paste-your-URL-here"
data = {
"content" : "Super simple",
"username" : "Test post!"
}
result = requests.post(webhook, json = data)
@av1d
av1d / FindEligibleItems.py
Created December 3, 2022 16:18
FindEligibleItems example for eBay Negotiation API in Python
import requests
# FindEligibleItems example for eBay Negotiation API in Python
# You must use a User Access Token from the grant flow, no other token will work.
# For access token, see: https://gist.github.com/av1d/2b2e524e51f0770ec25b3ace3ac10088
UserAccessToken = "paste User Access Token here"
headers = {
@av1d
av1d / GetSingleItem.py
Created December 7, 2022 06:43
eBay Shopping API - GetSingleItem
import requests
# Shopping API calls must authenticate with an OAuth application access token in the
# HTTP header X-EBAY-API-IAF-TOKEN and use OAuth application access tokens with a scope
# that includes https://api.ebay.com/oauth/api_scope
# https://developer.ebay.com/devzone/shopping/docs/concepts/shoppingapi_formatoverview.html
headers = {
'X-EBAY-API-IAF-TOKEN': 'Bearer paste-token-here',
'X-EBAY-API-SITE-ID': '0',