Skip to content

dev

My Ubuntu Setup: From Barebones to a Productive Dev Environment

When I install a fresh Linux distribution like Ubuntu 24, I'm not just setting up a computer; I'm building a personal workspace. My goal is a clean, reliable, and portable development environment that can be replicated anywhere, from my local machine to a remote VPS.

A clean, minimalist desktop setup
Image generated using Google Gemini

This isn't just about a list of commands, it's a philosophy of intentionality. Every tool I choose, and every tool I leave behind, is a step toward a more efficient and less cluttered workflow.

This is my journey to a perfect setup, and it all starts with version control.

Comprehensive Guide to SSH: Tunneling, File Transfers, and Key-Based Authentication

SSH (Secure Shell) is a powerful protocol used for secure communication between computers, offering a wide range of functionalities including secure remote access, file transfers, and key-based authentication.

In this guide, we'll cover various aspects of SSH, including:

  • Port tunneling for secure access to services like MySQL.
  • Secure file transfer using SFTP and SCP.
  • SSH agent forwarding and key-based authentication for enhanced security.
  • Dynamic port forwarding (SOCKS proxy) for secure browsing.

Mastering Essential Linux Commands: Your Path to File and Directory Mastery

Introduction

This documentation aims to offer a comprehensive understanding of essential commands and techniques for file and directory management in a Linux environment. Mastering these commands is crucial for efficient navigation, manipulation, and analysis of files and directories.

We'll embark on a journey by delving into the foundational usage of key commands like wc, du, grep, awk, and find, uncovering their individual functionalities. Additionally, we'll explore how these commands can be combined using powerful methods such as pipes (|), -exec {} \;, or -exec {} +, unlocking their synergistic potential.

Moreover, to solidify your understanding, real-life examples showcasing practical applications will be demonstrated.

Using MkDocs with Docker: Streamlining Documentation Workflow

Introduction

Looking to streamline your documentation workflow using MkDocs and Docker?

Documentation lies at the heart of every successful project. MkDocs offers a straightforward way to create elegant documentation sites, while Docker ensures a consistent and isolated environment for various applications. Combining these tools optimizes the documentation process and enhances collaboration within development teams.

This tutorial serves as your guide, illustrating how to set up MkDocs within a Docker container effectively. By following these steps, you'll establish a robust documentation framework, facilitating seamless documentation creation and deployment.

Let's dive into the process of integrating MkDocs with Docker to revolutionize your documentation workflow.

Prerequisites

Before starting, make sure you have the following files in the same directory:

  1. docker-compose.yml
  2. requirements.txt (or your specific requirements file)

For example,

MkDocs: Your Straightforward Documentation Companion

Introduction

Welcome to MkDocs: the hassle-free documentation solution!

In search of a tool that makes documentation creation a breeze? MkDocs is your answer!

This straightforward platform simplifies the process of generating professional project documentation.

This guide is your gateway to exploring MkDocs' user-friendly approach. You'll uncover how this tool streamlines the creation of polished and organized documentation for all your projects. Let's dive in and harness MkDocs' straightforwardness for your documentation needs.

Mastering SSH and File Transfers to Remote servers: A Beginner's Handbook

Introduction

Do you find yourself baffled by the intricacies of SSH connections and file transfers to remote servers ?

Navigating the landscape of SSH connections, troubleshooting connection issues, and securely transferring files across servers can be a daunting task, especially for newcomers.

This guide is your compass in the world of SSH, unraveling the complexities and providing step-by-step instructions for establishing secure connections and transferring files seamlessly using Git Bash or WSL2 for Windows users and straightforward methods for Linux enthusiasts.

Simple guide to using Docker on Windows 10 and access from WSL 2

Introduction

For a heavy linux user like me, using windows also mean find a door to work with a linux distro. There are several options to gauge from the situation. I usually need both docker and wsl2 on the computer. And i've installed this many times.

docker-logo

So, this is a very straight forward tutorial on docker and wsl2 installation and configuration on windows10 or 11.

Prerequisites

  • Windows 10 Pro, Enterprise, or Education edition.
  • WSL 2 enabled on your Windows machine.
  • Docker Desktop for Windows installed.

Step-by-Step Guide

  1. Install Docker Desktop for Windows:

  2. Enable WSL 2:

    Enable docker for wsl2

  3. Set wsl default version to 2:

    • Open PowerShell as an administrator and run the following command:
    wsl --set-default-version 2
    

Deploying any Web application with Nginx: Example of Flask

Introduction

You have created your flask application. How nice ! Now, you want to go a step further and deploy it. For most hosting services, you have nice interfaces to deploy your python applications with support for flask. But sometimes, you only have access via ssh to the server.

This is a very straigthforward tutorial on how to do it.

This tutorial also applies to any web server you can run on local but want to deploy

Step 1: Install Nginx and Flask

Make sure you have Nginx and Flask installed on your server. If not, install them using the appropriate package manager for your operating system.

Step 2: Configure Nginx

Create a new Nginx configuration file for your Flask app in the /etc/nginx/sites-available/ directory. For example, you could name it myapp.conf. Edit the file and add the following configuration:

Run an application forever on linux made easy: Case of a javascript project

Introduction

If you're looking to turn your application into a background process, you have come to the right tutorial, always using the fastest way.

Instead of just writing theory, we we use a real world example i've worked on.

To run a Java application as a background process and keep it running forever, you can use a process manager like systemd on Linux. Here's how you can set up a systemd service to run your Java application:

Certainly! Here are the steps named as per their actions:

Step 1: Create Service File

Create a new systemd service file for your Java application using a text editor:

sudo nano /etc/systemd/system/myapp.service

Step 2: Configure Service

Paste the following configuration into the file, replacing <jar-file-name> with the name of your JAR file:

Step-by-Step Guide to Identifying and Terminating Processes on Specific Ports

Introduction

This markdown provides a step-by-step guide to identify and terminate processes running on a specific port, catering to both Unix-based and Windows systems.

Handling Processes on a Port

Suppose you encounter an OSError: [Errno 98] Address already in use error while trying to run an application that requires port 8000. This commonly happens when another process is already using the same port.

Method 1: Using curl to Test the Port

One way to check if a process is using port 8000 is by attempting to access it:

curl 127.0.0.1:8000