What you need:

  1. The Ubuntu mini CD
  2. A linux and ZoneMinder-supported capture card
  3. A PC

Let’s start!

  1. Install Ubuntu
  2. After the base system is installed install ssh (always good to have) and ZoneMinder

    user@ubuntu:~$ sudo apt-get install openssh-server zoneminder

  4. Add the www-data user to the ‘video’ group to access the video streams from the web interface:

    user@ubuntu:~$ sudo usermod -a -G video www-data

  5. Make Apache automatically start the ZoneMinder web interface and restart Apache:

    user@ubuntu:~$ sudo ln -s /etc/zm/apache.conf /etc/apache2/sites-enabled/001-zoneminder
    user@ubuntu:~$ sudo service apache2 restart

  6. At this point you should be able to open ZoneMinder’s web interface by pointing your browser to http://IP-OF-ZONEMINDER-SERVER/zm/
  7. Download Cambozola to be able to view the live streams from any Java enabled browser in case the Flash viewer does not work for you:

    user@ubuntu:~$ wget http://www.charliemouse.com:8080/code/cambozola/cambozola-latest.tar.gz
    user@ubuntu:~$ tar -zxvf cambozola-latest.tar.gz
    user@ubuntu:~$ sudo cp cambozola-0.76/dist/cambozola.jar /usr/share/zoneminder/

    Please note: As of writing this cambozola version 0.76 is the latest one, hence if you get a newer version you should change to the respective directory.

  8. It’s time to add your cameras – it’s best to first read ZoneMinder’s defining a monitor documentation
  9. In the very likely event that you get black/blank screen when you try to view the live feed from your camera, then you should change your maximum allowed amount of shared memory and restart Apache and ZoneMinder:

    user@ubuntu:~$ sudo echo "256000000" > /proc/sys/kernel/shmmax
    user@ubuntu:~$ sudo service apache2 restart
    user@ubuntu:~$ sudo service zoneminder restart

    How to calculate that magic number (256000000 in my case) is discussed in this thread in the ZoneMinder’s forums. It’s best to read it and calculate the amount yourself, as this is highly dependent on the cameras that you intend to use.
    In order to add the change permanently you’ll need to edit /etc/sysctl.conf and add a line kernel.shmmax = 256000000 to it.
    If you are still getting no image you should check your cameras and how you set them and experiment with the Device format and Capture palette.

  10. You’re all set!

It might be a good idea to slightly tweak some configuration options. You can do that from the Web Interface’s options menu – it is located in the upper right corner, just below the load/disk-usage monitor and it took me quite a while to find it.

  1. Options -> Image -> OPT_CAMBOZOLA set to TICKED
  2. Options -> Image -> STREAM_METHOD set to mpeg

I plan to implement also a Live View monitor so stay tuned for the next HOWTO.

A day after the iOS 4 was released I upgraded my iPhone 3Gs to benefit from all the new features. I was delighted with the new Cellular Data switch – it allowed my iphone to be a real phone and last for days not merely hours, all due to the GPRS/3G not abusing the battery.

Unfortunately one of the “features” in iOS4 turned out to be an even worse battery abuser – the persistent Wi-Fi. While I was at home or in the office – about 20 hours of my average day – the phone was constantly connected to the Wi-Fi and the battery lasted for 15-16 hours tops, with no more than an hour of actual usage!

So far there is no “Persistent Wi-Fi” switch, so I set on finding out what caused this behavior, and here is what you need to do to get it off:

  1. Disable notifications (yes, no more knowing when someone wrote on your Faceboko wall or mentioned you on twitter)
  2. Disable any Push e-mail, from the list of e-mails (Exchange, GMail, Yahoo, etc.), not just the Push switch in Settings -> Mail -> Fetch New Data!

If you are using Exchange (or Gmail/Google Apps) you’ll also need to disable your calendar and contacts unfortunately. In other words you have to switch to IMAP/POP e-mails.

This feature, unfortunately, makes you chose between having Push e-mail and notifications or manually turning on and off the Wi-Fi every time you need it, just like those nasty Symbian phones, the iPhone claims to be superior to!

UPDATE: after ten days I have to admit – I was wrong. Probably one of those nasty background-running apps was keeping the Wi-Fi connected at all times. Now I close most of my apps after I’m done with them and battery indeed lasts for 2 days and about 3 hours of use! Cheers!