Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user


« Newer Snippets
Older Snippets »
4 total  XML / RSS feed 

Daily rotated backups to Strongspace


# backup folder
MYSQL_DATABASES="db1 db2 dbn"
DIRS="dir1 dir2 dirn"
[email protected]

BACKUP_ALT=$(python -c "import time, sys; sys.stdout.write(str(int(time.strftime('%d')) % 2))")

for d in MYSQL_DATABASES; do
mysqldump --quick --opt --skip-add-locks $d |gzip - >${DEST}/${d}.sql.gz

for d in DIRS; do
tar zcvf ${HOME}${DEST}/${d}.tar.gz ${HOME}/${d} >/dev/null

scp -r ${DEST}/* ${STRONGSPACE_USER}:backup/$BACKUP_ALT/

rm -rf $DEST/*

Real user directories for virtual hosts

The default TXD Apache setup gives you user directory URLs like


If you need real user directories, set the 'User WWW Directory' of your virtual host in Webmin to something like


to get URLs like


Apply the 'anchor patch' to Trac

The 'anchor patch' adds support for a couple of very useful Trac macros:

* TocMacro
* RefMacro

To apply the patch without bothering the overworked TXD admnins, you can set up your own local copy of the Trac python package.

Assuming you have copied anchor.diff from

to your home directory, and that you are using bash and have a valid .bash_profile in your home (.profile will do too):

mkdir -p ~/lib/python2.4/site-packages
cp -R /usr/local/lib/python2.4/site-packages/trac ~/lib/python2.4/site-packages/
cd ~/lib/python2.4/site-packages
patch -p1 <~/anchor.diff
echo 'PYTHONPATH=$HOME/lib/python2.4/site-packages:$PYTHONPATH; export PYTHONPATH' >> ~/.bash_profile
python /usr/local/lib/python2.4/ ~/lib/python2.4/site-packages/trac

Now kill and restart tracd, and it should pick up the trac module in your home instead of the default.

Italian peasant's salad

From Enrica


* boiled patatoes (cold)
* olives (black or green)
* ripe tomatoes
* finely chopped onions
* salt
* oregano or 3-5 basil leaves
  (not washed just cleaned)
* freshly battered extra-vergin olive oil and vinegar
  (please please do not use the so called "Italian dressing", which is fake)

Optional Ingredients

cubes of pecorino (sheep) cheese or mozzarella


Add tomatoes at the end, use cold potatoes, and do not put too much of anything: too much is not better, is just too much; anyway, this is not a minimalist salad either, so do not be stingy either: in medio stat virtus!
« Newer Snippets
Older Snippets »
4 total  XML / RSS feed