Archive for abril, 2023
Te llamo porque esta caído el p!»t0 Server
Es sábado
Las 8 de la matina
uno dormido
y suena el teléfono
Hola, esta caído el servidor....
Y si te levantas dormido y necesitas despertarte.
Escuchate algo copado.
no matching key exchange method found
Unable to negotiate with IP port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
# Solucion
ssh -oKexAlgorithms=+diffie-hellman-group1-sha1 root@IP
Empaquetando(.deb) otra oportunidad
# Me guio de
# https://www.baeldung.com/linux/create-debian-package
# Creo la carpeta del script
mkdir Prueba
# Vamos con un archivo.conf
vi Prueba/prueba.conf
NOMBRE=Pocho
# Vamos con el script que llama al otro
vi Prueba/prueba.sh
#!/bin/bash
. /etc/prueba.conf
echo "Hola $NOMBRE"
# Creamos carpeta bin y etc
mkdir Prueba/{bin,etc}
# Movemos los archivos conf a etc y sh a bin
mv Prueba/prueba.conf Prueba/etc/
mv Prueba/prueba.sh Prueba/bin/
# Creamos la carpeta DEBIAN
mkdir Prueba/DEBIAN
# y su archivo control
vi Prueba/DEBIAN/control
Package: prueba
Version: 0.0-1
Section: utils
Priority: optional
Architecture: all
Maintainer: Pucho <pucho@gmail.com>
Description: Simple paquete de pruebas
# Creamos el .deb
dpkg-deb --root-owner-group --build Prueba
# Comprobamos como esta
dpkg -c Prueba.deb
# probamos con lintian
lintian Prueba.deb
empaquetando(.deb) un script de bash
# Me guio de
# https://www.iodigital.com/en/history/intracto/creating-debianubuntu-deb-packages
Parto de un script basico llamado helloworld.sh
cat helloworld.sh
#!/usr/bin/bash
echo "Hola Mundo"
# Creo la carpeta del proyecto y la carpeta DEBIAN
mkdir helloworld && mkdir helloworld/DEBIAN
# Dentro armo la estructura de donde deberia de ir dicho script
mkdir -p helloworld/usr/local/bin
# Copio el script ahi
cp helloworld.sh helloworld/usr/local/bin/
# Creo el control
vi helloworld/DEBIAN/control
# Su contenido
Package: helloworld
Version: 0.1
Maintainer: Pablo Carrai
Architecture: all
Description: hello world
# Contruyo el .deb
dpkg-deb --build helloworld
# Lo instalo
dpkg -i helloworld.deb
Comentarios recientes