Pamela

From Hackerspace Brussels
Jump to: navigation, search
Pamela
[[Image:{{{picture}}}|200px]]
What:
Pamela
Tagline:
pamela in the sky with gems
Maintainer(s):
tazo,fs111,sandb
Archived:



WTF?[edit]

Project Pamela is the pretty silly name of an idea that Tazo came up with: The basic idea is to be able to see if someone is in hsb and if so who is actually there.

Gunstick from syn2cat came up with a decent naming explanation; from now on and forever more, Pamela means Pretty Amazing Member Enabled Localization Application

Pamela consists out of a Canvas based web page that shows all macs, or other data, flying around a main picture in the middle. Data can be provided by uploading it to Uploads.php. Pamela comes with a sample scanner script that scans the network for mac addresses and uploads those to the webserver.

Code[edit]

You can download the source from github: http://github.com/sandb/pamela/.

Installation[edit]

To install pamela, you'll need a webserver capable of running php5 scripts and having support for sqlite3.

  1. Download the latest release from https://github.com/sandb/pamela/tarball/1.2, it's a tar.gz file and untar it on your webserver.
  2. Rename the folder to something sensible like e.g. "pamela"
  3. In the pamela, make a directory called "db" and make sure it is writeable by the user used by your webserver e.g. "www-data" or whatever your setup uses.
  4. Edit the config.example.php file to a configuration to your liking (see #Configuration) and rename it to config.php.

After installing, you should be able to browse to the location you installed pamela under, and if everything is correct, you'll see a picture in the middle, with nothing flying around it. You should also see that pamela has created a file pamela.sql in the db folder. This is a sqlite3 database it uses to remember that data it should display.

Configuration[edit]

The configuration of pamela is done inside the filed config.php on your webserver. You can config the following parameters:

Database location[edit]

Edit the line that starts with define("SQLITE_DB",... so that it contains the absolute path of your db directory, and the name of the db file you want to use, e.g.:

define("SQLITE_DB", "/var/www/pamela/db/pamela.sql");

This is important, set this wrong and pamela will not work.

Background color[edit]

You can set the background of pamela by editing the line that starts with define("PAM_BGCOLOR",..., with using css notation for colors, e.g.

define("PAM_BGCOLOR", "#e340f4");

Image[edit]

To change the image pamela puts in the middle, upload your picture of choice to your webserver and change the line beginning with define("PAM_IMAGE",... to point to that image. e.g.

define("PAM_IMAGE", "img/my-favorite-picture.png");

You can use jpg's if you want, but pamela works nicer if you use a gif or png image that has transparent parts.

Download button[edit]

The download button is a button in the lower right of pamela that allow users to download the script to populate the db. You can set it's presence, which file it will serve up and the color of the text when hovering over the button.

You set the visibility or presence of the download button with (e.g. turning it off):

define("PAM_BUT_SHOW", "FALSE");

You set the text color for the hover text of the button by supplying a css color to (e.g. red):

define("PAM_BUT_COLOR", "#f00");

You set the script file served up by modifying the following line:

define("PAM_SCANNER_LINK", "scanner/pamela-scanner.sh");

Survival time for uploaded data[edit]

This is the time uploaded data will remain on the server. If data records get older than this time, they disappear from the server. This allows for multiple uploads from different sources all to be combined in one pamela instance. The only thing you need to make sure off is that you re-upload at regular times so pamela does not become empty.

You set the time-to-live in seconds by modifying (e.g. setting ttl to 1 hour):

define("DATA_TTL", "3600");