apr 27

New Ubuntu Logos

Do il mio piccolo contributo alla comunità come utente; ecco i link ad una mia macchina dove scaricare le ISO di 10.04 LTS man mano che saranno pubblicate.
Sono poco più di 100mbit ma tutto aiuta :) .

Download: http://cdt.techeffe.net/index.php?dir=%2Fubuntu/10.04

Vi ricordo di fare MD5 dopo il download, per sicurezza.

Scaricate il file MD5SUMS, poi dal terminale verificate che l’output del comando sia uguale alla corrispondenza nel file:

a54366aa72d6b576ee8fc0215f8a13b9  *ubuntu-10.04-alternate-amd64.iso
5b2dadacfd692b4f2d5c7cf034539262  *ubuntu-10.04-alternate-i386.iso
3e0f72becd63cad79bf784ac2b34b448  *ubuntu-10.04-desktop-amd64.iso
d044a2a0c8103fc3e5b7e18b0f7de1c8  *ubuntu-10.04-desktop-i386.iso
712277c7868ab374c4d3c73cff1d95cb  *ubuntu-10.04-netbook-i386.iso
8ee25c78f4c66610b6872a05ee9ad81b  *ubuntu-10.04-server-amd64.iso
15342636441181f7a19c65984b44e24c  *ubuntu-10.04-server-i386.iso

Tagged with:
feb 24

Scrivo due righe sulla prevenzione degli attacchi DoS (http://it.wikipedia.org/wiki/Denial_of_service), per prevenirli su Apache2, ovvero il server web.
C’è un modulo veloce e pratico da configurare che si chiama mod_evasive (anche conosciuto come mod_dosevasive http://nanoweb.si.kz/manual/mod_dosevasive.html) disponibile per Apache. Il modulo tiene conto della rapidità delle richieste da parte del client, se sono oltre una certa quantità per secondo le blocca restituendo un errore HTTP.

Abilitarlo su Ubuntu e Apache2 è molto semplice, visto che è già pacchettizzato:

apt-get update
apt-get install libapache2-mod-evasive
a2enmod mod-evasive

Bisogna inoltre dare una minima configurazione al modulo nell’httpd.conf.
Questa di seguito è un esempio, ma potete trovare il reference dei parametri su http://nanoweb.si.kz/manual/core.html#DosEvasiveError .
Fate attenzione a non essere restrittivi in modo da non bloccare rapide chiamate AJAX oppure i bot dei motori di ricerca.

<IfModule mod_evasive20.c>
DOSHashTableSize 4000
DOSPageCount 1
DOSSiteCount 60
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 40
</IfModule>

Scrivelela con il vostro editor preferito (io uso vim) e riavviate Apache2.

vim /etc/apache2/httpd.conf
apache2ctl restart

Finito.

Da notare che mod_evasive protegge solo Apache2, tuttavia può essere configurato per eseguire azioni dopo aver bloccato un IP; si potrebbe ipotizzare di creare una regola iptables, per bloccare a livello di sistema (e non solo HTTP) il client.

A voi il divertimento ;) .

Tagged with:
feb 05

Può succedere che Firefox 3.5 mostri fonts con il subhint (l’arrotondamento dei fonts o clear type) errato rispetto a quello del sistema, poichè usa quelli generati da fontconfig piuttosto che quelli di Gnome.

Io ho risolto cancellando la cache dei fonts e facendo il configure di fontconfig.

sudo -s
rm /etc/fonts/conf.d/10-hinting-slight.conf
rm /etc/fonts/conf.d/10-no-sub-pixel.conf
ln -s /etc/fonts/conf.available/10-hinting-medium.conf /etc/fonts/conf.d/.
ln -s /etc/fonts/conf.available/10-sub-pixel-rgb.conf /etc/fonts/conf.d/.
dpkg-reconfigure fontconfig
fc-cache -F -v

Tagged with:
nov 20

asf_logo_wide

Ecco un piccolo script in bash per automatizzare l’archiviazione dei log di Apache server.

Eseguito nella directory dei logs li prende e li archivia in una sottodirectory per data ed ora. Riavvia apache in modalità graceful per non chiudere connessioni. Crea poi un file .tar contentente tutti i logs prelevati e ne verifica l’integrità, elimina la directory sorgente e crea la firma md5 del .tar. Invia inoltre una mail di notifica all’amministratore di sistema.

Utile se si vuole automatizzare la gestione dei log, magari attraverso una regola crontab.

Lo script è facilmente modificabile per la gestione dei log di altri software

Rilasciato in GPL 3.

Download [apache_log_archiver.sh.tar]

#!/bin/bash
#
# Name:     Apache logs archiver (with email notify)
# Description:    A simple script that archive logs into an arbitrary directory
#        divided by date and time.
#        After that it can tar the subdir (and verify it), delete the
#        .log files, sign the .tar by md5sum and finally send a mail
#        with the urls to download files.
#        You can automate the execution of that script using a
#        cron rule (monthly, weekly, daily).
#
# Usage:    Place this script into your apache’s logdir
#        (ex. /var/log/apache2) and run it.
#        Set your options in the “configuration” section here.
#        Remind: give me +x! (chmod +x apache_log_archiver.sh)
#
# Requires:    sendmail, apache*-server, uname, tar, md5sum, whoami, date
#
# Author:     Mora Fabio
# Version:     0.1
# Contact:    fabio.mm@gmail.com – http://www.tech-effe.net
#
# This code is relased under GNU GPL v3 license
# (http://gplv3.fsf.org/)
#
# “Use Linux! It will save the world!”
# # # # # # # # # # # # # # # # # # # # # # # # #

# >>>>CONFIGURATION
#Archive dir
ARCHIVEDIR=archived_logs/
#Archive name prefix
ARCHIVEPREFIX=`uname -n`’[apache2]logs-’

#Apache init daemon path
APACHEINIT=/etc/init.d/apache2
#Apache control bin
APACHECTL=apache2ctl

#Send email? [1/0]
SENDEMAIL=1
#Wich email? [1/0]
TOEMAIL=’your@email.com’
#Wich subject? [1/0]
SUBJECTEMAIL=’There are new archived logs from ‘
#Path of MTA
SENDMAILMTA=sendmail
#Download URL
URLMAIL=’https://logs.myhostname.com/secreturl/’
#Email buffer
EMAILTMP=/tmp/logsarchivemail.txt

#Time to wait between apache reload and archiving?
#  You shuld leave 600 seconds in a production server running by crontab
#  You can override this using 0 seconds for test prupose
DELAY=600

#Remove *.log* files after tar? [1/0]
RMAFTERTAR=0
#Verify tar file (requires more time)? [1/0]
VERIFYTAR=1
#Generate signature (useful if you want an md5sum)? [1/0]
SIGNTAR=1
#Tarfile permissions (it is NOT a good idea use 777…)?
PERMSTAR=775

#Other settings
DATETIME=`date +%Y%m%d_%k%M%S`
NOTICE=’NOTICE: ‘
WARNING=’WARNING: ‘
ERROR=’ERROR: ‘

# >>>>Beginning…

#I check if you are root
if [ ! `whoami` == 'root' ]
then
echo $ERROR ‘Go away, you are not the root user.’
exit -1
fi

#I check if the archive dir exists, if no I try to make it
if [ ! -d $ARCHIVEDIR ]
then
if mkdir $ARCHIVEDIR
then
echo $NOTICE $ARCHIVEDIR “created successfully.”
else
echo $ERROR  $ARCHIVEDIR “could not be created. This is your FS?”
exit -1
fi
fi

#Creating the log subdir
if mkdir $ARCHIVEDIR$DATETIME
then
echo $NOTICE $ARCHIVEDIR$DATETIME “created successfully.”
else
echo $ERROR  $ARCHIVEDIR$DATETIME “could not be created. This is your FS?”
exit -1
fi

#Moving logs into the log subdir
if mv *.log* $ARCHIVEDIR$DATETIME
then
echo $NOTICE “logs successfully moved into” $ARCHIVEDIR$DATETIME”.”
else
echo $WARNING “unable to move logs into” $ARCHIVEDIR$DATETIME”. No logs?”
fi

#Restarts apache gracefully
if $APACHECTL graceful
then
echo $NOTICE “Apache gracefully restarted.”
else
echo $WARNING “I can’t restart Apache gracefully. Trying hard mode.”

if [ $APACHEINIT restart ]
then
echo $NOTICE “Apache hard-restarted.”
else
echo $ERROR “I can’t restart Apache.”
exit -1
fi
fi

#…wait until the last visitor comes out of apache
sleep $DELAY

#Add to an archive the moved logs
if [ $VERIFYTAR == 1 ]; then TAROPTIONS=’-cWf’; else TAROPTIONS=’-cf’; fi

if tar $TAROPTIONS $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.tar $ARCHIVEDIR$DATETIME
then
chmod $PERMSTAR $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.tar
echo $NOTICE $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.tar” is ready for you ;) .”

