Posts

Changing the Default Terminal to Terminator on Ubuntu

Image
Terminator is a powerful tool for developers, allowing you to manage multiple terminal sessions in a single window. Features like splitting panes, tabs, and simultaneous input can significantly boost your productivity. Step 1: Install Terminator First, install Terminator using the apt package manager. sudo apt update sudo apt install terminator -y The -y option automatically answers 'yes' to any prompts during the installation process, streamlining the setup. Step 2: Set as the System Default Ubuntu uses a utility called update-alternatives to manage default applications. We'll use this tool to change the default terminal emulator ( x-terminal-emulator ) to Terminator. Run the Configuration Command Enter the following command in your terminal. A list of available terminals will appear. sudo update-alternatives --config x-terminal-emulator Select Terminator From the resulting list, enter the selection number corresponding to terminator and press Enter. ...

How to Push to a GitHub Repository in IntelliJ

Image
1. Initialize and Connect the Git Repository # Run in the terminal from the project root git init git remote add origin https://github.com/[user]/[repository].git 2. Configure Git in IntelliJ Select VCS → Enable Version Control Integration . Choose Git and click OK . 3. Connect Your GitHub Account Go to File → Settings (on Windows) or IntelliJ IDEA → Preferences (on macOS). Navigate to Version Control → GitHub . Click Add Account ( + ). Select Log In with Token... and enter your GitHub Personal Access Token. 4. Add and Commit Files Go to VCS → Git → Add (or use the shortcut Ctrl+Alt+A ). Select the files you want to commit. Go to VCS → Commit (or use the shortcut Ctrl+K ). Write a commit message and click Commit . 5. Push Go to VCS → Git → Push (or use the shortcut Ctrl+Shift+K ). Click the Push button. Simpler Method (Using IntelliJ's Built-in Feature) Go to VCS → Share Project on GitHub . Set the repository name to vita-user-...

Pydantic v2, A Practical Guide from FastAPI to v1 Migration

Image
In the modern Python ecosystem, it's impossible to discuss data validation and settings management without mentioning Pydantic . It has become the de-facto standard, empowering countless developers to increase productivity by clearly defining data structures with type hints and enforcing them at runtime. This article will serve as your practical guide to mastering Pydantic v2. We will explore its core use cases with hands-on examples, from API development with FastAPI to settings management. Most importantly, we provide a detailed v1-to-v2 migration checklist to help you upgrade your codebase with confidence. 1. API Development (Web API Development) This is one of Pydantic's most well-known and powerful use cases. It plays a core role, especially when used with the FastAPI framework. Request Validation : It automatically checks if the data sent from a client (like a web browser or mobile app) to the server has the correct format and values. For example, it can val...

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