Other articles

  1. VSCode tips

    Sun 02 September 2018 | tags: VSCode




    To use a venv with VSCode, add in the folder settings:

        "python.pythonPath": "~/.virtualenvs/bureauxlocaux--Uxk5jFn/bin/python",
        "python.unitTest.pyTestEnabled": true
    read more
  2. Timeout a function in python

    Sat 02 June 2018 | tags: Python

    You can use signals and a context manager to acheive this. The idea is to register a function that will raise an exeption when the alarm signal is received and schedule the alarm signal for the timeout.

    import signal
    from contextlib import contextmanager
    def timeout(time):
        # Register a function …
    read more
  3. How to cache Python module in Gitlab CI

    By default, pip cache will be in ~/.pip. However, this folder cannot be cached by Gitlab. The trick is to force pip to use a folder located in the build directory with the --cache-dir option. You can then cache this folder.

    For instance, you can use .pip as in the …

    read more
  4. Chiffrer des fichiers avec GPG

    Voici deux fonctions bash qui permettent de chiffrer et déchiffrer un fichier ou un dossier avec GPG.

    Les dossiers sont compressés dans une archive ZIP avant le chiffrement.

    Le chiffrement laisse les fichiers d'origine intacts. Le déchiffrement laisse le fichier chiffré intact.

    Ces fonctions auront leur place dans votre .bashrc …

    read more

Page 1 / 5 »