WordPress vs Hugo

Managing WordPress can get time consuming. I have tried to move to static website several times but keep coming back to WordPress. But there are several advantages of static sites generators such as Hugo. I am advising a lot of my clients to use Hugo especially when they know that they will rarely ever update their sites.

Here are some of main advantages of Hugo (or other static site generators) vs WordPress and other CMS.

No System Administration

In order to run WordPress, you need a server. You will need to configure it, install database and PHP, in addition to a web server. Unlike personal computers that are not always connected to the Internet, a server hosting a website is always connected to Internet. So it is always available target for hackers. This means you need to secure the server properly and keep it up to date.

When using Hugo, you don’t need PHP and database. All you need is a web server, this reduces attack surface area significantly. As long as you don’t have any extra software running on the server, all you need to worry web server being properly secured.

Of course, you can use shared hosting for WordPress and avoid all headaches of System Administration.

No WordPress or plug-ins to update

The one huge advantage of Hugo is that there is no code to execute. Well no code on server to execute. You may still have some javascript. But this javascript code executes in a user’s browser and unlikely to be easily exploitable.

WordPress & plugins executes code on a server. This mean bugs in WordPress can be exploited to access your server or even install malicious code. That code can further infect your users’ computers. I have spend hours and hours restoring websites for clients when their websites got hacked. Of course, you can avoid this by keeping your WordPress installation up to date and carefully choosing plugins & themes. But this means regularly logging in the WordPress admin interface and applying any new updates.

On other hand, you will never have to update Hugo generated site once generated. Only time you will update is to change some content on it.

Simple Backups

Normally, I don’t give admin login for WordPress & server because of risk involved with client installing bad plugin or messing up something else. I sent them xml export of WordPress every once in a while. And of course they get zip file of WordPress directory and mysql export. Most of my client are not technical enough to restore from this backup. But they can give these files to someone technical who can restore it for them. To be honest, I have never tested these backup.

But I have tried to restore WordPress sites that were developed by someone else. Backup were too old, theme didn’t work with current version of WordPress. Some plugins were not in backup file and are no longer available. And the worst backup file contained viruses & malware.

With Hugo, client gets same zip file but it includes full functioning website. While it is still technical, but it should be a lot simpler to restore a static website. It can be as simple as uploading a folder to web server.

No Updates that Break your Site

Since static sites don’t need to be updated to secure against hacks, there is very little worry about any update that will break theme. If you don’t update your Hugo version, you should get same results if you run it against same source files.

In WordPress land, I have seen some people not updating their website for months or years and then when they do, it breaks their theme or plugins.

In Hugo world, you will need to update a website’s theme only when browsers stop supporting current versions of html, javascript, and css. That is going to be very long time.

Where WordPress Wins

There is one area where Hugo cannot touch WordPress. When client is actually using their WordPress site as blog or if they regularly post new content. With static sites, client will need to be technical enough to use markdown and git. Or they will email posts to you.

In my experience though most people rarely update their websites regularly enough to warrant all the extra headache involved with hosting WordPress.

iPad Pro for Programming & Fun

I finally bought 10.5” iPad Pro (Affiliate Link). It was mostly an impulse purchase. When first I started to use iPad, it felt blah. It is hard to find good apps or what apps you might want to try out.

My main goals with iPad was to have a really small laptop replacement. So I was hoping for a decent code editor. There are some code editing apps but there is no way to try out them before purchasing. So I am spending a lot of time reading reviews before I purchase any app.

Before purchasing iPad, I read a few blog posts by some programmers using their iPad as main computing device. They all said they had some issues but it was doable. Unfortunately, sample size is a bit small right now and it seems it is doable only if you ssh into a server. There is no easy solution for local dev.

Then my other goal was to use iPad as entertainment and artistic device. For these functions, I didn’t need to buy Pro version but because I wanted smallest and lightest possible profile with a keyboard; my only choice was Smart Keyboard. And Smart Keyboard only works with Pro version.

So here are my current apps.

Apps for Programming

I am still looking for a code editor app. Most programmers’ workflow was to login on server and edit code there. Here are my current apps:

Blink Shell

I started off with Termius shell client but quickly got tired of tapping screen to hit escape. I could not find anyway to remap keys in it. After some search, came across this post about using iPad Pro as main computer for programming. Based on his recommendation, I bought Blink shell for $20. This app let’s you map CAPS Lock key to escape and that was all I needed this for. However, its UI feels cleaner and more polished than Termius too.

I would recommend Blink over Termius unless you are likely to spend a lot of time in shell. And initially I was hoping I would not have to login to a server to code, but increasingly it looks like I will have to, that’s the other reason why I gave up and bought this.

Working Copy

This great free app. It works great with BitBucket. You can clone your repos, use built-in editor to edit files, commit & push. Perfect for local code editing. If you have CI/CD, you don’t have to do much more than push your code.


This is a great ssh client. Another free app. It has onscreen keyboard for sending keys that are missing on Smart Keyboard such as escape. However, I don’t want to use persistent connection. I want to be able to code on a plane or by pool. So local editor like Working Copy is the best option for me. This will come in handy though for when you need to debug or fix issues on the server.

Swift Playground

This is just a tutorial for learning swift but it is really really well made. I am really enjoying use it. I might end up learning Swift because I just like using this app. Highly recommended for kids and those who are new to programming.

Drawing Apps


I didn’t need to buy this as there are tons of free sketching apps. But this app kept coming up whenever I was searching for tutorials on drawing on iPad. It was also recommended by some of my friends. So I bought it.

It definitely a few level above free apps. One of the best feature I like about this app is that you can export images of any size. Most free apps limit the max resolution of images. For printing especially on t-shirts, this is perfect.


This free app and it is close competitor to Procreate. Only thing is that I could not figure out how to export high resolution images from it. So I gave up and bought Procreate.

Photography Apps

  • Instagram
  • Polarr
  • VSCO
  • Adobe Comp
  • PS Express
  • Snapseed
  • Photoshop Mix
  • Photoshop Fix

I think all of these apps are available for Android cellphone. The real advantage of using these apps on iPad is big beautiful screen.

More Creative Apps


This is fun. Just messing with it, I was able to make pretty decent sounding music. Need to play with this more.

I have GarageBand on my MacBook too but never played with it. Touch interface seems a lot more natural for making music.


Another app that is already available on MacBook. I have used it on my Macbook but touch interface makes it a bit easier use. However, iMovie on iPad lacks stabilization feature.

Help Me Decide, Today!

I have been learning Laravel for work. I was playing with Laravel back in 2011 but then got distracted with other stuff. In my view, the best way to learn new technologies to create a something with it.

As an indecisive person who rather enjoys collecting data instead of actually making a decision, I decided to build a website that helps with decision making process. I have used different formulas and methods for helping with decision making. When I was buying TV I had stats like pixels per dollar or inches per lb in a spreadsheet. Collecting that data was fun but it was not still clear what each stat really meant.

I have found the best system for me is to rank various pros and cons of each option and use that to assign points to the options. So I wanted to convert this system into a website that can be used by anyone and let me play with Laravel. So here it is: Help Me Decide, Today!

I am not a frontend developer, so UI is simple. It uses jQuery & Bootstrap CSS. There are a few issues with ranking page. I will fix that one day, but for now it should work.

Angular vs. React vs. Vue: A 2017 comparison

Trying to figure out which Javascript framework I should learn. This blog by Jens Neuhaus says Vuejs is the easiest to learn. Also I still don’t understand why these frameworks are better than jQuery but that is for another time.

If you are an unexperienced Javascript developer — or if you worked mainly with jQuery in the last decade — you should think about using Vue. The paradigm shift is more pronounced when moving to React. Vue looks more like plain Javascript while also introducing some new ideas: components, an event-driven-model, and one-way data flow. It also has a small footprint.

Source: Angular vs. React vs. Vue: A 2017 comparison – unicorn.supplies – Medium

ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist

Running unit tests in Laravel, I was getting this error:

ReflectionException: Class Tests\Unit\Symfony\Component\HttpKernel\Exception\NotFoundHttpException does not exist

The issue was missing root backslash, make sure you have expected exception like:


Upgrading to PHP 7.0 on Ubuntu 14

I upgraded PHP to version 7.0 on Ubuntu box. Running php -v on shell would show it as version 7.0. But Apache was still using PHP 5.6. I tried various methods to update settings for Apache but nothing worked until I issued following commands:

sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart

Source: PHP 7.0 (and 5.6) on Ubuntu | LornaJane

Setting Up Laravel on MacOS

After 3 years, I am using Laravel again at work. Laravel has extensive documentation but sometimes it can be a bit verbose. Here are command to get you started as soon as possible. This assumes pretty much fresh install of MacOS.

Install Homebrew

Check the official site for latest command
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PHP 7.1

brew install homebrew/php/php7

Install MariaDB

brew install mariadb

Set MariaDB to start as service at the end of installation.

Install Composer

Get Composer from https://getcomposer.org/download/ and make sure to install it globally for easier use.

Install Laravel

composer global require "laravel/installer"

Add following line to .bash_profile in home directory
export PATH="$HOME/.composer/vendor/bin:$PATH"

And restart terminal or issue this command:
source ~/.bash_profile

Install Valet

Valet is very useful for setting up dev environment.
composer global require laravel/valet
valet install

Create Projects Directory

Now create a projects directory and let Valet know it should server from that directory.
mkdir ~/sites
cd ~/sites
valet park

Test your setup

Now in sites directory, create a new laravel project:
laravel new blog
and load http://blog.dev
If everything went smoothly, you should see a fresh Laravel project.


Without understanding, I had enabled HSTS on amerkhalid.com with option includeSubDomains. I had a subdomain that was used as “Custom Domain” to SmugMug site. After enabling HSTS, these subdomains started to throw NET::ERR_CERT_COMMON_NAME_INVALID.

The fix is of course simple, don’t use includeSubDomains. But that opens up your top level domain to man in middle attacks.

For now, I decided to follow the best practices and leave includeSubDomains enabled. And decided to not use custom domain for my SmugMug site.

Lastly, you can clear HSTS settings in Chrome by:

  1. Enter in Address Bar chrome://net-internals/#hsts
  2. Under “Delete domain” type your domain
  3. Hit “Delete” button.


Error: xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory is a command line tools instance

I have been playing with Cordova lately and was getting this error when building iOS version:

Error: xcode-select: error: tool 'xcodebuild' requires Xcode, 
but active developer directory is a command line tools instance

Even full install of Xcode didn’t fix this error.

The solution was to run following command to use full Xcode instead of command line tools version that I had installed earlier:

sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer