Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View alanorth's full-sized avatar

Alan Orth alanorth

View GitHub Profile
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
ServerName erepo.usiu.ac.ke
@alanorth
alanorth / ilri-jobs.pde
Last active August 29, 2015 14:26
Tag cloud for ILRI jobs using Processing and Wordcram
import wordcram.*;
void setup() {
// Set up the Processing sketch
size(600, 400);
// RGB color mode is easier for humans
colorMode(RGB);
background(255,255,255);
// not sure if this does anything
smooth();
@alanorth
alanorth / dspace-sql
Created August 2, 2015 13:09
Finding the item causing the "|||" in the CGIAR Research Programs XMLUI facet.
dspace=# select item_id from metadatavalue where metadata_field_id=86 and (text_value='' OR text_value IS NULL);
item_id
---------
66841
(1 row)
dspace=# SELECT * FROM item, handle WHERE handle.resource_id = item.item_id AND item.item_id = '66841';
item_id | submitter_id | in_archive | withdrawn | last_modified | owning_collection | discoverable | handle_id | handle | resource_type_id | resource_id
---------+--------------+------------+-----------+----------------------------+-------------------+--------------+-----------+-------------+------------------+-------------
66841 | 1 | t | f | 2015-04-30 13:41:29.682+00 | 838 | t | 65272 | 10568/65272 | 2 | 66841
private static long REPROVISION_RESET = 6 * 7 * 24 * 60 * 60 * 1000;
private static long LICENSE_EXPIRATION = 3 * 7 * 24 * 60 * 60 * 1000;
@alanorth
alanorth / dspace5-cron.txt
Created September 28, 2015 09:17
DSpace 5 crontab
#-----------------
# GLOBAL VARIABLES
#-----------------
# Full path of your local DSpace Installation (e.g. /home/dspace or /dspace or similar)
# MAKE SURE TO CHANGE THIS VALUE!!!
DSPACE=/path/to/dspace
# Shell to use
SHELL=/bin/sh
@alanorth
alanorth / dspace-mirage2-build.md
Last active September 29, 2015 19:25
Preparing the build environment for DSpace 5 Mirage 2 on Ubuntu

Build Environment For Mirage 2

DSpace 5's Mirage 2 requires some extra setup if you want to tweak the base config and rebuild it. As Mirage 2 is based on Bootsrap it needs a few nodejs and ruby packages to be available in the build environment.

We build and deploy DSpace from the tomcat7 user (which is the default user for Tomcat on Ubuntu), and there are a few assumptions that must be met to allow the installation of nodejs and ruby:

  • The tomcat7 user must be able to write to its home folder—/usr/share/tomcat7—so it can create the ~/.nvm, ~/.npm, ~/.rvm, ~/.gnupg and other directories during installation
  • The ~tomcat7/.profile file must exist and be writable before installing nvm and rvm, as this is the default rc file for login shells, ie sudo su - tomcat7. These tools will append lines to those files to setup their environments on login.

This setup is based on the documentation that shipped with Mirage 2

@alanorth
alanorth / gist:1778705
Created February 9, 2012 09:23
February 9, 2012 changes to input-forms.xml
diff --git a/dspace/config/input-forms.xml b/dspace/config/input-forms.xml
index 6074d63..e01f3aa 100644
--- a/dspace/config/input-forms.xml
+++ b/dspace/config/input-forms.xml
@@ -171,6 +171,7 @@
<name-map collection-handle="10568/5468" form-name="CCAFS"/>
</form-map>
+ <!--CIFOR submssion form SINCE JAN 2012-->
@alanorth
alanorth / gist:1787556
Created February 10, 2012 07:51
CGSpace XMLUI item-view.xsl February 10, 2012
diff --git a/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl b/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
index 95056d3..8136aea 100644
--- a/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
+++ b/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
@@ -921,9 +921,35 @@
</xsl:call-template>
</xsl:when>
+ <!-- CIFOR Subject row -->
+ <xsl:when test="$clause = 30 and (dim:field[@element='cisubject' and @qualifier='ciforsubject'])">
diff --git a/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl b/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
index 95056d3..ea31bfc 100644
--- a/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
+++ b/dspace/modules/xmlui/src/main/webapp/themes/CGSPACE/lib/xsl/aspect/artifactbrowser/item-view.xsl
@@ -921,9 +921,33 @@
</xsl:call-template>
</xsl:when>
+ <!-- CIFOR Subject row -->
+ <xsl:when test="$clause = 30 and (dim:field[@element='cisubject' and @qualifier='ciforsubject'])">
@alanorth
alanorth / build-kernel.sh
Created March 13, 2012 13:56
Linux kernel build script for P6200
#!/bin/bash
function setenv {
echo -n "Setting ARM environment..."
export ARCH=arm
export CROSS_COMPILE="/home/aorth/src/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-"
echo " done."
echo -n "Setting other environment variables..."
# the kernel version we're compiling for