Archive for the ‘ Lunix ’ Category

pigz – Parallel gzip

pigz – Parallel gzip.


A parallel implementation of gzip for modern
multi-processor, multi-core machines

pigz, which stands for parallel implementation of gzip, is a fully functional replacement for gzip that exploits multiple processors and multiple cores to the hilt when compressing data. pigz was written by Mark Adler, and uses the zlib and pthread libraries. To compile and use pigz, please read the README file in the source code distribution. You can read the pigz manual page here.

Faillog: Reset authentication failures on Unix / Linux

Testing a lot on your servers can sometimes lead to the problem, that you receive this error message:
‘Received disconnect from Too many authentication failures for root’
or of course for other users, try faillog!
There are some options to view / reset the authentication failures for the given user(s)

This is the man page of this very useful command:

faillog --help
Syntaxe : faillog [options]
Options :
  -a, --all          afficher les enregistrements « faillog » pour tous
                       les utilisateurs
  -h, --help           afficher ce message d'aide et quitter
  -l, --lock-time SEC  après une connexion refusée, verrouiller le compte
                       pendant SEC secondes
  -m, --maximum MAX    positionner les compteurs de connexions refusées à
  -r, --reset          remettre à zéro les compteurs de connexions refusées
  -t, --time NB_JOURS  afficher les échecs de connexions datant de moins de
                       NB_JOURS jours
  -u, --user LOGIN     afficher l'enregistrement « faillog » ou gérer les
                       compteurs et les limites (si utilisé conjointement aux
                       options -r, -m ou -l) d'échecs uniquement pour
                       l'utilisateur dont le compte est LOGIN

Backup Script (shell)

Backup same directories or files and compress them with tar.gz

# creates backups of essential files
set $(date)
# full backup: TRAC / SVN
tar cfz "/var/MyBackup/trac/trac_full_$6-$2-$3.tgz" $TRAC
tar cfz "/var/MyBackup/svn/svn_full_$6-$2-$3.tgz" $SVN
if test "$1" = "dim" ; then
        # weekly a full backup of smb
        tar cfz "/var/MyBackup/smb/smb_full_$6-$2-$3.tgz" $SMB
        rm -f /var/MyBackup/smb/smb_diff*
        # incremental backup:
        find $SMB -depth -type f  \( -ctime -1 -o -mtime -1 \) -print > $LIST
        tar cfzT "/var/MyBackup/smb/smb_diff_$6-$2-$3.tgz" "$LIST"
        rm -f "$LIST"