mitchmac.com https://www.mitchmac.com Fri, 24 Mar 2017 16:41:22 +0000 en-US hourly 1 https://wordpress.org/?v=4.7.2 What to do when your Internet is too slow for composer? https://www.mitchmac.com/internet-slow-composer/ https://www.mitchmac.com/internet-slow-composer/#respond Fri, 24 Mar 2017 14:51:27 +0000 https://www.mitchmac.com/?p=54 Like the problems I was having with Docker timeouts, I recently had problems on my slow home Internet getting PHP’s composer to build the assets for a project. The error message contained “exceeded the timeout of 300 seconds” so it was easy to identify. The fix, run from the terminal was: export COMPOSER_PROCESS_TIMEOUT=1500 Where the … Continue reading "What to do when your Internet is too slow for composer?"

The post What to do when your Internet is too slow for composer? appeared first on mitchmac.com.

]]>
Like the problems I was having with Docker timeouts, I recently had problems on my slow home Internet getting PHP’s composer to build the assets for a project.

The error message contained “exceeded the timeout of 300 seconds” so it was easy to identify.

The fix, run from the terminal was:

export COMPOSER_PROCESS_TIMEOUT=1500

Where the number is the number of seconds before a composer operation timesout.  This fix is temporary, for a permanent solution have a look at how to make environment variables persist.

The post What to do when your Internet is too slow for composer? appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/internet-slow-composer/feed/ 0
What to do when your rural high speed Internet is too slow to use Docker? https://www.mitchmac.com/what-to-do-when-your-rural-high-speed-internet-is-too-slow-to-use-docker/ https://www.mitchmac.com/what-to-do-when-your-rural-high-speed-internet-is-too-slow-to-use-docker/#respond Sun, 26 Feb 2017 03:17:26 +0000 https://www.mitchmac.com/?p=48 On my mid-2010 MacBook Pro I was trying to get Docker running to experiment with. It isn’t quite modern enough to run Docker for Mac because of an incompatible CPU. I was able to get things running though by installing Docker Toolbox which puts the Docker daemon inside a VirtualBox VM. While trying to pull down … Continue reading "What to do when your rural high speed Internet is too slow to use Docker?"

The post What to do when your rural high speed Internet is too slow to use Docker? appeared first on mitchmac.com.

]]>
On my mid-2010 MacBook Pro I was trying to get Docker running to experiment with. It isn’t quite modern enough to run Docker for Mac because of an incompatible CPU.

I was able to get things running though by installing Docker Toolbox which puts the Docker daemon inside a VirtualBox VM. While trying to pull down an image to build a container via docker pull the command would fail and I would get the error message:

unauthorized: authentication required

This seemed weird, I’ve never had that problem on my work machines. These are public images, why would I need to be authorized? What could be the difference? The fact that the failure happened after some of the larger files were downloading made me think that something was timing out. It seems that there is token authorization happening during the download process and they are expiring. And these downloads were much, much slower on my home 2Mbps connection compared to 100Mbps at the office.

Some Googling pointed to an option for the Docker daemon that may help:

–max-concurrent-downloads

So in the case of having the Docker daemon on a vm, I used the docker-machine command to SSH to the daemon to put this extra config into a daemon.json file that is parsed when the daemon starts.

First, from your OS terminal:

docker-machine ssh

Then when you are logged into Docker VM:

echo ‘{“max-concurrent-downloads”:25}’ | sudo tee /etc/docker/daemon.json

This ensures that all of the files are downloaded concurrently, starting to download before what I assume is the token expiring. You will need to restart the daemon, I did it from directly inside the vm with

sudo /etc/init.d/docker restart

While our slow “high speed ultra” Internet has been an annoyance with poor quality audio and video and slow downloads, it has never caused something to absolutely not work without modification. This is a demonstrable example of how the poor quality of PEI’s rural Internet can impact employment and innovation.

The post What to do when your rural high speed Internet is too slow to use Docker? appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/what-to-do-when-your-rural-high-speed-internet-is-too-slow-to-use-docker/feed/ 0
Stormiest Winter Periods on Prince Edward Island https://www.mitchmac.com/stormiest-winter-periods-on-prince-edward-island/ https://www.mitchmac.com/stormiest-winter-periods-on-prince-edward-island/#respond Sat, 25 Feb 2017 02:43:46 +0000 https://www.mitchmac.com/?p=39 Talk to a few Islanders about the weather during the winter and you’ll usually hear that there are certain times of the year like St. Patrick’s Day when a winter storm is more likely. Let’s look at the frequency of 10+ cm during five day periods from 1944-2016. For the days below we show the … Continue reading "Stormiest Winter Periods on Prince Edward Island"

The post Stormiest Winter Periods on Prince Edward Island appeared first on mitchmac.com.

]]>
Talk to a few Islanders about the weather during the winter and you’ll usually hear that there are certain times of the year like St. Patrick’s Day when a winter storm is more likely.

