Skip to content

Instantly share code, notes, and snippets.

View jspeed-meyers's full-sized avatar

John Speed Meyers jspeed-meyers

View GitHub Profile
@jspeed-meyers
jspeed-meyers / nvidia-pytorch-package-list
Created March 14, 2024 17:08
NIVIDIA PyTorch image (nvcr.io/nvidia/pytorch:24.02-py3) component list (using syft)
➜ ~ syft nvcr.io/nvidia/pytorch:24.02-py3
✔ Pulled image
✔ Loaded image nvcr.io/nvidia/pytorch:24.02-py3
✔ Parsed image sha256:43fcc1b74fd54c3598c3c3d569c7ec4f6e93dc78adad06e38783c95e1bfd5c94
✔ Cataloged contents 57fd547447043b585ed68a43a7f1dfd3d01ea25c821df0b032b9da79ab82a385
├── ✔ Packages [892 packages]
├── ✔ File digests [14,449 files]
├── ✔ File metadata [14,449 locations]
└── ✔ Executables [2,759 executables]
[0432] WARN cataloger failed cataloger=javascript-package-cataloger error=failed to parse package.json file: json: cannot unmarshal s
@jspeed-meyers
jspeed-meyers / gist:919cc9bd3181568d21d60af22a463384
Created March 14, 2024 16:56
Chainguard PyTorch image (cgr.dev./chainguard/pytorch-cuda12) component list (using syft)
syft --platform linux/amd64 cgr.dev/chainguard/pytorch-cuda12
✔ Pulled image
✔ Loaded image cgr.dev/chainguard/pytorch-cuda12:latest
✔ Parsed image sha256:fde1b4b832c4dd0008ba8a49ac886ada4b3bbf3248b438f893e42664d29c9e07
✔ Cataloged contents efb7865bb45355ec5582bd8e02f1b14792c03cfdade52b6b1214e8eaf88ac99c
├── ✔ Packages [69 packages]
├── ✔ File digests [19,193 files]
├── ✔ File metadata [19,193 locations]
└── ✔ Executables [432 executables]
NAME VERSION TYPE
@jspeed-meyers
jspeed-meyers / ironbank_json_creation.py
Last active January 9, 2024 19:12
Create JSON listing ironbank images
import json
import pandas as pd
import requests
YOUR_SHEET_ID = "1ifFaQyNfgC-V0AnubYm9P3btkNwN9rXJNAHiauflHV4"
CSV_URL = f"https://docs.google.com/spreadsheet/ccc?key={YOUR_SHEET_ID}&output=csv"
res = requests.get(url=CSV_URL)
with open("image-names.csv", "wb") as data:
@jspeed-meyers
jspeed-meyers / summarize_funder_finder_data.py
Created August 10, 2023 01:04
Summarize funder finder data collected for top python packages
import json
import pandas as pd
pd.options.display.float_format = '{:.4f}'.format
with open("funder_finder_results.jsonl") as f:
df = pd.DataFrame(json.loads(line) for line in f)
#print(df.info())
#print(df.type.value_counts())
#print(pd.crosstab(df.type, df.funding_type))
@jspeed-meyers
jspeed-meyers / import_funder_finder_jsonl_results.py
Created August 10, 2023 00:37
Create a pandas dataframe from the funder finder jsonl results
import json
import pandas as pd
with open("funder_finder_results.jsonl") as f:
df = pd.DataFrame(json.loads(line) for line in f)
@jspeed-meyers
jspeed-meyers / analyze_pyup_io_safety_db.py
Created May 28, 2023 23:26
# find number of top 1000 python packages that have one or more CVEs
# find number of top 1000 python packages that have one or more CVEs
import json
# find all packages with a CVE
# Open the JSON file
with open("pyup_io_safety_db_python_cve.json") as file:
# Load the JSON data
data = json.load(file)
@jspeed-meyers
jspeed-meyers / run_funder_finder_on_repos.py
Created May 28, 2023 23:03
Collect funder finder data from multiple repos into a single CSV. Each line is one type of a contribution to one particular repo
# collect data from multiple repos into a CSV. Each line is one type of a contribution to
# one particular repo
import json
import os
def run_python_command(command):
# Execute the command and capture the output
output = os.popen(command).read().strip()
@jspeed-meyers
jspeed-meyers / funder_finder_results.jsonl
Created May 28, 2023 20:04
This is JSONL file with all the funder finder results. Each line in one funding source for one repo. A single repo can have multiple funding sources. A repo can also have no funding sources
{"funding_type": "individual", "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https://github.com/pytest-dev/execnet"}
{"funding_type": "organizational", "num_contributors": 5, "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https://github.com/ipython/comm"}
{"funding_type": "individual", "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https://github.com/scrapy/cssselect"}
{"funding_type": "individual", "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https://github.com/horejsek/python-fastjsonschema"}
{"funding_type": "individual", "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https://github.com/pytest-dev/py"}
{"funding_type": "individual", "type": "Github Sponsors", "is_funded": true, "date_of_data_collection": "2023-05-28", "repo_name": "https:
@jspeed-meyers
jspeed-meyers / deps2repos_python_output_post_filtering.txt
Last active May 28, 2023 19:50
deps2repos top Python package URLs after filtering
https://github.com/pytest-dev/execnet
https://github.com/ipython/comm
https://github.com/scrapy/cssselect
https://github.com/confluentinc/confluent-kafka-python
https://github.com/explosion/cymem
https://github.com/sighingnow/libclang
https://github.com/rbarrois/python-semanticversion
https://github.com/horejsek/python-fastjsonschema
https://github.com/pytest-dev/py
https://github.com/html5lib/html5lib-python
@jspeed-meyers
jspeed-meyers / filter_deps2repos_python_output.py
Created May 12, 2023 20:31
Filter GitHub URLS returned from deps2repos for top python packages
"""Filter deps2repos output for top python package GitHub URLs"""
input_filename = "pypi_repo_deps2repos_output.txt"
output_filename = "deps2repos_output_post_filtering.txt"
# read in output of deps2repos
with open(input_filename, "r") as file:
# only start collecting data on the 79th line because
# the early information is about repos lacking GitHub
# repos