Reviewing SPF, DKIM and DMARC settings for Google GSuite Mail on your domains

In the past, I’ve configured these on my domains (and wrote about SPF with GSuite – which was at the time, Google Apps). In the last 9 years, the rest of the DNS config has changed a lot, and as I’ve never had issues with mail, I never reviewed my settings. Until today.

For another reason, I checked my config on mx toolbox – and I spotted that some tuning was required.

The DNS report shows a few MX errors, and more warnings

As it happens, Google offer a similar tool for their users in their Google Apps toolbox.

It seems, that at some point the recommended record has changed from:

v=spf1 include:aspmx.googlemail.com ~all

To a different domain:

v=spf1 include:_spf.google.com ~all 

OK; no problem – that one’s easy to fix. Setting up DKIM was easy as well, using the guidance here, and again highlighted that those records were incorrect as well. At some point a CPanel server had managed the DNS config and added it’s own records!

Reminder to self – review my MX settings at least every couple of years!

Migrating a private repository from Bitbucket to GitHub with Git

As GitHub private repositories have just become free, I’m jumping on the bandwagon and shipping over a few of the repos I have on Bitbucket to reduce the number of providers I store code with.

The end result – a private GitHub repository with all the metadata from the old Bitbucket repository – note we have maintained the last commit from 10 months ago

The option below uses the shell to migrate the repo, but you can also use the GitHub importer if you prefer an automated solution (you’ll just have to wait while it does it).

Continue reading “Migrating a private repository from Bitbucket to GitHub with Git”

Doing your Qlik App Configuration in the load script, include files, or QMC (Publisher or the Qlik Repository Service APIs)?

For me, the bare minimum when it comes to app configuration in Qlik Sense or QlikView is:
– Setting paths and libs for use in data load script
– Setting “boilerplate” variables – e.g. the number/date/currency/etc formats
– Setting HidePrefix, SearchIndex and other app-specific behaviours
– Setting Product or Customer specific settings for consumption in the UI

This post adds some detail on config methods for Qlik Sense and QlikView, which fills the second tab from an earlier post about versioning.

 

Script for setting a base library based on config variables
Script for setting a base library based on config variables

 

In a multi-product/customer setup (see this previous post about deployment frameworks for context) where we follow common standards for names and folder structures we can streamline this configuration to reduce the maintenance and deployment burden.

Continue reading “Doing your Qlik App Configuration in the load script, include files, or QMC (Publisher or the Qlik Repository Service APIs)?”

Version sheets and tabs in the load script for Qlik Sense and QlikView

In the absence of a source control system like SVN or GIT, a quick and easy way of capturing changes in a app is to update a version control tab before passing the app back to other developers, or onto testers.

This is a very low-tech solution, but the format below works well in shared environments. The first two tabs of your application should be:
– Version (explain the app and list changes you’ve made)
– Config (set the configuration values like paths, dates, etc used in your application’s data load and UI)

Version and Config sheets will become a familiar sight
Version and Config sheets should become a familiar sight

Continue reading “Version sheets and tabs in the load script for Qlik Sense and QlikView”

3arcade PHP game script updated to version 2.1 to work with PHP 5.6

I have an installation of the 3arcade script that’s still in the wild, and decided it was time to update it to work with PHP 5.6 (at least).

These changes fix:
– a row 0 error in play.php linked to deprecated functions
– deprecation of the ereg_replace function through use of intval
– deprecation of the mysql_connect function (and future deprecation of mysql* functions) through use of PDO
– consistency of database connection and query errors with a variable in the config file

Changes live at https://github.com/withdave/3arcade

How to use subversion to publish Plugin updates to WordPress.org SVN after development

This is a quick post on how to publish updates for WordPress Plugins (like SEATT) to WordPress.org. As I rarely use SVN, I forget every time!

Software

For Windows, you can use TortoiseSVN.

Tortoise is a very easy to use, free tool

Checking out the repository

Using TortoiseSVN, right click in the target directory and select “Checkout”. Enter the URL of the repository (for SEATT this is https://plugins.svn.wordpress.org/simple-event-attendance/); if it’s on WordPress.org no auth is needed at this point.

Updating the repository

  • Copy the updated files into the /plugin/trunk folder
  • Right click on the /plugin folder and select “SVN Commit”. Add a comment and submit. You will be prompted to authenticate using your wordpress.org credentials
  • Right click on the /plugin/trunk folder and select “TortoiseSVN>Branch/tag…”. Change the target directory to “/plugin/tag/<tagId>” and submit
  • Right click on the /plugin folder and select “SVN Update” to fetch the tag you just created

Updating the “tested up to” value

  • Run “SVN Update” on your local copy
  • Update the “Tested up to” value in “/plugin/trunk/readme.txt” and use this to replace “/plugin/tag/<tagId>/readme.txt”
  • Run “SVN Commit” to push back to the repo

DateTime with no DateTimeZone set in PHP.ini with ffmpeg and ClipBucket

I’ve been exploring how to generate videos on the fly through use of packages like ffmpeg (I installed this the other day), and recently tried out ClipBucket (a free video site script).

ClipBucket is a little rough around the edges, but has a load of great features, has a relatively active community, and large parts of the code are on GitHub.

Continue reading “DateTime with no DateTimeZone set in PHP.ini with ffmpeg and ClipBucket”

Google Maps Distance (DistanceMatrix) API for UK in JSON

The postcode code has been updated to use Google’s distancematrix api, which provides a very different set of data from the old “as the bird flies” calculation (it calculates road distance, and provides transport options etc).

The following code is merely a demonstration, which can be seen here.

<?php
// Specify Postcodes to Geocode
$postcode1 = 'BH151DA';
$postcode2 = 'BH213AP';

// Set and retrieve the query URL
$request = "http://maps.googleapis.com/maps/api/distancematrix/json?origins=" . $postcode1 . "&destinations=" . $postcode2 . "&mode=driving&language=en-GB&sensor=false&units=imperial";
$distdata = file_get_contents($request);

// Put the data into an array for easy access
$distances = json_decode($distdata, true);

// Do some error checking, first for if the response is ok
$status = $distances["status"];
$row_status = $distances["rows"][0]["elements"][0]["status"];

if ($status == "OK" && $row_status == "OK") {

// Calculate the distance in miles
$distance = $distances["rows"][0]["elements"][0]["distance"]["value"];
$distance_miles = round($distance * 0.621371192/1000, 2);

echo 'The distance between '.$postcode1.' and '.$postcode2.' is '.($distance/1000).'Km ('.$distance_miles.' miles).';

} else {
    echo "Calculating the distance between your locations caused an error.";
}

?>

Having better error checking would also be a good idea if you plan to use the above code. Using &unit=imperial is optional, as Google always returns metres – so the code runs a basic calculation on these to convert to miles.