This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DevOps Exercise: Secure Serverless Data Ingestion Pipeline | |
Objective | |
Provision a secure, event-driven data pipeline entirely using Terraform. The pipeline will use an AWS Lambda function, triggered by an S3 event, to ingest data into a relational database (RDS). Critically, all database credentials must be managed securely through AWS Secrets Manager, and the Lambda must operate within a VPC to connect to the private RDS instance. | |
This exercise validates your ability to provision a complex, secure, and networked infrastructure stack using IaC. | |
Scenario |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"log": { | |
"version": "1.2", | |
"creator": { | |
"name": "Firefox", | |
"version": "139.0.4" | |
}, | |
"browser": { | |
"name": "Firefox", | |
"version": "139.0.4" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DevOps Exercise: Scalable Data Pipeline with AWS, Prometheus, Grafana, and SFTP | |
Objective | |
Deploy a data ingestion and processing pipeline using Docker Compose, AWS services, and monitoring tools. The pipeline should securely transfer data from an SFTP server, process it, store it in an AWS S3 bucket, and provide real-time monitoring of performance and health. This exercise tests your understanding of containerization, cloud services, monitoring, and secure data handling. | |
Scenario | |
You are tasked with building a data pipeline that ingests log files from an external SFTP server, processes them using a custom Python script, and stores the processed data in an AWS S3 bucket. The pipeline needs to be scalable, monitored, and secure. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
account_id = "1ed--61e" | |
url = f"https://api.cloudflare.com/client/v4/accounts/{account_id}/challenges/widgets" | |
headers = { | |
"X-Auth-Email": "a@gmail.com", | |
"X-Auth-Key": "504--1e6" #not API token | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DevOps Exercise: Multi-Service Deployment with Docker Compose | |
Objective | |
Deploy a scalable, multi-service e-commerce setup using Docker Compose that includes a reverse proxy, product management service, caching, and a database. Your setup should be secure, resilient, and able to handle simulated load. This exercise tests container orchestration, secure configuration management, and performance monitoring. | |
Scenario | |
You're setting up the backend infrastructure for a product catalog in an e-commerce platform. The platform includes: | |
1.API Gateway (Nginx): A reverse proxy that routes requests to the Product Service and caches frequently accessed data. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Payslip - Consolidated</title> | |
<style> | |
table { | |
width: 100%; | |
border-collapse: collapse; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define an upstream block for backend services | |
upstream api_backend { | |
server localhost:6565; | |
} | |
# HTTP server block to handle requests | |
server { | |
listen 80; | |
server_name ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To set up multiple WordPress instances with separate databases using Docker, you'll need to modify the Docker commands to create additional containers for WordPress and MariaDB. Here's how you can set it up for three websites: | |
1. Create Docker networks: | |
```bash | |
docker network create wordpress-network1 | |
docker network create wordpress-network2 | |
docker network create wordpress-network3 | |
``` | |
2. Create volumes for each WordPress instance and database: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from openai import OpenAI | |
client = OpenAI( | |
api_key = os.getenv("OPENAI_API_KEY"), | |
) | |
completion = client.chat.completions.create( # Change the method | |
model = "gpt-3.5-turbo", | |
messages = [ # Change the prompt parameter to messages parameter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
import * as THREE from 'three'; | |
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader'; | |
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; | |
function Basic3d() { | |
useEffect(() => { | |
// Scene | |
const scene = new THREE.Scene(); | |
scene.background = new THREE.Color(0xaaaaaa); // Optional: Change scene background |
NewerOlder