Alun Rowe

ramblings about cars, tech, web development and more. BOTB Winner in 2010

Fixed: Cannot create Skype account with Office 365 email address

Here’s something incredibly annoying! If you have an Office365 account you cannot create a Microsoft account for use with Skype using that email address.

The answer to this conundrum is simple! We just used one of our unused domains, created email forwarders for each member of staff then registered with Skype using this.  eg  [email protected] forwards to my [email protected] account.  This way password resets etc can come to your work email account etc too.

Wayne Coyne of the Flaming Lips on stage at Brixton Academy stood in front of an 18ft tall inflatable robot

The Flaming Lips – Brixton – 2019

A Short note: epic, life affirming and 18 foot inflatable robots. There really is nothing that compares. Thank you Flaming lips for everything

Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open preferences and verify that you're signed in with an account that has permission to access this repository

GitHub Desktop – Authentication failed with a private repository

The other day a new error appeared that I’ve not come across before.  When attempting to push my changes to our own hosted GitLab instance using GitHub Desktop I received the following message:

“Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open preferences and verify that you’re signed in with an account that has permission to access this repository.”

After muttering and swearing for a bit I went to the command line and tried to push from there and saw the following:

The authenticity of host ‘YOURPRIVATE HOST (YOURPRIVATEIP)’ can’t be established.

ECDSA key fingerprint is SHA256:XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx.

Are you sure you want to continue connecting (yes/no)?

Simply replying “yes” to this prompt cleared the error.

So why did it happen?

Simply I had deleted my known_hosts file in my ~/.ssh/ folder as I’d had to move a bunch of dev servers around.

So in future I’m going straight to the command line if I get any problems with GitHub Desktop

 

Validate UK Driving Licence number using REGEX (DVLA)

My weapon of choice is PHP but I’ve included the raw REGEX too to help others.  I found the information about the makeup of the code on the APH website to help me understand the parts of the code and then REGEXR to help test my REGEX codes.

Driving Licence Number : [A-Z9<]{5}[0-9<]{6}[A-Z9]{2}[A-Z0-9]{3}

$regex = ‘^[A-Z9<]{5}[0-9<]{6}[A-Z9]{2}[A-Z0-9]{3}$^’;

$result = preg_match($regex, $value);

returns TRUE or FALSE

I hope this is useful to you!

How to easily transfer Epub’s and PDF’s to your kindle

Recently I finally joined the 21st century and purchased an Amazon Kindle Paperwhite.

After enjoying a few books I’d found via Amazon Kindle Unlimited I started to wonder if my huge stash of Web development E-Books in PDF and Epub formats could be easily transferred to the Kindle.

After a bit of searching around I found a simple solution where you can simply email the documents to your kindle using a secret @kindle.com email address.

Below are the simple steps to set this up:

  1.  Head to your local Amazon e.g. Amazon.co.uk
  2. If necessary login
  3. Find “Your Account” in the navigation and then go to “Manage your Content & Devices” (Not “Your apps & devices”) 
  4.  Choose “Devices” in the top page navigation. 
  5. You should now see your Kindle in the list
  6. Click the three dots in a box (ellipsis)
  7. Now simply send yourself an email to the address with the file you wish to view attached.
  8. if your document doesn’t arrive go to the Preferences tab on the Devices and Content page and check the “Approved Personal Document E-mail List” contains the email address you are sending from.

Enjoy

 

Validate MRZ passport numbers with Regex and PHP

Recently I needed to validate MRZ passport numbers using the Machine Readable Passport Zone (MRZ) numbers and PHP.

My weapon of choice is PHP but I’ve included the raw REGEX too to help others.  I used High Programmer to understand the parts of the code and then REGEXR to help test my REGEX codes.

 

MRZ line 1: [A-Z0-9<]{2}[A-Z<]{3}[A-Z0-9<]{39}

$regex = ‘^[A-Z0-9<]{2}[A-Z<]{3}[A-Z0-9<]{39}$^’;

$result = preg_match($regex, $value);

returns TRUE or FALSE

 

MRZ Line 2: [A-Z0-9<]{9}[0-9]{1}[A-Z<]{3}[0-9]{6}[0-9]{1}[FM<]{1}[0-9]{6}[0-9]{1}[A-Z0-9<]{14}[0-9]{1}[0-9]{1}

