Skip to content

Instantly share code, notes, and snippets.

View di's full-sized avatar

Dustin Ingram di

View GitHub Profile
@di
di / gist:dadce0a0359526323d09efc9309f1d22
Created March 3, 2024 17:13
PyPI wheels with invalid metadata
2014-01-22 21:23:42.982908,https://files.pythonhosted.org/packagesb3/bc/af6d15248ad72eec26bc91da45479e34e4af37397bd05487db62fa7fb84f/django_dynamic_finder-0.1-py2.7.egg
2015-01-06 02:16:58.826469,https://files.pythonhosted.org/packages6c/2c/ccd8875cf624042ed4b950e221379136029c8539829b031abea933ce34a2/readibility-plus-0.1.tar.gz
2015-03-15 15:04:51.632322,https://files.pythonhosted.org/packages6a/50/b36b055b2c0e93da8a58b90a79dd5e892f8349cea359ff98d059db5b4560/symfit-0.2.4.zip
2015-04-13 08:41:45.437167,https://files.pythonhosted.org/packagesa7/71/d03c24ecba05b383d98acbbeddaadda72c2103041d9d9061b88bb6558ea0/pandaSDMX-0.2.0-py2.py3-none-any.whl
2015-05-17 18:49:19.070728,https://files.pythonhosted.org/packages3c/05/e09bf35b3f61fa3fc2e208006d525e271ecbc01e8b213cb5ee357c389e3c/Task_allocator.tar.gz
2015-05-19 20:28:12.575573,https://files.pythonhosted.org/packagesdf/99/bbeb6e08293ddaf29f3c4f107cd8aa701265176acc39d7b3a75949c402c1/pandaSDMX-0.2.2-py2.py3-none-any.whl
2015-06-12 09:29:19.452406,https://files.pythonho
@di
di / compromised-download-counts.sql
Created August 24, 2022 20:57
BigQuery query to measure download counts of projects compromised by PyPI's phishing attack
# Using https://packaging.python.org/en/latest/guides/analyzing-pypi-package-downloads/
SELECT
file.project,
file.version,
COUNT(*) AS total_downloads
FROM
`bigquery-public-data.pypi.file_downloads`
WHERE
file.project IN ('exotel',
'spam',
starting build "10cc9d38-4ba5-481e-a1a2-a0343996f105"
FETCHSOURCE
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint:
hint: git config --global init.defaultBranch <name>
hint:
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
@di
di / specifiers.py
Created July 15, 2020 20:59
Specifier vs LegacySpecifier analysis
import csv
from collections import defaultdict
import packaging.requirements
totals = defaultdict(int)
with open('specifiers.csv') as f:
reader = csv.reader(f)
@di
di / specifiers.py
Created July 15, 2020 20:57
Specifier vs LegacySpecifier analysis
This file has been truncated, but you can view the full file.
"Documentation, https://github.com/keystroke3/redpaper/wiki",1
django-notifications-hq (>=1.0),5
"Documentation, https://django-model-revisioning.readthedocs.io",4
"Release Management, https://github.com/pycontribs/a2h/releases",1
trixi-slim (>0.1.2.1) ; extra == 'full',1
thespian (==3.5.2),2
pantsbuild.pants.contrib.node (==1.18.0rc1),1
mailinglogger,3
tabulator (>=1.38),1
smmap (>=0.8.0),2
@di
di / all_versions.sql
Created July 15, 2020 19:55
Version vs LegacyVersion analysis
select
version,
count(version),
max(created) as version_count
from
releases
group by
version
order by
version_count desc;
(env) /tmp $ python --version
Python 2.7.14
(env) /tmp $ python -c "import html"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named html
(env) /tmp $ pip install future
Collecting future
Installing collected packages: future
Successfully installed future-0.17.0
@di
di / app.py
Created October 31, 2016 17:59
simple flask server which receives files and stores them locally
import os
from flask import Flask, request
from werkzeug.utils import secure_filename
app = Flask(__name__)
app.config['UPLOAD_FOLDER'] = '.'
@app.route('/', methods=['POST'])
def upload_file():
file = request.files['filedata']
@di
di / coins.py
Created December 4, 2015 15:38
consolidated coins script
import cv2
import numpy as np
img = cv2.imread("coins.png", cv2.IMREAD_GRAYSCALE)
circles = cv2.HoughCircles(
img,
cv2.cv.CV_HOUGH_GRADIENT,
dp=1.5,
minDist=30,

Keybase proof

I hereby claim:

  • I am di on github.
  • I am dustingram (https://keybase.io/dustingram) on keybase.
  • I have a public key whose fingerprint is 321D E2BA 9BA7 5C06 AF95 53F6 93D2 B8D4 930A 5E39

To claim this, I am signing this object: