Skip to content

Instantly share code, notes, and snippets.

View repositorioinformatico's full-sized avatar

repositorioinformatico

View GitHub Profile
#!/bin/bash
# ========================================
# SCRIPT DE LABORATORIO: SERVIDOR DHCP CON PODMAN
# Arquitectura: Servidor (2 interfaces: NAT + red interna)
# Cliente (1 interfaz: solo red interna, sin internet)
# ========================================
# Limpiar todo
echo "Limpiando contenedores, imágenes y redes existentes..."
#!/bin/bash
# Pedir la hora al usuario
read -p "Introduce la hora para empezar la cuenta atrás (HH:MM): " target_time
# Validar formato HH:MM
if ! [[ $target_time =~ ^([01]?[0-9]|2[0-3]):[0-5][0-9]$ ]]; then
echo "Formato inválido. Usa HH:MM (ejemplo: 14:30)"
exit 1
fi
git init
touch f1
git add f1
git commit -m "c 1 en master"
touch f2
git add f2
git commit -m "c 2 en master"
git checkout -b feature
git checkout master
touch f3
#!/usr/bin/env bash
git init
touch f1
git add f1
git commit -m "c 1 en master"
touch f2
git add f2
git commit -m "c 2 en master"
git checkout -b feature
git checkout master
mkdir con_historial_sucio_scripteado_merge_nocommit
cd con_historial_sucio_scripteado_merge_nocommit
git init
touch f1
git add f1
git commit -m "c 1 en main"
touch f2
git add f2
git commit -m "c 2 en main"
git checkout -b feature
mkdir 17
cd 17
touch f1
git add f1
git commit -m "c 1 en master"
touch f2
git add f2
git commit -m "c 2 en master"
git checkout -b feature
git checkout master
mkdir 16
cd 16
git init
touch f1
git add f1
git commit -m "c 1 en master"
touch f2
git add f2
git commit -m "c 2 en master"
touch f3
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
[remote "origin"]
url = git@github.com:usuario/nombre-del-repo.git
#!/bin/bash
set -x
# Obtiene la ruta absoluta del script de bash en ejecución
script_directory="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
echo $script_directory
# El script de Python como una cadena de texto
python_script='
import os
du -h -d 1 "$(pip -V | cut -d ' ' -f 4 | sed 's/pip//g')" | grep -vE "dist-info|_distutils_hack|__pycache__" | sort -h