Skip to content

Instantly share code, notes, and snippets.

@manning-ncsa
manning-ncsa / Dockerfile
Last active October 27, 2023 18:35
This Gist is a sandbox for learning how to use the https://github.com/p1c2u/openapi-core Python library.
FROM python:3
RUN pip install openapi-core
COPY ./ ./

DESaccess login API

Run the desaccess_api_test.py script to test your credentials via the DESaccess login API:

$ python desaccess_api_test.py

# Create a file to define the environment variables as shown below and source it prior to executing this script.

cat < $HOME/.desaccess-credentials

Basic DESaccess login via API

To test the DESaccess login API and general programmatic access pattern, try the following. Define environment variables as shown, inserting your username and password. Then run the Python script to test that you can authenticate and fetch an API access token.

export DESACCESS_API_BASEURL=https://des.ncsa.illinois.edu
export DESACCESS_API_DB=desdr
export DESACCESS_API_USER=
export DESACCESS_API_PASS=
@manning-ncsa
manning-ncsa / Readme.md
Last active September 27, 2022 21:12
DESaccess bulk downloader
@manning-ncsa
manning-ncsa / Readme.rst
Created April 18, 2021 17:59
Syncthing deployment on Kubernetes

Syncthing Device for a Persistent Peer

Overview

Syncthing provides a way to share arbitrary numbers of files between any number of people without the need for a central server. It is a peer-to-peer (P2P) application that automagically syncs files in the background. This deployment app launches a Syncthing "device" (Persistent Peer) that offers a high-availability peer for members of a team to include in their file shares.

For example, imagine there are three people in a team who want to share various folders with each other during the course of their work. They can accomplish this with Syncthing using only their three workstations, by exchanging Device IDs and sharing the folders. However, what if one person modifies or adds a file while the other two are offline, and then that person goes offline before the other two come online? In that event, they would not receive the update. This is where a Persistent Peer is helpful, because in

#!/usr/bin/env python3
import os
import sys
import requests
import time
import json
try:
# Import credentials and config from environment variables