Monthly Archive for July, 2011

Remove logs older than X days

The simplest way to remove files older than $NUMBER of days..

Dry run (files will be NOT deleted, you will see a list with files older than 100 days)

1
find /var/log/squid3/ -mtime +100 -exec echo {} \; | less

Another dry run, see what you will delete :

1
2
3
find /var/log/squid3/ -mtime +600 -exec echo rm {} \;
rm /var/log/squid3/access.log.0
rm /var/log/squid3/access.log.2

Finally if you decided to remove the files:

1
find /var/log/squid3/ -mtime +600 -exec rm {} \;

Getting started with arduino

Some weeks ago I bought a really cool book – “Getting Started with Arduino”, which was written by the co-founder of Arduino Massimo Banzi.


This little booklet offers a thorough introduction to the Continue reading ‘Getting started with arduino’

Apache short paths

A little trick to simplify your apache virtual hosts configuration, instead of full paths you can use some predefined variables like the directory of apache logs or the configuration directory.

${APACHE_LOG_DIR} is for /var/log/apache2

1
2
ErrorLog ${APACHE_LOG_DIR}/access.log
CustomLog ${APACHE_LOG_DIR}/error.log

$APACHE_CONFDIR is for /etc/apache2

1
$APACHE_CONFDIR/mods-available

Rsync Server

Another new and different method to create your backups, a client with important data connecting to a rsync server. I describe a simple method without authentication (trusted LAN), there are no configuration limits. Continue reading ‘Rsync Server’

DRBD master/slave setup

In the last time I get a lot questions and feedback to some older posts (Active/Passive Cluster) where I used DRBD. And actually I never wrote how to setup DRBD and I try to fill this gap now. Also this post will be a new ground for some new ideas and posts related to Active/Passive Clustering with KVM.

DRBD (Distributed Replicated Block Device) is a really cool cluster solution to have radundant data on two or more nodes. Everybody know RAID, DRBD is like RAID 1 over network.
Continue reading ‘DRBD master/slave setup’