Skip to content

Instantly share code, notes, and snippets.

[
{
"_id": "fr-lo",
"created_at": ISODate("2014-04-17T18:11:53.926Z"),
"title": "Licence Ouverte / Open Licence",
"alternate_titles": [
"LO/OL",
],
"slug": "licence-ouverte-open-licence",
"url": "https://www.etalab.gouv.fr/wp-content/uploads/2014/05/Licence_Ouverte.pdf",

Before

$ inv vmlist
>> wolf.data.gouv.fr
>>> Memory
             total       used       free     shared    buffers     cached
Mem:           63G        62G       497M         0B        92M        22G
-/+ buffers/cache:        40G        22G
@noirbizarre
noirbizarre / oauth_tester.py
Created March 15, 2018 21:12
A quick and dirty oauth 2 client tester
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import Flask, redirect, url_for, session, json, render_template_string
from authlib.flask.client import OAuth
# Dirty hack for self signed certificate
import ssl
if hasattr(ssl, '_create_unverified_context'):
@noirbizarre
noirbizarre / emojis.json
Created February 7, 2018 16:28
Slack emojis
{
"ok": true,
"emoji": {
"bowtie": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/bowtie\/f3ec6f2bb0.png",
"squirrel": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/squirrel\/465f40c0e0.png",
"glitch_crab": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/glitch_crab\/db049f1f9c.png",
"piggy": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/piggy\/b7762ee8cd.png",
"cubimal_chick": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/cubimal_chick\/85961c43d7.png",
"dusty_stick": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/dusty_stick\/6177a62312.png",
"slack": "https:\/\/emoji.slack-edge.com\/T04C2PSNY\/slack\/5ee0c9bea3.png",
@noirbizarre
noirbizarre / udata.todo
Created January 4, 2018 16:00
A TODO list for udata
Entry-points:
☐ Commands
✔ harvesters @done(2017-11-30 00:08) @project(Entry-points)
✔ Link checkers @done(2017-11-30 00:08) @project(Entry-points)
✔ Thèmes @done(2017-11-30 00:09) @project(Entry-points)
☐ Metrics
Switches:
☐ Python 3
☐ Flask-CLI
@noirbizarre
noirbizarre / datasets.json
Created October 25, 2017 16:47
Datasets en erreur
[
{
"_id" : ObjectId("56fe661288ee380160c352f9"),
"_cls" : "Dataset",
"metrics" : {
"nb_uniq_visitors" : NumberInt(0),
"views" : NumberInt(0),
"followers" : NumberInt(0),
"reuses" : NumberInt(0),
"nb_visits" : NumberInt(0),
@noirbizarre
noirbizarre / README.md
Last active January 2, 2024 19:06
A Python macro for LibreOffice calc exporting all the sheets from a spreadsheet to CSV files UTF-8 encoded

Manual

This macro has to be installed in your personnal user macro in:

  • ~/.config/libreoffice/4/user/Scripts/python/export_as_csvs.py on Linux
  • \AppData\Roaming\LibreOffice\4\user\Scripts\python\export_as_csvs.py on Windows
  • /Applications/LibreOffice.app/Contents/Resources/Scripts/python/export_as_csvs.py on MacOS (there may be a better alternative)

You can execute it from the menu Tools > Macros > Run macro... and then select My Macros > export_as_csv in the left column and export_sheets_to_csv in the right one and then click on Run.

@noirbizarre
noirbizarre / zones-with-slashes.js
Last active August 4, 2017 16:15
A Map-Reduce listing remaining dataset coverage zones with slashes in identifiers
/*
* List zones with slahes in identifiers with their occurence count
*/
function mapZonesWithSlahes() {
this.spatial.zones.forEach(function(zone) {
if (zone.indexOf('/') >= 0) {
emit(zone, 1);
}
});
@noirbizarre
noirbizarre / udata-1.1-deployment.md
Last active August 29, 2017 20:16
Déploiement de udata 1.1.0 sur next

Dépôt infra

Modification du fichier group_vars/datagouv-preprod/config.yml

Modifier l'entrée udata_territory_handled_levels avec les valeurs suivantes:

  • fr:commune
  • fr:departement
  • fr:region

Déploiement de la preprod avec restoration des données

ansible-playbook sites/next.data.gouv.fr.yml --extra-vars "restore=true"
@noirbizarre
noirbizarre / datagouv-getting-started.md
Last active June 6, 2017 07:57
Démarrage rapide Data.gouv.fr