Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- my $usuario = 'univalle';
- # Función para ejecutar comandos del sistema
- sub run_command {
- my ($cmd) = @_;
- print "Ejecutando: $cmd\n";
- system($cmd);
- }
- # Actualizar e instalar paquetes
- run_command('apt update && apt upgrade');
- run_command('apt install net-tools wget gpg git openssh-server curl -y');
- run_command('apt install -y software-properties-common apt-transport-https ca-certificates curl gnupg lsb-release');
- run_command('apt install -y build-essential libncursesw5-dev libreadline-dev libssl-dev libsqlite3-dev tk-dev libc6-dev libbz2-dev libffi-dev');
- run_command('apt install -y python3 python3-pip python3-virtualenv');
- run_command('apt install -y libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6');
- # Instalar Docker
- run_command('apt update');
- run_command('apt install -y ca-certificates curl');
- run_command('curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker.gpg');
- run_command('echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null');
- run_command('apt update');
- run_command('apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose');
- # Instalar Kubernetes (kubectl y Minikube)
- run_command('curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.30/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg');
- run_command('echo \'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ /\' | tee /etc/apt/sources.list.d/kubernetes.list');
- run_command(' apt-get update');
- run_command(' apt-get install -y kubectl');
- run_command('curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb');
- run_command('dpkg -i minikube_latest_amd64.deb');
- run_command("usermod -aG docker $usuario");
- # Instalar Visual Studio Code
- run_command('wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg');
- run_command('sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg');
- run_command('echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" |sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null');
- run_command('rm -f packages.microsoft.gpg');
- run_command('sudo apt install apt-transport-https');
- run_command('apt update');
- run_command('apt install -y code');
- # Instalar Azure CLI
- run_command('curl -sLS https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | tee /etc/apt/keyrings/microsoft.gpg > /dev/null');
- run_command('chmod go+r /etc/apt/keyrings/microsoft.gpg');
- my $az_dist = `lsb_release -cs`;
- chomp($az_dist);
- run_command("echo \"Types: deb\nURIs: https://packages.microsoft.com/repos/azure-cli/\nSuites: ${az_dist}\nComponents: main\nArchitectures: $(dpkg --print-architecture)\nSigned-by: /etc/apt/keyrings/microsoft.gpg\" | tee /etc/apt/sources.list.d/azure-cli.sources");
- run_command('apt update && apt install -y azure-cli');
- # Instalar AWS CLI
- run_command('apt install awscli -y');
- # Instalar Google Cloud CLI
- run_command('curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo gpg --dearmor -o /usr/share/keyrings/cloud.google.gpg');
- run_command('echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list');
- run_command('apt update');
- run_command('apt-get install google-cloud-cli');
- # Instalar Terraform
- run_command('wget -O- https://apt.releases.hashicorp.com/gpg | gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg');
- run_command("echo \"deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com \$(lsb_release -cs) main\" | tee /etc/apt/sources.list.d/hashicorp.list");
- run_command('apt update');
- run_command('apt install -y terraform');
- # Instalar navegadores y utilidades
- run_command('wget -qO- https://deb.opera.com/archive.key | apt-key add -');
- run_command('add-apt-repository -y "deb [arch=i386,amd64] https://deb.opera.com/opera-stable/ stable non-free"');
- run_command('apt update');
- run_command('apt install -y opera-stable chromium chromium-l10n');
- run_command('echo "export PATH=\$PATH:/usr/sbin" >> /etc/profile');
- run_command('systemctl enable docker --now');
- #Aceptar conexiones
- run_command('iptables -I INPUT -j ACCEPT');
- # Añadir backports a las sources.list
- run_command('echo "deb http://deb.debian.org/debian $(lsb_release -cs)-backports main contrib" | tee /etc/apt/sources.list.d/backports.list');
- # Instalar la clave del archivo fasttrack
- run_command('apt install fasttrack-archive-keyring');
- # Añadir fasttrack a las sources.list
- run_command('echo "deb http://fasttrack.debian.net/debian-fasttrack/ $(lsb_release -cs)-fasttrack main contrib" | tee /etc/apt/sources.list.d/fasttrack.list');
- run_command('echo "deb http://fasttrack.debian.net/debian-fasttrack/ $(lsb_release -cs)-backports-staging main contrib" | tee -a /etc/apt/sources.list.d/fasttrack.list');
- # Actualizar los repositorios
- run_command('apt update');
- run_command('apt install -y virtualbox virtualbox-ext-pack');
- # Instalar virtualbox-guest-x11
- run_command('apt install -y virtualbox-guest-x11');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement