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 functools | |
import requests | |
import dnf | |
def get_package_version_from_repo(owner, project, chroot, package_name): | |
repo_url = f"https://download.copr.fedorainfracloud.org/results/{owner}/{project}/{chroot}" | |
# Creare una base per la transazione dnf |
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
# Legge messaggi in BUFR o JSON da stdin e li salva in un dbadb | |
# Utilizzo: mistral_dbadb_insert.py [BUFR|JSON] DBADSN | |
# | |
# Author: Emanuele Di Giacomo <[email protected]> | |
# License: GPLv2+ | |
import argparse | |
import sys | |
import dballe |
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
#!/usr/bin/bash -posix | |
# -*-sh-mode-*- | |
# Copyright (C) 2018 Emanuele Di Giacomo <[email protected]> | |
# | |
# 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. |
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 urllib.request | |
import urllib.parse | |
import re | |
from SPARQLWrapper import SPARQLWrapper, JSON | |
sparql = SPARQLWrapper("http://dbpedia.org/sparql") | |
sparql.setQuery(""" | |
SELECT ?songName WHERE { | |
?song dct:subject ?subj . |
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
# Wind barbs for uv raster data. | |
# | |
# The symbol "windbarb" has two barbs. The symbol should be split in multiple symbols and | |
# the raster layer should have multiple CLASS with EXPRESSION: each CLASS will use the right | |
# number of barbs. | |
# | |
# Note: the uv values of the input file `out.tiff` are between 0 and 1. | |
MAP | |
IMAGETYPE PNG | |
OUTPUTFORMAT |
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
#!/bin/bash | |
print_help() | |
{ | |
echo "Usage: $0 ENVI_FILE OUTPUTDIR" | |
echo "" | |
echo "Convert a 52 band ENVI file in 52 GeoTiff files with colortable" | |
} | |
if [[ "$1" == "-h" || "$1" == "--help" ]] |
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
# encoding: utf-8 | |
# | |
# Crea un GeoJSON dei comuni a partire dal raster di precipitazione in cui | |
# aggiunge i seguenti attributi alle feature: | |
# - preci_count: numero di celle nel comune | |
# - preci_sum: somma della precipitazione nel comune | |
# - preci_max: massima precipitazione nel comune | |
# - preci_threshold_50mm_count: numero di celle nel comune che superano i 50mm | |
# - preci_threshold_50mm_alert: "green" se nessuna cella supera i 50mm, | |
# "yellow" se la superano meno di dieci, "red" se la superano 10 o più |
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
from django.http import HttpResponse | |
from django.db.models import BinaryField, Func, F, Value, CharField | |
from .models import MyModel | |
def view_png(request): | |
"""Return a PostGIS raster as a PNG image.""" | |
# MyModel is a django model with a RasterField named "rast". | |
# Note: ST_AsGdalRaster can reproject the data, |
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
#!/bin/bash | |
trap cleanup EXIT | |
cleanup() | |
{ | |
[[ -n "$tmpdir" ]] && rm -rf $tmpdir | |
} | |
show_help() |
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
from datetime import date, timedelta | |
import calendar | |
def daterange(start, end, step=timedelta(days=1)): | |
d = start | |
while d <= end: | |
yield d | |
d += step |
NewerOlder