Skip to content

Instantly share code, notes, and snippets.

Mathieu Leplatre leplatrem

Block or report user

Report or block leplatrem

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@leplatrem
leplatrem / snippet.yaml
Last active Oct 11, 2018
Remote Settings Example Schema
View snippet.yaml
attachment:
enabled: true
required: true
displayFields:
- details.name
- incremental
- attachment.filename
schema:
type: object
description: Certificate revocation data.
View delete-collections.sh
USERPWD=user:pass
SERVER=https://kinto-writer.stage.mozaws.net/v1
for cid in 2a0b9078-a798-4f37-b5f3-9cd7eebda544 66cd6e46-e925-413d-a992-d725703ff65f 3db1da84-a687-4c3f-bc06-e57829fe9629 1484aaaa-6d94-4a96-bd08-fd9aab2deaa2 qatest-2 qatest2 qatest qatest1 qatest123 0800b409-53ec-4987-b22d-15e990a7d405 baidvv4w3v5tap7y bicyolhzprhvu4ey bmduchjvfkgusq6a bjyzvcvzeuzacyty 50c3b114-8fb6-4dec-a262-bd36e8e97d1f 0b568598-079d-4cb6-95b0-d4a6c3296b4d 182f2e43-6af7-447a-b38b-72eaf810476f qa-test abc BtkWLaXr ivufVz0q eFh34Dtz DKCqLcZk; do
curl -X DELETE $SERVER/v1/buckets/main-workspace/groups/$cid-editors -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-workspace/groups/$cid-reviewers -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-workspace/collections/$cid -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main-preview/collections/$cid -u $USERPWD
curl -X DELETE $SERVER/v1/buckets/main/collections/$cid -u $USERPWD
done
@leplatrem
leplatrem / RemoteSettings.rst
Last active Apr 3, 2018
RemoteSettings.rst
View RemoteSettings.rst

Remote Settings

The remote-settings.js module offers the ability to fetch remote settings that are kept in sync with Mozilla servers.

Usage

@leplatrem
leplatrem / bulk.py
Last active Feb 21, 2018
bulk plugins update + request review
View bulk.py
import os
from kinto_http import Client
FIREFOX_GUID = "ec8030f7-c20a-464f-9b0e-13a3a9e97384"
SERVER = os.getenv("SERVER") or "https://settings-writer.prod.mozaws.net/v1"
USERNAME = os.getenv("USERNAME")
PASSWORD = os.getenv("PASSWORD")
View iam-example-balrog.yaml
audience: balrog.stage.mozaws.net
managers:
- releng@mozilla.com
groups:
admins:
- email:mathieu@mozilla.com
- userid:google-oauth2|34351789u0y
policies:
-
id: super-user
View telemetry-example.py
import aiohttp
import asyncio
import json
import sys
PRODUCT = "firefox"
SERVER_URL = "https://buildhub.stage.mozaws.net/v1/buckets/build-hub/collections/releases/search"
@leplatrem
leplatrem / async_pipe.py
Last active Aug 11, 2017
Download, decompress and process gzipped content
View async_pipe.py
import asyncio
import io
import zlib
import sys
import asyncio
import aiohttp
async def download_big_file(loop):
@leplatrem
leplatrem / export.geoson
Created Jun 21, 2017
Italian pizzerias
View export.geoson
This file has been truncated, but you can view the full file.
{
"type": "FeatureCollection",
"generator": "overpass-ide",
"copyright": "The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.",
"timestamp": "2017-06-20T14:05:51Z",
"features": [
{
"type": "Feature",
"properties": {
@leplatrem
leplatrem / mirror_archives.py
Last active Nov 19, 2018
mirror_archives.py
View mirror_archives.py
import asyncio
import json
import os
import re
from urllib.parse import urlparse
import async_timeout
import aiohttp
import backoff
View gist:289fb866dba8213708fcf762517b846d
import datetime
import json
import requests
import kinto_http
def buildid2iso(buildid):
return datetime.datetime.strptime(buildid, "%Y%m%d%H%M%S").isoformat()
You can’t perform that action at this time.