This script allows you to compress multiple files that share a common prefix before the first dot in their filenames.
The script has the following dependencies:
- GNU Parallel
- tar
# Adapted from the default gromit-mpx configuration file | |
# In ubuntu 18.04, copy this file to $HOME/.config. | |
# DEFINITIONS | |
"red Pen" = PEN (size=5 color="red"); | |
"green Pen" = PEN (size=5 color="green"); | |
"blue Pen" = PEN (size=5 color="blue"); | |
"yellow Pen" = PEN (size=5 color="yellow"); | |
"red Marker" = "red Pen" (arrowsize=2); |
library(stringr) | |
library(purrr) | |
library(rvest) | |
#------------------------------------------------------------------------------# | |
# Author: Andrew Do | |
# Purpose: A bunch of utility functions for the main ScrapeCityToPage The goal | |
# is to be able to scrape up to a specified page number for a given city and | |
# then to store that information as a data frame. The resulting data frame will | |
# be raw and will require additional cleaning, but the structure is more or less |
#!/bin/bash | |
# Based on https://gist.github.com/douglas/1287372 | |
# But with a couple of changes | |
# store the current dir | |
CUR_DIR=$(pwd) | |
# Let the person running the script know what's going on. | |
echo "Pulling in latest changes for all repositories..." |
Every time I install Ubuntu on a different computer, I need to clone again the same git repositories. This is why I use this bash script.
It clones the list of repositories to a convenient working directory in the home folder. I use the /home/git
folder.
Arguments are lists of git repositories. One repo per line, one file per list. See the example:
#!/bin/bash | |
apt-get update && apt-get install -y \ | |
build-essential \ | |
ppa-purge \ | |
curl \ | |
p7zip-full \ | |
git \ | |
make \ | |
brasero \ |
"""Calculate building floors from the Spanish Cadastre GIS files (SHP). | |
Once logged, data can be downloaded from https://www.sedecatastro.gob.es/ | |
and the data specification is at | |
http://www.catastro.minhap.gob.es/ayuda/manual_descriptivo_shapefile.pdf | |
This python script is to be used in the QGIS 2.x field calculator. | |
The "CONSTRU" field stores volumetric data and other attributes in the form | |
of a structured text code. Floor numbers are in roman numerals. | |
As for example, "-II+IV+TZA" is a building part with two underground floors, |
SELECT *, true AS resid FROM usos5 WHERE usos5.id_2009 IN (SELECT id_2009 FROM usos5 | |
WHERE (xpath('//COBERTURA[@ID="EDF" and @Sup>20]/@ID', xml_2009::xml))[1]::text='EDF' | |
OR (xpath('//COBERTURA[@ID="UCS" and @Sup>20]/@ID', xml_2009::xml))[1]::text='UCS' | |
OR (xpath('//COBERTURA[@ID="UEN" and @Sup>20]/@ID', xml_2009::xml))[1]::text='UEN' | |
OR (xpath('//COBERTURA[@ID="UDS" and @Sup>20]/@ID', xml_2009::xml))[1]::text='UDS' | |
OR (xpath('//COBERTURA[@ID="TCO" and @Sup>20]/@ID', xml_2009::xml))[1]::text='TCO' | |
OR (xpath('//COBERTURA[@ID="TCH" and @Sup>20]/@ID', xml_2009::xml))[1]::text='TCH') | |
UNION | |
SELECT *, false AS resid FROM usos5 WHERE usos5.id_2009 NOT IN (SELECT id_2009 FROM usos5 | |
WHERE (xpath('//COBERTURA[@ID="EDF" and @Sup>20]/@ID', xml_2009::xml))[1]::text='EDF' |