Skip to content

Instantly share code, notes, and snippets.

View r3xakead0's full-sized avatar
🏠
Working from home

Afu Tse r3xakead0

🏠
Working from home
View GitHub Profile
@r3xakead0
r3xakead0 / lb-backend.sh
Created November 10, 2025 17:15
Create a HTTP load balancer in GCP
# 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 \
@r3xakead0
r3xakead0 / index.html
Created October 19, 2025 21:51
Ejemplo de una página web sencilla con HTML, CSS y JS
<!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;
@r3xakead0
r3xakead0 / spot-http-stress.sh
Created October 9, 2025 20:34
Create a low-cost EC2 Spot instance that runs your stress tests and is automatically deleted. This stress test involves generating multiple requests to a URL and monitoring the results of these tests and saving them to a file.
#!/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}"
@r3xakead0
r3xakead0 / Install-azure-functions-core-tools.sh
Last active February 19, 2024 01:31
Install Azure Functions Core Tools on Linux Ubuntu
# 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
@r3xakead0
r3xakead0 / Install-azure-cli.sh
Created February 11, 2024 04:47
Install Azure Client on Linux Ubuntu
# 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
@r3xakead0
r3xakead0 / Install-ntpdate.sh
Created February 6, 2024 19:27
Install ntpdate on Linux Ubuntu to keep the time and date updated
sudo apt install ntpdate -y
sudo ntpdate time.nist.gov
date
@r3xakead0
r3xakead0 / Install-python3-pip3.sh
Created February 6, 2024 15:26
Install python and pip 3 on Linux Ubuntu
sudo apt update
sudo apt install python3 -y
python3 -V
which python3
sudo apt install python3-pip -y
pip3 -V
which pip3
@r3xakead0
r3xakead0 / Install-nvm.sh
Created February 5, 2024 15:27
Install nvm on Linux Ubuntu
sudo apt update
sudo apt install -y curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
nvm install node
nvm install 18.19.0
nvm list
nvm use 18.19.0
@r3xakead0
r3xakead0 / Install-python2.sh
Last active February 6, 2024 15:32
Install python 2 on Linux Ubuntu
sudo apt update
sudo apt install -y python2
python2 --version
which python2
@r3xakead0
r3xakead0 / Install-java-18.sh
Last active February 5, 2024 15:16
Install Java 18 on Linux Ubuntu
sudo apt update
sudo apt install -y openjdk-18-jdk
sudo apt install -y openjdk-18-jre
export JAVA_HOME=/usr/lib/jvm/java-18-openjdk-amd64
echo $JAVA_HOME