Categories
CI/CD Dev Docker

Deploying a FastAPI App to Fly.io with GitHub Actions: Part 2

Part 1 covered building a FastAPI application with a Dockerfile and getting it running locally. Here you take that same application and ship it to Fly.io, then wire up a three-stage GitHub Actions pipeline that tests, builds, and deploys on every push to main. By the end, you have a production URL, a health check […]

Categories
Cisco Dev SDA

Cisco Catalyst Center Jinja Templating: Part 1

Manually configuring hundreds of network devices creates unnecessary friction, even when the differences between configs are minimal. Jinja templating in Catalyst Center lets you parameterise device configurations, so you write a template once and provision devices at scale by feeding in different variable values. This approach eliminates copy-paste errors and makes configuration management auditable and […]

Categories
Ansible MacOS

How to Set Up Ansible in a Virtual Environment on macOS

Prerequisites If you haven’t installed Homebrew yet, open Terminal and run: Follow the on-screen instructions to complete the installation. Step 1: Install Python and virtualenv First, ensure that Python is installed. Homebrew makes this straightforward: Next, install virtualenv and sshpass using Homebrew: Step 2: Create a Virtual Environment Choose a directory where you want to set up […]

Categories
Python

Guide to Reading CSV Data with Python

Introduction CSV (Comma Separated Values) files are commonly used for data exchange between different applications. In Python, reading information from a CSV file is quite straightforward with the built-in csv module. This article will guide you through writing Python code to read information from a CSV file using this module. Prerequisites Make sure that your Python environment […]

Categories
ESP32 Python

ESP32, MicroPython, and controlling a relay

Now that we have an ESP32 connected to our network and running python, the next task is to connect a two switch relay and be able to control it. Eventually we will do this via MQTT, but for now a web server will be enabled on the board to allow manual control of the relay […]

Categories
ESP32 Python

MicroPython connect to wireless network

In our previous post we uploaded a python script to the ESP32 to run on boot. This time we will connect the ESP32 to our wireless network. Firstly I am going to create a config.py file to store any configuration parameters we are going to use. In this case we simply have the SSID and […]

Categories
ESP32 Python

ESP32 MicroPython run script on boot

In a previous post we flashed a W32-WROOM-32 with MicroPython and successfully got to an interactive python prompt via serial. Now we will create a simple python script and upload it to the ESP32 and have it run on boot. First, lets create a really simple python script -: import time print(‘Hello world! I can […]

Categories
ESP32 Python

ESP32 and MicroPython

I have some ESP32 based boards lying around and stumbled across MicroPython, which appealed to me as I have some Python code I wanted to try and port to an ESP32 board. MicroPython supports ESP32 and any board should work, I am using an ESP32-WROOM-32. Download the firmware Download the latest version of the firmware […]