Skip to content

Instantly share code, notes, and snippets.

View rdnajac's full-sized avatar

Ryan D. Najac rdnajac

View GitHub Profile
@rdnajac
rdnajac / glaciertool.py
Last active November 18, 2024 17:30
Wrapper script for interacting with AWS S3 Glacier objects (requires boto3 library and assumes AWS CLI already configured)
#!/usr/bin/env python3
import boto3 # pip install boto3
import argparse
from urllib.parse import urlparse
from botocore.exceptions import ClientError
# Initialize S3 client
s3_client = boto3.client("s3")
@rdnajac
rdnajac / pubmed-recent-publications.js
Last active November 13, 2024 03:31
This script fetches and renders recent publications by a specified author using the PubMed E-Utilities (E-Utils) API. The retrieved publication data is then rendered into a webpage, displaying key information like the title, authors, journal, year, DOI, and PubMed link.
/**
* @constant {number} MAX_NUM_PUBS
* @description Specifies the maximum number of publications to fetch from PubMed.
* Adjust this value to limit the number of results (valid options are 10, 20, 50, 100, or 200).
*/
const MAX_NUM_PUBS = 10;
/**
* @function fetchPublications
* @description Fetches a list of publications from PubMed using E-Utilities, based on the provided author's name.
@rdnajac
rdnajac / install_RStudioServer.bash
Created August 6, 2024 17:05
Installation script for RStudioServer
#!/bin/bash
## Install R, bspm and RStudio Server on Ubuntu 20.04 or 22.04 (focal or jammy).
##
## Install via ssh with:
## ssh -i "RStudioServerKey.pem" ubuntu@ec2-instance 'sudo bash -s' < $THIS_SCRIPT
##
## Note that RStudio Server starts immediately after installation.
## Access it via http://ec2-xx-xx-xx-xx.eu-central-1.compute.amazonaws.com:8787
@rdnajac
rdnajac / my_scheduler.c
Created August 6, 2024 15:11
Linux Scheduler Class
// SPDX-License-Identifier: GPL-2.0-only
/*
* Generic entry points and implementation of Linux a scheduling class.
*/
#include "sched.h"
#include <linux/sched/myscheduler.h>
#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/sched/task.h>
@rdnajac
rdnajac / debug_EZFS.c
Created February 9, 2024 20:39
debugging tool for EZFS
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <unistd.h>
#include <fcntl.h>