Let’s look at the frequency of 10+ cm during five day periods from 1944-2016. For the days below we show the percentage of years that had at least 10cm of snow fall on a single day during the 5 day time period focused on that day (that day, 2 days before, and 2 days after).

So on December 17, 10cm+ of snow has fallen in the 2 days before, the day of, and 2 days after on average 57.3% of the time. With this calculation I’m trying to find periods of time that tend to get moderate/heavy snowfall.

December 16, 17 & 18 tend to get a moderate/heavy snowfall the most often followed by the time period of February 15, 16 & 17 and their surrounding days. In a followup post, I will show that the mid-February storms pack a greater punch though. November and March seem to ease us in and out of the winter season when it comes to snow.

It also looks like a heavy snowfall around Boxing Day is more frequent than around St. Patrick’s Day!

Date (and 2 days before and after) Percent frequency
of 10+ cm of snow
December 17 57.3
December 16 54.7
February 17 48.2
December 18 45.8
February 15 44.1
February 16 44.1
December 26 43.3
January 05 43
January 06 42.9
February 14 42.7
December 15 42.2
January 31 41.7
January 03 41.4
December 19 40.3
January 04 40.1
December 14 39.4
December 25 39.2
December 20 39.1
February 02 39.1
February 01 39
January 02 38.8
February 07 38.7
February 18 38.7
January 18 38.7
January 16 38.6
January 15 38.3
February 03 37.5
January 29 37.4
February 06 37.3
February 13 37.2
February 25 37
January 14 36.9
March 02 36.8
December 24 36.6
December 27 36.2
February 04 36.2
January 30 36.1
January 17 36
January 19 36
February 08 35.9
February 10 35.9
January 07 35.9
March 03 35.6
March 01 35.4
February 05 34.7
February 24 34.3
February 26 34.3
January 12 34.2
December 23 33.8
December 28 33.4
February 11 33.3
February 19 33.3
January 08 33.2
January 09 33.2
February 09 33
January 13 32.8
February 27 32.7
February 28 32.7
February 29 32.7
December 04 32.3
December 05 32.3
December 02 32
December 29 32
January 01 31.9
January 20 31.9
March 16 31.8
December 03 30.7
December 01 30.6
February 12 30.4
March 14 30.4
February 23 30.3
January 28 30.2
January 10 30.1
January 11 30.1
December 13 29.7
December 22 29.6
January 21 29
March 15 29
March 17 28.9
March 04 28.8
December 06 28.1
December 31 27.8
December 30 27.7
December 07 26.7
December 08 26.7
December 21 26.6
November 30 26.4
February 21 26.2
January 22 26.2
March 05 26.2
January 27 26.1
March 13 25
February 22 24.9
March 06 24.9
March 18 24.8
February 20 23.6
November 29 23.6
January 25 23.5
April 09 23.2
March 07 22.1
January 26 22
April 08 21.8
December 12 21
March 12 20.9
January 23 20.8
March 08 20.8
March 09 20.8
April 01 20.7
March 10 20.7
April 02 20.6
March 24 20.6
April 10 20.5
December 10 19.5
December 11 19.5
November 28 19.5
March 19 19.3
March 20 19.3
March 21 19.2
March 23 19.2
March 25 19.2
April 07 19.1
December 09 18.2
January 24 18
March 30 17.9
April 03 17.8
March 22 17.8
April 05 17.7
April 06 17.7
March 11 16.6
March 31 16.6
March 29 16.5
March 26 16.4
March 27 15.1
March 28 15.1
April 11 15
November 16 14
April 04 13.7
April 30 13.7
April 27 13.6
April 28 13.6
November 17 12.6
November 18 12.6
November 27 12.6
April 29 12.3
November 15 11.2
November 19 11.2
November 20 11.2
April 12 10.9
November 14 9.8
November 21 9.8
November 22 9.8
November 26 9.8
April 21 9.6
April 26 9.5
November 25 8.4
May 01 8.3
April 20 8.2
April 22 8.2
April 23 8.2
April 24 8.2
November 23 7
November 24 7
November 12 5.6
November 13 5.6
April 13 5.5
April 14 5.5
April 19 5.5
April 25 5.5
April 18 4.2
May 02 4.2
November 08 4.2
November 09 4.2
November 10 4.2
May 04 4.1
May 05 4.1
May 06 4.1
May 07 4.1
May 08 4.1
April 15 2.8
April 16 2.8
April 17 2.8
May 03 2.8
November 11 2.8
May 09 1.4
November 06 1.4
November 07 1.4
October18 1.4
October19 1.4
October20 1.4
October21 1.4
October22 1.4

