Gitlab CICD Pipeline to Deploy your Python Flask API with Postgres on Heroku
Today we will build a Restful API using Python Flask, SQLAlchemy using Postgres as our Database, testing using Python Unittest, a CI/CD Pipeline on Gitlab, and Deployment to Heroku.
Should you be interested in setting up a Custom Gitlab Runner on Your Own Server for Gitlab CI have a look at the embedded post.
Heroku
If you don'...
Capturing 54 Million Passwords with a Docker SSH Honeypot
The last couple of days I observed thousands of SSH Brute Force Attacks, so I decided I will just revisit my SSH Server configuration, and change my SSH port to something else for the interim.
The dashboard that showed me the results at that point in time:
Then I decided I actually would like to set up an SSH Honeypot to listen...
While I'm learning a lot about encryption at the moment, I wanted to test out encryption with the PyCrypto module in Python using the Advanced Encryption Standard (AES) Symmetric Block Cipher.
Installing PyCrypto:
$ pip install pycrypto --user
PyCrypto Example:
Our AES Key needs to be either 16, 24 or 32 bytes long and our Init...
Improve MySQL Write Performance Using Batch Writes
I am no DBA, but I got curious when I noticed sluggish write performance on a mysql database, and I remembered somewhere that you should always use batch writes over sequential writes. So I decided to test it out, using a python script and a mysql server.
What will we be doing
I wrote a python script that writes 100,000 records...
In this tutorial we will setup a Hugo Blog with the Kiera theme on Linux and will be using Ubuntu for this demonstration, but since Hugo runs on Go, you can run this on Windows, Linux or Mac.
Dependencies
We require git to download the theme from github, so first update your package managers indexes, and install git:
$ apt updat...
In this tutorial, I will demonstrate how to set up cross-account access for S3, from using two AWS Accounts.
Scenario
We will have 2 AWS Accounts:
a Green AWS Account which will host the IAM Users, this account will only be used for our IAM Accounts.
a Blue AWS Account which will be the account that hosts our AWS Resources,...
Logging with Loki is AMAZING!
Background
In the past couple of months I've been working a lot with logging, but more specifically logging with Loki. As most of my metrics reside in Prometheus, I use Grafana quite extensively and logging was always the one that stood out a bit as I pushed my logs to Elasticsearch and consumed th...
Using the libvirt provisioner with Terraform for KVM
In this post we will use the libvirt provisioner with Terraform to deploy a KVM Virtual Machine on a Remote KVM Host using SSH and use Ansible to deploy Nginx on our VM.
In my previous post I demonstrated how I provisioned my KVM Host and created a dedicated user for Terraform to authenticate to our KVM host to provision VMs.
O...
In this post I will demonstrate how to send messages to slack using python based on the status of an event.
We will keep it basic, that when something is down or up, it should send a slack message with the status, message, color and embed your grafana dashboard links inside the alert (or any links that you would like).
Create a...
In this tutorial we will use minica to enable us to run our web applications over HTTPS for local development.
To read more about about minica check out their website.
Generate Certificates
You can use their binary from their github page or use my docker image to generate the certificates to a ./certs directory:
$ docker run --u...
In this tutorial I will demonstrate how to run Loki v2.0.0 behind a Nginx Reverse Proxy with basic http authentication enabled on Nginx and what to do to configure Nginx for websockets, which is required when you want to use tail in logcli via Nginx.
Assumptions
My environment consists of a AWS Application LoadBalancer with a Ho...