Webtool for managing Motion on Raspberry Pi

Raspberry PI Morion Webtool

A few months ago I setup a small surveillance system at home with motion detection using a Rapsberry Pi, Motion detection software and a webcam, following roughly these instructions for a low cost Raspberry Pi surveillance camera.

For a while I managed the surveillance system via SSH on my smartphone. It worked great but I was getting tired of SSH, so I finally got my act together and developed a small web-tool to do the work for me. It’s a very simple tool and all it does is check the status of the system and allow me to switch it on or off via the browser on my phone.

Here is how you can install my web tool.

(For installing Motion and setting up your Raspberry Pi, please follow the instructions on the link posted above)

  • Install Apache ( sudo apt-get install apache2 )
  • Install PHP5 (sudo apt-get install php5)
  • Install PHP5-gd (sudo apt-get install php5-gd) – this will enable PNG support, used by the function that displays the On/Off buttons depending on the status of Motion.

Download and install the web-tool

  1. At the Raspberry PI console type these commands, pressing “Enter” after each of them.
  2. cd /var/www
  3. sudo mkdir motion
  4. cd motion
  5. sudo wget http://itechlog.com/projects/motion-webtool.tar.gz
  6. sudo tar zxvf motion-webtool.tar.gz
  7. Allow web server user www-data to run sudo commands for motion and pkill (pkill is used to kill processes by their names) – this is probably a little unsecure and lazy, but your RasPi should be only accessible within you network so it’s not a big deal – suggestions are welcome though.

Permissions – How to.

  • sudo visudo (to edit sudoers)
  • and add the following lines:

www-data ALL=(root) NOPASSWD:/usr/bin/motion
www-data ALL=(root) NOPASSWD:/usr/bin/pkill

  • To save press shift+o, Enter to confirm overwrite, shift+x to exit
  • Start Apache: sudo service apache2 start

Then access the tool via your browser: http://<ip>/motion (where <ip> is the ip address of your Raspberry Pi, which should have been setup as a static IP).

Linux distribution for Astronomy

Distro Astro

As a Physics undergraduate student (in my almost middle age) with great interest in Astronomy, Linux and Open source software, I cannot give enough thanks to team behind the Distro Astro – Linux for astronomers.

 

The distro

The Distro Astro is a Debian based distribution, you can test run it in full from the live DVD version without the need to install it first. Their latest version (2.0) is called Pallas and contains various software packages used by professional and amateur astronomers. It comes loaded with camera drivers, imaging software, tools for astrophotgraphy, planetariums, sky maps and charts, data analysis tools and much more.

A unique feature of Distro Astro is support for Nightvision Mode. This allows you to toggle between normal and red nightvision colors to preserve dark adaptation (of your eyes) while using the computer at night, especially during observations.

Help develop

In the spirit of true open source, the developers have asked for contribution from other developers and non-developers in packaging existing software, creating new tools and features, mirror hosting, bug testing, promoting the distro,  hardware support and financial sponsoring.

So if you have an interest in Astronomy, why no give Distro Astro a try.  You can also follow Distro Astro’s development on Twitter, Google+ and Facebook

 

Truecrypt Failed to set up a loop device in openSUSE

If you are getting the error message “Failed to set up a loop device” while mounting Truecrypt media on Linux, especially in openSUSE, there’s a simple fix. Normally I have to browse through various forums to find different bits of information to fix a problem, and I normally post the full fix here. This fix is so simple that I’ll link directly to it on openSUSE’s support forum.

Fix: TrueCrypt issue – Failed to set up a loop device

Technorati Tags: , , ,

Linux and Android in space with STRaND-1

The UK’s nano satellite STRaND-1 has taken an Android smart-phone (Nexus One) where no other smart-phone has gone before, space!  The satellite also contains a small computer running Linux in its payload.

During the summer of 2011, the STRaND team ran a competition to find apps to be loaded onto the phone. There selected winners were:

iTesa  – will record the magnitude of the magnetic field around the phone during orbit.

The STRAND Data app –  will show satellite telemetry on the smartphone’s display which can be imaged by an additional camera on-board.

The 360 app  – will take images using the smartphone’s camera and use the technology onboard the spacecraft to establish STRaND-1’s position.

The Scream in Space app – will make full use of the smartphone’s speakers. Testing the theory ‘in space no-one can hear you scream, made popular in the 1979 film ‘Alien’.

The anatomy of STRaND-1

 

 

Stop Salesforce web-to-lead spam

Salesforce web to lead form is a great way of collecting leads straight from your website into Salesforce CRM. The biggest problem is that Salesforce has not put in place a SPAM filtre for this, so once your form is out there anyone can cache it and send SPAM to your CRM as a new lead.

What about CAPTCHA

CAPTCHA alone won’t help. Since the form can be submitted from any server, once they get hold of your web to lead OID, they can cache your form, remove the CAPTCHA and continue to SPAM you.

At the moment I am using the following solution posted by Scott Hemmeter on his blog post “Stopping web to lead SPAM“. This solution is to setup a Validation Rule in Salesforce in order to avoid SPAM leads being created.

Let’s hope Salesforce will come up with a way of checking and stopping web to lead SPAM.

Technorati Tags: , , , , , ,