Skip to content

Instantly share code, notes, and snippets.

View ianibo's full-sized avatar

Ian Ibbotson ianibo

View GitHub Profile
@ianibo
ianibo / DemoContextProblem.groovy
Created February 18, 2012 10:23
A Groovy Elasticsearch scriptlet that will not join a cluster because of the resolver strategy in GXContextBuilder
#!/usr/bin/groovy
@GrabResolver(name='es', root='https://oss.sonatype.org/content/repositories/releases')
@Grapes([
@Grab(group='org.elasticsearch', module='elasticsearch', version='0.19.0.RC2'),
@Grab(group='org.elasticsearch', module='elasticsearch-lang-groovy', version='1.1.0')])
import org.elasticsearch.groovy.client.GClient
import org.elasticsearch.groovy.node.GNode
@ianibo
ianibo / GoogleReverseGeocode.groovy
Created December 11, 2012 16:35
Groovy scriptlet to reverse geocode a lat/long and extract county and other address information
#!/usr/bin/groovy
@Grapes([
@Grab(group='com.gmongo', module='gmongo', version='0.9.2'),
@Grab(group='org.apache.httpcomponents', module='httpmime', version='4.1.2'),
@Grab(group='org.apache.httpcomponents', module='httpclient', version='4.0'),
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.0'),
@Grab(group='org.apache.httpcomponents', module='httpmime', version='4.1.2')
])
@ianibo
ianibo / SchoolsToEs.groovy
Created February 1, 2014 15:01
Groovy Scriptlet to extract schools data from sparql and insert into ES
@Grapes([
@Grab(group='net.sourceforge.nekohtml', module='nekohtml', version='1.9.14'),
@Grab(group='org.codehaus.groovy.modules.http-builder', module='http-builder', version='0.5.1'),
@Grab(group='xerces', module='xercesImpl', version='2.9.1') ])
import groovyx.net.http.*
import static groovyx.net.http.ContentType.URLENC
import static groovyx.net.http.ContentType.*
import static groovyx.net.http.Method.*
import groovyx.net.http.*
@ianibo
ianibo / gist:0670970fccc7f424924f
Last active November 30, 2018 21:27
Virtuoso 7 Ubuntu 1404 build
# Last used 2017-01-21, Ubuntu 16.10
http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VOSUbuntuNotes
http://www.slideshare.net/YusukeKomiyama/virtuoso-7-install-guide-for-ubuntu-1210-64bit
#
apt-get install dpkg-dev build-essential
apt-get install autoconf automake bison checkinstall flex gawk gperf libiodbc2 libiodbc2-dev libssl-dev libtool python-dev
git clone https://github.com/openlink/virtuoso-opensource.git
@ianibo
ianibo / gist:65741ebde55b181fe2ca
Created April 28, 2015 13:16
Smart Admin Angular Version - Adding a new "Home" screen
Rough notes on my first new controller inside a SmartAdmin angular apps. Documentation seems very thin on the ground, so experimenting and documenting those experiments here.
New dir :: public/app/home with the following files
module.js
define([
'angular',
'angular-couch-potato',
'angular-ui-router',
@ianibo
ianibo / gist:89cdbb20fe043d3e9383
Created July 23, 2015 12:07
DOI LIst Handles Experiment
import net.handle.api.HSAdapterFactory
import net.handle.hdllib.*;
println("groovy -cp ./handle-client.jar test1.groovy");
net.handle.api.HSAdapter hsadapter = HSAdapterFactory.newInstance()
def someHandle = "10.1126/science";
String[] types = []
int[] indexes = []
HandleValue[] h = hsadapter.resolveHandle(someHandle, types, indexes);
println("Hello ${hsadapter}");
println("Hello ${h}");
@ianibo
ianibo / sign.groovy
Created October 4, 2017 16:00
Sign and validate some bytes using public and private key strings read from ~/.ssh
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.NoSuchAlgorithmException;
import java.security.Signature;
import java.io.*;
import java.nio.*;
import java.security.*;
import java.security.spec.*;
import java.nio.file.Files;
@ianibo
ianibo / GOKb CLA.txt
Last active January 24, 2018 11:26
GOKb Contributor License Agreement
** Placeholder **
version: "2.0"
volumes:
pgdata:
mysqldata:
esdata:
virtuoso:
services:
#
application.yaml
param1: This is param1
BootStrap.groovy
def init = { servletContext ->
log.debug("test value:\"${grailsApplication.config.param1}\"");
}