Posts

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...

A Comprehensive Guide to Spring Boot & Swagger (OpenAPI) Integration

Image
This guide provides a detailed walkthrough for integrating Swagger UI (with OpenAPI 3.0) into your Spring Boot project. It covers everything from initial dependency setup to handling authentication and following best practices to effectively automate and manage your API documentation. 1. Adding Dependencies First, add the necessary springdoc-openapi dependencies to your pom.xml file. springdoc-openapi-starter-webmvc-ui : This is the core library that automatically generates the OpenAPI 3.0 specification by analyzing your Spring Boot application. It also provides the embedded Swagger UI. springdoc-openapi-maven-plugin : (Optional) This plugin extracts the API documentation into a static file (e.g., openapi.json ) during the Maven build process. It's useful for CI/CD pipelines, sharing API specs with other teams, or generating client-side code. <dependencies> <dependency> <groupId>org.springdoc</groupId> <artifactId>s...

How to extract YouTube to MP3 with yt-dlp

Image
yt-dlp.exe is a powerful command-line program that allows you to download videos and audio from various websites, including YouTube. With this tool, you can easily convert and save YouTube videos as MP3 audio files. Before you begin, yt-dlp.exe requires a separate program called FFmpeg to convert files to MP3 format. Therefore, you must complete the following two preparatory steps first. Prerequisites Download yt-dlp.exe: Go to the official yt-dlp GitHub releases page and download the latest version of the yt-dlp.exe file. Download and Install FFmpeg: Navigate to the official FFmpeg website and download the version compatible with your operating system (Windows). After unzipping the downloaded file, you must either copy the ffmpeg.exe file from the bin folder into the same folder as yt-dlp.exe , or add the path to the folder containing ffmpeg.exe to your system's Path environment variable. For ease of use, it is recommended to place yt-dlp.exe and ffmpe...

How to Add a gRPC Endpoint to a Spring Boot Microservice

Image
This blog guides you through the standard procedure for adding a gRPC endpoint to the order-service project. The primary goal is to handle "create new order" requests from external clients via gRPC. This process involves calling an internal u ser-service to validate user information. Why Use gRPC? Performance: It's fast, using HTTP/2 and binary serialization (Protobuf), which reduces communication overhead. Strict API Specification: The .proto file clearly defines the service interface and message structures, ensuring type safety at compile time. Multi-language Support: It's suitable for polyglot architectures, as clients and servers can be implemented in various languages. 1. Define the Service with Protocol Buffers (.proto) First, define the service contract by creating a .proto file in the src/main/proto directory. order.proto syntax = "proto3"; package com.abc.order.grpc; // Java code generation options option java_multiple_fil...

A Guide to Automating Connections with SecureCRT Logon Scripts

Image
Developers and system administrators often repeat the daily process of connecting to multiple servers via SSH or Telnet. SecureCRT's "Logon Actions" (or "Logon Scripts") feature is a useful tool that automates these repetitive connection procedures, reducing wasted time and significantly improving work efficiency. I personally used this feature because I found the process of connecting to a PostgreSQL database to be tedious every time. In addition to database connections, this feature is also very useful when you need to connect to a final destination server through an intermediary server, often for security reasons. For example, the true value of this feature becomes apparent in a "jump server" environment, where you must first log into Server A via SSH and then, from there, initiate another Telnet or SSH connection to Server B. Step 1: Create the Python Script File Create a python code file with a .py extension. It's recommended to creat...

How to install docmost on Synology NAS (DS916+) with Docker

Image
This blog provides a comprehensive guide to installing and configuring Docmost, an open-source collaborative wiki and notion alternative, on a Synology NAS (DS916+ and similar models) environment using Docker. 1. Reverse Proxy Setup for External Access To access Docmost via an external domain (e.g.,  docmost.your-domain.i234.me ) and to fix the "Real-time editor connection lost" error, a reverse proxy setup is essential. Step 1. Navigate to Reverse Proxy Settings Go to DSM  Control Panel  >  Login Portal  >  Advanced  tab. Click the  Reverse Proxy  button and then  Create . Step 2. General Settings Step 3. (Crucial) Custom Header Settings After clicking  Create , go to the  Custom Header  tab. Click the  Create  dropdown menu and select  WebSocket . This will automatically add the two necessary headers. This step is key to resolving the real-time editing error. Click  Save  to complete...

Setting Up a Modern Vim 9.x IDE on Ubuntu or Linux

Image
This guide walks you through the process of transforming the terminal on a new Ubuntu or Linux server into a powerful, IDE-like environment. We will accomplish this by installing the latest Vim 9.x, setting up a plugin manager, and configuring essential plugins for a modern development workflow. Step 1: Create Vim Directories First, let's create the directories where Vim's settings will be stored. These folders will hold backup files, swap files, and a persistent undo history, which helps keep your project folders clean and improves data safety. # Pre-create directories for Vim settings mkdir -p ~/.vim/undodir ~/.vim/backupdir ~/.vim/swapdir Step 2: Prepare the .vimrc File Next, create Vim's configuration file, ~/.vimrc . Copy the content below and paste it into your ~/.vimrc file. This configuration includes a list of plugins, key mappings, UI settings, and more. # Save the following content as your ~/.vimrc file. " === Plugin Manager: vim-plug === ...