Skip to content

Instantly share code, notes, and snippets.

View brucehoff's full-sized avatar

Bruce Hoff brucehoff

  • Sage Bionetworks
  • Seattle
View GitHub Profile
@brucehoff
brucehoff / copyWikis.R
Last active August 29, 2015 14:10 — forked from brian-bot/copyWikis.R
#####
## FUNCTION FOR COPYING ALL SYNAPSE WIKI CONTENT (AND SUBPAGES) FROM ONE OWNER RESOURCE TO ANOTHER
## AUTHOR: BRIAN M. BOT
#####
## ARGUMENTS:
## oldOwnerId - the Synapse ID of the resource (e.g. Project) to copy the wiki content from
## newOwnerId - the Synapse ID of the resource (e.g. Project) to copy the wiki content to
#####
## VALUE:
## Silently returns the Wiki headers from the new owner
library(digest)
library(synapseClient)
getStorageLocationId<-function(projectId) {
synRestGET(sprintf("/projectSettings/%s/type/upload", projectId))$locations
}
# For a file that's been uploaded to an S3 bucket associated with a Synapse project, this creates
# a FileEntity in the project.
@brucehoff
brucehoff / exportEmail.py
Last active July 11, 2017 20:04
Python script to export email addresses
#
# This script downloads name and email information for a Synapse Team
#
# usage: python exportEmail.py -u <synapse-username> -p <synapse-password> -t <team-name> -f <output-filepath>
# If <team-name> includes spaces then enclose the name with quotes
#
# To install the Synapse Python client see: http://docs.synapse.org/python/#installation
#
import synapseclient
import argparse
##
## Activate the correct R version.
##
# This script is used by many Jenkins jobs that have to switch between two version of R when running a 'matrix' of builds
# There are two inputs, 'label' which indicates a platform (Linux, MacOS or Windows) and RVERS (e.g. 3.4).
#
## export the jenkins-defined environment variables
export label
export RVERS
# This script, when run from Jenkins, takes as input the artifacts generated by an "*_artifacts" job and publishes the R packages
# Sage Bionetworks 'ran' repository. Users can then install the packages using the commmand:
# install.packages(<package-name>, repos="https://sage-bionetworks.github.io/ran")
## unpack the artifact
rm -rf unpacked
mkdir unpacked
unzip *.zip -d unpacked
REPO_NAME=ran
{"keys":[{"kid":"W7NN:WLJT:J5RK:L7TL:T7L7:3VX6:JEOU:644R:U3IX:5KZ2:7ZCK:FPTH","kty":"RS256","use":"SIGNATURE","concreteType":"org.sagebionetworks.repo.model.oauth.JsonWebKeyRSA","e":"65537","n":"23849945482965474905145517268643374920797943471323985175965744145737716565974743372430224111712427375247329399083025816245758319370417823556150277277108206652909956951038779719911852573197057021578055098390526471329800633323810194331080461575761929434803674679324161848934212115408664545557149085782355814220300934332546841936281140526074557863136209882049706193681336920386488318165861734677089379383062612396288597494008262190644212623312133588769704107491411726875356548977535231883438734129050591099689225763743937356377342527223979976407213258598569748635314939347146403284906522122994148568855913460554935920381"}]}
{"keys":[{"kid":"W7NN:WLJT:J5RK:L7TL:T7L7:3VX6:JEOU:644R:U3IX:5KZ2:7ZCK:FPTH","kty":"RSA","use":"sig","concreteType":"org.sagebionetworks.repo.model.oauth.JsonWebKeyRSA","e":"AQAB","n":"ALztjtBAwij1AE12ZRMf7pm1yPx-1o5KKzEpmM0KBwTitpKpYPRrYp8PH0Wepoxrc8yVRfXtKksLeeLf5WPiSKMTYLjA5hYrVX2VhjroWEMoCOC7FIebJR4uzCQDIaIumeszkiWa4VGM5FidEDMVVfQ31DfdPhDzKfCct66JBZ59I_iB2NoTsDkMig6tobGeEvZctBjEAAz65CBRuvTC6xlXDwx_Fl9eTo2wIMa2Ncd-_c4srG-uM3DayJ5GUAeFQ564CKceUksl6f5P5EdXVgQGMs-LbwVCJUSLSpvfcBTZv92wjKsyo1CorRcbBq-gTzXR0wrQ0LnsVid_F1tFZv0="}]}
@brucehoff
brucehoff / staging-openid-configuration.json
Created January 30, 2020 20:38
Modified copy of the Synapse Staging Open ID Connect Configuration Document
{
"issuer": "https://repo-staging.prod.sagebase.org/auth/v1",
"authorization_endpoint": "https://staging-signin.synapse.org",
"token_endpoint": "https://repo-staging.prod.sagebase.org/auth/v1/oauth2/token",
"userinfo_endpoint": "https://repo-staging.prod.sagebase.org/auth/v1/oauth2/userinfo",
"jwks_uri": "https://repo-staging.prod.sagebase.org/auth/v1/oauth2/jwks",
"registration_endpoint": "https://repo-staging.prod.sagebase.org/auth/v1/oauth2/client",
"scopes_supported": [
"openid"
],