Skip to content

Instantly share code, notes, and snippets.

Avatar

Rick Herrick rherrick

  • Neuroinformatics Research Group
  • St. Louis, Missouri
View GitHub Profile
@rherrick
rherrick / failing-daemon-609609.out.log
Created Mar 17, 2021
Gradle debug output from building xnat-data-models with com.palantir.git-version
View failing-daemon-609609.out.log
2021-03-17T11:01:10.720-0500 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonMain] Assuming the daemon was started with following jvm opts: [-XX:+CMSClassUnloadingEnabled, -Xms256m, -Xmx2g, -Dfile.encoding=UTF-8, -Duser.country=US, -Duser.language=en, -Duser.variant]
2021-03-17T11:01:10.778-0500 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=d5d1f199-5814-4fea-b2fc-c62d1b9bb78f,javaHome=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64,daemonRegistryDir=/home/jenkins/.gradle/daemon,pid=609609,idleTimeout=120000,priority=NORMAL,daemonOpts=-XX:+CMSClassUnloadingEnabled,-Xms256m,-Xmx2g,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
2021-03-17T11:01:10.788-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface ens192
2021-03-17T11:01:10.788-0500 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
2021-03-17T11:01
@rherrick
rherrick / Anonymizer.groovy
Created Sep 21, 2020
A script that pulls in the XNAT Mizer library and DicomEdit 4 and 6 and applies an anonymization script to DICOM files. Requires Groovy installation. Save this file as Anonymizer.groovy, make it executable (e.g. chmod +x Anonymizer.groovy), then run it.
View Anonymizer.groovy
#!/usr/bin/env groovy
@GrabConfig(systemClassLoader = true)
@GrabResolver(name = "NRG Release Repo", root = "https://nrgxnat.jfrog.io/nrgxnat/libs-release")
@GrabResolver(name = "NRG Snapshot Repo", root = "https://nrgxnat.jfrog.io/nrgxnat/libs-snapshot")
@Grapes([
@GrabExclude("org.slf4j:slf4j-simple"),
@GrabExclude("org.slf4j:slf4j-log4j12"),
@Grab("info.picocli:picocli:4.5.1"),
@Grab("ch.qos.logback:logback-classic:1.2.3"),
@Grab("org.nrg.dicom:mizer:1.2.0-SNAPSHOT"),
@rherrick
rherrick / get-resources.sh
Created Sep 20, 2020
Get resource files from XNAT dataset collection
View get-resources.sh
#!/usr/bin/env bash
showHelp() {
echo
echo "Usage: ${0} --server <URL> --username <USER> --password <PASSWORD> --project <PROJECT> --collection <COLLECTION_ID>"
echo
echo "Note: all options are required, with the exception of --password. If --password"
echo " is omitted, you must enter your password when the script runs."
echo
exit 255
@rherrick
rherrick / 2019-03-28T18_22_05_888Z-debug.log
Created Mar 28, 2019
Failure when launching test node app
View 2019-03-28T18_22_05_888Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ '/Users/username/.nvm/versions/node/v10.15.3/bin/node',
1 verbose cli '/Users/username/.nvm/versions/node/v10.15.3/bin/npm',
1 verbose cli 'run',
1 verbose cli 'dev' ]
2 info using npm@6.4.1
3 info using node@v10.15.3
4 verbose run-script [ 'predev', 'dev', 'postdev' ]
5 info lifecycle @~predev: @
6 info lifecycle @~dev: @
@rherrick
rherrick / Main.java
Created Dec 19, 2018
Refactor of advent day 1 code
View Main.java
package com.nerdnetworks;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashSet;
import java.util.Set;
import java.util.concurrent.atomic.AtomicInteger;
public class Main {
@rherrick
rherrick / add-to-java-cacerts.sh
Created May 10, 2018
Shows failure to install Charles proxy cert on Java 10 JDK on OS X
View add-to-java-cacerts.sh
decker:Internet Plug-Ins root# JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home $(find /Applications/Charles.app/Contents/ -name "*.command")
############################################
Charles Root Certificate Java VM Import Tool
############################################
This tool imports your Charles Root Certificate into the Java VMs that it finds on
your computer, so that Java applications trust your Charles Root Certificate for
SSL Proxying.
@rherrick
rherrick / build.gradle
Last active Feb 27, 2018
Repositories element without dcm4che repo for XNAT pom.xml and build.gradle files. Note that the repositories block in build.gradle should _not_ be applied to a repositories block inside a buildscript block, only to the standard repositories block.
View build.gradle
repositories {
mavenLocal()
maven {
url "http://maven.imagej.net/content/groups/public"
name "ImageJ Maven Repository"
}
jcenter()
mavenCentral()
maven {
url "https://nrgxnat.jfrog.io/nrgxnat/libs-release"
@rherrick
rherrick / build.gradle
Created Dec 8, 2017
Simple configuration of Javadoc coverage doclet for Gradle
View build.gradle
configurations {
// Other configuration lines might be in here
javadocCoverage
}
dependencies {
// Your application's other dependencies go here.
javadocCoverage "com.manoelcampos:javadoc-coverage:1.1.0"
}
@rherrick
rherrick / xnat-ext-1.7.4-SNAPSHOT.gradle
Last active Aug 17, 2017
External Gradle configuration
View xnat-ext-1.7.4-SNAPSHOT.gradle
apply plugin: "jacoco"
ext.propertyWithDefault = { String name, def value ->
hasProperty(name) ? property(name) : value
}
dependencyManagement.imports {
mavenBom "org.nrg:parent:${vXnat}"
}
@rherrick
rherrick / create_recon.sh
Last active Jul 24, 2017
Create XNAT image reconstruction then update to include manually added files
View create_recon.sh
# Get a session
http --auth admin:minda --session=admin xnat164.xnat.org/data/projects
# Create the reconstruction and resource folder
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001 xnat:reconstructedImageData/type==RECON_A
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/resources/NIFTI format==NIFTI
# Upload NIFTI and JSON to the reconstruction resource
for SERIES in t1_mpr_1mm_p2_pos50_20061214091206_4 t1_mpr_1mm_p2_pos50_20061214091206_5 t2_spc_1mm_p2_20061214091206_6; do
http --session=admin PUT xnat164.xnat.org/data/archive/projects/prj001/subjects/prj001_001/experiments/prj001_001_MR2/reconstructions/prj001_001_MR2_recon_001/resources/NIFTI/files/${SERIES}.nii.gz inbody==true < ${SERIES}.nii.gz