Tracking My Position all the Time

I have a long standing interest in monitoring my daily doings, I previously thought about putting a GPS tracker in my car, a good idea for both tracking my position and also checking to see if it has gone walkies (is stolen). I decided against doing this a while ago due to exams and lack of time to set the whole thing up. But I did decide to have a crack at this idea later with my phone.

The way I chose to go about this power hungry task was to use an app like IFTTT to record my position to a spreadsheet. But then I heard about owntracks, a purpose-built app for tracking your position. After setting up the owntracks server, MQTT and owntracks recorder. I now have a pretty good way of determining where I am at one time or another and have been using it for about 6 months.

My phone is a OnePlus 3 and as I said the app is fairly power hungry. Currently owntracks uses ~39% of my battery’s capacity based on 1 day 1 hour uptime. Although this seems fairly high I have accepted it as a fair compromise untill I can finish another GPS project I have in the works.

Here’s my experience of such a setup so far,

  • Battery usage increased significantly to a point where some users may not find it acceptable.
  • I had to turn off battery optimization and advanced battery optimization or else the app would stop.
  • The app does not always capture my location all of the time, sometimes it may be a few hours before it reports a significant change despite being in move monitoring mode or significant changes mode.
  • The performance and recording of positions in the app isn’t as good if the app does not have internet access all the time, so if data is switched off in my phone, the recording of the position isn’t as good as if it were on all the time, sometimes there can be large gaps where there was no internet access where it drops out.
  • My use case was for later analysis of the data, not realtime.
  • Owntracks recorder is not very featured but it does the job.
Oneplus3 Battery usage with owntracks

Hull University Timetable to Google Calendar

Getting your iCal Link for your Timetable

To add your Hull University Timetable iCal feed to Google Calendar, or equivalent calendar to use on your phone or other devices copy the link below,


replacing the 201700500 with your student ID found on your lanyard.

Adding your Scientia Timetable to Google Calendar

Then open Google Calendar and click the plus symbol highlighted in red like below.

Google Calendar add timetable calendar

Then click From URL and paste your link in. It should appear almost instantly. You should then see the new calendar appear that you can then set up notifications and colors to suit your needs.

Adding your Canvas Calendar

You can also add your canvas calendar which has your deadlines on by going to this link and then adding the link in the bottom right the same way we did above, you should now have all of your calendars in one place!

Note that this does not synchronize your calendar which you may receive emails with invitations through, and you can’t because you will see this message that prevents you.

outlook cant share calendar out of network



I am not associated with Hull University, they’re good guys.

How Long Will my Phone Battery Last Before it Dies?

phone battery last before it diesDefined obsolescence has gotten a hold of me again, I will have to purchase a new phone, as my old one is about to expire! I have had my phone for about 2 Years, I recieved it in the summer and It was fairly new at the time, being released in August 2014, My little HTC Desire 610 has been through a lot. It’s had 2 screen protectors, 2 cases and been across 3 networks. Now that It is aged, I have since rooted it and install android Lollipop it has had a new breath of life, However It’s quite slow as a daily driver and I think I will need a new one soon. The battery cover on the back cannot be removed and only the SIM card and External Memory can be replaced. How Unfortunate. But It got me wondering, How long will my phone battery last before it dies.

Some people wonder how long their phone battery will last before it dies, before it basically doesn’t hold a charge and it’s battery life is no longer able to last a day.I however know that answer, my phone will die on approximately Saturday, December 24th 2016 at 8:20 am, as at this point it will no longer hold a charge. How do I know this? Let me explain…

Data Collection

Firstly, I needed to collect data to predict when my phone was degrading in battery life, I decided that the easiest measurable metric would be when my phone was plugged in. Because I would usually do this when I got in from home, It did not require me collecting any data as it could all be done automatically. I know this isn’t the most precise method for multiple reasons, such as I may not always plug my phone in at the same time, the phone may not always record the results (as you will see) and the percentage when i plug it in is not an accurate assumption of health. However my findings did show a trend that shows the battery is degrading at about 0.000109% every minute, which gives me 7 and a half months to buy a new one.

Recording the Results

To record the results I used Google Drive and IFTTT to note down the percentage charge at the times the phone was disconnected and reconnected from power. It also recorded the charge type, such as USB,AC or an external Battery. This could potentially also alter my results as the percentage increase would vary over different mediums of charge, so I eliminated all but AC power, as this was always from the same plug and USB lead. So, How did I calculate how long will my phone battery last before it dies?

The recipe I used is nearly identical to this one, I made one for it being plugged in and one for it being unplugged. the data ended up looking like this.

Date and Time Status Battery Percentage Power Source
March 11, 2016 at 04:19PM Unplugged 41
March 11, 2016 at 04:19PM Charging 41 AC
March 11, 2016 at 04:33PM Unplugged 50
March 11, 2016 at 04:34PM Charging 49 AC
March 11, 2016 at 04:37PM Unplugged 52
March 11, 2016 at 04:39PM Charging 52 AC
March 11, 2016 at 04:44PM Unplugged 56
March 11, 2016 at 04:45PM Charging 56 AC

