Wednesday, 13 April 2022

Preventing Doze Mode on Samsung Galaxy Tab 8

We have a relatively old Samsung Galaxy Tab 8 android device that we use as a monitor for OpenSeizureDetector.

The problem is that when it is not plugged in, we start to get fault 'pips' until we wake up the device.     There are no obvious 'Battery Optimisation' settings in the OpenSeizureDetector page of the device Settings->Apps menu.

It turns out that the battery optimisation settings are well hidden.  To disable battery optimisation do:

  • Settings -> Apps
  • Three dots at top of screen to open extra menu.
  • "Special Access"
  • "Optimise Battery Usage"
  • Select "All Apps"
  • Locate OpenSeizureDetector and set the switch to off (not optimised).
This should prevent OpenSeizureDetector being forced into 'Dose Mode' so it will continue to run normally in the background when the device is asleep.

Sunday, 6 March 2022

Transferring a MySQL Database to another Server

 This should be easy...

On server do:

mysqldump -u osd -p osd > osd_dump_06mar21.sql

But on my very small virtual server I hit an error about conection to mysql being lost.     I had to increase some timeouts in the mysqld configuration file....but I have forgotten which ones - will update this when I remember.


Transfer the dump file to the other server (I use scp).

On the other server, set up the user login details then do:

mysql -u osd -p osd < osd_dump_06mar21.sql

BUT this gave an error:

Unknown collation: 'utf8mb4_0900_ai_ci'

I found (on stack exchange!) that the solution is to replace all occurrences of this string with 'utf8mb4_unicode_ci'

The simplest way to do that is with sed:

sed -i 's/utf8mb4_0900_ai_ci/utf8mb4_unicode_ci/g' osd_dump_06mar21.sql 

After doing that the import:

mysql -u osd -p osd < osd_dump_06mar21.sql

worked fine. 

 

Friday, 4 February 2022

Using a Brother Networked Printer/Scanner with Linux

 Notes for future reference:

Printing just worked using the 'Printing' GUI.

Scanning Didn't.....the SimpleScan programme did not detect the scanner.

The trick is to install a driver that pretends that the networked scanner is connected locally using the SANE interface, brsaneconfig4

Doing:

brsaneconfig4 -q lists the scanners that are available.

brsaneconfig4 -a name=SCANNER model=MFC-L3750CDW ip=192.168.0.19

adds the scanner, and it now works nicely with simplescan.

Sunday, 2 January 2022

Parkrun Finish Token Generator

We had an issue with 'losing' some of our nice new finish tokens from Hartlepool Parkrun. We ended up replacing them with spares from our old set of tokens, but these were worn and difficult to scan, and had been repaired using barcode stickers which wear off easily.

The main parkrun web site gives the ability to print out a finish toke bar code, but they are not the same size as the real tokens so do not stack nicely with the original tokens.

To get around this I wrote a Python script that will generate SVG images of a requested set of finish tokens.  These can be printed out, laminated and cut to the same size as the original tokens.   The python scripts are here: https://github.com/jones139/parkrun_tokens

I know that some people that might find this useful will struggle with using a python script from the command line, so I made a simple web app that presents the script as a web page to allow the user to specify the parkrun name to be printed on the tokens along with the list of tokens to generate.   The token generator web app is running here: https://barcodes.ddns.net.



A typical A4 sized SVG output image is shown below:

Once the page is printed, laminated and cut to size, the completed set of tokens looks like this:
We have not had any issues with scanning these tokens - they seem to work as well as the originals (at least for the first few weeks that we have been using them - they may well deteriorate after a few very rainy Saturdays!).