Blog
Pull private docker images from Docker Hub to EC2 instances
If you’re running Docker containers, probably you want to run this container in the cloud, but sometimes you need to deploy a image from a private repository on Docker Hub in many EC2 machines so, typing docker login in all is not exactly a good solution. You could use Ansible for something like that, but it involves private keys, access to all machines through ssh, and it might be not possible depending on your company or application.
December 8, 2021
How to cache API keys in Python
Making a timed LRU cache We’re not going deep in lru_cache in this article. If you want to know more about how the things work under the hood, I suggest two links: this link to the official docs, and this link for a nice tutorial from Real Python. To use lru_cache, you can simply add the decorator in the function, but the cache will never expire, and it is bad for our problem because API keys do expire, they have a lifespan. We need to expire this cache in a certain time. So, we’ll have to override the decorator with our decorator.
September 6, 2021
Simple guide of Iptables
Attention: All the operations will be accomplished considering that you’re logged as “root”, or that you’re running the commands with sudo, therefore, be careful Show the Rules: First, you’ll need to verify all the rules that you already have. To list all the rules,use the following command: iptables -L If you want to see the lines of the rules (this will be important later), you can simply type the following command:
May 19, 2021