Posts

Showing posts from June, 2024

Managing FastAPI Projects with Poetry: A Step-by-Step Guide

Image
This guide will walk you through how to use Poetry to manage dependencies and structure your project in FastAPI . It includes detailed explanations of Poetry's core concepts and commands to help prevent issues that can arise during team collaboration and deployment. 1. What is Poetry? Poetry is a dependency management and packaging tool for Python. It goes beyond simply installing libraries by allowing you to clearly declare the dependencies your project needs and ensuring that all developers on the project have the same library versions. Clarity in Dependency Management : Explicitly manage your project's basic information and required libraries through the pyproject.toml file. Reproducible Builds : By locking all dependency versions in the poetry.lock file, it fundamentally prevents "it works on my machine" problems. Integrated Development Environment : It automatically creates and manages isolated virtual environments for each project and handles mo...

Opening a Port on Ubuntu Using UFW (Uncomplicated Firewall)

To open a specific port (in this case, 9040) on Ubuntu, we can use ufw (Uncomplicated Firewall), which is a user-friendly firewall tool in Ubuntu and other Linux. For example, follow these steps to open port 9040 TCP : 1. Check UFW Status First, check if UFW is enabled by running the following command in the terminal:   jason@GU502DU:~$ sudo ufw status  [sudo] password for jason:   Status: active     To                         Action       From   --                         ------       ----   22/tcp                     ALLOW       Anywhere   9200/tcp                   ALLOW       Anywhere   3000/tcp                 ...

FFmpeg] How to Convert WAV (MP4) to MP3 Using FFmpeg

FFmpeg is a powerful tool that can handle various multimedia formats. Converting a WAV file to MP3 is straightforward with FFmpeg. Basic Conversion To convert a WAV file to MP3, use the following command: -i is the input file option, which specifies the file that you want to convert. In this case, input.wav is the name of the WAV file you want to convert.   C:\Users\jason\Downloads> ffmpeg -i input.wav output.mp3 Setting the Bitrate You can specify the bitrate of the output MP3 file using the -b:a option. For example, to convert the file with a bitrate of 192kbps, use: -b:a 192k specifies that the audio bitrate should be set to 192 kilobits per second (kbps). Common bitrates for MP3 files range from 128kbps (standard quality) to 320kbps (high quality).   C:\Users\jason\Downloads> ffmpeg -i input.wav -b:a 192k output.mp3 Extracting MP3 from MP4 The same command can also be used to extract the audio from an MP4 video file and save it as an MP3 file. For exampl...