Information Technology Grimoire

Version .0.0.1

IT Notes from various projects because I forget, and hopefully they help you too.

Thumbnail Gallery

This script makes a simple gallery html page of all images in a specific directory and creates a simple page that lists them all.

The Thumbnail Script

#!/bin/bash
FILES="$@"
echo "<html><head><title>generated thumbs</title></head><body>"
for i in $FILES
do
echo "<a href='$i'><img src='thumb.$i' alt='$i'/ ></a>"
/usr/bin/convert -thumbnail 150 ./$i ./thumb.$i
chown www-data.www-data $i
chown www-data.www-data thumb.$i
done
echo "</body></html>"

Example Usage

./thumbnails.sh I*.jpg > index.html