Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am csjx on github.
  • I am csjx (https://keybase.io/csjx) on keybase.
  • I have a public key whose fingerprint is B4EE D58C 7628 9740 9043 5E08 C711 F430 69DC E3B7

To claim this, I am signing this object:

@csjx
csjx / V2NodeListTest.java
Created September 24, 2015 16:37
Some V2 NodeList tests
package org.dataone.tests;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import org.dataone.service.types.v2.NodeList;
[ERROR] 2016-03-13 20:59:46,237 (MNResourceHandler:handle:526) class java.lang.IllegalStateException: Hazelcast Instance is not active!
java.lang.IllegalStateException: Hazelcast Instance is not active!
at com.hazelcast.impl.FactoryImpl.initialChecks(FactoryImpl.java:728)
at com.hazelcast.impl.MProxyImpl.beforeCall(MProxyImpl.java:102)
at com.hazelcast.impl.MProxyImpl.get(MProxyImpl.java:112)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.isAuthoritativeMNodeAdmin(D1NodeService.java:875)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.isAuthorized(D1NodeService.java:1116)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.create(D1NodeService.java:393)
at edu.ucsb.nceas.metacat.dataone.MNodeService.create(MNodeService.java:613)
at edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler.putObject(MNResourceHandler.java:1535)
@csjx
csjx / gist:d856434b50409066118eb90b59f19cc8
Last active August 3, 2016 18:08
CNIdentityLDAPImpl error message
In /var/log/tomcat7/cn.log
[ WARN] 2016-08-03 17:43:06,740 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0002-8121-2341
[ WARN] 2016-08-03 17:43:06,767 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0003-1758-9950
[ WARN] 2016-08-03 17:43:06,791 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0003-2192-431X
[ WARN] 2016-08-03 17:43:06,829 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0002-8121-2341
[ WARN] 2016-08-03 17:43:06,830 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0002-8121-2341
[ WARN] 2016-08-03 17:43:06,830 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0003-1758-9950
[ WARN] 2016-08-03 17:43:06,832 (CNIdentityLDAPImpl:constructDn:690) Subject not a valid DN: http://orcid.org/0000-0003-2192-431X
[ WARN] 2016-08-03 17:43:06,833 (CNIdentityLDAPImpl:constructDn:690) Subject not a val
package org.dataone.tests;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.XMLConstants;
import javax.xml.parsers.DocumentBuilder;
@csjx
csjx / D1LibclientTimeoutTest.java
Last active September 14, 2016 15:54
An example showing http connection timeout issues with d1_libclient_java v2.2.0, httpclient 4.3.6
package org.dataone.tests;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import org.dataone.client.v2.itk.D1Client;
import org.dataone.client.v2.MNode;
import org.dataone.service.exceptions.BaseException;
import org.dataone.service.exceptions.ServiceFailure;
@csjx
csjx / rdf-modify-test.html
Created April 6, 2017 15:03
An example of modifying an RDF graph to test an rdflib.js problem
<!DOCTYPE html>
<html lang="en">
<head>
<title>RDF Test</title>
<script type="text/javascript" src="components/rdflib.js"></script>
<script type="text/javascript" src="components/jquery.js"></script>
<script type="text/javascript" src="components/underscore.js"></script>
<script type="text/javascript" src="rdf-modify-test.js"></script>
</head>
<body onload = "RDFTest.run()">
@csjx
csjx / dataone-node-operation-dates.R
Last active September 6, 2017 15:44
An R script that queries the DataONE Node Registry and extracts a list of dates when each MN became operational
# Query the DataONE Node Registry to find dates that Member Nodes began operation
# The DataONE Node registry service returns results as XML
library(httr)
library(xml2)
# The base URL for the DataONE Coordinating Node
cn_base_url <- "https://cn.dataone.org/cn"
# The node registry endpoint
@csjx
csjx / dataone-node-operation-dates.R
Created September 6, 2017 07:26
An R script that queries the DataONE Node Registry and extracts a list of dates when each MN became operational
# Query the DataONE Node Registry to find dates that Member Nodes began operation
# The DataONE Node registry service returns results as XML
library(httr)
library(xml2)
# The base URL for the DataONE Coordinating Node
cn_base_url <- "https://cn.dataone.org/cn"
# The Solr query service endpoint
@csjx
csjx / File 1: dataone-package-upload-example.rst
Last active March 27, 2024 17:32
Using the DataONE API on the command line

DataONE Data Package Upload Example

Table of Contents

This is an example of how to upload content into a repository that implements the DataONE Tier 3 MNStorage API. We focus on a simple yet complete data package example that involves two CSV data files, one EML metadata file, and one OAI-ORE resource map file. This example is based on content in the following published dataset, but has some changes to simplify the example: