Skip to content

Instantly share code, notes, and snippets.

@rbramley
rbramley / check_hudson_job.pl
Created May 10, 2011 10:38
Nagios check for Hudson/Jenkins job status using the JSON API
#!/usr/bin/perl
use strict;
use LWP::UserAgent;
use JSON;
#
# Check Hudson job status using the JSON API
#
# (c) 2009 Robin Bramley, Opsera Ltd.
# Copying and distribution of this file, with or without modification,
@rbramley
rbramley / check_many.groovy
Created May 27, 2011 09:28
A groovy script to run multiple Opsview checks and aggregate the return value and status / performance data
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Aggregate Opsview checks.
* @author Robin Bramley, Opsera Limited (c) 2010
*/
@rbramley
rbramley / check_sql_query.groovy
Created May 27, 2011 09:56
A service check groovy script to query a database for Opsview
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Custom SQL check (invoked using check_by_ssh) to ensure app server can query
* the database. Used with Groovy 1.5.6 on Debian Lenny against SQL Server.
*
* Opsview users should use check_sql_advanced for MySQL/PostgreSQL/Oracle or
@rbramley
rbramley / DuplicateId_LuceneIndexWalker.groovy
Created June 23, 2011 16:29
Script to walk an unoptimised Lucene index to determine how many deletions were due to updates
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2011
*
* Purpose:
* Of the deletions in an unoptimised Lucene index, how many were
@rbramley
rbramley / map_counter_bump.groovy
Created June 24, 2011 15:52
Groovy meta-programming to 'bump' a counter in a map
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2011
*
* Groovy meta-programming to 'bump' a counter in a map for conciseness.
*/
@rbramley
rbramley / CreateSonarPom.groovy
Created July 29, 2011 21:46
A Grails Gant script to create a Maven POM for the Sonar Groovy Plugin
/*
* Copyright 2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@rbramley
rbramley / walk_and_count.groovy
Created May 4, 2012 12:26
Quick & dirty Groovy scripts for processing Freemind leaf nodes
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* @author Robin Bramley (c) 2012
*
* Groovy script to walk a Freemind node tree and count occurrences of leaf terms.
*/
@rbramley
rbramley / IssueMigrator.groovy
Created March 2, 2013 21:43
Script to migrate GoogleCode issues
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Migrate issues from one Googlecode project to another (e.g. if you need to rename).
* Note (line 39): fetch of issues from source project currently limited to 50
*
* See: http://code.google.com/p/support/wiki/IssueTrackerAPI for API details
@rbramley
rbramley / blueprints_rdf_graphsail_neo4j.groovy
Created January 7, 2014 17:01
An executable Groovy script to create and query some simple RDF statements within a Neo4j database using the Blueprints GraphSail ouplementation. Based on sample code from the Tinkerpop wiki: https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation It sources dependencies from Maven Central using Grape.
@Grab(group='com.tinkerpop.blueprints', module='blueprints-neo4j-graph', version='2.4.0')
@Grab(group='com.tinkerpop.blueprints', module='blueprints-graph-sail', version='2.4.0')
@Grab(group='org.openrdf.sesame', module='sesame-repository-sail', version='2.7.8')
@Grab(group='org.openrdf.sesame', module='sesame-queryparser-sparql', version='2.7.8')
import com.tinkerpop.blueprints.*
import com.tinkerpop.blueprints.oupls.sail.GraphSail
import com.tinkerpop.blueprints.impls.neo4j.Neo4jGraph
import info.aduna.iteration.*
/**
* Copying and distribution of this file, with or without modification,
* are permitted in any medium without royalty provided the copyright
* notice and this notice are preserved. This file is offered as-is,
* without any warranty.
*
* Script to take an Android ADB email dump and process emails to .eml RFC822
* format files. Does not handle attachments/multipart at present.
*
* <em>Notes:</em>