Skip to content

Instantly share code, notes, and snippets.

View spikeheap's full-sized avatar

Ryan Brooks spikeheap

View GitHub Profile
@spikeheap
spikeheap / settings.xml
Last active December 28, 2015 21:19
Sample settings.xml file demonstrating Sonar integration for Grails. Drop it in your ~/.m2/ directory.
<settings>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<!-- Example for MySQL-->
<sonar.jdbc.url>
@spikeheap
spikeheap / pom.xml
Last active December 28, 2015 21:29
A pom.xml sample for a Grails project to use Gmetrics and CodeNarc, published to Sonar
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.company.yourproject</groupId>
<artifactId>YOURPROJECT</artifactId>
<version>1.0</version>
<packaging>pom</packaging>
<name>YOUR PROJECT</name>
<build>
<sourceDirectory>grails-app</sourceDirectory>
@spikeheap
spikeheap / sonar.conf
Created November 20, 2013 15:53
Sample configuration file for nginx to serve a homebrew installation of Sonar
upstream sonar {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
access_log /opt/boxen/log/nginx/sonar.access.log;
error_log /opt/boxen/log/nginx/sonar.error.log;
listen 80;
server_name sonar.dev;
@spikeheap
spikeheap / jenkins.conf
Created November 20, 2013 15:56
Sample nginx conf for Jenkins
upstream jenkins {
server 127.0.0.1:9000 fail_timeout=0;
}
server {
access_log /opt/boxen/log/jenkins/sonar.access.log;
error_log /opt/boxen/log/jenkins/sonar.error.log;
listen 80;
server_name jenkins.dev;
@spikeheap
spikeheap / sonar-runner.properties
Last active January 4, 2019 04:50
# A sample sonar-runner.properties file to test Groovy and Javascript in a Grails project # Note that the blank projectBaseDir properties are necessary otherwise Sonar infers # the directory name from the module name, which doesn't apply here.
# A sample sonar-runner.properties file to test Groovy and Javascript in a Grails project
# Note that the blank projectBaseDir properties are necessary otherwise Sonar infers
# the directory name from the module name, which doesn't apply here.
#
# Author: Ryan Brooks (ryan.brooks@ndm.ox.ac.uk)
# required metadata
sonar.projectKey=com.example
sonar.projectName=My Project
sonar.projectVersion=0.1
@spikeheap
spikeheap / niceperlscraper.pl
Created November 23, 2013 14:36
A scraper to retrieve the NICE pathways in XML format, for research purposes.
use warnings;
use strict;
use LWP::UserAgent;
use File::Basename;
use Time::HiRes qw(usleep);
use CGI qw/escape/;
# Create an LWP User-Agent object for sending HTTP requests.
my $ua = LWP::UserAgent->new;
@spikeheap
spikeheap / interfaces
Last active January 16, 2024 22:19
A sample /etc/network/interfaces file for Raspberry Pi using WiFi. Be sure to set your WiFi SSID and shared key!
auto lo
iface lo inet loopback
iface eth0 inet static
address 192.168.0.222
netmask 255.255.255.0
gateway 192.168.0.1
broadcast 192.168.0.1
dns-nameservers 192.168.0.1
@spikeheap
spikeheap / crontab
Last active December 30, 2015 16:59
A sample crontab to run heating control
# Update the time from the RTC hourly
0 * * * * hwclock -s
# Post sensor readings to emoncms
* * * * * /root/ryan_scripts/tempToEmon.sh > /dev/null
* * * * * /root/ryan_scripts/heatingStateToEmon.sh > /dev/null
# Every morning, 6:30 to 7:00
30 6 * * * /root/ryan_scripts/switchHeatingOn.sh > /dev/null
0 7 * * * /root/ryan_scripts/switchHeatingOff.sh > /dev/null
@spikeheap
spikeheap / gist:7869563
Created December 9, 2013 09:22
Instructions to install a basic snug-node instance on a Raspberry Pi. Needs working into the docs, but this is a WIP.

Installing Snug on Raspberry Pi

Enable kernel modules

Install WiringPi

First the WiringPi library:

git clone git://git.drogon.net/wiringPi
cd wiringPi 
#################################################
# rsnapshot.conf - rsnapshot configuration file #
#################################################
# #
# PLEASE BE AWARE OF THE FOLLOWING RULES: #
# #
# This file requires tabs between elements #
# #
# Directories require a trailing slash: #
# right: /home/ #