This repository contains two related deliverables for the ALX System Engineering & DevOps course:
- Shell Variables & Expansions — solutions for
0x03
shell scripting tasks. - Web Infrastructure Design — conceptual diagrams and explanations for progressively more resilient web infrastructure designs.
This directory contains solutions for ALX task 0x03 - Shell, init files, variables and expansions.
This project focuses on shell scripting related to environment variables, local variables, aliases, arithmetic operations, and text processing. You will learn how to manipulate shell environments, perform calculations using shell variables, and use scripting to accomplish various Linux tasks.
Each script in 0x03-shell_variables_expansions/
follows the ALX constraints (two-line scripts unless specified, executable, newline at end). The tasks and a short description are below.
Defines a dangerous alias (ls
behaving as rm *
) to demonstrate alias manipulation.
Prints hello user
, where user
is the currently logged-in Linux username.
Appends /action
to the end of $PATH
.
Counts the number of directories in $PATH
(including empty entries).
Displays all environment variables (printenv
).
Lists local variables, environment variables, and functions (set
).
Creates a local variable BEST
with value School
(declared inside a function so it is truly local).
Creates a global environment variable BEST
with value School
.
Prints the sum of 128
and the value in TRUEKNOWLEDGE
.
Prints the result of dividing POWER
by DIVIDE
.
Raises BREATH
to the power of LOVE
using shell arithmetic.
Converts a binary number ($BINARY
) to its decimal equivalent.
Prints all two-letter combos (aa
..zz
) excluding oo
, sorted.
Prints the value of NUM
formatted with two decimal places.
Converts base-10 value $DECIMAL
to hexadecimal.
Applies ROT13 to standard input.
Prints every other line from input, starting with the first.
Adds two numbers from custom base systems and prints the result in a third base.
All scripts are required to be:
- Exactly two lines long (excluding the shebang) unless the task specifies otherwise
- End with a newline
- Use only allowed shell built-ins and commands (no
bc
,awk
,sed
unless explicitly allowed) - Made executable (
chmod +x
)
These tasks test foundational shell scripting skills used in automation, DevOps, and systems administration.
This section contains conceptual designs and explanations for four stages of building and improving web infrastructure, from a single-server LAMP setup to a scaled, secured, and monitored architecture.
Repository diagrams (images) are included and linked below. Each diagram should have been whiteboarded, screenshot, and uploaded to an image hosting service — the hosted links are referenced here so reviewers can verify your diagrams.
Overview A basic single-server setup where all components run on one machine.
Image link
Components & Notes
- DNS → Single Server (Nginx/Apache + App + MySQL)
- Pros: Easy to set up, low cost
- Cons: SPOF, limited scalability
Overview Introduce redundancy and traffic distribution: load balancer, multiple web servers, and a primary/replica DB setup.
Image link
Notes
- Load balancer distributes traffic
- Web servers host app code
- Database primary handles writes; replica(s) handle reads and provide failover
Overview Adds firewalls, SSL/TLS, monitoring tools and alerting to the distributed setup for operational security and visibility.
Image link
Key additions & issues
- Firewalls, SSL, monitoring agents, logging and alerting
- Remaining issues: LB and DB still possible SPOFs; replication lag; monitoring blind spots
Overview Splits web, application, and database services across dedicated servers and clusters the load balancers to remove SPOFs and scale by layer.
Image link
Architecture flow
User → DNS (www.foobar.com) → Load Balancer Cluster (2 HAProxy) → Web Server Pool → App Server Pool → Database Cluster (Primary + Replica)
Benefits
- No SPOF at LB layer
- Independent scaling of tiers
- Performance and maintenance flexibility
- For each task, whiteboard your solution (whiteboard, paper, or diagram tool).
- Take a clear screenshot of your whiteboard/diagram.
- Upload the screenshot to an image host (Imgur, Postimages, etc.).
- Insert the image link into the corresponding answer file or README entry.
- Commit and push your work to GitHub.
- Paste the GitHub file URL into the ALX submission form.
- Be prepared to whiteboard each task live in front of a mentor — no computer or notes.
- Author: Halima
- Course: ALX System Engineering & DevOps
- Tips: Keep answers focused and concise during whiteboarding — only expand when asked.
Last updated: 2025-08-05