johnro.net Now on AWS!

My WordPress site is now on AWS! I spent a good chunk of my time debugging the All-in-One WP Migration plugin to get my migration working, and I finally realized I skipped an important step in their migration documentation:

Migrate WordPress from PHP 5 to PHP 7

1. Make sure that all plugins are deactivated. This will ensure your website error is not caused by any third-party software

If you are getting stuck in the “Done Preparing Blogs” stage, then it could be because you didn’t deactivate all the plugins.

Cheers!

Happy 2018!

Happy new year! I have been lazy with my posts the past months (years?) so as part of my new resolutions I plan to write more.

While I am here, I will leave a tip on how to better yourself as a software developer/enthusiast: practice, learn, practice. Continue to learn, and repetition is key to nailing information in your brain! Also, check out https://www.pluralsight.com or https://www.lynda.com for study material.

Cheers!

xlsjs: “Error: Unrecognized ExtProp type: 2 0”?

xlsjs

While working on ETL (Extract, Transform, Load) projects at work, I ran into an unusual issue using xlsjs:

Error: Unrecognized ExtProp type: 2 0

After digging through the xlsjs source code, I realized that it was following the MS-XLS Specifications, as it should, and section 2.5.108 ExtProp, the extType value that I was running into was not defined in the table. Seeing as the format structure was related to formatting, I forked the xlsjs library and created a version that was more forgiving.

If you are running into this issue and want a workaround, try xlsjs2.

git: Please properly rename / move files and directories

I get frustrated when I browse a file from a git repository only to realize its history was lost due to improper renaming/moving of the file. It seems common for developers to manually rename/move a file in a git repository by using regular file system commands rather than git commands.

For example, let’s look at the following:

So what have we here? We start off by creating a new directory called test. We then go into the directory and start a new local git repository using git init. Next we create a new file called test.txt that contains simple text “hi”. test.txt is then added and committed to the repository. Finally, we use the mv command to rename the file to test2.txt.

git status shows us the result:

Git status after 'mv'
Result of git status

This is not what we were expecting. This shows that the original file test.txt was deleted and now there is an untracked new file called test2.txt, when it really should say that test.txt was renamed to test2.txt.

Btw, this goes for moving files as well. For example, rather than renaming the file, if it was moved to, say, a different folder, e.g. newFolder/test.txt, the result would be the same.

So how can this be solved? It’s actually not far off from the steps above. Let’s start with backtracking by reverting the rename:

Running the above commands produces the following result:

Use 'git mv' to rename/move files
Use ‘git mv’ to rename/move files

Much better, isn’t it? Renaming/moving files from git repositories the proper way will allow retention of their history, which is what we want.

AWS: EB CLI Throws Exceptions VersionConflict and/or DistributionNotFound

When running EB CLI, do you run into the following error?

I ran into this error today. Apparently it was caused by installing AWS CLI after EB CLI:
pip install awscli
Reinstalling EB CLI solved the issue:
pip install awsebcli