-
Quick API Auth for Flask
Saturday, March 21, 2020
A quick decorator function for api authorization on Flask endpoints …
-
JSON to Data Object in Python
Friday, February 14, 2020
I recently learned about Class methods. Here is a quick Class method to parse a JSON response into a Data object in Python. …
-
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: …
-
drone.io and the GCR
Wednesday, May 22, 2019
For the last week or so I’ve been evaluating drone.io as a replacement for our current CI engine (spoiler: we aren’t going to use it). Something that I ran across that wasn’t immediately obvious on how to achieve was pulling private images from Google Container Repository. Although there is a thread on the Discouse forums that touches on it, I had to do some testing on my own to actually get it working. Here is what I did. …
-
Keybase
Wednesday, April 17, 2019
Yesterday I decided to resurrect my keybase account. For those of you that don’t know what Keybase is, I suggest you check it out. Among also being (another) secure method to chat, they have a unique feature that allows you to verify that you are the person who is behind other accounts and/or websites. For instance, I verified my Github account, so you can be sure that the Github account @binaryronin is actually the same person writing this article (as I also verified this website), and the person you are messaging on Keybase. …
-
Testing Ansible AWX/Tower roles
Friday, September 21, 2018
As I continue to push forward the use of AWX in our infrastructure, there is continued need to test what we are producing. Much like any other kind of development, sometimes we need a local environment to test something. This came up recently for me in AWX because I was testing a role that modified the AWS Task container in order to provide enhanced functionality. I wrote the following little shell provisioner that gets AWX up and running quickly for testing. …
-
Using Nginx in front of AWX for SSL
Wednesday, August 8, 2018
I’ve got AWX deployed in production currently. Obviously for production, you need to SSL for authentication. Since AWX doesn’t offer this currently, and I’m not paying $20/month just for a ELB for this, I decided to slap Nginx in front of the containers to proxy SSL. This ended up being a larger pain than I expected because of the websockets. Finally got it figured out and wanted to post my nginx config for anyone else trying to do the same thing. …
-
Migration to Gitlab and Gitlab Runners
Wednesday, July 25, 2018
The Linux community, and the open-source community in general, was up in arms last month as Microsoft announced a purchase of Github. For many reasons, which I am not going to detail here, I agree with the general concern and outrage over this. Due to this, I have migrated all my repos from Github (where I was a paying member) to Gitlab. The migration itself is dead easy, but with this migration you lose access to other tools. This mainly impacted me with the loss of CircleCI. Enter Gitlab runners! …
-
docker-py deprecated in favor of docker
Tuesday, July 17, 2018
Just a quick note that the Python module docker-py has been deprecated in favor of docker. I run a few Ansible hosts that run Docker containers for various reasons and recently they started to fail during their Ansible runs. Turns out that docker-py now fails during said runs. After some searching I found that this module hasn’t been updated in a very long time, and has been deprecated in favor of the docker module instead. I wrote the following small Ansible task to fix this on my machines. …