Archive for August, 2007

Intel Create and Share

Thursday, August 16th, 2007

I have an Intel PC Camera Pro and I had a hell of a time getting drivers and software that work with Windows XP. Intel tries to make you buy a CD, forget it. If you have an older Intel web cam and can’t find drivers, try these.

Download Intel Create and Share Software

Backup Script

Wednesday, August 15th, 2007

I recently created a BASH script that creates a g-zipped tarball and writes it to a NAS. It also checks the free space available on the NAS and deletes previous backups until it has enough space to store a new backup. Maybe someone will find it useful or will be inspired to improve it.

Variables to modify:

DATA = What directories you want to backup.
LOGDIR = Where you want the backup logs to be stored.
BACKUPMNT = The mount point of your NAS or backup device.
BACKUPDIR = The directory on the mount to store the backup.

#!/bin/bash
# Steve Horbachuk 2007
# tars directories and writes to NAS
#

DATA="/home /root /etc /usr/local /var/www /var/log"
LOGDIR="/var/log/my-backup"
BACKUPMNT="/mnt/linkstation"
BACKUPDIR="/mnt/linkstation/server"
MYDATE=`date +%F`
LASTFILESIZE=0
LASTFILENAME=""

echo "Backup started : `date`" > $LOGDIR/backup_$MYDATE.log
echo "-------------------------------------------------" >> $LOGDIR/backup_$MYDATE.log

#find the last file in the backup folder
#and store information about it.
for FILE in $BACKUPDIR/*; do
if [ -f $FILE ]; then
FILEINFO=(`ls -lk $FILE`)
LASTFILENAME=${FILEINFO[8]}
LASTFILESIZE=${FILEINFO[4]}
fi
done

#delete files until there is enough space to hold a file
#the same size as the last backup.
for FILE in $BACKUPDIR/*; do
DISKINFO=(`df -k | grep $BACKUPMNT`)
DISKFREE=${DISKINFO[3]}
if [ -f $FILE ]; then
if [[ "$LASTFILESIZE" -gt "$DISKFREE" ]]; then
rm -vf $FILE >> $LOGDIR/backup_$MYDATE.log
fi
fi
done

tar -czf $BACKUPDIR/backup_$MYDATE.tar.gz --exclude='*.iso' --exclude='*/tmp/*' $DATA >> $LOGDIR/backup_$MYDATE.log

echo "-------------------------------------------------" >> $LOGDIR/backup_$MYDATE.log
echo "Backup finished : `date`" >> $LOGDIR/backup_$MYDATE.log

Here is the mount in /etc/fstab:
//10.0.0.50/share /mnt/linkstation cifs rw,guest 0 0

Where “//10.0.0.50/share” is the SMB share on the NAS, and /mnt/linlkstation is the Linux mount point.

Flash Video

Tuesday, August 14th, 2007

A couple of semesters ago I created this movie for a design class. I guess it’s pretty funny.

Big Site Change!

Monday, August 13th, 2007

As you may have noticed there is a big change in the site. I seem to have installed Wordpress. Recently some things have happened that inspired me to get this log back up and running. For now, I’m enjoying the default theme, until I get a chance to play around with the CSS.

The old site has been archived. I will probably tidy it up and keep it on the server for history’s sake. I will repost anything useful from it.

There will also be a new direction towards the site. I will post movie reviews and various tech things.