Springwatch in School

Since Thursday, Jason and I have been working on a project to bring a little nature over to the St. Peter’s website.

I got the call on Thursday asking me if I could source a camera to take in to the school. Apparently a nest had been found outside one of the classrooms, and the school wanted a live feed.

Time was of the essence!

After having a scour around the internet, I found a cool budget camera that would fit the the bill.

The bonus of this camera is that it has infra-red for night vision, as well as sound if required.

I went along on Friday, and we hooked up the camera near the nest and armed with a sledgehammer, drill and an uneasy desire to cause carnage connected the camera to the school network and the mains.

Configuration was interesting. The IP camera allows a live feed that you can configure it with – but requires the installation of an unsigned ActiveX control (which is a pain to install because it is unsigned). Also, the FTP settings will allow you to connect to an FTP site, but not set a filename or folder. ARGH!

So some jiggery pokery came into play. I set up an FTP service in IIS 6.0 on the main server, and created a new folder for the uploaded images. After a little bit of waving in front of the camera, I found that the images were being uploaded in a sequence from when the camera is turned on. eg. cam0001.jpg, cam0002.jpg and so on.

I created a page on my own website, as the school doesn’t have direct FTP access:

<h1>St. Peter's Nestcam</h1>
<img id="camImg" src="./cam.jpg" alt="" />

The picture you are seeing is a motion-sensitive feed,
which is updated every 10 seconds. If there is little or no movement,
the picture stays the same.

Don't worry, it does change! Just take a look at another time.&lt;/p&gt;

Thanks to the bods at <a href="http://www.centaur.it/">Centaur Systems</a>
for setting this up so quickly

Back to the
<a href="http://www.st-peters-canterbury.kent.sch.uk/">school website</a>

Finally, two scripts were created to upload to FTP. I don’t have them to hand, but I’ll upload them later. I promise!

Extract Audio from DVDs in Ubuntu

I wanted to extract Marillion’s cover of Toxic today, which lives on the DVD release of Thankyou Whoever You Are / Most Toys.

I found a useful page over at Ubuntu Geek which covered the topic nicely using a tool called transcode, which I’ve used a little of in the past.

I was having some difficulties with this one though, as transcode only worked on a few titles on the DVD. After a bit of testing, I discovered that this wasn’t woking on titles that had no video.

Eventually I settled on this command line to extract the song:

<code>transcode -i /dev/dvd -x null,dvd -T 4,1,1 -a 0 -y null,ogg -o MarillionToxic.ogg</code>

Here’s the breakdown:
transcode – run transcode
-i /dev/dvd – set the input to the DVD drive
-x null,dvd – set the input modules. As I don’t want video, I’ve used null and then dvd for the audio channel
-T 4,1,1 – set the Title 4, Chapter 1, Angle 1, which is the Toxic track on the DVD
-a 0 – set the audio track (the first is 0 on DVDs)
-y null,ogg – sets the output to ogg. Once again, I’ve forced null for the video
-o MarillionToxic.ogg – finally, I’ve set the filename for extracting the audio.

The whole track was extracted from DVD in a matter of seconds. Brilliant.

Ubuntu 7.04 fails to mount USB drive after kernal upgrade

After the recent Feisty kernel update, I found that I couldn’t access a USB drive without using root privileges in the command prompt.

When plugging a USB flash drive in, I’d get the following error:
Cannot Mount Volume

Cannot mount volume.

You are not privileged to mount the volume ‘drivename’.

The problem is the new way that Ubuntu identifies disk drives on your system, and also some changes in the mounting system. What I had to do was edit the /etc/fstab file to correct the error. So here goes:

  • Insert the USB pen drive into the USB port
  • Click Applications > Accessories > Terminal
  • type dmesg
  • Read the last entry that appears on screen (you should see some errors or warnings), and then type sudo gedit /etc/fstab
  • Here you need to find the connection between your error:
    <code>[ 1025.759465] NTFS-fs warning (device hde1): parse_options(): Option utf8 is no longer supported, using option nls=utf8. Please use option nls=utf8 in the future and make sure utf8 is compiled either as a module or into the kernel.
    [ 1026.098973] NTFS volume version 3.1.

    and the fstab:

    <code>proc /proc proc defaults 0 0</code><code>
    # Entry for /dev/sdb1 :</code>
    UUID=2966f4fe-7f28-4017-b986-1ca801944b4f / ext3 defaults,errors=remount-ro 0 1</code>
    # Entry for /dev/sdb5 :</code>
    UUID=68989c2d-87a1-4a4f-b5d7-210790b336c4 none swap sw 0 0</code>
    /dev/hdd /media/cdrom0 udf,iso9660 user,noauto 0 0</code>
    /dev/ /media/floppy0 auto rw,user,noauto 0 0</code>
    none /proc/bus/usb usbfs devgid=100,devmode=666 0 0</code>
    /dev/sda1 /media/VistaHDD ntfs umask=222,utf8 0 0</code>
  • For me, the connection is the ntfs-fs error and the list listed drive. The error says that I can’t use UTF8, so it’s stopping before it mounts the USB drive.
  • If you think that you’ve found the connection, comment out the line with a hash:
    <code>#/dev/sda1 /media/VistaHDD ntfs umask=222,utf8 0 0</code>
  • Save the file, then try and put the USB drive back in the computer again
  • If it works, great. If not, run dmesg again, and check the error is the same – then comment out the appropriate entry again.

This is mainly to do with recent kernal upgrades, which are changing a number of features. I’m sure it’s good in the long run!