Wednesday, June 20, 2012

Recover your stolen phone, tablet and computer with Prey

Prey is free open source software that lets you keep track of your device whenever its stolen or missing. It works on Ubuntu, Debian, Mac OS, Linux, Android, i OS and Windows.

If you check in the site and set your device to stolen the device will send a Google map with the location of the device (Even if there is no GPS in the device!), a screenshot, a webcam picture, network info like ip adress and the name of the wifi connection.

I tested this on Ubuntu 12.4 LTS (32 bit) and Ubuntu 18.04.5 LTS (32 bit) and it works great. (After a bit of tweaking.)

The current version in the repository does not work as the directories are changed in 12.4 LTE.

To make it work in Ubuntu 12.4 download the .deb file from http://preyproject.com/download. Install the .deb file and register yourself and the device at the prey website.

There is an old version of Prey in the Ubuntu 18  repository that can be installed with: sudo apt install prey.
Do this then purge the install with: sudo apt purge prey.

Better to download the latest  .deb file from the prey website and run:

sudo dpkg -i prey_1.9.6_i386.deb

Prey resides in:     /usr/lib/prey

Open the GUI with:     sudo /usr/lib/prey/current/bin/prey config gui -f

try: sudo /usr/lib/prey/current//bin/prey -h

and try: sudo /usr/lib/prey/current//bin/prey config check 




Now check and if needed edit /etc/prey/config or /etc/prey/prey.conf and add the device key and API key which can both be found at the prey website under settings>about.
The API key is on the account page, the device key is at the device page.
This can also be done command line: 
sudo /usr/lib/prey/current//bin/prey config account authorize -a -e email@adress -p preypassword

I had to do a reboot to get it running properly.

Prey uses systemd and if installed correctly creates prey-agent.service

Check status with: sudo systemctl status prey-agent.service

Optional detail filter in cognos report.

Create a valueprompt with 3 static Choices that give parameter ?PromptParameter? one of these values: allmissing, 1of2missing or nonemissing.

Choosing 1 of these 3 options results in a filter being used.

Only one detail filter is used. Remember, a detail filter can only be true or false.

Detail Filter:

( ?PromptParameter? = 'allmissing'
and [Data1] is missing
and [Data2] is missing)

or

( ?PromptParameter? = '1of2missing'
and
( [Data1] is not missing
or [Data2] is not missing))

or

( ?PromptParameter? = 'nonemissing')



There is another possibility not to use this filter but to add 3 dataitems that only count the data that is wanted. Then create 3 lists and make them conditional, but I like this "hack" better.
This way there is only one report with one list with one filter to maintain.

I like to do these things KISS ( Keep It Simple Stupid). KISS things are easy to maintain, easy to understand, easy to change, easy to explain and therefore highly efficient.

Please try to do these complicated things KISS. (As I learned from my Elmer.)