Wednesday, 20 April 2016

Silverstone April 2014 World Endurance racing - pictures


Choose your favourite ..
Aston Martins

Ferraris


American muscle

Porsches

Toyota


All racing at Silverstone April 16/17 2016 weekend. Results write up here and full gallery here.




Saturday, 26 March 2016

Paradox database.db recycled into Libre Office ready for mailing label generation

Problem

A neighbour asked for some help moving over from a couple of turn of the century windows XP boxes onto a new PC running Windows 10. Most of this was easy as the printer was quite up-to-date and most of the activity on the machine was for email using Thunderbird and document creation using Word 2003. The sting in the tail was the "Mailings" system used to handle a small business mailing list. As can be seen the standard address data was supplemented with some flags marked a..z which are used to record various attributes about the entry.  The main output from the system was mailing labels used for posting catalogs. There are about 5700+ entries in the database.



Research and process

The first task was to find which database system is used to hold the data, then see if the data can be extracted easily. Step two would be to reformat the extracted data into a modern usable format and finally figure out how to create mailing labels from that data.

Finding the brand of database was achieved by online search of files ending in .DB and .PX. Doing a strings command on the .EXE file and looking on the web for hints from the contents.

The strings output gave these names that looked like sub-routines or procedure names near the start of the file.

DBEDIT
DBGARROW
DBINSERT
DBN_CANCEL
DBN_DELETE
DBN_EDIT
DBN_FIRST
DBN_INSERT
DBN_LAST
DBN_NEXT
DBN_POST
DBN_PRIOR 

Search on these names gave hints that Delphi development environment had been used. The searches for .DB and .PX had results that indicated a Paradox database was being used. This matched with the known technology from the age of the system from around 2004. 

There are four main ways to read and refactor database files :
  1. Start the existing database - connect to it and extract all the data,
  2. Read the database files using an extractor tool, reformat or reuse the output,
  3. Read the database files and figure out the low level format to extract the records and rebuild into an input format,
  4. Use the import feature of a new database to read an older one.

The major advantage of using some kind of extraction tool  2) over a forensic bit twiddling approach 3) are time to solution, accuracy and ease of use.  Extraction from database using encryption mandate methods 1 & 4 above. For this project method 2 was to be used.

Knowing that the database was in Paradox format allowed the research to be more focused on obtaining a read and extract tool. Luckily the Wikipedia page for Paradox database listed PxTools & Pxlib combination that could be used to read an existing database file. The PxTools project is partly hosted on Sourceforge and partly on private web pages of  Jan Kneschke. The download links were a bit mixed up but just knowing that such a tool existed was enough to believe that clean extraction would be possible.

After some struggles to get a clean compile of the pxlib and link-load with pxtool ( -lm was needed ) a viable binary was obtained. 

Many database files build in the format of the data into a header record. Once that header is understood the rest of the data extraction is quite straight forward. The pxtool was then able to pull the record format and then provide the data in a variety of formats.

$ more ADDRESS_sceema.txt
File Version:            5.0
File Type:               indexed .DB data file
Tablename:               resttemp.DB
Num. of Records:         5716
Theor. Num. of Rec.:     6980
Num. of Fields:          36
Header size:             2048 (0x800)
Max. Table size:         2 (0x800)
Num. of Data Blocks:     1396
Num. of 1st Data Block:  1
Num. of last Data Block: 1241
Num. of prim. Key fields: 1
Next auto inc. value:    0
Write protected:         0
Code Page:               437 (0x1B5)
Encryption:              0x0
Update time:             27.8.2001 23:00:00 (998949600)

Fieldname          | Type
------------------------------------
         Client No | int(4)
           Surname | char(50)
              Name | char(50)
           Address | char(100)
              Town | char(30)
            County | char(30)
          Postcode | char(10)
         Telephone | char(40)
              Date | int(2)
                 A | boolean(1)
                 B | boolean(1)
                 C | boolean(1)
                 D | boolean(1)
                 E | boolean(1)
                 F | boolean(1)
                 G | boolean(1)
                 H | boolean(1)
                 I | boolean(1)
                 J | boolean(1)
                 K | boolean(1)
                 L | boolean(1)
                 M | boolean(1)
                 N | boolean(1)
                 O | boolean(1)
                 P | boolean(1)
                 Q | boolean(1)
                 R | boolean(1)
                 S | boolean(1)
                 T | boolean(1)
                 U | boolean(1)
                 V | boolean(1)
                 W | boolean(1)
                 X | boolean(1)
                 Y | boolean(1)
                 Z | boolean(1)
     Mailsort Code | int(4)
