Blog / Howto

How to download the entire contents of a folder in an S3 bucket with Ansible

June 21, 2018

Just ran into this issue today. I needed to be able to download all the files inside a folder stored in an S3 bucket with Ansible.

The aws_s3 module docs on the Ansible site didn't provide an example on how to do this, but I did find a couple of articles that pointed me in the right direction.

- name: Get list of files from S3
aws_s3:
mode: list
aws_access_key: "{{ aws_access_key_id }}"
aws_secret_key: "{{ …

PostgreSQL Database Restore Commands

June 11, 2018

I've been finding myself doing restores from db backups to my local development more often recently as I've been building dashboard pages for a client and I want to have real data locally so I can get a better idea of what it will look like in production.

I also have a bunch of projects in production with real users and it's good to test-restore their backups at least once a month to make sure …

How to check if your Python app supports TLS 1.2

June 3, 2018

As you may have already heard, the Payment Card Industry (PCI) will be requiring everyone to use at least TLS 1.1 (1.2 is recommended) to meet their data security standard starting on June 30, 2018. Other services, such as PyPI, will be requiring only TLS 1.2 connections on the same date as well.

You need to make sure that the version of Python you're using and related packages support TLS 1.2 or a bunch …

How to find the Wi-Fi network password (and other settings) via command line in Ubuntu

February 7, 2018

While you can get this information via the "Network Connections" GUI, it could come in handy sometimes to know where this is located. For example, you might want to write a script to display the SSID and passwords of all the Wi-Fi networks you've connected to.

Basically, all the network connections are saved under /etc/NetworkManager/system-connections in Ubuntu in separate configuration files. If you want to delete all the Wi-Fi settings in bulk (for privacy reasons …

How to delete all queues in RabbitMQ

January 21, 2018

I recently had to do this for one of my older Django projects that uses Celery as I made the mistake of using the broker as the result backend.

Using "amqp" as the result backend is not recommended in production as this will create a queue for each task. I noticed I was getting a warning for the file descriptors in the RabbitMQ web management dashboard.

From the web management (available by installing the management …