Skip to content

Instantly share code, notes, and snippets.

View DonRichards's full-sized avatar

Don Richards DonRichards

  • Johns Hopkins University
  • Knoxville, TN
  • 02:59 (UTC -05:00)
  • X @highlander411
View GitHub Profile
@DonRichards
DonRichards / README.md
Created February 25, 2025 22:03
This is an example of a Notepad for Cursor IDE for a containerized drupal setup.

WIthin Cursor click the + character next to notepads in the left column.

Description:

Give it a name that describes to the LLM what it's for like "drupal-developer"

Give it a useful description:

maintaining a clean, scalable, and secure Drupal codebase in a Composer-managed, containerized environment while following best practices for development, theming, and database interactions

What files to point at:

Globs: codebase/*

@DonRichards
DonRichards / Dockerfile
Last active November 19, 2024 17:52
Idea for making a Section 508 compliant PDF (prototype)
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Install dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
tesseract-ocr \
@DonRichards
DonRichards / upgrade_6_2_extras.sh
Last active October 15, 2024 21:08
Enable Plugins for testing on Dataverse v6.2 (draft)
#!/bin/bash
# Globals
DOMAIN="dataverse-clone.mse.jhu.edu"
PAYARA="/usr/local/payara"
CURRENT_VERSION="6.2"
DATAVERSE_USER="dataverse"
PAYARA_EXPORT_LINE="export PAYARA=\"$PAYARA\""
BAGIT_NUMBER_OF_THREADS=10
@DonRichards
DonRichards / upgrade_5_14_to_6_0.sh
Last active October 17, 2024 18:58
Upgrade Dataverse v5.14 to v6.0
#!/bin/bash
# Globals
DOMAIN="dataverse-clone.mse.jhu.edu"
PAYARA_OLD="/usr/local/payara5"
PAYARA_NEW="/usr/local/payara6"
JAVA_UPGRADE_SCRIPT_URL="https://gist.github.com/DonRichards/cb992523a5ec588f1fb978d752d0d030/raw/upgrade_java.sh"
PAYARA_ZIP_URL="https://nexus.payara.fish/repository/payara-community/fish/payara/distributions/payara/6.2023.8/payara-6.2023.8.zip"
DATAVERSE_WAR_URL="https://github.com/IQSS/dataverse/releases/download/v6.0/dataverse-6.0.war"
SOLR_TAR_URL="https://archive.apache.org/dist/solr/solr/9.3.0/solr-9.3.0.tgz"
@DonRichards
DonRichards / upgrade_6_1_to_6_2.sh
Last active October 17, 2024 18:59
Upgrade Dataverse v6.1 to v6.2
#!/bin/bash
# Used release to generate this: https://github.com/IQSS/dataverse/releases/tag/v6.2
# Globals
DOMAIN="dataverse-clone.mse.jhu.edu"
PAYARA="/usr/local/payara"
SOLR_SCHEMA_URL="https://raw.githubusercontent.com/IQSS/dataverse/v6.2/conf/solr/9.3.0/schema.xml"
SOLR_SCHEMA_FILE=$(basename "$SOLR_SCHEMA_URL")
DATAVERSE_WAR_URL="https://github.com/IQSS/dataverse/releases/download/v6.2/dataverse-6.2.war"
DATAVERSE_WAR_FILE="/home/dataverse/dataverse-6.2.war"
@DonRichards
DonRichards / upgrade_6_0_to_6_1.sh
Last active October 17, 2024 18:58
Upgrade Dataverse v6.0 to v6.1
#!/bin/bash
# Globals
DOMAIN="dataverse-clone.mse.jhu.edu"
PAYARA="/usr/local/payara"
DATAVERSE_WAR_URL="https://github.com/IQSS/dataverse/releases/download/v6.1/dataverse-6.1.war"
DATAVERSE_WAR_FILE="/home/dataverse/dataverse-6.1.war"
DATAVERSE_WAR_HASH="c6e931a7498c9d560782378d62b9444699d72b9c28f82f840ec4a4ba04b72771"
GEOSPATIAL_URL="https://github.com/IQSS/dataverse/releases/download/v6.1/geospatial.tsv"
GEOSPATIAL_FILE="/tmp/geospatial.tsv"
@DonRichards
DonRichards / measure_video_load.js
Created October 1, 2024 20:09
How long does a video page take to load
// npm install puppeteer
// node measure_video_load.js https://digital.library.jhu.edu/islandora/dumb-show
const puppeteer = require('puppeteer');
(async () => {
// Get the URL from command-line arguments
const url = process.argv[2]; // The URL is the third argument in the command line (0 = node, 1 = script name, 2 = URL)
if (!url) {
console.error('Please provide a URL as an argument.');
@DonRichards
DonRichards / upgrade_java.sh
Last active October 14, 2024 18:00
Upgrade for Java version for a IQSS/dataverse upgrade.
#!/bin/bash
# Configurable variables
TARGET_JAVA_VERSION="17"
LOGFILE="java_upgrade.log"
# Function to log and print messages
log() {
echo "$(date +"%Y-%m-%d %H:%M:%S") - $1" | tee -a "$LOGFILE"
}
@DonRichards
DonRichards / README.md
Created August 27, 2024 13:51
Commands to test Isle-dc (DRAFT)

Testing Fits:

Download file onto Alpaca,

curl -v -F "datafile=@/opt/alpaca/G3844_B2_G4_1972_c1_back_0.jp2" "http://fits:8080/fits/examine"

Test houdini(Image Conversion):

curl -v -F "source=@/opt/alpaca/G3844_B2_G4_1972_c1_back_0.jp2" -F "destination=test_output.jp2" -F "args=-depth 8" "http://houdini:8000/convert"
curl -v -F "source=@/opt/alpaca/G3844_B2_G4_1972_c1_back_0.jp2" -F "destination=test_output.tif" -F "args=-depth 8 -compress none" -H "Apix-Ldp-Resource: true" "http://houdini:8000/convert"
@DonRichards
DonRichards / Islandora Drupal Engineer ChatGPT Prompt
Last active November 5, 2024 14:35
Islandora Drupal Engineer ChatGPT
**Islandora Drupal Engineer GPT Instructions**
You are a 'GPT' – a version of ChatGPT customized to assist with Drupal software engineering, specializing in Islandora development. You provide expert guidance on development, setup, and maintenance related to Islandora, Drupal, and the Fedora Commons Repository. You also help users resolve issues and answer questions related to Islandora Workbench. Your role includes handling database queries, code debugging, and offering advice on module development and configuration.
You have access to several reference files that are essential to your task. You will dynamically use these files to ensure accurate and detailed answers to all user queries.
### **Files Available for Reference**
- **Islandora_Drupal_Engineer_Prompt.md**: This file contains tips, tricks, and best practices for Islandora development. Use it for advanced troubleshooting, module setup, and system optimization. When questions regarding the Islandora namespace change to drupal arise, refer users to