As you can see at this time I unplugged the device multiple times over 25 minutes to read emails and texts or whatever showed up on my phone. I was interested in this, so charted the occurrences of a date and time, and found that I had unplugged and plugged in again my phone four times in 1 minute at maximum, and had unplugged and plugged in my phone over 249 times. Here are the occurrences, excluding dates where I did not plug in my phone as although it would contribute to how long will my phone battery last before it dies, it did not trigger the app.

phone unplug replug showing Battery Last before It Dies

This also got me wondering how many times a day I unplugged my phone, If you look at the data, It shows that, for example, on the 20th of February, a Saturday, I unplugged my phone 16 times.

times phone was unplugged on a given day showing Battery Last before It Dies

It seems that for about a week during march I was unplugging my phone a lot, and I can’t really see a connection, I was at school on the 11th, I guess I must have been heavily using my phone over that period. The more perceptive of you will have noticed that the entire month of April is omitted, that is because the data was not recorded as I had been logged out of the IFTTT app, I did not realise until later when I re-enabled it, Having the empty months would alter the data so I have removed them from the results. Perhaps I shouldn’t worry how long will my phone battery last before it dies and instead how long the connector will last.

So How Long Will My Phone Battery Last Before It Dies?

phone plug in showing Battery Last before It Dies

This graph shows every event recorded, including when I was not recording the phone being plugged in, It clearly shows, using a linear trendline, that there is a decline in the battery percentage. Which shows my phone’s average battery percentage when being plugged in, when it reaches 0%, which I have decided is to be a dead battery, in 336101 Minutes, or 5602 hours. Coincidentally, It dies on Christmas Eve, the perfect time to be gifted a new phone ;).

Simulating a phone combination brute force


If a malicious individual were to steal your android or iPhone, plug in a device to emulate a keyboard and have it test every single pass code possible, it would take a while, using the following tutorial, you can calculate the time It would take to do so.








Firstly, you need to grab Python 3.4.3, or you can probably use the version you have installed. Next we need to create the code.

Firstly we need to import datetime to convert the guesses into time it would have taken, we also need to write down what the combination is, for this example, it will be ‘3502’.

import datetime
combination = "3502"

print (" [Info] Starting")

Then we need to add a guess and how long has passed while performing a guess, as it takes time to enter the numbers into the device, we will simulate this as well as 1 second.

guess = "0000"
seconds_taken = 0

def addsec(seconds):
     global seconds_taken
     seconds_taken = seconds_taken + seconds

I could have added the seconds section into the code directly, but adding as a def allowed me to edit it if I needed to, now that we have done the basics, we need to start guessing, there are 10,000 possible combinations, thats combinations such as 0001, this is problematic as leading zeros will not be carried over into integers in python, we can fix this using .zfill(4), which will add the leading zeros back into the guess, allowing us to compare it with the actual combination. This also means that we can convert the guess back into an integer in order to see if we have exceeded our limit. We also need to add a second for a combination guess.

def addsec(seconds):
     global seconds_taken
     seconds_taken = seconds_taken + seconds

while int(guess) <= 9999:
     if guess.zfill(4) == combination:
          print (" [Alert] Combination guessed, combination is " + combination)
          guess = str(int(guess) + 1)
          print (" [Info] Guess is now '" + str(guess).zfill(4) + "'")

Finally, we need to convert our result into a time, we can do this by dividing our seconds_taken (which is coincidentally the number of guesses if you add one for ‘0000’) by 5 (because it takes 5 guesses before a penalty), and then tuning that into an integer, rounding down and then multiplying by 300, to simulate 5 minutes lockout. then we combine penalties_incurred and seconds_taken, to get the time it takes to guess the combination (in seconds), then use that to convert into an hh:mm:ss format, using datetime.

penalties_incurred = int(seconds_taken / 5) * 300
time_taken = (str(datetime.timedelta(seconds=(penalties_incurred + seconds_taken))))
print (" [Finished] The combination would have taken '" + time_taken + "' to brute force. (h:m:s)")
print (" [Finished] You would have had to wait for " + str(int(penalties_incurred / 300)) + " lockout session(s)" )

What have we learnt?

  • There are 10,000 possible combinations.
  • For my combination, it would take 6 days, 30 minutes to guess.

On an Android Device,

  • It would take over 2,000 lockouts to guess every combination.
  • It would take 7 days, 1 hour, 26 minutes and 40 seconds to guess every combination.
  • It would take 8 hours, 28 minutes and 20 seconds to guess 500 combinations.
  • It would take 50 minutes and 50 seconds to guess 50 combinations, with 10 lockouts.

On an Apple Device*,

  • It would take 1666 lockouts to guess every combination.
  • It would take 5 days, 21 hours, 36 minutes and 40 seconds to guess every combination.
  • It would take 7 hours, 3 mintes and 20 seconds to guess 500 combinations.
  • It would take 40 minutes and 50 seconds to guess 50 combinations, with 8 lockouts.

