Skip to content

Instantly share code, notes, and snippets.

View dheles's full-sized avatar

Drew Heles dheles

  • LYRASIS
  • Baltimore, MD
View GitHub Profile
@dheles
dheles / keybase.md
Last active November 12, 2016 17:30
keybase verification

Keybase proof

I hereby claim:

  • I am dheles on github.
  • I am dheles (https://keybase.io/dheles) on keybase.
  • I have a public key ASCG57l46vR_p_wl_b5vQFNTP_e7peoodYLWJxShwWc9mQo

To claim this, I am signing this object:

@dheles
dheles / hyrax_virtualhost.conf
Last active May 2, 2017 18:57
hyrax virtualhost configuration
<VirtualHost *:80>
ServerName sufia
ServerAlias sufia.test.test
ErrorLog "/var/log/httpd/sufia-error.log"
CustomLog "/var/log/httpd/sufia-access.log" combined
DocumentRoot /var/www/html/sufia/public
PassengerRuby /usr/local/bin/ruby
@dheles
dheles / gist:7adf1b12c55abae2ba47e1e6dde12c60
Last active May 17, 2017 21:47
dspace packager rake error
$ RAILS_ENV=development bundle exec rake packager:aip["import/CompSci_current.zip","dheles@jhu.edu"]
loading task import
Building Import Package from AIP Export file: import/CompSci_current.zip
***** COLLECTION [Current Technical Reports] *****
******* ITEM [http://jhir.library.jhu.edu/handle/1774.2/33295] *******
bitstream_430525.pdf -> ChaudhryTR09.pdf
-------- UpLoaded Files ----------
#<Hyrax::UploadedFile:0x00000005e9c3c0>
----------------------------------
** Creating Item...
@dheles
dheles / work.rb
Created May 17, 2017 16:27
work model
# Generated via
# `rails generate hyrax:work Work`
# attribute mapping from dspace_packager.rake:
## "dc.title" => "title",
## "dc.contributor.author" => "creator",
## "dc.date.issued" => "date_issued",
# "dc.identifier.uri" => "handle",
# "dc.description.abstract" => "abstract",
# "dc.description.provenance" => "provenance",
@dheles
dheles / dspace_packager.rake
Created May 17, 2017 16:28
dspace packager rakefile
# Author: Aaron Collier, CalState
# Adapted for JHU by Drew Heles
# Steps to use this:
# 1 - Export DSpace data in AIP format
# ---- [dspace bin]/dspace packager -d -a -e [email address] -i [handle of comm/coll/item] -t AIP [full path to export file name in .zip format]
# ---- this will include all sub items and collections in ITEM-HANDLE.zip format - move all files to server for import
# 2 - in the directory with the above zip files, add a "complete" directory (this should be added to the code, just hasn't been done yet)
# 3 - run the rake from your hydra project root as: rake packager:aip["path/to/top_level_zip","admin@somehere.edu"] (where admin@ is your admin email address)
@dheles
dheles / gem_build_hyrax_gemspec.log
Created July 18, 2017 17:02
output from building hyrax 1.0.3 gem
$ gem build hyrax.gemspec
WARNING: license value 'Apache2' is invalid. Use a license identifier from
http://spdx.org/licenses or 'Nonstandard' for a nonstandard license.
Did you mean 'Apache-2.0', 'mpich2'?
WARNING: open-ended dependency on hydra-head (>= 10.4.0) is not recommended
if hydra-head is semantically versioned, use:
add_runtime_dependency 'hydra-head', '~> 10.4', '>= 10.4.0'
WARNING: open-ended dependency on browse-everything (>= 0.10.5) is not recommended
if browse-everything is semantically versioned, use:
add_runtime_dependency 'browse-everything', '~> 0.10', '>= 0.10.5'
@dheles
dheles / test_login.rb
Created November 4, 2017 13:53
regex format example
def test_session
session = "test-session"
default_label = "test-default-login"
session_label = "test-session-login"
username = "user"
password = "pass"
default_output = "#{default_label}:#{username}:#{password}"
session_output = "#{session_label}:#{username}:#{password}"
error_pattern_no_record = /No such record\(s\)/
error_pattern_no_session = /Unknown session/
$ python client.py
https://jscholarship.library.jhu.edu/swordv2/collection/1774.2/58586
atom_generator: '['admin@dspace-prod.mse.jhu.edu version:"2.0" uri:"http://www.dspace.org/ns/sword/2.0/"']'
atom_id: '['https://jscholarship.library.jhu.edu/swordv2/edit/dbbde8a5-179f-4e94-bd4f-c852682e357d']'
atom_rights: '[None]'
atom_title: '['Untitled: example.zip']'
atom_updated: '['2018-07-02T04:00:00.000Z']'
dcterms_available: '['2018-07-02T16:48:49Z']'
dcterms_description: '['Zip file deposted by SWORD without accompanying metadata']'
dcterms_provenance: '['Made available in DSpace on 2018-07-02T16:48:49Z (GMT). No. of bitstreams: 2\nexample.zip: 33777 bytes, checksum: 2b25f82ba67284461d4a481d7a06dd28 (MD5)\nexample.zip: 33777 bytes, checksum: 2b25f82ba67284461d4a481d7a06dd28 (MD5)']'
# EXAMPLE "local.cfg" for DSpace.
#
# Any configurations added to this file will automatically OVERRIDE configurations
# of the same name in any of the DSpace *.cfg files. This includes overriding
# settings in any of these files:
# * [dspace]/config/dspace.cfg
# * Or any configuration file that is included in 'dspace.cfg'
# (See "include = [filepath]" settings near the end of dspace.cfg.
# By default, it includes all [dspace]/config/modules/*.cfg files)
#
#---------------------------------------------------------------#
#----------------SWORD 2.0 SERVER CONFIGURATIONS----------------#
#---------------------------------------------------------------#
# These configs are only used by the SWORD Server interface, #
# version 2.0 (used by DSpace to accept ingest packages via #
# SWORD 2.0 protocol) #
#---------------------------------------------------------------#
# the base url of the sword 2.0 system
#