Skip to content

Instantly share code, notes, and snippets.

@mattsouth
mattsouth / gist:77e5cad0c2573861d822
Last active January 16, 2021 02:33
How to listen to all default samples in sonic-pi
# All samples
sample_groups().each do |grp|
print "\n###### :#{grp} ######\n"
sample_names(grp).each do |smp|
print smp
sample smp
sleep sample_duration smp
end
end
@mattsouth
mattsouth / gist:9c03212b2065c57e78ff
Last active August 29, 2015 14:16
contact Galileo
{
"NHSNumber" : "18243291",
"_id" : ObjectId("1111a2ddaddd832311"),
"accessPrivilege" : "Participant",
"clinicians" : [
{
"firstName" : "Clint",
"lastName" : "Ician",
"tcid" : 13,
"title" : "Mr"
@mattsouth
mattsouth / gist:8d067e814ee5dd89ca9d
Last active August 29, 2015 14:16
contact Galileo
<contacts>
<NHSNumber>18243291</NHSNumber>
<_id>1111a2ddaddd832311</_id>
<accessPrivilege>Participant</accessPrivilege>
<clinicians>
<list>
<item>
<firstName>Clint</firstName>
<lastName>Ician</lastName>
<tcid>13</tcid>
@mattsouth
mattsouth / xnat schema summary
Last active August 29, 2015 14:20
XSLT for providing end user usable view of xnat schema
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0"
>
<!--
Notes:
created-by: MJS ([email protected])
created-on: 1st May 2015
Need to insert this line to 2nd line of xnat schema to instruct XSLT Processor:
@mattsouth
mattsouth / upload.sh
Last active August 29, 2015 14:25
Bash script for uploading a directory of dicom images to xnat 1.6.4
#!/bin/bash
# uploads dicom images for a particular subject session to the tng xnat instance
# takes five parameters:
# 1: username - xnat username
# 2: password - xnat password
# 3: project - project id
# 4: scan date - session date e.g. '01/02/14'
# 5: directory - the subdirectory that contains the session files
#
# Assumptions!
@mattsouth
mattsouth / scan.sh
Last active August 29, 2015 14:26
For testing scan type mappings
#!/bin/bash
# works through the current directory (assumed of sessions with subdirectories of scans) for unmapped scan types
function mapType {
if [[ "$1" == DTI_* ]]; then
type='DTI'
elif [[ "$1" == ep-moco-nav-set* ]]; then
type='Navigator'
elif [[ "$1" == fieldmap_* ]]; then
type='FieldMap'
elif [[ "$1" == gre_0.8inplane_5mm_* ]]; then
@mattsouth
mattsouth / uploadzip.sh
Last active August 29, 2015 14:26
Script to upload dicom images for a particular subject session to the tng xnat instance
#!/bin/bash
# uploads dicom images for a particular subject session to the tng xnat instance
# takes five parameters:
# 1: username - xnat username
# 2: password - xnat password
# 3: project - project id
# 4: scan date - session date e.g. '01/02/14'
# 5: directory - the subdirectory that contains the session files
#
# Assumptions!
@mattsouth
mattsouth / uploaddcmtk.sh
Last active August 29, 2015 14:26
Uploads dicom images for a particular subject session to the tng xnat instance
#!/bin/bash
# uploads dicom images for a particular subject session to the tng xnat instance
# takes five arguments:
# 1: username - xnat username
# 2: password - xnat password
# 3: project - xnat project id
# 4: directory - the subdirectory that contains the session scan sud-directories
# 5: subject_id - the subject id associated with the session scan
#
# Assumptions!
@mattsouth
mattsouth / csvupload.sh
Last active August 29, 2015 14:27
Upload mulitple dicom sessions as outlined in a spreadsheet
#!/bin/bash
# uploads dicom images for a set of subject sessions to the tng xnat instance
# takes three parameters:
# 1: csv - the filename a csv file that contains three columns:
# a: subject_id
# b: directory
# c: scan date
# 2: xnat-username
# 3: xnat-password
# 4: xnat-project_id
---
# file: munin-monitoring.yml
# install munin master that monitors itself on ubuntu 14.04
# and uses apache and fast-cgi (for the dynamic zooming graphs)
# to host dashboard
- hosts: monitoring
handlers:
- name: restart munin-node
service: name=munin-node state=restarted
- name: restart apache2