Mes scripts “Maison”

Pour avoir la météo en bash:

#!/bin/bash
#
# Meteo mise à jour toutes les heures
#
# Smokyr <smokyr@extra-ordinaire.com>
#
if [ -z "$1" ]
then
        minute=5 #minute de maj par défaut
else
        minute=$1
fi
while true
do
        clear
        LC_ALL='fr_FR.utf8' date
        curl wttr.in/93200?lang=fr
        sleep 1m
        LC_ALL='fr_FR.utf8' date -d '1 minute ago'
        tempo=$(date +%M | sed -e 's/000$//' -e 's/^0//')
        attente=$(($minute - $tempo + 60))
        sleep $attente.m
done
meteo sous bash
Exemple de météo sous bash

Afin de vérifier le statut de fail2ban et la table nfttables correspondante:

Read more “Mes scripts “Maison””

Installation de portsentry

Objet: bloquer les scanneurs de ports

Installation avec la méthode habituelle: apt install portsentry

Puis modification de certains paramètres dans le fichier /etc/portsentry/portsentry.conf :

##################
# Ignore Options #
##################
\[...]
# 0 = Do not block UDP/TCP scans.
# 1 = Block UDP/TCP scans.
# 2 = Run external command only (KILL_RUN_CMD)
BLOCK_UDP="2"
BLOCK_TCP="2"
###################
# External Command#
###################
\[...]
# The KILL_RUN_CMD_FIRST value should be set to "1" to force the command 
# to run \*before\* the blocking occurs and should be set to "0" to make the 
# command run \*after\* the blocking has occurred. 
#
KILL_RUN_CMD_FIRST = "1"
#
#
KILL_RUN_CMD="/home/unutilisateur/portsentry_ext_cmd.sh $TARGET$"
# for examples see /usr/share/doc/portsentry/examples/
Read more “Installation de portsentry”