Building a Local RAG System for My Static Hugo Blog

How I integrated Retrieval-Augmented Generation (RAG) functionality into my static Hugo site using C# and local LLMs to create a dynamic question-answering system.

April 24, 2025 · TC

The Complete Guide to Training Machine Learning Models

I wanted to learn about training a model to see if I can train my own little model for my own needs. The Complete Guide to Training Machine Learning Models Training a machine learning model involves teaching it to make predictions or decisions by learning from data. Here’s a simple explanation of the process: 1. Data Collection and Preparation Gather relevant data from various sources Clean the data by handling missing values and outliers Normalize or standardize features to ensure equal importance Split the data into training, validation, and test sets (typically 70-15-15 or 80-10-10) 2. Feature Engineering Select relevant features that contribute to predictions Create new features from existing ones to improve model performance Reduce dimensionality if necessary to prevent overfitting 3. Choose a Model Select an appropriate algorithm based on your problem and data Linear models (e.g., linear regression, logistic regression) for simpler problems Tree-based models (e.g., random forests, gradient boosting) for complex data with non-linear relationships Neural networks (e.g., transformers or CNNs) for more complex tasks. 4. Train the Model Feed the training data into the model and adjust its parameters to minimize errors. The process typically involves: ...

April 5, 2025 · 2 min · 368 words · Taner

Setting Up Asus Archer C50 as a Travel VPN Router with OpenWrt

Setting up your Asus Archer C50 as a travel VPN router with OpenWrt involves several steps. Here’s a general guide to get you started: 1. Install OpenWrt on Your Router Check Compatibility: Ensure your Archer C5 model is supported by OpenWrt. You can verify this on the OpenWrt Table of Hardware. Download Firmware: Visit the OpenWrt website and download the appropriate firmware for your router model. Flash the Firmware: Access your router’s web interface, upload the OpenWrt firmware, and follow the instructions to flash it. Be cautious, as flashing firmware incorrectly can brick your router. 2. Configure OpenWrt Access OpenWrt Interface: After installation, log in to the OpenWrt web interface (usually at 192.168.1.1). Set Up Basic Settings: Change the default password, configure the LAN and WAN interfaces, and enable Wi-Fi. 3. Install VPN Software Choose a VPN Protocol: OpenWrt supports OpenVPN and WireGuard. Decide which one suits your needs. Install Packages: Use the OpenWrt package manager to install the necessary VPN packages (e.g., openvpn-openssl or luci-app-wireguard). Upload VPN Configuration: Obtain the configuration files from your VPN provider and upload them to the router. 4. Configure Travelmate (Optional) Install Travelmate: Travelmate is an OpenWrt package that simplifies managing Wi-Fi connections in travel scenarios. You can find more details here. Set Up Captive Portal Handling: Travelmate can help you connect to hotel Wi-Fi networks and maintain a secure connection. 5. Test Your Setup Connect Devices: Connect your devices to the router’s Wi-Fi network. Verify VPN Connection: Check your IP address to ensure traffic is routed through the VPN. This is a high-level overview. For detailed instructions, you can refer to resources like the OpenWrt Forum or video tutorials such as this one. ...

April 2, 2025 · 2 min · Taner

Use Case Diagram for Event-Based Reservation Systems

Here is a Use Case Diagram for our reservation system, which visualizes the interactions between users (actors) and the system’s functionalities (use cases). graph TD %% External Actors Customer[Customer] --> CreateReservation Customer --> CancelReservation Customer --> ViewReservationDetails Customer --> ReceiveNotifications Administrator[Administrator] --> ManageResources Administrator --> GenerateReports Administrator --> ViewCustomerDetails %% System subgraph ReservationSystem [Reservation System] CreateReservation[Create Reservation] CancelReservation[Cancel Reservation] ViewReservationDetails[View Reservation Details] ReceiveNotifications[Receive Notifications] ManageResources[Manage Resources] GenerateReports[Generate Reports] ViewCustomerDetails[View Customer Details] end Explanation of the Diagram Actors: ...

April 2, 2025 · 1 min · Taner

Building a Robust Reservation System with Event-Driven Architecture

