Skip to content

Instantly share code, notes, and snippets.

@robkooper
robkooper / qr.sh
Created December 12, 2022 15:35
Script to create a QR code using qrcode-tiger.com
!/bin/bash
# https://www.qrcode-tiger.com/api-documentation
# /api/qr/static
API_KEY="SECRET"
FRAME_COLOR="#054080"
EYE_COLOR="#ff6500"
@robkooper
robkooper / flavor.gp.kube.sh
Created October 24, 2022 14:21
convert kube cluster from m1 to gp flavors
#!/bin/bash
. ~/Work/radiant/openstack.sh
export OS_CLOUD=cinet
kubectx cinet
for n in $(kubectl get no | awk '/controlplane/ { print $1}'); do
echo "-- $n"
FLAVOR=$(openstack server show $n | awk '/flavor/ { print $4}')
@robkooper
robkooper / markdown.js
Created October 19, 2022 18:11
markdown renderer for clowder, place the files in a folder .../custom/public/javascripts/previewers/markdown
(function($, Configuration) {
// Preserve these in our current scope
var initialTab = Configuration.tab;
var initialID = Configuration.id;
var initialPreviewer = Configuration.previewer;
// add div for markdown
$(initialTab).append("<div id=\"markdown\"></div>");
// load the script
@robkooper
robkooper / ingressroute.yaml
Last active October 5, 2022 21:35
Watch IngressRoute for Traefik and use certmanager to create the certificates. This should allow us to run multiple instances of traefik.
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard
namespace: traefik
spec:
entryPoints:
- websecure
routes:
- match: Host(`traefik.example.com`)

CLOWDER PROJECT Contributor License Agreement

Thank you for your interest in contributing to the Clowder Project. In order to contribute, you will need to provide your name and contact information and sign this Clowder Project Contributor License Agreement, which sets for the terms and conditions of the intellectual property license granted with your contributions.

This Clowder Project Contributor License Agreement (“Agreement”) is by and between you (any person or entity “You” or “Your”) and The Board of Trustees of the University of Illinois, through its National Center for Supercomputing Applications (“Illinois”). Please read this document carefully before signing and keep a copy for your records . By signing this Agreement or making a “Contribution” to the “Clowder Project” as defined below, You agree to the following:

  1. “Clowder Project” is an open-source project that aims to simplify the management of research data. Clowder provides tools to manage the full lifecycle of research data; scalable w
@robkooper
robkooper / pull.sh
Last active January 31, 2022 18:56
pull layers of image. if you need to access a private image, add `-u "username:password"` to the login curl commands.
#!/bin/bash
# SERVER="https://harbor.example.com
# SERVICE="harbor-registry"
SERVER="https://registry.hub.docker.com"
SERVICE="registry.docker.io"
IMAGE="library/busybox"
TAG="latest"
@robkooper
robkooper / kubeconfig.sh
Last active April 26, 2023 20:54
Connect to rancher and get all your kubeconfigs into a single config file. This will save your docker-desktop, rancher-desktop and rancher (if any exist) configurations. This will cleanup your api keys in rancher as well.
#!/bin/bash
CURRENT=$(kubectl config current-context)
USERTOKEN="supersecretapitoken"
RANCHERENDPOINT=https://gonzo-rancher.ncsa.illinois.edu/v3
CLUSTERS=$(curl -s -u $USERTOKEN $RANCHERENDPOINT/clusters -H 'content-type: application/json' | jq -c '.data[] | {"name":.name, "id": .id}' | sort)
# cleanup
rm -f kubeconfig
@robkooper
robkooper / clowder.license.md
Last active November 4, 2021 17:32
this describes how to manually change the license for all files/datasets in clowder

Pick your license, copy to the script at the end, and update the database. For large databases this can take some time, but should not impact clowder.

Custom Licsens

Custom license, the default. If you set rightsHolder to be "" it will default to the uploader. Set m_allowDownload to true (allow downloads) or false (no downloads except admins and owner).

var license={
  "licenseData": {
    "m_licenseType" : "license1",
@robkooper
robkooper / diagram.py
Created October 23, 2021 19:06
using diragrams to crate an image of the PEcAn infrastructure
#!/usr/bin/env python
from urllib.request import urlretrieve
from diagrams import Diagram, Cluster, Edge
from diagrams.custom import Custom
from diagrams.generic.storage import Storage
from diagrams.onprem.queue import Rabbitmq
from diagrams.onprem.network import Traefik
from diagrams.onprem.database import Postgresql
@robkooper
robkooper / pecan.py
Last active January 28, 2021 05:42
example python code using the pecan api
import sys
import time
import requests
# pecan-api-1
# server = "http://141.142.216.73"
# pecan-api-2
server = "http://141.142.218.196"