Skip to content

Instantly share code, notes, and snippets.

View markpbaggett's full-sized avatar

Mark Baggett markpbaggett

View GitHub Profile
@markpbaggett
markpbaggett / ark.py
Created August 5, 2025 19:54
Code to generate arks
import csv
import requests
import os
class EZIDARKGenerator:
def __init__(self, shoulder_url='https://ezid.cdlib.org/shoulder/ark:/81423/d2'):
self.url = shoulder_url
self.headers = {'Content-Type': 'text/plain'}
self.auth = (os.getenv("EZID_USER"), os.getenv("EZID_PASSWORD"))
@markpbaggett
markpbaggett / metadata.json
Created July 31, 2025 14:51
AMC Early Presidents AI Metadata Prompt Return Value
{
"dublin_core": {
"title": {
"value": "suggested title",
"confidence": "high|medium|low",
"reasoning": "explanation of how determined",
"source_text": "relevant excerpt from letter"
},
"creator": {
"value": "author name",
@markpbaggett
markpbaggett / htr.json
Created July 31, 2025 14:49
AMC Early President Prompt Return format
{
"extracted_text": "full text content",
"confidence_assesment": "high/medium/low",
"legibility_notes": "any notes about difficult to read sections"
}
@markpbaggett
markpbaggett / get_files.py
Last active July 21, 2025 15:55
Download Best Files from an Avalon Work and Prep for Whisper
import requests
import os
from tqdm import tqdm
import math
import subprocess
from subprocess import CalledProcessError
from csv import DictWriter
class AvalonBase:
@markpbaggett
markpbaggett / aspectratio.py
Last active July 8, 2025 11:53
Get Files not Matching Aspect Ratio
from PIL import Image
import os
class AMCItem:
def __init__(self, path, files):
self.path = path
self.files = sorted(files)
self.ignore = {self.files[0]}
self.target_ratio = self.get_target_aspect_ratio(f"{path}/{self.files[0]}")
@markpbaggett
markpbaggett / new_with_better_tail.py
Last active July 1, 2025 21:43
This attempts to rekick the Fedora pod assuming karaf.log stopping is a sign that something is wrong.
import subprocess
import time
import threading
from time import sleep
timeout_seconds = 30
switch_context = [
"kubectl",
"config",
"use-context",
@markpbaggett
markpbaggett / git.sh
Last active June 17, 2025 14:21
Corina Github Cheat Sheet
# If you are on main, checkout a new branch.
git checkout -b a-new-branch-name-that-has-not-been-used
# After you have a branch, you'll do these things:
git status # Shows you which files changed
git diff # This will show which things in a file changed
git add directory/file.ext # Adds a file so it can be committedd
git commit -m "What I changed." # Commits a file
git push origin the-branch-you-are-on # Look at the thing in red for a hint here. Make sure it doesn't say main or master.
{
"audrey-import":{
"ingestType":"SAF",
"isHeadless":true,
"repositories": [{
"name": "audrey import",
"type": "FEDORA_PCDM",
"settings": [{
"key": "repoUrl",
"values": [
@markpbaggett
markpbaggett / all_collections.json
Last active June 9, 2025 19:51
Testing All Collections
{
"responseHeader": {
"status": 0,
"QTime": 1,
"params": {
"q": "*:*",
"facet.field": "collection",
"indent": "true",
"rows": "0",
"facet": "true"
@markpbaggett
markpbaggett / link-to-image.md
Last active April 22, 2025 16:49
Claude Request and Output with Sonnet 3.7