Last active
December 14, 2020 23:52
-
-
Save fernandolopez/5010599 to your computer and use it in GitHub Desktop.
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/sh | |
if [ -n "$RANDOM" ]; then | |
# Bash | |
random(){ echo $RANDOM; } | |
elif which perl; then | |
random(){ perl -e "print(rand() * (10**15))"; } | |
elif which openssl; then | |
random(){ printf "%d" 0x$(openssl rand -hex $(date +%r)); } | |
else | |
random(){ | |
python -c "from random import random; print('{0:d}'.format(int(random()*10**15)))" | |
} | |
fi | |
if which aplay; then | |
play() { aplay "$@"; } | |
else | |
play() { mplayer "$@"; } | |
fi | |
wget -O /tmp/ding.wav http://www.ctv.es/RECURSOS/SONIDOS/wav/ding.wav > /dev/null 2>&1 | |
while sleep $(expr $(random) % 5); do | |
play /tmp/ding.wav & | |
if [ $(expr $(random) % 2) -eq 0 ]; then | |
zenity --error --title "Error de Windows" --text "Ocurrió el error $(printf "%04x:%04x" $(random) $(random)), el sistema puede quedar inestable.\n\nPor favor, si el problema persiste, contacte con el soporte de Windows para solucionarlo." | |
else | |
while zenity --question --title "Error inesperado" --text "Ha ocurrido un error $(printf "%04x:%04x" $(random) $(random)) accediendo a la librería mvc40.dll.\n\n¿Desea volver a intentarlo?"; do | |
play /tmp/ding.wav & | |
done | |
fi | |
done > /dev/null 2>&1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment