Other articles

  1. 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
    
    
    @contextmanager
    def timeout(time):
        # Register a function …
    read more
  2. Some tips for django

    Easily increment migrations numbers

    Here is a small bash script to increment the numbers of your migrations. Put it into your ~/.profile or ~/.bashrc. Use it like: inc-migrations PROJECT/apps/APP_NAME/migrations 0012

    It will rename all migrations from 0012 (ie transform 0012_mig.py into 0013_mig.py and so on …

    read more
  3. Run multiple docker daemons on the same host

    Today I am going to explain how you can run multiple docker daemons on the same host. This can be useful if you want several users to use docker and want each of them to be isolated from one another (ie don't see images, containers, … of other users). The solution …

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

Page 1 / 10 »

Pages

blogroll

social

>