This file contains 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/bash | |
# Clona la base de datos $1 con el nombre $2 | |
set -e | |
# Comprobaciones | |
[ $# -ne 2 ] && echo "ERROR: Número de argumentos" && exit 1 | |
[ ! -f ~/.my.cnf ] && echo "ERROR: ~/.my.cnf no definido" && exit 1 | |
[ "$1" == "$2" ] && echo "ERROR: No puedes clonar sobre ti mismo" && exit 1 |
This file contains 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/bash | |
# Cuando tratas de completar un trámite con Hacienda (AEAT) | |
# mediante un certificado digital correctamente instalado en iceweasel | |
# salta este error: | |
# es.gob.afirma.keystores.main.common.AOKeystoreAlternativeException | |
# Error message: Error al inicializar el almacen NSS unificado de | |
# Mozilla Firefox |
This file contains 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/bash | |
# Recarga la configuración de nginx, pensado para que determinados usuarios | |
# puedan cambiar la configuración del servidor web y recargarla. | |
# | |
# Invocado /etc/sudoers.d/nombre-usuario | |
# | |
# Referencias: | |
# * https://github.com/rtCamp/nginx-helper/issues/9 | |
# * http://www.cyberciti.biz/tips/allow-a-normal-user-to-run-commands-as-root.html |
This file contains 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/bash | |
# | |
# Genera un certificado autofirmado | |
# | |
# VARIABLES DE CONFIGURACIÓN | |
USUARIO="www-data:www-data" | |
DESTINO="/etc/nginx/ssl" | |
PASSWD="pass:pEpElEchEs" | |
DOMINIO=$1 |
This file contains 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/bash | |
# Requiere tener configurado el acceso a MySQL en ~/.my.cnf | |
if [ ! -f ~/.my.cnf ]; then | |
echo "ERROR: No existe ~/.my.cnf" | |
exit 1 | |
fi | |
# Para usar junto con rsnapshot los ficheros generados deben | |
# estar en el directorio actual. Por ello el valor de DESTINO |
This file contains 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/bash | |
DIR_BACKUP="/var/backups" | |
[[ "$1" == "" ]] && echo "Error en el número de argumentos" && exit 1 | |
[[ -z $(lxc-ls | grep -w $1) ]] && echo "No existe el contenedor $1" && exit 1 | |
[[ -z $(whereis pigz | tr -d 'pigz:') ]] && echo "Error: pigz no instalado" && exit 1 | |
#echo "Existe el contenedor $1" | |
CONTENEDOR=$1 |
This file contains 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/bash | |
# Install jitsi-desktop 2.10.5550-1 | |
# Tested on: | |
# - Ubuntu 20.04, 21.10 and 22.04 | |
# - Elementary OS 6.1 | |
# ---------------------------------------------------------- | |
# Add missing dependencies and force to run with openjdk-8 | |
[ "$(id -u)" -ne 0 ] && echo "This script must be run as root" && exit 1 |
This file contains 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
# APT OVH mirrors | |
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy main restricted | |
# deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy main restricted | |
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy-updates main restricted | |
# deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy-updates main restricted | |
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy universe | |
# deb-src http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy universe | |
deb http://ubuntu.mirrors.ovh.net/ftp.ubuntu.com/ubuntu/ jammy-updates universe |