if [ $RMAFTERTAR == 1 ]
then
echo $NOTICE $ARCHIVEDIR” clean from logs.”
rm -R $ARCHIVEDIR$DATETIME
fi
else
echo $ERROR “failed to tar files.”
exit -1
fi

#Generating .tar signature
if [ $SIGNTAR == 1 ]
then
touch $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.md5
md5sum $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.tar > $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.md5
chmod $PERMSTAR $ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.md5
echo $NOTICE”signed “$ARCHIVEPREFIX$DATETIME”.tar into “$ARCHIVEPREFIX$DATETIME”.md5.”
fi

if [ $SENDEMAIL == 1 ]
then
echo “Subject:” $SUBJECTEMAIL `uname -n` > $EMAILTMP
echo ‘Hi’ $TOEMAIL ‘,’ >> $EMAILTMP
echo ‘  there are new logs from’ `uname -n` “.” >> $EMAILTMP
echo ‘They are:’ >> $EMAILTMP
echo ‘ – (TAR) ‘$URLMAIL$ARCHIVEPREFIX$DATETIME.tar >> $EMAILTMP
if [ $SIGNTAR == 1 ]; then echo ‘ – (MD5) ‘$URLMAIL$ARCHIVEDIR$ARCHIVEPREFIX$DATETIME.md5 >> $EMAILTMP; fi;
echo ‘   Goodbye!’ >> $EMAILTMP

if $SENDMAILMTA “$TOEMAIL” < $EMAILTMP
then
echo $NOTICE “email for” $TOEMAIL “queued.”
else
echo $ERROR “I can’t send email.”
exit -1
fi
fi

#Exiting succefully
exit 0

Tagged with:
preload preload preload