------------------------------------
     Record length | 346 (0x15A)

Extracts in .cvs and .html and .sql were obtained using the various options of PxTool. The database originally had some more involved functions to enable the use of mail sort codes but this was no longer needed. 

With the data extracted into .csv format, the import into LibreOffice Calc was straightforward. The 5777 address records appear as a row each with the fields separated out into columns.  The standard data filters were applied to the headings row to allow for sorting and searching. Conditional formatting was applied to the A..Z fields to highlight the set values. Some of the Address fields had line breaks which were replaced with, using a find/replace command.

Creating output

The last stage was to figure out how to generate the mailing labels, now only needed for Xmas cards, as the whole catalog process has moved on-line to a website. The lettered column flags are used to filter the data into various categories one of which was to send a Christmas card.

Libre Office has all the features needed to generate mail merge and labels project.  The steps required to do this are all.
  1. Review the data and check the column alignment and data.
  2. Register the spreadsheet as a data source in the Libre office Base program,
  3. Create a template label document with fields from the data source set up in 2)
  4. Generate the actual labels document using a filtered set of the data.
Step 2 is the magic, a new database is created that links back into the spreadsheet. After this step this "bridge" database can be used as a data source for later merges.


Once this whole process has been done for the first time just step 4) is repeated for other output selections. There are a couple of ways to achieve this all of which are demonstrated in YouTube. The most useful YouTube demos coming from TheFrugalComputerGuy who goes over many of the basic and advanced feature of Libre office.

Reimplementation of a database is the sort of project that can be a real time sink. Using the resources already existing this transformation was achieved in a couple of afternoons work. 

Wednesday, 30 December 2015

Ubuntu catch-up

It's be a long while since my last blog post. Have to say that I have mostly been commenting over on the time sink that is Facebook. Anyway I had a few days off over the Xmas break to catch up on a few housekeeping tasks. I don't mean re-roofing the shed, pulling leaves out of the pond, adding compost to the sinking vegtable patch or clearing the accumulating kibble from the office book shelves. What I mean is getting the Ubuntu linux machine up to date.  I have this hotrod machine that has a fairly complex set up that includes being able to boot into Windows 7, Windows 10 and Ubuntu Linux, used ocasionaly for various digital exploring and research projects.

In a fit of reckless enthusiasm the upgrade to 14.04 Ubuntu was triggered. After the usual process a reboot launched. This was where the fun started, the GUI login screen shows but in a low resolution version. Logging in gave a few flashes then back to the login screen. This is not a uncommon issue that relates to having an Nvidia plug-in graphics card that needs updated drivers.

First step was to get console access to the system using F1 or ssh in from another system (if previously configured).  

Next was update the Nvidia driver using

$  sudo apt-get install nvidia-current

However this ended with

Building for 3.2.0-68-generic and 3.13.0-61-generic
Building for architecture x86_64
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
Building initial module for 3.13.0-61-generic
Done.

IE a successful build for the latest kernel version but not he one running on the system, which was rather old as shown by...

$ uname -a
Linux bb02-u910 3.2.0-68-generic #102-Ubuntu SMP Tue Aug 12 22:02:15 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

3.2 being much older than 3.13.0

This was not expected, I had no particular need to run an old kernel on the updated system.  Indeed looking at the version table 3.2 is well behind the rest of the system, dating back to Ubuntu version 12.04

The kernel version is loaded during the system start up sequence by GRUB. Looking in /boot shows the configuration files and menus file that offer the kernel version during the start up sequence. The update-grub command should be adding the latest built kernels to the menu offered during the start up sequence. Update-grub appears to be working but the new kernels were not offered, it was instead showing a list of older kernels. Some research showed that GRUB needed updating. After checking which actual device is used the update sequence went through first time.

With Grub updated, the new kernel version 3.13.0-61-generic loaded and the graphics driver was in place. Success.

Notes and Links:

To get console -  use
  • Ctrl-Alt-F1 shortcut keys to switch to the first console.
    To switch back to Desktop mode, use the Ctrl-Alt-F7 shortcut keys.
    Or ssh in from another system,
Update Nvidia driver   or this way if you have a working GUI login
Check the Kernel version against name -a
Grub version update from 0.97 to 1.96 - Did not need to use boot recovery disk as the MBR was fine.

Whilst the above may seem quite complicated the main message to understand this that there is help out there especially on the Ubuntu forums.



Wednesday, 29 July 2015

Whatsapp Spam direct to your mobile and in ur face deception

This single image shows the whole process of Whatsapp spam process. Get a WhatsApp account (free) Load up a load of random or guessed phone numbers into a group. Send a cheesy message and then unload the group. Simples. A pain in the a***e international spam in short order. Cheaper than international SMS and no blowback.