*However, apple wipes their devices after 11 bad combinations, to avoid this, the combinations would have to be entered correctly after the sixth try in order for the apple device estimates to be correct, which defeats the purpose of brute forcing, for that reason apple devices are much more secure, however there is potential for data to be deleted accidentally.

This simulation is flawed because,

  • It does not take into account combinations greater than 4 digits
  • It does not take into account cumulative waiting times
  • It does not take into account device combinations that don’t involve numbers
  • You could increase the number of digits allowed in order to calculate your combination, for example if it was 67890, replacing the 13th line with 99999 would allow you to calculate it.

Here is the full code extract,

Cerberus for android – It’s awesome

So I bought Cerberus for android and installed it on all my devices for about 2 years, and its pretty great, not only does it provide you with the standard ‘find your device’ features that common apps do, but its also got ROOT permission stuff as well, the online console looks like this



The online console also shows when a command is both sent and recieved


Here is a list of features from the dropdown menu (As HTML)

<option value="START_TRACKING">Start tracking</option>
<option value="STOP_TRACKING">Stop tracking</option>
<option value="DEVICEINFO">Get device info</option>
<option value="HISTORY">Get location history</option>
<option value="LOCK">Lock with code</option>
<option value="UNLOCK">Unlock</option>
<option value="ALARM">Start alarm with a message</option>
<option value="MESSAGE">Display message</option>
<option value="CALLLOG">Get call log</option>
<option value="SMSLOG">Get SMS log</option>
<option value="CALL">Call phone</option>
<option value="SMS">Send SMS</option>
<option value="RECORDAUDIO">Record audio</option>
<option value="TAKEPICTURE">Take picture</option>
<option value="CAPTUREVIDEO">Capture video</option>
<option value="SCREENSHOT">Grab screenshot</option>
<option value="STARTEMERGENCY">Start emergency mode</option>
<option value="STOPEMERGENCY">Stop emergency mode</option>
<option value="HIDE">Hide from app drawer</option>
<option value="UNHIDE">Show in app drawer</option>
<option value="WIPE">Wipe device memory</option>
<option value="WIPESD">Wipe SD card</option>
<option value="REBOOT">Reboot device</option>
<option value="BACKUP">Backup data</option>
<option value="STOP_BACKUP">Stop backup</option>
<option value="GET_APP_LIST">Get installed apps</option>
<option value="LAUNCH_APP">Start application</option>
<option value="START_SERVICE">Start service</option>
<option value="SEND_BROADCAST">Send broadcast</option>
<option value="STARTSHELL">Start shell</option>
<option value="ENABLEBLUETOOTH">Enable bluetooth</option>
<option value="DISABLEBLUETOOTH">Disable bluetooth</option>
<option value="ENABLEHOTSPOT">Enable Wi-Fi hotspot</option>
<option value="DISABLEHOTSPOT">Disable Wi-Fi hotspot</option>
<option value="SCREENRECORD">Capture screen recording</option>
<option value="GETAPPCONF">Change app settings</option>

Some features require root, which for me is no issue. Some things to note is the picture and video quality is very poor, I cant tell whether this is because they try to save bandwidth (as responses are given over email) or because of some funky implementation the app uses, but they are mostly watchable, though you’d get lucky to get your thief’s face.

You can start apps which is useful, you can also go into the app settings and set the app to open when you ring a phone number like ‘10000’ for example, you can also force it to be persistent by installing it with TWRP or  CWM so it survives a wipe of the entire system, as well as deleting the app, once the phone is restarted, it re-installs, with your settings.

You can also download the ‘System Framework’ version, which in the event that your phone is nicked, the app wont be deleted by the thieves.

2015-09-24 18.11.00

2015-09-24 18.12.00

2015-09-24 18.12.08

2015-09-24 18.11.53

The app also has some other features seen below

2015-09-24 18.12.22

SIM checker allows the app to secretly send a message to a defined number if a new SIM is inserted, which I accidentally triggered when I replaced my SIM, so I can say that I’m confident it works so long as the SIM has credit. The AutoTask Configuration is useless at best, there aren’t much things you can do with it and whenever I try to save, it crashes the phone, which I can only assume is because it tries to write to some inaccessible memory.

The track feature is good, precise and fairly accurate, it updates regularly, Id say every minute or so (sat stationary on a desk for 3 minutes. {note that the inaccuracy may be due to GPS, rather than Cerberus itself})


Being able to switch on data with a text command was especially handy when I had to retrieve a phone, once the phone was on we were loaded with all there Cerberus and able to find it at Tesco’s lost and found, but without the tracking we would have had no clue where to look (does not require root).

One other good feature is the ability to disable turning off the phone without first unlocking the device, this is one of my favourite features and a unique selling point for Cerberus

All in all I’d defiantly say it’s worth the one time investment, I’ve lost a phone and found it again with Cerberus, It worked well.