Skip to content

deji-ola/linux-dev-setup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Linux Development Environment Setup for Cloud/DevOps Engineers

Overview

This guide provides a streamlined process to organize and optimize a Linux development environment for cloud engineering and DevOps work, specifically focused on AWS, Terraform, and Kubernetes interview preparation.

Prerequisites

  • Ubuntu/WSL2 environment
  • Administrative access
  • Existing development tools (may be disorganized)

Directory Structure Design

~/
├── archive/
│   └── 2024-learning/         # Old learning materials and experiments
├── workspace/                 # Active development projects
│   ├── project-name/
│   └── learning-materials/
├── tools/                     # Development tools and binaries
├── interview-prep/            # Structured interview preparation
│   ├── aws/
│   ├── terraform/
│   ├── kubernetes/
│   ├── python/
│   ├── projects/
│   ├── practice/
│   │   ├── coding/
│   │   ├── architecture/
│   │   └── scenarios/
│   └── notes/
├── Downloads/                 # Standard downloads directory
└── snap/                      # System snap packages

Step-by-Step Setup

Step 1: Check System Resources

df -h

Ensure adequate disk space (recommended: >10GB available).

Step 2: Create Directory Structure

mkdir -p ~/archive/2024-learning ~/workspace ~/tools ~/interview-prep/{aws,terraform,kubernetes,python,projects,practice/{coding,architecture,scenarios},notes}

Step 3: Organize Existing Files

Archive old learning materials:

# Move completed learning projects to archive
mv ~/old-project-* ~/archive/2024-learning/ 2>/dev/null
mv ~/tutorial-* ~/archive/2024-learning/ 2>/dev/null

Organize active projects:

# Move current projects to workspace
mv ~/my-terraform-project ~/workspace/ 2>/dev/null
mv ~/banking-infrastructure ~/workspace/ 2>/dev/null
mv ~/learn-* ~/workspace/ 2>/dev/null

Organize development tools:

# Move development tools
mv ~/go ~/tools/ 2>/dev/null

Step 4: Clean Up Unnecessary Files

