Other articles

  1. ZSH tips



    Useful to have a notification when a long command completes.

    To enable it, add zbell to your plugins array if you are using oh-my-zsh or source the definition file.

    To configure:

    • The minimum time commands must take for the notification to happen, use: ZBELL_DURATION. For instance ZBELL_DURATION …
    read more
  2. Heroku tips

    Use an editor

    By default there is no editor on Heroku. To get one, you can use the heroku-nano plugin like this (or by installing as a plugin):

    mkdir bin
    cd bin
    curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent > nano.tar …
    read more
  3. Use dnsmasq with NetworkManager

    Sat 08 September 2018 | tags: linux

    This will, for instance, allow you to redirect all matching domains to a certain server: dnsmasq will intercept the DNS query and return the ip you specified.

    To do this, edit NetworkManager configuration in /etc/NetworkManager/NetworkManager.conf and add in the main section dns=dnsmasq:


    You …

    read more
  4. 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
  5. 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

Page 1 / 6 »