Skip to content

Instantly share code, notes, and snippets.

View CJCShadowsan's full-sized avatar

Chris Coates CJCShadowsan

View GitHub Profile
apiVersion: batch/v1
kind: CronJob
metadata:
name: check-cert-expiry
namespace: default
spec:
schedule: "0 2 * * *" # Runs daily at 2:00 AM
jobTemplate:
spec:
template:
@CJCShadowsan
CJCShadowsan / hplcalculator.py
Last active July 28, 2025 15:24
HPL.dat calculator - Takes system specs on a single-node basis and calculates N, NB, P, and Q based on available memory and cores
#!/usr/bin/env python3
import math
import psutil
def get_system_info():
# Get the number of physical cores
num_cores = psutil.cpu_count(logical=False)
# Get available physical memory (in bytes)
@CJCShadowsan
CJCShadowsan / SC24ProceedingsDownloader.py
Last active December 3, 2024 13:12
A simple Python script using BeautifulSoup to loop through the PDFs available from the session and download them. Now renames the title of the PDFs based on the title in the publication.
#!/usr/bin/env python3
import time
import random
import os
import requests
from bs4 import BeautifulSoup
from PyPDF2 import PdfReader
# Function to create a directory if it doesn't exist
@CJCShadowsan
CJCShadowsan / lvm-libvirt-install.sh
Created August 8, 2024 14:14
Install KVM and Libvirt on Rocky Linux 9 with bridge networking
#!/bin/bash
## Prerequisites:
# - Rocky Linux 9 install
# - Sudo user setup
## Check virtualisation enabled
cat /proc/cpuinfo | egrep "vmx|svm"
## Ensure up-to-date
sudo dnf upgrade --refresh
@CJCShadowsan
CJCShadowsan / condor-pool.yaml
Created October 6, 2022 07:43
A quick-and-dirty condor pool - From: https://raw.githubusercontent.com/htcondor/htcondor/latest/build/docker/k8s/pool.yaml modified to have smaller requirements for "Devin - The Little Cluster That Could"
# This is the service that names the ip address of the collector
# All pods get an environment variable with this ip in it
apiVersion: v1
kind: Service
metadata:
name: condor
spec:
selector:
htcondor-role: cm
ports: