Posts

I Lost Internet on an Ubuntu Server.... due to a Blank YAML File.

I expected the difficult part of setting up my Ubuntu Server to be Docker. Instead, I couldn't even run apt update . Package installations were failing because the server couldn't reach Ubuntu's repositories. At first, it looked like a VirtualBox problem but the VM was running, the network adapter was attached, and everything appeared normal. The problem turned out to be much simpler: Ubuntu had no usable network configuration. Where Ubuntu Gets Its Network Configuration Modern Ubuntu Server uses Netplan to describe how network interfaces should be configured. The configuration files live under: /etc/netplan/ Normally you'll find a YAML file that tells Ubuntu which interface to bring up, whether to request an IP address through DHCP, and which DNS servers to use. The configuration file was completely blank. That meant Ubuntu had nothing telling it to bring the interface online. Looking in the Wrong Place When a server has no...

The Bug That Taught Me Cryptography Isn't Enough: How Flawed API Logic Can Destroy a Secure Vault

Image
When I thought of building security-focused applications, the emphasis was on encryption. Use a well-tested cryptographic library, avoid storing plaintext, and derive keys properly. Those are all good practices. I followed the same approach while building a small self-hosted password manager called vo!t (sounds similar to vault!) using Flask. Passwords were encrypted before being written to disk, and I eventually replaced a stored encryption key with one derived from a master password using PBKDF2. From a cryptographic standpoint, nothing was obviously wrong. The problem was in the application logic. During testing, I found that submitting an incorrect master password didn't return an authentication error. Instead, the application accepted the request, wrote data encrypted with the wrong key into the vault, and left the database in a state where legitimate users could no longer decrypt it. The encryption library behaved exactly as expected. My application didn't. ...

Learning IPv6 in Cisco Packet Tracer: From Direct Connections to Routed Networks

Image
As part of my CCNA preparation, I decided to learn IPv6 by building progressively larger networks in Cisco Packet Tracer. Rather than memorizing commands, I focused on understanding how packets move between devices and how routers handle traffic between different IPv6 networks. Why IPv6? IPv4 addresses are limited, while IPv6 provides a vastly larger address space and several improvements in routing and address assignment. Since IPv6 is an important CCNA topic, I started with simple topologies and gradually moved toward routed networks. Lab 1: Two PCs Connected Directly My first exercise involved connecting two PCs directly and assigning IPv6 addresses from the same subnet. Goal Verify that two hosts can communicate when they belong to the same IPv6 network. Key Concepts Learned IPv6 address structure Prefix length (/64) Basic connectivity testing using ping Neighbor discovery After assigning addresses, I verified connectivity using the ping command. Lab 2: Two PCs Connected Through a ...

Custom Memory Debugger in C: Technical Breakdown

This post breaks down a lightweight, portable memory debugging system that tracks allocations, detects leaks, and catches double-free errors. Core Architecture The system revolves around a linked list that tracks every memory allocation with metadata about where it was allocated and whether it's been freed. The Memory Header Structure typedef struct MemHeader { size_t size; // Size of allocated memory const char *file; // Source file name int line; // Line number int freed; // Flag: 0 = active, 1 = freed struct MemHeader *next; // Linked list pointer } MemHeader; This header is prepended to every allocation, creating a "fat pointer" system where metadata travels with the allocated memory. Global Tracking List static MemHeader *alloc_head = NULL; A single global pointer maintains the head of a singly-linked list containing all allocation records. This approach is simple but means the system isn't thread-safe withou...

Building a Dynamic Array in C: A Deep Dive into Memory Management

Dynamic arrays are one of the most fundamental data structures in programming, yet they're not built into C like they are in higher-level languages. Today, we'll explore how to implement a dynamic array from scratch in C, understanding the underlying memory management principles that make it work. What is a Dynamic Array? A dynamic array is a data structure that can grow or shrink in size during runtime, unlike static arrays whose size must be determined at compile time. This flexibility makes them incredibly useful for situations where you don't know how much data you'll need to store beforehand. The Structure Foundation Our implementation starts with a simple but powerful structure: #define initialCap 2 typedef struct {     int * data ;     int size ;     int capacity ; } DynamicArray ; This structure contains three crucial components: data : A pointer to the actual array elements stored in heap memory size : The current number of elements ...