Skip to content

Instantly share code, notes, and snippets.

Last updated: 2015-08-11

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

###Output photos that don't have datetimeoriginal to a CSV### Note this can take a long time if you have a lot of jpgs

@percursoaleatorio
percursoaleatorio / docx2rst.bat
Created July 28, 2014 12:56
Convert from docx to restructured text
@echo off
rem nery[_at_]tecnico.ulisboa.pt v2014.01.16 [CC BY-NC-SA]
rem OBJETIVO: Converter de DOCX para RST utilizando o CALIBRE e o PANDOC.
rem Criar ficheiro de texto com o mesmo nome e extensão *.rst
rem PRE-REQUISITOS:
rem C:\Users\nery\AppData\Local\Pandoc\
rem C:\Programs\Calibre\Calibre Portable\Calibre
rem REFERENCES
@percursoaleatorio
percursoaleatorio / CRS_PT
Last active March 5, 2016 13:00
PROJ.4 config file for PT Coordinate Reference Systems. Configuration file for PROJ.4 coordinate transformations. Contains all commonly used CRS and coordinate transformations for Portugal. Includes obsolete CRSs. Includes CRSs for the Madeira and Azores Islands.
# EXAMPLES:
# ogr2ogr -f "ESRI Shapefile" -s_srs "+init=CRS_PT:4274_9615 +wktext" -t_srs "+init=CRS_PT:3763_NIL +wktext" output.shp input.shp
# gdalwarp -s_srs "+init=CRS_PT:3763_NIL +wktext" -t_srs "+init=CRS_PT:3857_NIL +wktext" -r bilinear input.tif output.tif
# SYNTAX: EACH TRANSFORMATION IS IDENTIFIED AS "epsgCoordinateReferenceSystemCode_epsgCoordinateOperationMethod"
# IF, WITHIN A CRS AREA OF USE, DIFFERENT TRANSFORMATIONS ARE AVAILABLE FOR SPECIFIC AREAS THEN EACH TRANSFORMATION IS IDENTIFIED AS "epsgCoordinateReferenceSystemCode_epsgCoordinateOperationMethod_epsgAreaOfUse"
#
### ENUMERATION OF epsg Coordinate Reference System Code
# 4326 "WGS84/Geographic 2D"
# 4258 "ETRF89/Geographic 2D"
(: Suppose that validate-record is a function that checks a single record.
It receives the sequence of records to be validated and the position of the specific record to validate.
It returns a sequence.
If the recork is OK, then the returned sequence is empty.
If the recork is not OK, then the returned sequence contains a single element with the validation result.
Something like... :)
declare function validate-record($records as element()+, $position as xs:integer) as element()?
{ (: Whatever you need to do the check the record in that position.
Return an empty sequence if the record is ok.
#####################################
# Reportnet: Data flows #
# http://cr.eionet.europa.eu/sparql #
#####################################
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX rod: <http://rod.eionet.europa.eu/schema.rdf#>
PREFIX obl: <http://rod.eionet.europa.eu/obligations/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
@percursoaleatorio
percursoaleatorio / Bitnami-Stack-for-Limesurvey.rst
Last active December 24, 2015 23:29
LimeSurvey - my notes on Bitnami-Stack for LimeSurvey.

Bitnami Limesurvey

  1. Update Virtual Box if necessary. Install the most recent Virtual Box Extension Pack.
  2. Download the VM from http://bitnami.com/stack/limesurvey. Unzip...
  3. Create a new VirtualBox VM
@percursoaleatorio
percursoaleatorio / wubi.rst
Last active December 15, 2015 20:41
WUBI
Author

nery

Copyright

CC BY-NC-SA 2.0 <http://creativecommons.org/licenses/by-nc-sa/2.0/>

Date

$Date: 2013-04 $

Revision

$Revision: 2014.01.08 $

Description

Ubuntu 12.04LTS Precise Pangolin | Ubuntu 13.10 Saucy Salamander - Notas sobre a Instalação em Windows (WUBI), instalação de programas de escritório eletrónico, sistemas de informação geográfica e outras aplicações úteis ao dia-a-dia...

Introdução

Versões de Ubuntu

#!/usr/bin/env python
#******************************************************************************
# $Id: gdal2tiles.py 19288 2010-04-02 18:36:17Z rouault $
#
# Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/)
# Support: BRGM (http://www.brgm.fr)
# Purpose: Convert a raster into TMS (Tile Map Service) tiles in a directory.
# - generate Google Earth metadata (KML SuperOverlay)
# - generate simple HTML viewer based on Google Maps and OpenLayers
# - support of global tiles (Spherical Mercator) for compatibility
#
# script to register Python 2.0 or later for use with win32all
# and other extensions that require Python registry settings
# written by Joakim Loew for Secret Labs AB / PythonWare
#
# source:
# http://www.pythonware.com/products/works/articles/regpy20.htm
#
# modified by Valentine Gogichashvili as described in http://www.mail-archive.com/distutils-sig@python.org/msg10512.html
#!/usr/bin/env python
#buffer.py
import sys
import os
from osgeo import ogr
def buffer(infile,outfile,buffdist):
try:
ds_in=ogr.Open( infile )
lyr_in=ds_in.GetLayer( 0 )