Saturday, March 19, 2016

PHP - Problems With Long Running Processes

Great article about the problems with using PHP for long running processes: https://software-gunslinger.tumblr.com/post/48215406921/php-is-meant-to-die-continued

Describes the main reason why I started using Python for long-running jobs.

Thursday, March 3, 2016

Ansible Vault - storing secrets in repos

When others are deploying a project for you, it's easy for mistakes to be made when secrets must be updated in environmental variables. Ansible-vault takes a different approach and encrypts the secrets - allowing you to store the secrets in your repo.

To encrypt a file: ansible-vault encrypt secrets.py
To decrypt a file: ansible-vault decrypt secrets.py

More documentation is available here: http://docs.ansible.com/ansible/playbooks_vault.html

Python - isort, useful tool for sorting python imports

http://timothycrosley.github.io/isort/

I saw it in the django coding style documentation: https://docs.djangoproject.com/en/1.9/internals/contributing/writing-code/coding-style/

To make an entire project's imports easier to read, all you need to do is:

  • pip install isort
  • isort -rc .

There's also a sublime plugin for it here: https://github.com/thijsdezoete/sublime-text-isort-plugin#install