Skip to content

Instantly share code, notes, and snippets.

View pmauduit's full-sized avatar

Pierre Mauduit pmauduit

View GitHub Profile
@pmauduit
pmauduit / pom.xml
Last active April 13, 2023 08:33
basic pom.xml for a groovy project
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>example</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>example</name>
<properties>
<maven.compiler.source>11</maven.compiler.source>
@pmauduit
pmauduit / override.conf
Created September 26, 2021 10:36
systemd-logind - not failing systemd configuration under LXC
[Service]
PrivateTmp=no
RestrictNamespaces=no
ReadWritePaths=/etc /run /var/run
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_MAC_ADMIN CAP_AUDIT_CONTROL CAP_CHOWN CAP_KILL CAP_DAC_READ_SEARCH CAP_DAC_OVERRIDE CAP_FOWNER CAP_SYS_TTY_CONFIG
ProtectProc=default
ProtectClock=yes
ProtectControlGroups=no
ProtectHome=no
ProtectHostname=yes
@pmauduit
pmauduit / GeoUtils.groovy
Last active September 22, 2021 08:24
groovy - scraping polygons from OpenStreetMap (fr) API
import groovy.json.JsonSlurper
class GeoUtils {
static def retrieveProbableOsmRelationId(String cityName) {
def cityNameEncoded = java.net.URLEncoder.encode(cityName, "utf-8")
def queryUrl = "https://nominatim.openstreetmap.org/search?q=${cityNameEncoded}&format=json&osm_type=relation"
def nominatimResult = new JsonSlurper().parseText(new URL(queryUrl).text)
if (nominatimResult.size() == 0) {
return null
@pmauduit
pmauduit / pom.xml
Created July 16, 2021 13:20
sample pom file for groovy projects
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dudu.dudu</groupId>
<artifactId>popo</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>dudududupopopo</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@pmauduit
pmauduit / HttpsClient.java
Created March 4, 2021 14:43
SSLPoke simple HttpsClient
import java.net.MalformedURLException;
import java.net.URL;
import java.security.cert.Certificate;
import java.io.*;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLPeerUnverifiedException;
public class HttpsClient{
@pmauduit
pmauduit / liste
Created September 1, 2020 18:51
Liste noire numéro téléphone avant suppression
0299007144,
0422615192,
0257544483,
0465663030,
0185153027,
0970580331,
0615539125,
0184145020,
0187645876,
0238531758,
@pmauduit
pmauduit / keybase.md
Created September 11, 2019 13:04
keybase proof

Keybase proof

I hereby claim:

  • I am pmauduit on github.
  • I am pmauduit (https://keybase.io/pmauduit) on keybase.
  • I have a public key ASAmmm2aIBameHKMhnEHo0FHcjv49OA2cxx0K4ySeLmS8Ao

To claim this, I am signing this object:

@pmauduit
pmauduit / osmposter.md
Last active October 26, 2019 09:28
OSMPoster

Introduction

L'idée était d'utiliser les tracess gpx fournies par les contributeurs OSM. Je ne sais plus trop pourquoi j'étais parti la dessus, sans doute que c'était moins chiant et plus "fuzzy" que de tenter de récupérer tous les chemins possibles (routes, autoroutes, secondaires, tertiaires, pistes cyclables, ...), i.e. la donnée déjà traitée et valorisée dans la base OSM. J'avais voulu sans doute partir sur quelquechose un peu plus "brut de fonderie".

Donc il y avait plusieurs étapes:

@pmauduit
pmauduit / settings.xml
Created January 14, 2019 12:34
m2 settings
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>artifactory-georchestra</id>
<mirrorOf>*</mirrorOf>
<url>https://packages.georchestra.org/artifactory/maven</url>
</mirror>
@pmauduit
pmauduit / bash
Created November 29, 2018 12:21
rancher-cli sample
% cat ~/bin/rancher-pigma-dev-2 02:28|26:55|2018-11-29 13:20:09 pmauduit pts/14
#!/bin/bash
rancher --config ~/.rancher/cli-caas-dev.camptocamp.com.json --env pigma-dev-2 $@