CODE-IT SOFTWARE       

    HOME      PRODUCTS  &  SERVICES      SUPPORT      

 

 What the heck is this set of wcs "Bash Shell Scripts" ...

Being fairly new to programming for Linux - I am constantly amazed at what a simple BASH script can do.  

So.. what is a BASH script? Normally, scripts are interactive. It means they accept command from you (via keyboard) and execute them. But if you use command one by one (sequence of 'n' number of commands) , then you can store this sequence of command to text file and tell the shell to execute this text file instead of entering the commands. This is known as a shell script. Shell script defined as: "Shell Script is a series of commands written in plain text file".

Shell scripting advantages...

  • * To automate the frequently performed operations
  • * To run sequence of commands as a single command
  • * Easy to use
  • * Portable (It can be executed in any Unix-like operating systems without any modifications)
  • * And the most amazing thing for me - is that complicated tasks can be done without all the overhead of using a heavy programming software app and the need to have an install/ setup program. 
    • * Just put the script somewhere on your Linux system, set it's property to "make executable", double click it and select to run (just like a full blown software program). 
    • * You could also easily configure it to be automatically ran at system startup.

Here's a simple Bash Script that I'm putting out there for beta testing - since it involves the use of a web cam (that there are so many different models of) - just cuz it works well on my dev system doesn't mean very much;-) I'm not done with adding features to this script so for now it is very basic and simple.

Web Cam Spy

Place this very simple set of Bash scripts anywhere on your Linux system (i.e home, desktop, etc...)

Double click to activate  (make sure the "make executable" property is set to positive) - select to "run". Of course you can also activate via the terminal ;-)

There are 4 different Bash Scripts in this zipped folder:

WCS.sh - This script will hopefully (if working correctly) take a web cam snap shot every 3 minutes and save in a hidden directory (see below for more detailed info...) It can be used to monitor a room/ space, monitor gauge activity of boilers or any other appliance or machinery, monitor any space, or thing, that the web cam can be pointed at, etc... 

WCS_Stop.sh - this script will stop the WCS script

WCS_Viewer.sh - this script can be used to preview the smapshots

WCS_MakeVideo.sh - this will create a video of the snapshots

Things you need to know:

  • * you need to be sure the "Make Executable" property of the file is set to positive.
  • * the snapshot images (jpg) should be saved within a "hidden fiolder" in your home directory. Path = ~/.wcs
  • * the script automatically creates this folder (~/.wcs)
  • * in case you don't know - to show hidden folder within your home directory - open the home directory, click to give it foucus then press the hotkey of CTRL+h. This will show (make visible) all hidden folders.
  • * is set to take snapshot every 3 minutes by default - this value can easily be reset to any value - just open  the script file, with a ASCII text editor, and change the interval (sleep) value.
  • * the snap shots (jpg files) are saved with the date and time as the file name.
  • * this script runs (after activated) in a constant loop - in other words runs as long as the system is active or until you enter into the Terminal this command: pkill -f WCS.sh
    • * instead of stopping the script via the Terminal input - you could easily use the included BASH script (WCS_Stop.sh) to do so.

DOWNLOAD IT HERE...

Install and compatibility info:

This (the file you download) is a "zip" file - merely unzip it to get the WCS.sh BASH script file.

You'll need to have "fswebcam" installed. You can install using the `apt-get  install fswebcam' command in the Terminal.

If you are one that's beta testing the script:

  • * first off I'd like to know - does it even work with your system and web cam!

  • * do you have any suggestions for improvement?

  • * can you foresee that this script might be useful?

  • * do you think that it would be better if was a normal GUI software app (instead of a script)?

  • * any other observations or comments?

Things/ features I'm considering adding before public release: may release more or less "as is" but have a "PRO" version that impliments the following added features...

  • * option to automatically upload (via SFTP) the snap shot images to a server that can be accessed via YOUR unique link (URL)  - possibly password protected entry.

  • * have the snapshots displayed within a image viewer

  • * option to set amount of images saved before deleted to conserve space

  • * option to set interval without having to manually edit the file

  • * option to set local path for saved images (if select to save to HD instead of uploading to a server)

  • * option to activate the script upon system startup (or not)

A BIG THANKS TO ANYONE THAT TAKES THE TIME TO BETA TEST - YOUR EFFORTS ARE GREATLY APPRECIATED! If you give me permission - I'l put your name on the about screen as a contributor.

Hack'n the Linux - mikeB

a no nonsense Wyoming U.S.A. enterprise since 1997

Need any help or support? Please feel free to contact mb@code-it.com

UNAUTHORIZED REPRODUCTION AND DISTRIBUTION OF THIS (C) INFORMATION WOULD BE DEEPLY APPRECIATED!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

sudo add-apt-repository ppa:gambas-team/gambas3
sudo apt-get update