Skip to content

Instantly share code, notes, and snippets.

View GadgetSteve's full-sized avatar

Steve (Gadget) Barnes GadgetSteve

  • Bridgend, UK
View GitHub Profile
@GadgetSteve
GadgetSteve / cgi-post.py
Created October 30, 2021 09:42 — forked from SteveBarnes-BH/cgi-post.py
CGI Debugging - sometimes you have a web page that uses CGI and you need to see what data is being POSTed.
#!/usr/bin/env python
"""
This script is based on https://cgi.tutorial.codepoint.net/file-upload but with changes as needed.
To use:
- Download the web page to be debugged.
- Edit it to replace `action="/cgi-bin/cgi-post"` with `action="/cgi-bin/cgi-post.py"` (on Windows on Linux you can simply rename this file to not have .py at the end.
- place in a cgi-bin subdirectory of the one where you saved the web page
- start a simple web server with ` python -m http.server 8001 --bind localhost --cgi`
@GadgetSteve
GadgetSteve / list_licenses.py
Last active January 27, 2021 16:27 — forked from WLPhoenix/list_licenses.py
Python license lister
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import pkg_resources
def get_pkg_license(pkgname):
"""
Given a package reference (as from requirements.txt),