Skip to main content

CLI-based LFCS Practice Environment with Docker containers

Project description

LFCS Practice Tool

========================================================================
                                                                       
   ██╗     ███████╗ ██████╗███████╗                                   
   ██║     ██╔════╝██╔════╝██╔════╝                                   
   ██║     █████╗  ██║     ███████╗                                   
   ██║     ██╔══╝  ██║     ╚════██║                                   
   ███████╗██║     ╚██████╗███████║                                   
   ╚══════╝╚═╝      ╚═════╝╚══════╝                                   
                                                                       
        Linux System Administration Practice Tool                
                                                                       
========================================================================

Interactive Linux System Administration Practice Environment with Docker Containers

A comprehensive CLI-based training tool designed to help you prepare for the Linux Foundation Certified System Administrator (LFCS) exam. Practice real-world Linux administration tasks in isolated Docker containers with automatic validation, progress tracking, and interactive learning modules.

Table of Contents

Features

Core Features

  • 83+ Practice Scenarios across 5 LFCS exam categories
  • Isolated Docker Environments for safe, repeatable practice
  • Automatic Validation with detailed feedback on task completion
  • Progress Tracking with statistics, streaks, and mastery percentages
  • Multi-Distribution Support (Ubuntu, CentOS, Rocky Linux)
  • Interactive Learning Mode with 14 structured learning modules
  • Live Validation - check your work without exiting the container
  • Difficulty Progression from easy to hard scenarios
  • Smart Recommendations based on your performance

Advanced Features

  • Context Generation - scenarios with randomized values for variety
  • Property-Based Testing - comprehensive test coverage
  • Error Recovery - intelligent error handling with recovery suggestions
  • Comprehensive Logging - detailed logs for debugging
  • Configuration Management - flexible YAML and environment variable configuration
  • Achievement System - track milestones and accomplishments

Quick Start

# Install from PyPI
pip install lfcs

# Clone repository for Docker files and scenarios
git clone https://github.com/loyality7/lfcs-practice-tool.git
cd lfcs-practice-tool

# Build Docker base images (required for practice mode)
cd docker/base_images
./build_all.sh
cd ../..

# Start practicing
lfcs start

# Or try interactive learning mode
lfcs learn

Installation

Prerequisites

  • Python 3.9+
  • Docker (for practice scenarios)
  • 4GB RAM minimum
  • 10GB disk space for Docker images

Step 1: Install from PyPI

# Install the package
pip install lfcs

# Or install with AI features
pip install lfcs[ai]

Step 2: Clone Repository for Docker Files

# Clone to get Docker files, scenarios, and learning modules
git clone https://github.com/loyality7/lfcs-practice-tool.git
cd lfcs-practice-tool

Note: The PyPI package contains only the Python code. You need the repository for:

  • Docker base image files (docker/base_images/)
  • Practice scenarios (scenarios/)
  • Learning modules (learn_modules/)
  • Validation scripts (docker/validation_scripts/)

Step 3: Build Docker Images

# Build all distribution images (Ubuntu, CentOS, Rocky)
cd docker/base_images
./build_all.sh

# Or build only Ubuntu (faster)
./build_ubuntu_only.sh

Step 4: Verify Installation

# Check installation
lfcs --version

# Run system check
lfcs start
# The tool will automatically check prerequisites

Alternative: Development Installation

For contributors who want to modify the code:

# Clone repository
git clone https://github.com/loyality7/lfcs-practice-tool.git
cd lfcs-practice-tool

# Install in editable mode
pip install -e ".[dev,ai]"

# Build Docker images
cd docker/base_images
./build_all.sh

Optional: AI Features

To enable AI-powered hints and validation:

# Set your API key
export ANTHROPIC_API_KEY="your-api-key-here"
# or
export OPENAI_API_KEY="your-api-key-here"

# Start with AI mode
lfcs start --ai

Usage

Basic Commands

# Start interactive practice session
lfcs start

# Start with filters
lfcs start --category networking --difficulty easy

# List available scenarios
lfcs list

# View your statistics
lfcs stats

# Interactive learning mode
lfcs learn

# Reset progress
lfcs reset --confirm

Practice Workflow

  1. Select Scenario: Choose category, difficulty, and specific scenario
  2. Read Task: Review the task description and hints
  3. Work in Container: Complete the task in the Docker shell
  4. Validate: Type exit to validate your work
  5. Review Results: See detailed feedback and score
  6. Track Progress: View statistics and recommendations

Interactive Learning Mode

# Start learning mode
lfcs learn

# List all modules
lfcs learn --list

# Start specific module
lfcs learn --module 01_beginner/01_linux_basics

# Continue from last lesson
lfcs learn --continue

Learning Modes

1. Practice Mode (Scenario-Based)

Practice specific LFCS exam tasks with automatic validation:

  • Essential Commands: Text processing, pipes, archives
  • Operations & Deployment: Services, packages, systemd
  • Networking: Interface configuration, routing, firewall
  • Storage: Filesystems, LVM, mounting, permissions
  • Users & Groups: User management, permissions, sudo

2. Interactive Learning Mode

Structured learning path from basics to LFCS level:

  • Beginner: Linux basics, file navigation, basic commands
  • Intermediate: Text processing, process management, packages
  • Advanced: Networking, storage management, user administration
  • Expert: Security hardening, automation, troubleshooting

3. Local Practice Mode

Practice on your local system without Docker (use with caution):

lfcs start --local

WARNING: Local mode modifies your actual system. Use only if you understand the risks.

Documentation

