Leetcode April challenge

While we’re riding out the COVID-19 and socially isolating, myself and some colleagues are doing the leetcode 2020 April daily challenges. I highly recommend all devs to join in!

https://leetcode.com/explore/other/card/30-day-leetcoding-challenge/

I’m doing my solutions all in C/C++, rather than my usual languages of PHP and JS, just to have some more fun and brush up on those lower level languages.

I’m adding my solutions to my github repo for the challenge day by day!

https://github.com/specialtactics/leetcode-2020-30day

Laravel presentation on 5.8 + Some other things

Today was the monthly Sydney Laravel Meetup. We had some pretty interesting circumstances, with myself not having the time to prep my original talk (and thus doing a shorter, more topical talk), and our other main speaker pulling out sure to unforeseen circumstances.

However with Harlan and Dave stepping in to do awesome lighting talks, we actually did pretty good!

Laravel 5.8 brings about more interesting changes than normal – including some backwards breaking changes, so be sure to check out the presentation!

Check out my Slides here

API Days Conference 2018

I’ve just attended the API days conference in Melbourne. It was a pretty amazing experience – especially because this as my first visit to Melbourne! Big thanks to my employer (Cover Genius) for sending me!

Me and my colleagues had great fun, although some of the talks seemed a bit too “sponsored” if you know what I mean (content wise). Still, there were some real gems in terms of API design and micro-services.

I hope next year’s one will be at the Gold Coast !


How to migrate domains between 2 AWS accounts on Route53

I had an interesting problem to solve yesterday. Essentially I needed to migrate a domain (ie. hosted zone) from one AWS account to another. This isn’t an all-together complicated act, however the biggest problem is migrating the DNS records – particularly if you have a lot of them.

Unsurprisingly, the AWS console makes no attempt at allowing you to export and import a common format of zone file (in fact there’s no export at all). I figured, surely this would be possible using the cli tools… however unfortunately that is not very straightforward.

It is possible to export DNS records for a domain using the aws cli, and it is possible to import them as well, however the structure of the 2 files is a bit different (almost like the two functions were designed by 2 entirely separate teams, who were competing or something!). So what I did was write a simple PHP cli script to convert from the export format to the import format.

To do this process, I recommend you set up profiles for both accounts in your ~/.aws/credentials file. Then follow the following steps;

Instructions

Firstly, for both accounts, get the hosted domain zone ID. You can do it using the following command:

You want the 12-16 character alphanumeric ID of the zone associated with the relevant domain name. Change the zone ID in the following examples as necessary.

Then on the source account, you want to export all DNS records with the following aws cli command, which puts them into a file called “source-records” in the current directory.

Now you want to manually edit that file, and just delete the 2 entries equivilent to the default ones AWS adds for every new domain – the nameservers and root SOA record for the domain. Because these exist already in the new domain route53 setup and are different to the old ones, you do not want to import them. Since this is much simpler to do visually, I didn’t want to bother automating this in the script.

Then, run the converter script on that file.

And then, use the aws cli to import the converted file into the new zone (note this assumes again that the record file is in the current directory)

All done! Really hope this helps someone, as I couldn’t find any guide on how to do this online.

My professional blog – a brief intro

I’ve created this blog with the aim of it being an outlet for my own discussion, thoughts and reflection on my current work, be it in formal employment, freelancing, or personal projects.

The focus of the content herein will be on technology, engineering, productivity and community – as it applies primarily to web development. Hopefully others in my industry and perhaps peripheral industries may find this helpful or interesting.