-
CentOS and Newer Versions of Python
Wednesday, September 2, 2020
When working on Python development locally on my Arch machine, I am generally either working on Python 3.7 or 3.8. This is usually not an issue since Lambda natively supports Python 3.7. However, on CentOS 7 and 8 the latest version of Python available is 3.6. In order to sanely get Python 3.7 on CentOS I wrote the following little playbook that uses Pyenv to install the version of Python I need on the servers. …
-
Quick API Auth for Flask
Saturday, March 21, 2020
A quick decorator function for api authorization on Flask endpoints …
-
Quickly deploying Python code to Lambda
Thursday, December 12, 2019
Lambda is pretty awesome, and we use it for a ton of things at work. I’ve deployed around 20 different scripts at this point, that do everything from monitoring type of tasks to a full Slackbot. Although generally we use Ansible to deploy everything (including our Lambda tasks), there are times when things need to go and they need to go now. For this I wrote a simple script that zips up a package that can be manually deployed to Lambda with all the necessary libraries and things your script needs. …
-
Writing a Custom Model Field for Encryption
Tuesday, July 23, 2019
Lately I’ve been learning web development with Django. I have a few projects I’ve been working on and have learned a ton. Something I came across in one of my projects was the need to encrypt fields in the database. Being a DevOps/Security guy I know the whole arguments against and for using encryption on specific database fields. In this case I am storing some usernames and passwords for a site I am scraping, and felt that encryption was better than nothing. I found an article but didn’t like the exact way they were implementing the encryption so I changed it. Below is that implementation: …
-
Migrating to Lambda from Cron Jobs
Wednesday, February 21, 2018
One of my jobs (at least as I see it) is not only to automate infrastructure, but also to consolidate and simplify infrastructure. Too many companies I have worked at have small bits of amazing things, surrounded by loads of convoluted messes left by others. As we move more and more into public cloud infrastructure, in this case AWS, I started thinking about the things I could simplify using AWS only tools. The old way of doing things (as set up by the engineers before me) was to have loads of cron jobs, running across multiple machines, for tasks like taking EBS snapshots. This isn’t a problem when everything is humming along perfectly, but as soon as something breaks, the hunt for where it broke begins. My old strategy involved using the bastion hosts (those that sat on the outside of the VPC for access to VPC machines). But even this could be missed by someone who doesn’t understand my particular way of doing things. This also doesn’t provide consolidated logging either, unless you consume logs from every bastion host into some logging service. Enter Lambda. …