Skip to content

Instantly share code, notes, and snippets.

View La0's full-sized avatar

Bastien Abadie La0

View GitHub Profile
@La0
La0 / Dockerfile
Last active August 27, 2021 10:28
dateparser crash
FROM python:3.8
RUN curl 'https://gist.githubusercontent.com/La0/b47ffd259809be0dc08cae1315ccf2b2/raw/dcb863966d22fa3b587e4ae3b868f61510cdbd2a/test.py' > test.py
RUN pip install -q pytest==6.2.4 dateparser==1.0.0
CMD ["pytest", "-vv", "test.py"]

graph TD A[Hard] -->|Text| B(Round) B --> C{Decision} C -->|One| D[Result 1] C -->|Two| E[Result 2]

graph TD
A[Hard] -->|Text| B(Round)
B --> C{Decision}
C -->|One| D[Result 1]
C -->|Two| E[Result 2]
@La0
La0 / crash-black.sh
Last active February 26, 2020 14:30
#!/bin/bash -xe
pip install pre-commit virtualenv==20.0.5
virtualenv x
source x/bin/activate
git clone https://github.com/psf/black.git
cd black
git checkout stable
pip install .
@La0
La0 / tc-admin.py
Last active February 12, 2020 08:52
tc-admin proxy demo
from tcadmin.appconfig import AppConfig
from tcadmin.resources import Secret
appconfig = AppConfig()
@appconfig.generators.register
async def test(resources):
# Create a dummy secret
name = "project/fuzzing/test-proxy"
resources.manage(f"Secret={name}")
@La0
La0 / demo.py
Created January 24, 2020 06:49
from taskcluster.helper import TaskclusterConfig
from datetime import timedelta
ttl = timedelta(days=2)
tc = TaskclusterConfig("https://community-tc.services.mozilla.com")
tc.auth()
tc.upload_artifact("public/demo.txt", "Hello Taskcluster World!", "text/plain", ttl)
@La0
La0 / artifact.py
Last active November 12, 2019 18:02
import datetime
import os
import requests
from taskcluster import Queue
TASKCLUSTER_DATE_FORMAT = "%Y-%m-%dT%H:%M:%S.%fZ"
def create_blob_artifact(
queue_service, task_id, run_id, path, content, content_type, ttl
@La0
La0 / infer.json
Created August 29, 2019 14:28
Infer payload
[
{
"bug_trace": [
{
"column_number": -1,
"description": "Accessing a value using a key that was retrieved from a `keySet` iterator. It is more efficient to use an iterator on the `entrySet` of the map, avoiding the extra `HashMap.get(key)` lookup.",
"filename": "mobile/android/geckoview/src/main/java/org/mozilla/gecko/mozglue/GeckoLoader.java",
"level": 0,
"line_number": 102
}

Keybase proof

I hereby claim:

  • I am La0 on github.
  • I am la0 (https://keybase.io/la0) on keybase.
  • I have a public key whose fingerprint is 69A3 9F9F 8230 7217 870D 083F F5F6 0CAA 5BB6 9CAA

To claim this, I am signing this object:

@La0
La0 / gist:f8671d694bfdebe7b63c11ebaf4c7521
Created June 6, 2017 16:48
docker-diff mozilla-shipit-pulse-listener:1.0.0 mozilla-shipit-uplift:1.0.0
This file has been truncated, but you can view the full file.
3,5c3,5
< -r-xr-xr-x 2455 bin/..shipit-pulse-listener-wrapped-wrapped
< lrwxrwxrwx 0 bin/.python3.5m-wrapped
< -r-xr-xr-x 652 bin/.shipit-pulse-listener-wrapped
---
> lrwxrwxrwx 0 bin/.flask-wrapped
> lrwxrwxrwx 0 bin/.gunicorn-wrapped
> -r-xr-xr-x 6612 bin/.python3.5m-wrapped
96a97
> -r-xr-xr-x 6607 bin/flask