Building a Robust Reservation System with Event-Driven Architecture In this post, I’ll guide you through creating a scalable reservation system using event-driven architecture. We’ll explore domain modeling, event handling, and message processing - essential concepts for modern distributed systems. The Reservation Process Flow Let’s start by visualizing the reservation workflow with a Mermaid diagram: flowchart TD A[Start Reservation Process] --> B[Receive Reservation Request] B --> C{Validate Request} C -->|Valid| D[Check Availability] C -->|Invalid| E[Return Error to Client] D --> F{Availability?} F -->|Available| G[Create Reservation] F -->|Not Available| H[Notify Client of Unavailability] G --> I[Send Confirmation via Wolverine] H --> I I --> J[Store Reservation in Postgres] J --> K[Return Success Response to Client] E --> L[End Process] K --> L This diagram shows the end-to-end process from receiving a request to returning a response, with key decision points and actions along the way. ...

April 2, 2025 · 5 min · Taner

Building a Robust Reservation System: A Step-by-Step Guide

1. Define Your Requirements Before diving into code, clarify the system’s core functionalities. For a reservation system, we might consider: Booking Management: Creating, updating, and canceling reservations. Availability Checking: Ensuring that double-booking or conflicts are prevented. Customer Management: Handling user details, authentication, and notifications. Resource or Venue Management: Tracking the items or spaces being reserved. Concurrency Control: Managing simultaneous booking attempts (e.g., using transactions and locks). Understanding these requirements will help guide your design decisions. ...

April 2, 2025 · 5 min · Taner

Designing Event-Based Systems with Wolverine: A Comprehensive Guide

Designing an event-based system with Wolverine is an exciting challenge that leverages asynchronous messaging to decouple components and build a resilient architecture. Here’s a comprehensive pathway to help you get started: 1. Understand the Role of Wolverine Wolverine is a lightweight, .NET-native messaging framework designed to help you craft robust, event-driven applications. It facilitates: Message Routing: Seamlessly route events and commands to corresponding handlers. Transport Flexibility: Integrate with in-memory queues or external messaging systems such as RabbitMQ or Azure Service Bus. Resilience and Durability: Apply advanced patterns like retry, scheduling, and outbox support if needed. By using Wolverine, you can focus on business logic while the framework handles much of the messaging infrastructure. ...

April 2, 2025 · 4 min · Taner

System Sequence Diagram for Reservation Workflow

Below is a System Sequence Diagram for a reservation system, which highlights the interaction between external actors (e.g., customer, administrator) and the system during a reservation workflow: sequenceDiagram participant Customer participant System as Reservation System Customer ->> System: Enter reservation details System -->> Customer: Validate inputs Customer ->> System: Submit reservation request System ->> System: Check resource availability alt Resource available System ->> System: Create reservation System ->> Customer: Confirm reservation System ->> System: Trigger payment process System ->> Customer: Notify payment status else Resource not available System ->> Customer: Display unavailability message end Explanation of the Diagram: Actors and System: ...

April 2, 2025 · 1 min · Taner

State Diagram for Reservation Lifecycle in Event-Based Systems

Here’s an example of a State Diagram for a reservation system object. This illustrates the states that a reservation can move through and the transitions triggered by events or actions. stateDiagram-v2 state "Pending" as Pending state "Confirmed" as Confirmed state "Cancelled" as Cancelled state "Completed" as Completed %% State Transitions Pending --> Confirmed: Payment Received Pending --> Cancelled: Customer Cancels Confirmed --> Cancelled: Customer Cancels Confirmed --> Completed: Reservation Period Ends Cancelled --> Pending: Reopen Request Explanation of States and Transitions: States: ...

April 2, 2025 · 1 min · Taner

Sequence Diagram for Event-Based Reservation Workflow Using Wolverine

Below is a Mermaid sequence diagram that showcases how components of our event-based reservation system interact during a typical workflow. This example outlines the process of a customer creating a reservation and includes key components such as the frontend, service layer, Wolverine event bus, and external systems. sequenceDiagram participant Customer participant Frontend participant Service as Reservation Service participant EventBus as Wolverine Event Bus participant ResourceCatalog participant Notification as Notification Service Customer ->> Frontend: Request to create a reservation Frontend ->> Service: Submit reservation details Service ->> ResourceCatalog: Check resource availability ResourceCatalog -->> Service: Availability status Service ->> Service: Validate and process reservation Service ->> EventBus: Publish ReservationCreated event EventBus ->> Notification: Notify customer of confirmation EventBus -->> Service: Acknowledge event publishing Service -->> Frontend: Return confirmation to customer Frontend -->> Customer: Display confirmation details Explanation of the Workflow Customer Interaction: ...

April 2, 2025 · 2 min · Taner