And what is WhatsApp doing about this - nothing I as far as I can tell. 



Who who'll have guessed that a free messaging app would be used for spam ? Where's the president for that ? Just about the last 30 years of internet, Usenet, Email, worms, Viruses, Facebook.

---------------------------------------------------

Here is another ugly face of the net - pop up deception right in your face. Triggered from from a random interesting post on Facebook this javascript dialog box locks out your browser.  The use of a deceptive domain name "com-macupdate.info"  preceded by apple. gives the impression of legitimacy.

Action to take - Force quit Safari then restart Safari holding down Shift to avoid dropping right back into the same issue.  This and other similar scams are discussed on the Apple support forums.


http://apple.com-macupdate.info domain is a part of com-macupdate.info nothing to do with Apple.com

Monday, 13 April 2015

Engine Complexity in 30 years

Engine bay from a Ford Escort 1600 - mid 1980 vintage..


Nissan WER Nismo LP2 2015 race car engine bay


Nissan photo from Marshall Pruett on FB.


Tuesday, 7 April 2015

The gods of Google are fickle and don't look at what you expect.

I write this blog as a place to push out ideas, describe topics that interest me and practice writing skills. There is little danger of finding fame and fortune from a random collection of posts with little topic focus and absolutely no publishing schedule.

"Art is nothing without an audience" and for a blog that means looking at the viewing stats provided by Google. Generally this is low traffic blog with a few 10s of views on most entries, and a couple 100s of hits on the more popular entries.

Up to the start of this year the most popular entry was "The seven habits of successful technical support." with almost a 5000 views. The the start of a new career, fame at last ? Sorry no all the searches leading to the page were looking for the colourful 7 logo.

Last month the blog viewing stats suddenly went through the roof with over 1000 hits a day.
All the traffic was going to a Feb 2014 entry based round a picture of a maths question that had previously been circulating on Facebook. The blog has some added value describing the maths behind the question and adding some humour on the end. I was surprisingly pleased by the number of page hits and even added an advert for my sisters new book on the end of the entry.




 The joy did not last long and the stats tailed off quickly. A recent search for "old time maths question" shows why.  The image and the article are still at the top hit but the image link goes to a Pinterest page. No added value on that Pinterest page, it just redirects back to my blog entry.




However the traffic is stolen and the link to the blog is lost behind a sign-up click wall.


What I learnt from this, make an eye catching image and don't rely on great content to find traffic. There is little sense of time in search with derivative works valued as much as original content.

Wednesday, 18 March 2015

Apple Watch the distance from an original prediction to actuality

Lets have a look at an early prediction of the watch sized computer and how it turned out after 34 years of development.

Byte Magazine cover from April 1981
Apple Watch advert from March 2015 ( 34 years later )
Detail changes:
Keyboard -> Touch screen
Removable media -> Wireless connection
Text screen - > Full graphics screen
Stainless steel strap -> Stainless steel strap ( or leather etc)
Nothing -> Sensors for heartbeat, location, time, motion
Nothing -> Communication connection to iPhone
Text based adventure - > Angry Birds.

Software from early version would have been text based, limited by the lack of sensors, communication and 10 years of smartphone software development.






Tuesday, 10 March 2015

BT Openreach - Fails to provide phones lines to new houses in over 9 months.

Today yet another email from BT Openreach arrived with confirmation of yet another failed connection date at Torridge View new house site in Bideford EX39 4HH.


After BBC Watchdog castigated BT Openreach  for long delays connecting new housing developments back in November 2014 I contacted Openreach directly to track when the installation date was set.  We really hoped things would change as the site had already been waiting for connection for at least 4 months by that time.


After some delay the reply came….


> we expect to have all of our work completed at that development and to be able to provide your site with service by 16/02/15. 


On 19th January this changed to ...


>provide your site with service by 04/02/2015. 
then

be able to provide your site with service by 18/02/2015.
then

>provide your site with service has changed and is now 10/03/2015
then today ….

>provide your site with service has changed and is now 19/05/2015.


Broken promise after broken promise.


This repeated failures to stick to connection dates and deliver a basic service is both annoying and exceptionally poor service for the residents of the site.  It has been mentioned that some of the houses have been provided with temporary lines but this fails to address the core problem of lack of site connectivity. The length of delay at over 8 months was previously enough to cause Watchdog to run a report and yet this length of delay continues. 

Having a moan on behalf of a couple of residents on the site. We will be asking for free line rental for the same duration as the delay in installation.

This failure has already made the local paper back in October 2014 to little apparent effect.