Skip to content

Instantly share code, notes, and snippets.

View juanluisrp's full-sized avatar

Juan Luis Rodríguez Ponce juanluisrp

View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# tomcat recipe comes from https://github.com/opscode-cookbooks/tomcat
include_recipe "tomcat::default"
template "/tmp/template1" do
source "default.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, "service[tomcat]", :delayed
end
@juanluisrp
juanluisrp / deployGeonetwork.sh
Created December 4, 2015 22:39
Update, compile and deploy GeoNetwork into Tomcat
#!/bin/bash
GN_SOURCES=geonetwork
GN_PROFILES=env-prod
DEPLOY_NAME=geonetwork-ngr3
GN_DATA_DIR=/var/local/geonetwork/${DEPLOY_NAME}
RED='\e[31m'
EC='\e[0m'
@juanluisrp
juanluisrp / gist:4384845
Created December 27, 2012 02:06
Properly setting of externalGraphic size in OpenLayers.
var myStyles = new OpenLayers.StyleMap(
new OpenLayers.Style(
{
externalGraphic: baseUrl +'/img/marker-blue.png',
fill: false,
stroke: false,
pointRadius: 0,
graphicWidth: 18 ,
graphicHeight: 30,
fillOpacity: 1,
@juanluisrp
juanluisrp / create_template_postgis.sh
Last active December 11, 2015 21:49 — forked from rolo/gist:1481128
Install Postgres and create template_postgis
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
import org.apache.commons.io.FileUtils;
import java.io.File;
public class DeleteDirectory {
@juanluisrp
juanluisrp / map.geojson
Created August 12, 2013 20:07
via:geojson.io
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@juanluisrp
juanluisrp / gist:3928064
Created October 21, 2012 18:46
Convert from utm to lat,lon
// include the library
<script src="lib/proj4js-combined.js"></script> //adjust the path for your server
//or else use the compressed version
. . .
// creating source and destination Proj4js objects
// once initialized, these may be re-used as often as needed
var dest = new Proj4js.Proj('EPSG:4236'); //source coordinates will be in Longitude/Latitude
var zone29 = new Proj4js.Proj('EPSG:23029'); //destination coordinates in UTM zone 29
@juanluisrp
juanluisrp / config-view-service-override.xml
Created December 28, 2018 09:36
Overrides xml.metadata.get service to return geonet:info elements
<overrides xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="config-overrides.xsd">
<file name=".*/WEB-INF/config/config-service-xml-api.xml">
<replaceAtt xpath="services/service[@name='xml.metadata.get']/class/param[@name='skipInfo']" attName="value" value="n"/>
</file>
</overrides>
@juanluisrp
juanluisrp / AnchorSwitcher.js
Created July 8, 2019 14:54
Geonetwork Anchor Switcher
/*
* Copyright (C) 2001-2016 Food and Agriculture Organization of the
* United Nations (FAO-UN), United Nations World Food Programme (WFP)
* and United Nations Environment Programme (UNEP)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*