Requirements

System Requirements

  • OS: Linux, macOS, or Windows with WSL2
  • CPU: 2+ cores recommended
  • RAM: 4GB minimum, 8GB recommended
  • Disk: 10GB free space for Docker images
  • Network: Internet connection for Docker image downloads

Software Requirements

  • Python 3.9 or higher
  • Docker 20.10 or higher
  • Git (for cloning repository)

Optional Requirements

  • Anthropic or OpenAI API key (for AI features)
  • 16GB RAM (for running multiple containers)

Project Structure

lfcs-practice-tool/
├── src/                    # Source code
│   ├── cli/               # Command-line interface
│   ├── core/              # Core engine and scenario loader
│   ├── docker_manager/    # Docker container management
│   ├── validation/        # Validation strategies
│   ├── learn/             # Interactive learning system
│   ├── utils/             # Utilities and helpers
│   └── main.py            # Main entry point
├── scenarios/             # Practice scenarios (83+ YAML files)
│   ├── essential_commands/
│   ├── networking/
│   ├── operations_deployment/
│   ├── storage/
│   └── users_groups/
├── learn_modules/         # Learning modules (14 YAML files)
│   ├── 01_beginner/
│   ├── 02_intermediate/
│   ├── 03_advanced/
│   └── 04_expert/
├── docker/                # Docker configuration
│   ├── base_images/       # Dockerfiles for Ubuntu, CentOS, Rocky
│   └── validation_scripts/ # Custom validation scripts
├── database/              # SQLite database for progress
├── config/                # Configuration files
├── tests/                 # Test suite
└── docs/                  # Documentation

Configuration

Configuration Files

  • config/config.yaml - Main configuration
  • config/ai_config.yaml - AI provider settings
  • .env - Environment variables (create from .env.example)

Environment Variables

# Docker configuration
export DEFAULT_IMAGE="ubuntu"
export CONTAINER_NETWORK="bridge"
export DOCKER_PRIVILEGED="true"

# Database and logs
export DB_PATH="database/progress.db"
export LOGS_PATH="logs"
export LOG_LEVEL="INFO"

# AI configuration (optional)
export AI_ENABLED="true"
export ANTHROPIC_API_KEY="your-key"

# Local mode (practice without Docker)
export LOCAL_MODE="false"

Statistics and Progress

The tool tracks comprehensive statistics:

  • Overall Performance: Total attempts, pass rate, average score
  • Category Breakdown: Performance by category and difficulty
  • Mastery Levels: Percentage mastery for each difficulty level
  • Streaks: Current and best passing streaks
  • Achievements: Unlocked milestones
  • Recommendations: Personalized suggestions for improvement

View your stats anytime:

lfcs stats                    # Overall statistics
lfcs stats --category storage # Category-specific stats

Troubleshooting

Docker Issues

# Docker not running
sudo systemctl start docker

# Permission denied
sudo usermod -aG docker $USER
newgrp docker

# Image not found
cd docker/base_images && ./build_all.sh

Common Issues

  • Container fails to start: Check Docker daemon status and available resources
  • Validation fails unexpectedly: Check container logs with docker logs <container-id>
  • Database locked: Close other instances of the tool
  • Permission errors: Ensure write permissions for database and logs directories

See TROUBLESHOOTING.md for detailed solutions.

Contributing

We welcome contributions! See CONTRIBUTING.md for guidelines.

Quick Contribution Guide

  1. Fork the repository
  2. Create a feature branch
  3. Add scenarios or fix bugs
  4. Write tests
  5. Submit a pull request

Adding Scenarios

# Create a new scenario YAML file
cp scenarios/storage/easy/create_directory_01.yaml \
   scenarios/storage/easy/my_scenario_01.yaml

# Edit the scenario
# Test it
lfcs start --category storage --difficulty easy

# Submit PR

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=src --cov-report=html

# Run specific test
pytest tests/unit/test_scenario_loader.py

# Run property-based tests
pytest tests/unit/ -k "property"

License

MIT License - see LICENSE file for details.

Acknowledgments

  • Linux Foundation for the LFCS certification program
  • Docker for containerization technology
  • All contributors and scenario authors

Support

Roadmap

  • Web-based UI
  • Multi-user support
  • Cloud deployment scenarios
  • Kubernetes practice scenarios
  • Video tutorials integration
  • Mobile app for progress tracking

Made with ❤️ for the Linux community

Version: 1.0.0 | Author: C Sarath Babu | License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lfcs-1.0.0.tar.gz (141.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lfcs-1.0.0-py3-none-any.whl (78.4 kB view details)

Uploaded Python 3

File details

Details for the file lfcs-1.0.0.tar.gz.

File metadata

  • Download URL: lfcs-1.0.0.tar.gz
  • Upload date:
  • Size: 141.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lfcs-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a888a9d8c2f7e6f6fe000913edb038c5b4874eb4f27bb660bdf4ac6bfb9e2117
MD5 711894c1b26f66ff7212c0853cc3d501
BLAKE2b-256 c9ee691cab93ecb722407953ac75ccb70c2dc10de8813ee1e3fd01afe3366950

See more details on using hashes here.

File details

Details for the file lfcs-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: lfcs-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 78.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for lfcs-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 068737684c25aaa4990c0eae95d0fab2815f22c04417154a24ff6e487c8eef10
MD5 5ec442d130483a4e9ba7eac9924bb31c
BLAKE2b-256 9b005282589ec73bfab412496dbe4d48f467d17ccbfb1b08dd42b48873fece8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page