# Remove downloaded installation files
rm -f ~/*.zip
rm -f ~/*.tar.gz
rm -f ~/kubectl.sha256
rm -f ~/story*.txt
rm -f ~/test-*.sh

# Remove orphaned configuration files
rm -f ~/main.tf ~/outputs.tf ~/providers.tf ~/variables.tf

Step 5: System Maintenance

# Update package lists and clean system
sudo apt update && sudo apt autoremove -y && sudo apt autoclean

# Clean Docker system (if applicable)
docker system prune -af 2>/dev/null

# Clean Terraform cache
find ~ -name ".terraform" -type d -exec rm -rf {} + 2>/dev/null
find ~ -name "terraform.tfstate*.backup" -delete 2>/dev/null

Step 6: Configure Shell Environment

Add productivity aliases to ~/.bashrc:

cat >> ~/.bashrc << 'EOF'

# Navigation Aliases
alias workspace='cd ~/workspace'
alias interview='cd ~/interview-prep'
alias awsp='cd ~/interview-prep/aws'
alias k8sp='cd ~/interview-prep/kubernetes'
alias pythonp='cd ~/interview-prep/python'

# Enhanced ls commands
alias ll='ls -la'
alias la='ls -A'
alias l='ls -CF'

# Git shortcuts
alias gs='git status'
alias ga='git add'
alias gc='git commit -m'
alias gp='git push'

# AWS shortcuts
alias awswho='aws sts get-caller-identity'
alias awsregion='aws configure get region'
EOF

source ~/.bashrc

Step 7: Tool Verification Script

Create a system check script:

cat > ~/interview-prep/daily-practice.sh << 'EOF'
#!/bin/bash
echo "=== Development Environment Status ==="
echo "Date: $(date)"
echo ""
echo "Directory Structure:"
echo "- Workspace: $(ls ~/workspace | wc -l) projects"
echo "- Interview Prep: $(ls ~/interview-prep | wc -l) areas"
echo "- Archive: $(ls ~/archive/2024-learning 2>/dev/null | wc -l) items"
echo ""
echo "Tool Status:"
aws --version 2>/dev/null && echo "✓ AWS CLI configured" || echo "✗ AWS CLI needs setup"
terraform version 2>/dev/null | head -1 && echo "✓ Terraform available" || echo "✗ Terraform needs installation"
kubectl version --client 2>/dev/null | head -1 && echo "✓ Kubectl available" || echo "✗ Kubectl needs installation"
python3 --version 2>/dev/null && echo "✓ Python available" || echo "✗ Python needs installation"
git --version 2>/dev/null && echo "✓ Git available" || echo "✗ Git needs installation"
echo ""
echo "Quick Navigation:"
echo "- workspace    : Go to active projects"
echo "- interview    : Go to interview preparation"
echo "- awsp         : Go to AWS practice"
echo "- k8sp         : Go to Kubernetes practice"
EOF

chmod +x ~/interview-prep/daily-practice.sh

Step 8: Create Practice Templates

AWS Practice Template:

cat > ~/interview-prep/aws/practice-template.tf << 'EOF'
# AWS Infrastructure Practice Template
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }
}

provider "aws" {
  region = var.aws_region
}

variable "aws_region" {
  description = "AWS region for resources"
  type        = string
  default     = "us-east-1"
}

variable "environment" {
  description = "Environment name"
  type        = string
  default     = "interview-practice"
}

# Practice resources go here
resource "aws_vpc" "practice_vpc" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_hostnames = true
  enable_dns_support   = true

  tags = {
    Name        = "${var.environment}-vpc"
    Environment = var.environment
  }
}
EOF

Kubernetes Practice Template:

cat > ~/interview-prep/kubernetes/deployment-template.yaml << 'EOF'
# Kubernetes Deployment Practice Template
apiVersion: apps/v1
kind: Deployment
metadata:
  name: practice-app
  labels:
    app: practice-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: practice-app
  template:
    metadata:
      labels:
        app: practice-app
    spec:
      containers:
      - name: app
        image: nginx:latest
        ports:
        - containerPort: 80
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "128Mi"
            cpu: "500m"
---
apiVersion: v1
kind: Service
metadata:
  name: practice-app-service
spec:
  selector:
    app: practice-app
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
  type: ClusterIP
EOF

Tool Installation (if needed)

AWS CLI

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
rm -rf aws awscliv2.zip
aws configure  # Configure with your credentials

Terraform (using tfenv for version management)

git clone https://github.com/tfutils/tfenv.git ~/.tfenv
echo 'export PATH="$HOME/.tfenv/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
tfenv install latest
tfenv use latest

kubectl

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
rm kubectl

Verification and Testing

Run System Check

~/interview-prep/daily-practice.sh

Test Navigation Aliases

workspace    # Should navigate to ~/workspace
interview    # Should navigate to ~/interview-prep
ll           # Should show detailed file listing

Verify Tool Configuration

aws sts get-caller-identity    # Should return account info
terraform version              # Should show version
kubectl version --client       # Should show client version

Maintenance

Weekly Cleanup

# Run system updates
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y

# Clean Docker (if used)
docker system prune -f 2>/dev/null

# Update Terraform
tfenv install latest && tfenv use latest

Monthly Archive

# Move completed projects to archive
mv ~/workspace/completed-project-* ~/archive/$(date +%Y%m)/

Benefits

  1. Organized Structure: Clear separation between active work, practice, and archive
  2. Improved Productivity: Quick navigation aliases and organized tools
  3. Interview Ready: Dedicated practice areas with templates
  4. Maintainable: Easy cleanup and maintenance processes
  5. Professional: Clean, organized environment suitable for client work

Best Practices

  • Keep active projects in ~/workspace
  • Use ~/interview-prep for structured learning and practice
  • Archive completed work regularly
  • Run daily status check before starting work
  • Maintain tool versions appropriate for your work environment
  • Document project-specific setup in project README files

This setup provides a professional development environment optimized for cloud engineering work and technical interview preparation.

About

"Linux development environment setup"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published