Skip to content

Instantly share code, notes, and snippets.

View DonRichards's full-sized avatar

Don Richards DonRichards

  • Johns Hopkins University
  • Knoxville, TN
  • 20:00 (UTC -05:00)
  • X @highlander411
View GitHub Profile
@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
@DonRichards
DonRichards / README.md
Last active August 20, 2024 12:30
Islandora Isle-DC Service Discovery and Network Check Troubleshooting Script

Islandora Isle-DC Service Discovery and Network Check Script (DRAFT)

This script is designed to verify the network configuration and DNS resolution of services running in Docker containers specifically within an Islandora Isle-DC environment. It helps ensure that all microservices and components in the Isle-DC stack are correctly connected and communicating.

Features

  • Service Discovery: Automatically identifies services defined in your docker-compose.yml file for Isle-DC.
  • Network Validation: Checks if each Isle-DC service is connected to the correct Docker network.
  • Ping Tests: Performs ping tests between all running Isle-DC services to verify inter-container communication.
  • DNS Resolution: Ensures that DNS is properly configured and resolves between services in the Isle-DC environment.
@DonRichards
DonRichards / server_specs_and_performance.sh
Created July 23, 2024 14:35
Summary of a server's hardware specifications and performance metrics
#!/bin/bash
# Description:
# server_specs_and_performance.sh is a comprehensive shell script designed to provide an easy-to-read
# summary of a server's hardware specifications and performance metrics. Specifically, the script:
#
# 1. Benchmarks CPU and I/O performance:
# - Runs `vmstat` every 5 seconds for 1 minute to collect performance metrics.
# - Analyzes metrics such as `r`, `us`, `sy`, `id`, `wa`, `bi`, and `bo` to determine if there are
# potential issues with CPU or disk I/O performance.