Skip to content

Instantly share code, notes, and snippets.

View djtfmartin's full-sized avatar

Dave Martin djtfmartin

View GitHub Profile
@djtfmartin
djtfmartin / species-autocomplete.js
Last active August 28, 2015 08:30
species-autocomplete.js
// initialise plugins
$(function(){
var autocompleteUrl = 'http://species-ws.als.scot/auto';
// autocomplete on navbar search input
$("input.general-search").autocomplete(autocompleteUrl, {
extraParams: {limit: 100},
dataType: 'json',
parse: function(data) {
@djtfmartin
djtfmartin / UK_state_province_layer.txt
Created August 27, 2015 15:37
Generate UK state province layer
# SHP import to PostGIS
shp2pgsql /Users/mar759/Downloads/bdline_essh_gb/Data/GB/european_region_region.shp scotland.european_region_region > /tmp/uk.sql
# SOL script
@djtfmartin
djtfmartin / scottish-feature-species.txt
Created August 24, 2015 16:09
scottish-feature-species.txt
Sciurus vulgaris
Felis silvestris
Martes martes
Vipera berus
Buteo buteo
Milvus milvus
Aquila chrysaetos
Fratercula arctica
Morus bassanus
Cepphus grylle
@djtfmartin
djtfmartin / Jenkins_PPK_setup.txt
Created August 21, 2015 13:00
Jenkins PPK setup
Jenkins public private key
---------------------------
On index.als.scot
---------------
Create a user called jenkins:
useradd -m jenkins
usermod -G tomcat7 jenkins
sudo su jenkins
@djtfmartin
djtfmartin / meta.xml
Last active October 28, 2015 23:16
DwC-A meta.xml
<?xml version="1.0" encoding="UTF-8"?>
<archive xmlns="http://rs.tdwg.org/dwc/text/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" metadata="description.xml" xsi:schemaLocation="http://rs.tdwg.org/dwc/text/ http://rs.tdwg.org/dwc/text/tdwg_dwc_text.xsd">
<core ignoreHeaderLines="1" fieldsTerminatedBy="," fieldsEnclosedBy="&quot;" rowType="http://rs.tdwg.org/dwc/terms/Taxon">
<files>
<location>taxa.csv</location>
</files>
<id index="0" />
<field index="0" term="http://rs.tdwg.org/dwc/terms/taxonID" />
<field index="1" term="http://rs.tdwg.org/dwc/terms/parentNameUsageID" />
<field index="2" term="http://rs.tdwg.org/dwc/terms/acceptedNameUsageID" />
@djtfmartin
djtfmartin / session.txt
Created December 15, 2014 05:06
Ansible bash session - EC2 setup
mar759@calamari-be:~/dev/ala-install/ansible$ date
Mon 15 Dec 2014 14:53:38 AEDT
mar759@calamari-be:~/dev/ala-install/ansible$ ansible-playbook --private-key ~/.ssh/uk-demo-frankfurt.pem -u ubuntu -s ala-demo.yml -i inventories/demo-ec2
PLAY [ala-demo] ***************************************************************
GATHERING FACTS ***************************************************************
ok: [ec2-54-93-32-22.eu-central-1.compute.amazonaws.com]
TASK: [common | set debian variables] *****************************************
@djtfmartin
djtfmartin / uk-inventory
Created December 15, 2014 04:54
UK demo inventory
# An inventory for the deployment of the ALA demo for the UK.
[ala-demo]
ec2-54-93-32-22.eu-central-1.compute.amazonaws.com
[ala-demo:vars]
is_vagrant=false
local_repo_dir = ~/.ala
data_dir=/data
use_cdn=true
@djtfmartin
djtfmartin / index.html
Created October 26, 2014 22:45
LeafletJS and ALA occurrence layer
<!DOCTYPE html>
<html>
<head>
<title>LeafletJS and ALA occurrence layer</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://leafletjs.com/dist/leaflet.css" />
</head>
<body>
<div id="map" style="height: 800px"></div>
@djtfmartin
djtfmartin / index.html
Created October 2, 2014 04:16
ALA mapping example
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>ALA Occurrence Records Map Example</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap-theme.min.css">
@djtfmartin
djtfmartin / setfacts.yml
Created September 23, 2014 10:04
setfacts.yml that uses amazon CDN
- name: set debian variables
set_fact:
tomcat: tomcat7
tomcat_user: tomcat7
tomcat_conf: /etc/default/tomcat7
apache: apache2
mysql_service: mysql
cassandra_yaml: /etc/cassandra/cassandra.yaml
cassandra_user: cassandra
tomcat_webapps: /var/lib/tomcat7/webapps/