preloader

Today I Learnt

A collection of things I've learned, one day at a time

TIL
bg-shape
bg-shape
bg-shape
bg-shape
bg-shape
bg-shape
bg-shape
bg-shape
bg-shape

Explore My Learnings

Today I learned how to efficiently manage Docker containers using docker-compose. This is a game-changer for managing multi-container applications.

Basic Commands

The most common commands for docker-compose are surprisingly simple:

# Start containers defined in docker-compose.yml
docker-compose up

# Start containers in detached mode (background)
docker-compose up -d

# Stop running containers
docker-compose down

# Stop containers and remove volumes
docker-compose down -v

# View running containers
docker-compose ps

The docker-compose.yml File

The docker-compose.yml file is where all the magic happens. Here’s a basic example:

Today I learned how to set up a website using Hugo, a powerful static site generator. The process was surprisingly straightforward and much faster than I expected.

Installation

First, I installed Hugo on my system:

# On Windows using Chocolatey
choco install hugo -confirm

# Verify installation
hugo version

Creating a New Site

Creating a new Hugo site is as simple as:

hugo new site mywebsite
cd mywebsite

This creates a new directory with the basic structure for a Hugo site.

Today I helped a client set up their WiFi and learned some interesting things about WiFi channels and common misconceptions about 5G vs 5GHz.

WiFi Channels Explained

WiFi networks operate on specific frequency channels. I learned that:

  1. 2.4GHz band has 14 channels (though only 1-11 are used in the US)
  2. 5GHz band has many more channels (36-165 depending on region)

The key insight: Adjacent channels overlap and cause interference! For 2.4GHz networks, only channels 1, 6, and 11 don’t overlap with each other.

Today I learned how to set up and use OpenVPN on my mobile phone. This is incredibly useful for securing connections on public WiFi networks and accessing region-restricted content.

What is OpenVPN?

OpenVPN is an open-source VPN protocol that creates secure point-to-point connections. It’s widely regarded as one of the most secure VPN protocols available.

Setting Up OpenVPN on Android

The process was surprisingly straightforward:

  1. Download the App: Install “OpenVPN Connect” from the Google Play Store
  2. Get Configuration File: Obtain the .ovpn configuration file from your VPN provider
  3. Import the Profile: In the app, tap the plus icon and select “Import” to add your .ovpn file
  4. Connect: Tap the profile and then the “Connect” button

Setting Up OpenVPN on iOS

The iOS setup is similar:

Today I learned how to SSH into a server and an Optical Line Terminal (OLT). This is a fundamental skill for remote server administration and network management.

Basic SSH Command

The basic syntax for SSH is surprisingly simple:

ssh username@hostname

For example:

ssh admin@192.168.1.100

SSH Authentication Methods

I learned there are two main ways to authenticate:

  1. Password Authentication: Simply enter your password when prompted
  2. Key-Based Authentication: More secure, uses a public/private key pair

Setting Up Key-Based Authentication

To set up key-based authentication:

Today I learned how to properly clone a GitHub repository using Git instead of downloading the ZIP file. This approach is much better for development work as it maintains the Git history and allows for easier updates.

The Basic Clone Command

The most basic way to clone a repository is:

git clone https://github.com/username/repository.git

This creates a new directory with the repository name and downloads all the code and Git history.

Today I learned how to take significantly better photos using just my smartphone by applying the golden ratio and a few other simple techniques.

The Golden Ratio in Photography

The golden ratio (approximately 1:1.618) has been used in art and design for centuries. In photography, it helps create naturally balanced, aesthetically pleasing compositions.

Unlike the rule of thirds (which divides the frame into equal thirds), the golden ratio creates a spiral pattern known as the “Fibonacci spiral” or “golden spiral.”