Ubuntu
-
How to Configure Consul KV Using Docker
Introduction Consul by HashiCorp is a versatile tool that serves multiple functions in a modern DevOps environment. It’s widely used for service discovery, health checks, load balancing, and, notably, as a distributed key-value (KV) store. The KV store in Consul is perfect for storing dynamic configuration data, feature flags, secrets, and metadata in a highly available, consistent manner across your infrastructure such that it can be dynamically accessed by services in a distributed system. Using Docker to configure Consul’s KV…
-
How to Set Up a Fast API Application with a NoSQL Database
Introduction When developing Python applications, FastAPI stands out as a top choice for building high-performance solutions. It offers speed, simplicity, and support for asynchronous programming, making it ideal for developing modern, scalable applications. In this tutorial, we will walk you through the process of setting up a FastAPI application with a NoSQL database. When it comes to storing and managing data, NoSQL databases offer flexibility and scalability, making them a great fir doe applications that need to handle diverse and…
-
How To Perform Unit Testing in Flask
Introduction Testing is essential to the software development process, ensuring that code behaves as expected and is defect-free. In Python, pytest is a popular testing framework that offers several advantages over the standard unit test module, which is a built-in Python testing framework and is part of the standard library. pytest includes a simpler syntax, better output, powerful fixtures, and a rich plugin ecosystem. This tutorial will guide you through setting up a Flask application, integrating pytest fixtures, and writing…
-
How to Build Fast API Application using Docker Compose
Introduction FastAPI is a modern web framework for Python that is designed to deliver high performance, making it an excellent choice for developing application, especially AI-powered apps. This tutorial will guide you through the process of creating and setting up a FastAPI application on an Ubuntu machine using Docker Compose. This method simplifies deployment and provides a strong foundation for integrating AI in your applications. Build FastAPI App using Docker Compose Python Environment Setup Create Virtual Environment Install Docker Create…
-
How To Create a REST API with Flask on Ubuntu
Introduction In this tutorial, you will learn how to create a simple REST API using Flask, a lightweight Python web framework. We’ll cover the basics of setting up a Flask application, defining routes, handling requests, and returning JSON responses. By the end of this tutorial, you will have a working API that you can extend and integrate with other applications. Prerequisites A server running Ubuntu and a non-root user with sudo privileges and an active firewall. For guidance on how…
-
How to Run a Python Script on Ubuntu
Introduction As building AI-based tools becomes increasingly popular with developers, Python has emerged as one of the best programming languages for AI due to its simplicity, readability, and extensive libraries like TensorFlow, PyTorch, and scikit-learn. These libraries provide powerful tools for machine learning, data analysis, and neural networks, making Python a top choice for AI and machine learning projects. Considering Python’s central role in AI, it’s important to learn how to run Python scripts effectively. This tutorial is designed to…
-
How to Use Fast API with a Relational Database on Ubuntu
Introduction FastAPI has quickly gained popularity as a high-performance, easy-to-use web framework for building APIs with Python. When paired with a relational database, FastAPI can be used to create powerful, scalable applications. This guide will walk you through the process of setting up a FastAPI application with a relational database on an Ubuntu 24.04 machine. We will cover everything from installing the necessary tools to configuring the database and creating API endpoints. Use FastAPI with PostgreSQL Database Python Environment Setup…
-
Ansible and the Pre-Container Arts
Before containerization made it so easy to prepare images for virtualization, it was quite an art to prepare custom ISO images to boot from CD. Later these images were used to boot virtual machines from. In other words, ISO images were precursors of container images. It is so that I had a couple of unfortunate run-ins with the Windows Docker client. Even when not running any containers, the Windows memory manager would hand it as much memory as possible slowing…
-
Building for Production: Web Applications — Backups
Introduction After coming up with a recovery plan for the various components of your application, you should set up the backup system that is required to support it. This tutorial will focus on using Bacula as a backups solution. The benefits of using a full-fledged backup system, such as Bacula, is that it gives you full control over what you back up and restore at the individual file level, and you can schedule backups and restores according to what is…