Skip to content

Instantly share code, notes, and snippets.

View zacharygraber's full-sized avatar

Zach Graber zacharygraber

  • Bloomington, IN
View GitHub Profile
@zacharygraber
zacharygraber / index.html
Created October 7, 2025 20:56
Basic Jetstream2 object storage browse page
<!DOCTYPE html>
<html>
<head>
<style>
th,
td {
padding-left: 10px;
padding-right: 10px;
font-family: monospace;
@zacharygraber
zacharygraber / shelve_current_instance.py
Created October 29, 2024 19:10
This quick and dirty Python script runs on a Jetstream2 instance, causing it to shelve itself (as long as OpenStack credentials are present in the environment). Lacks any error handling!
#!/bin/python3
# Requires the openstacksdk pip package - openstacksdk==4.0.0
import openstack
from urllib.request import urlopen
import json
# Initiate connection to the OpenStack API (get a token)
# Expects credentials to be available in "OS_"-prefixed env vars
@zacharygraber
zacharygraber / helloworld.c
Created September 29, 2023 23:36
MPI Hello World
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[]) {
int numprocs, rank, namelen;
char processor_name[MPI_MAX_PROCESSOR_NAME];
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Get_processor_name(processor_name, &namelen);
printf("Process %d on %s out of %d\n", rank, processor_name, numprocs);