This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script de récupération des URL des contenus collecté dans scoop.it | |
# | |
# Usage: sh descoopit.sh url_scoopit nb_pages | |
# | |
# Exemple: sh descoopit.sh https://www.scoop.it/u/open-data-france/ 3 > odf.txt | |
# | |
# Dépendances: curl, jq, grep, sed | |
for p in `seq 1 $2` | |
do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# extraction des changements de SIRET dans les fichiers de maj quotidien SIRENE | |
# génère un fichier CSV avec SIRET_OLD, SIRET_NEW et DATEMAJ | |
# unzip = décompression du zip | |
# csvcut = ectraction des colonnes qui nous intéressent + conformation CSV | |
# egrep = extraction de slignes qui nous intéressent | |
# csvsql = rapprochement pour obtenir le lien ancien -> nouveau SIRET | |
FILE=$(echo $1 | sed 's/.zip//') | |
unzip $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export SHAPE_ENCODING="UTF-8" | |
pushd /home/cquest/public_html/openfla/export/ | |
# export communes (métropole et DOM) | |
ogr2ogr -f "ESRI Shapefile" -lco ENCODING=UTF-8 -s_srs "EPSG:3857" -s_srs "EPSG:3857" -t_srs "EPSG:4326" -overwrite communes-20180101.shp PG:"dbname=osm" -sql "select tags->'ref:INSEE' as insee, name as nom, tags->'wikipedia' as wikipedia, floor(st_area(geography(st_transform(way,4326)))/10000) as surf_ha, way from fr_admin where tags ? 'ref:INSEE' and admin_level='8' and tags->'ref:INSEE'<'98000' and tags->'ref:INSEE' not like '975%'" | |
zip -9m communes-20180101-shp.zip communes-20180101.* && zip communes-20180101-shp.zip LICENCE.txt communes-descriptif.txt | |
# export communes (hors métropole et DOM) | |
ogr2ogr -f "ESRI Shapefile" -lco ENCODING=UTF-8 -s_srs "EPSG:3857" -t_srs "EPSG:4326" -overwrite communes-com-20180101.shp PG:"dbname=osm" -sql "select tags->'ref:INSEE' as insee, name as nom, tags->'wikipedia' as wikipedia, floor(st_area(geography(st_transform(way,4326)))/10000) as surf_ha, way from |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Téléchargement des données INSEE" | |
wget https://www.insee.fr/fr/statistiques/fichier/2387803/bpe16_ensemble_xy_dbase.zip | |
unzip bpe16_ensemble_xy_dbase.zip | |
echo "Téléchargement des données OpenStreetMap" | |
wget http://osm13.openstreetmap.fr/~cquest/openfla/export/communes-20160614-shp.zip | |
unzip communes-20160614-shp.zip | |
echo "Import dans postgresql" | |
pgdbf bpe_ensemble_xy.dbf -s iso8859-1 | sed 's/,\([0-9][0-9][0-9][0-9]\)/.\1/g' | psql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
noeuds avec tag ref:INSEE=* et name=* non conforme aux règles de toponymie | |
*/ | |
[out:xml][timeout:300]; | |
{{geocodeArea:france}}->.searchArea; | |
( | |
node["ref:INSEE"][place!~"suburb"][name!~"^(Le |La |Les |Aux |)[A-Za-zÉÈÎŒÇéèêëäàäâîïöÿôûüœç\'\-]*$"](area.searchArea); | |
); | |
out meta; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
with serial.Serial('/dev/ttyUSB0', 4800, parity=serial.PARITY_EVEN, bytesize=7, timeout=5) as ser: | |
ser.write(12) | |
ser.write(b'Hello world') | |
s = ser.read(10) | |
print(s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=renderd service | |
After=postgresql.target | |
[Service] | |
Type=forking | |
User=www-data | |
PIDFile=/var/run/renderd/renderd.pid | |
ExecStartPre=/bin/mkdir -p /var/run/renderd | |
ExecStart=/usr/bin/nice /usr/bin/renderd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
175060001 COM | |
175060011 LIB DTE 003 | |
175060018 LIB DER 000 | |
175060043 LIB PCV 000 | |
175060047 LIB NA 065 | |
175060055 LIB PCV 000 | |
175060058 LIB NA 070 | |
175060059 LIB PCV 000 | |
175060064 COM | |
175060067 LIB PCV 000 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
f = open(sys.argv[1],'r') | |
lines = f.readlines() | |
directory = ['','','','','','','',''] | |
prefix = '' | |
for l in lines[1:-2]: | |
n = l.lstrip() | |
level = (len(l)-len(n))/2 | |
i = n.split(' ') |