Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / print_stacktrace.rb
Created May 11, 2012 14:37 — forked from alainravet/print_stacktrace.rb
How to print the stacktrace in Ruby
# How to print the stacktrace from anywhere :
# 1°
#------------------------------------------------------------------------------
module Kernel
def print_stacktrace
raise
rescue
puts $!.backtrace[1..-1].join("\n")
end
@pmauduit
pmauduit / build.gradle
Last active January 4, 2016 09:09
build.gradle - groovy sample code
apply plugin: 'groovy'
buildscript {
repositories {
mavenLocal()
maven {
url "http://repo.opengeo.org"
}
}
dependencies {
@pmauduit
pmauduit / logstash.md
Last active January 4, 2016 16:59
Developing with logstash

logstash v2.x

rake bootstrap
...
./bin/plugin install --no-verify logstash-codec-json
./bin/plugin install --no-verify logstash-output-stdout
./bin/plugin install --no-verify logstash-intput-log4j

sample config for geOrchestra sp

@pmauduit
pmauduit / insp_vanilla.xml
Created February 7, 2014 13:41
inspire vanilla WMS 1.1.1 GetCapabilities
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE WMT_MS_Capabilities SYSTEM "http://schemas.opengis.net/wms/1.1.1/WMS_MS_Capabilities.dtd"
[
<!ELEMENT VendorSpecificCapabilities (inspire_vs:ExtendedCapabilities)><!ELEMENT inspire_vs:ExtendedCapabilities ((inspire_common:MetadataUrl, inspire_common:SupportedLanguages, inspire_common:ResponseLanguage) | (inspire_common:ResourceLocator+, inspire_common:ResourceType, inspire_common:TemporalReference+, inspire_common:Conformity+, inspire_common:MetadataPointOfContact+, inspire_common:MetadataDate, inspire_common:SpatialDataServiceType, inspire_common:MandatoryKeyword+, inspire_common:Keyword*, inspire_common:SupportedLanguages, inspire_common:ResponseLanguage, inspire_common:MetadataUrl?))><!ATTLIST inspire_vs:ExtendedCapabilities xmlns:inspire_vs CDATA #FIXED "http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" ><!ELEMENT inspire_common:MetadataUrl (inspire_common:URL, inspire_common:MediaType*)><!ATTLIST inspire_common:MetadataUrl xmlns:inspire
@pmauduit
pmauduit / test.map
Created February 7, 2014 14:03
mapfile - Mapserver inspire validation error
MAP
EXTENT -180 -90 180 90
IMAGECOLOR 192 192 192
IMAGETYPE "png24"
NAME "World_Map"
SIZE 600 300
STATUS ON
UNITS DD
OUTPUTFORMAT
@pmauduit
pmauduit / psql_xml_ninja_queries.sql
Last active July 26, 2016 11:30
PostGreSQL XML / arrays SQL ninja queries
-- extracts xlink hrefs from MD
SELECT
unnest(xpath('//x:Anchor/@y:href',
data::xml,
ARRAY[ARRAY['x', 'http://www.isotc211.org/2005/gmx'],
ARRAY['y', 'http://www.w3.org/1999/xlink']])) AS hrefs
FROM
metadata
WHERE
id = 22;
@pmauduit
pmauduit / osmposter.sh
Created March 4, 2014 07:25
OSM GPX traces retriever - Shell script
#!/bin/sh
set -x
# Chambéry
#CITY=Chambéry
#NORTH=45.5903
#SOUTH=45.5354
#WEST=5.8621
#EAST=5.9755
@pmauduit
pmauduit / gist:9807684
Last active August 29, 2015 13:57
Very useful tricks
## in a maven project:
$ mvn eclipse:eclipse -DdownloadSources=true
## JDWP
-agentlib:jdwp=transport=dt_socket,address=30303,server=y,suspend=n
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -Xmx2048M -XX:MaxPermSize=1024M
@pmauduit
pmauduit / Vagrantfile
Created April 25, 2014 12:47
Vagrant provision with puppet
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian-7-amd64-c2c"
config.vm.provision "puppet" do |puppet|
puppet.module_path = "modules"
end
end
@pmauduit
pmauduit / DisableSSLChecks
Created July 29, 2014 13:15
Get rid of SSL checks in Java
// don't really care of SSL issues ...
public static void disableCertificates() {
TrustManager[] trustAllCerts = new TrustManager[]{
new X509TrustManager() {
@Override
public java.security.cert.X509Certificate[] getAcceptedIssuers() {
return null;
}