$regex = ‘^[A-Z0-9<]{9}[0-9]{1}[A-Z<]{3}[0-9]{6}[0-9]{1}[FM<]{1}[0-9]{6}[0-9]{1}[A-Z0-9<]{14}[0-9]{1}[0-9]{1}$^’;

$result = preg_match($regex, $value);

returns TRUE or FALSE

 

I hope this is useful to you!

Exporting Weight data from Garmin Connect

Garmin connect is a great place to collect all of your fitness data together from your weight to calories burnt etc.

Recently I was asked if I could get the weight at a out of the site for use in EXCEL so I had a little dig around and found the following:

Once you are logged into the Garmin Connect portal you can then copy/paste this URL into your browser bar hit return and you’ll see the data.

https://connect.garmin.com/modern/proxy/userprofile-service/userprofile/personal-information/weightWithOutbound/filterByDay?from=1483228800&until=1527807599999
Copy and paste the WHOLE document or save it to your hard drive and then head to https://json-csv.com/ where you can convert that data to a CSV for use in Excel etc

To edit the start and end dates you will need to use the website https://www.epochconverter.com/ and replace the numbers in from=[FROM EPOCH] and until=[TO EPOCH]

 

Adding days to a date in Excel

It’s one of those things I end up googling overtime I need to do it so, in the spirit of this blog, I’m going to write down everything I learn about Dates and MS Excel here so I know where to find it in the future!

How to add a day to a date in Excel

Assuming your existing date is in Column A Row 1 all we need to do is

=DATE(YEAR(A1), MONTH(A1) , DAY(A1) +1 )

So it therefore follows if you want to add a year to an excel date use:

=DATE(YEAR(A1) +1, MONTH(A1) , DAY(A1) )

And if you want to add a month to an excel date use:

=DATE(YEAR(A1), MONTH(A1) +1, DAY(A1) )

If you want to get clever you can insert a value from another field like this:

=DATE(YEAR(A1), MONTH(A1) , DAY(A1) + A13 )

or if you want to get it from a static cell either use the $ identifier to lock the row or the column e.g.: $A1 would lock the column and A$1 would lock the row OR use both $A$1 to lock both the column and the row. You can also use NAMED CELLS.

Have fun and I’ll add new excel date tips to this as I find things out. Feel free to post info you find in the comments

Connect SequelPro to Homestead Vagrant Mysql database

Although you can run multiple apps per vagrant box I’ve always been happier running Homestead in the Per Project mode.  It keeps things neat and tidy for me.  I’ve also found with more complex setups that Laravel Valet doesn’t always work as intended.

Using the default passwords the step as are as below.  If you start changing your defaults this may not work for you…

Ok, first step is to open SequelPro and create a new connection by clicking the small plus sign in the bottom left.

Add a connection to Sequel Pro

Next up click the SSH button in the connection window.

Choose SSH connection type in SequelPro

Now simply fill in the following details:

 

MySQL Host
127.0.0.1
Username
homestead
Password
secret
Database
homestead
Port
Leave empty (3306 as default)
SSH Host
192.168.10.10 (Or whatever you set yours too in your Homestead.yaml file)
SSH User
vagrant
SSH Password
secret
SSH Port
Leave empty
Connect using SSL checkbox
Leave empty

Now click Test Connection.

You will be asked if you want to trust the SSH server.  Choose Yes and you are good to go!

Posting a form in WordPress sends you to a 404 page

Recently I had to write an integration to a third party iframe embedded application. It really wasn’t pretty and I’ll write up the results soon for that BUT the big thing I faced was an issue where by *posting a form to a WordPress page resulted in a 404 error*.

I tried all sorts of things to fix it and couldn’t even get a result out of adding

echo '<pre>';
echo print_r($_POST, 1);
echo '</pre>';

nothing. Not a damned thing!

So I tried setting up a simple form with just a field called field1 and it worked fine!

So, after a bit of searching forums and blog posts I finally found out that there are a bunch of reserved field names that you MUST NOT USE under any circumstances when trying to post a form to a WordPress page.

So, simply change the form field names to ones that aren’t on the list and all will be fine.

The most commonly used by me reserved field names are:

  • day
  • debug
  • error
  • m
  • name
  • year

and a full list can be found here: http://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms

Hope that helps!

Page 1 of 4

Powered by WordPress & Theme by Anders Norén