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
| #!/bin/sh | |
| set -e # Stop the script if any command fails | |
| # Get the currently configured GCP Project ID | |
| PROJECT_ID=$(gcloud config get-value project --quiet) | |
| # Validate that a project is set | |
| if [ -z "$PROJECT_ID" ]; then | |
| echo "❌ ERROR: No project is configured in gcloud." | |
| echo "Run: gcloud config set project <PROJECT_ID>" |
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
| #!/bin/sh | |
| set -e # Stop the script if any command fails | |
| # Get the currently configured GCP Project ID | |
| PROJECT_ID=$(gcloud config get-value project --quiet) | |
| # Validate that a project is set | |
| if [ -z "$PROJECT_ID" ]; then | |
| echo "❌ ERROR: No project is configured in gcloud." | |
| echo "Run: gcloud config set project <PROJECT_ID>" |
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
| #!/bin/sh | |
| kubectl apply -f deployment.yaml | |
| kubectl apply -f service.yaml | |
| kubectl apply -f ingress.yaml | |
| kubectl get deployment | |
| kubectl autoscale deployment helloworld-deployment \ | |
| --cpu-percent=60 \ |
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
| #!/bin/sh | |
| set -e # Stop the script if any command fails | |
| # Get the currently configured GCP Project ID | |
| PROJECT_ID=$(gcloud config get-value project --quiet) | |
| # Validate that a project is set | |
| if [ -z "$PROJECT_ID" ]; then | |
| echo "❌ ERROR: No project is configured in gcloud." | |
| echo "Run: gcloud config set project <PROJECT_ID>" |
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
| #!/bin/sh | |
| # Set default region and zone | |
| gcloud config set compute/region europe-west1 | |
| gcloud config set compute/zone europe-west1-b | |
| # Create a static IP address | |
| gcloud compute addresses create network-lb-ip-1 \ | |
| --region europe-west1 |
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
| # Set default region and zone | |
| gcloud config set compute/region europe-west1 | |
| gcloud config set compute/zone europe-west1-b | |
| # Create an instance template | |
| gcloud compute instance-templates create lb-backend-template \ | |
| --region=europe-west1 \ | |
| --network=default \ | |
| --subnet=default \ | |
| --tags=allow-health-check \ |
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 lang="es"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width,initial-scale=1" /> | |
| <title>Ejemplo: index.html con CSS y JS</title> | |
| <style> | |
| /* CSS embebido: estilos simples */ | |
| :root{ | |
| --bg: #f7f9fc; |
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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| ############# PARÁMETROS EDITABLES ############# | |
| REGION="${REGION:-us-east-1}" # cambia si quieres | |
| INSTANCE_TYPE="${INSTANCE_TYPE:-t3.small}" # barato y suficiente p/HTTP | |
| SPOT_MAX_PRICE="${SPOT_MAX_PRICE:-}" # vacío = precio spot on-demand cap (recomendado) | |
| SECURITY_GROUP_NAME="${SECURITY_GROUP_NAME:-spot-http-stress-sg}" | |
| IAM_ROLE_NAME="${IAM_ROLE_NAME:-EC2SpotStressS3Role}" | |
| INSTANCE_PROFILE_NAME="${INSTANCE_PROFILE_NAME:-EC2SpotStressS3Profile}" |
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
| # Download and install the Microsoft signing key | |
| curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg | |
| sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg | |
| # Add to software repository | |
| sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-$(lsb_release -cs)-prod $(lsb_release -cs) main" > /etc/apt/sources.list.d/dotnetdev.list' | |
| # Update repository information and install package | |
| sudo apt-get update | |
| sudo apt-get install azure-functions-core-tools-4 -y |
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
| # Get packages needed for the installation process | |
| sudo apt-get update | |
| sudo apt-get install ca-certificates curl apt-transport-https lsb-release gnupg -y | |
| # Download and install the Microsoft signing key | |
| sudo mkdir -p /etc/apt/keyrings | |
| curl -sLS https://packages.microsoft.com/keys/microsoft.asc | | |
| gpg --dearmor | | |
| sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null | |
| sudo chmod go+r /etc/apt/keyrings/microsoft.gpg |
NewerOlder