The post Stormiest Winter Periods on Prince Edward Island appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/stormiest-winter-periods-on-prince-edward-island/feed/ 0
Coldest Day of the Year on PEI https://www.mitchmac.com/coldest-day-of-the-year-on-pei/ https://www.mitchmac.com/coldest-day-of-the-year-on-pei/#respond Mon, 20 Feb 2017 01:49:47 +0000 https://www.mitchmac.com/?p=33 From 1944-2016, February 6 had an average mean temperature of -9.19°C with an average high of -4.9°C and average low of -13.43°C in Charlottetown.

The post Coldest Day of the Year on PEI appeared first on mitchmac.com.

]]>
From 1944-2016, February 6 had an average mean temperature of -9.19°C with an average high of -4.9°C and average low of -13.43°C in Charlottetown.

The post Coldest Day of the Year on PEI appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/coldest-day-of-the-year-on-pei/feed/ 0
Warmest Day of the Year on PEI https://www.mitchmac.com/warmest-day-of-the-year-on-pei/ https://www.mitchmac.com/warmest-day-of-the-year-on-pei/#respond Mon, 20 Feb 2017 01:44:59 +0000 https://www.mitchmac.com/?p=29 Ever wonder when the warmest day of the year is on PEI on average? From 1943-2016, July 26 had an average mean temperature of 19.47°C and an average high of 24.41°C in Charlottetown.

The post Warmest Day of the Year on PEI appeared first on mitchmac.com.

]]>
Ever wonder when the warmest day of the year is on PEI on average?

From 1943-2016, July 26 had an average mean temperature of 19.47°C and an average high of 24.41°C in Charlottetown.

The post Warmest Day of the Year on PEI appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/warmest-day-of-the-year-on-pei/feed/ 0
WordPress as a static website generator? https://www.mitchmac.com/wordpress-as-a-static-website-generator/ https://www.mitchmac.com/wordpress-as-a-static-website-generator/#respond Mon, 20 Feb 2017 00:12:25 +0000 https://www.mitchmac.com/generator/?p=16 WordPress is a great blogging platform. It’s easy to create content and has a good ecosystem of plugins and themes to extend your website. But it has a few problems that have kept me from using it for personal projects: security – WordPress security has improved a good deal over the past few years but … Continue reading "WordPress as a static website generator?"

The post WordPress as a static website generator? appeared first on mitchmac.com.

]]>
WordPress is a great blogging platform. It’s easy to create content and has a good ecosystem of plugins and themes to extend your website. But it has a few problems that have kept me from using it for personal projects:

  • security – WordPress security has improved a good deal over the past few years but there are still core security issues being exploited yearly. With auto-updates, the risk is minimized but it’s still there. Plugins exist to better secure WordPress, but core issues can never be completely protected via plugins. WordPress installations can’t be neglected for this reason.
  • performance – WordPress out of the box isn’t very fast and chews up memory. Again, there are plugins of various quality with cumbersome installation steps that may mitigate these issues. There are server side caching solutions as well, but for a personal website why bother?

When it comes down to it, most personal blogs are just serving HTML content with little need for the dynamic abilities that PHP gives to WordPress.

What about WordPress.com? The cost is certainly reasonable, but the arbitrary limitations on what can be customized and enabled just doesn’t seem right.

But what if we think about WordPress as a static website generator? When WordPress is first installed, the only dynamic functionality that is enabled besides the admin dashboard is commenting and search (and XML-RPC and REST…). If you don’t need that functionality or can find alternative services, using WordPress as a static website generator is relatively straightforward.

First you have WordPress installed somewhere. If you still want to be able to create and edit content via the web, then you can install it as usual but limit access to it at the web server layer (Apache, NGINX) by enforcing basic authentication or some other mechanism. There are many ways this could be done, with firewalls, Docker, etc. the possibilities are endless. Otherwise you can just install it on a computer at home.

Disable comments and search, unless you have alternatives in place like Disqus or Google Custom Search Engine. Configure WordPress like usual and start creating content! Use a tool like HTTrack to create a static mirror of your website and upload the HTML somewhere!

Of course the last few steps have a few details you’ll need to work through but they can be automated so that you can update your website quickly. With static HTML, you can use Amazon S3, Github pagesGitLab Pages, Dropbox, or a simple static HTTP server to host the content with less risk than a wide open WordPress install with better performance and it can be for free or very cheap.

As I work through hosting my own blog in this fashion, I will try to share tips and code to make WordPress as a static website generator as easy as it is sensible. I think many brochureware marketing sites and blogs that are built with WordPress could ultimately be static websites.

Finally, what about traditional static website generators like hugo? They are certainly the answer if: you don’t need native web access for content updates and are able to customize a theme or use one of the more limited number of ones that are open source.

The post WordPress as a static website generator? appeared first on mitchmac.com.

]]>
https://www.mitchmac.com/wordpress-as-a-static-website-generator/feed/ 0