Never use file_get_contents to make URL queries

Why you should not ever use file_get_contents

As each programmer by nature, I’m lazy. I try to accomplish as much as possible with minimum effort.

So whenever I use PHP to fetch something, I use file_get_contents to make queries and pull data from other services. So basically, my favourite snippet is this guy here:

How to replace all links in html to markup

How to replace all links in html to markup

Regular expression to replace href to markup

I recently moved my blog from WordPress to Hugo , which involved a lot of content fixing. One of the problems was that not all HTML code was correctly transferred to markup during the export. So I needed fix (replace) all pending <a href="https://spidersoft.com.au">spidersoft</a> to [spidersoft](https://spidersoft.com.au). What we need are just two simple regular expressions. One to find links <a.*?href="(.+?)".*?>(.+?)</a> Second one to replace them in reverse order [$2]($1) You can run this in basically any IDE - Sublime will do the job, I was using PHPStorm
Clearing up git submodules problems

Clearing up git submodules problems

As some of you noted, I moved my blog into Hugo . You have to pull multiple git repositories to compile the entire project during the build process. Because begging is always challenging, it’s always trial and error, and I ended up having many sub-repositories missing. I’m now going to show the whole journey how to solve “the issue”.

Docker, GO and CGO application build

Docker, GO and CGO application build

I’ve been avoiding Docker for a very long time. I started as a sysadmin setting up servers running FreeBSD and early versions of Debian on bare-bone servers. As soon as “cloud” came into the market, I switched to AWS and GCE and have used them since then. EC2 was my always goto choice to deploy something on the internet quickly. But Docker — for some reason, I was avoiding it until this two years ago, when I started using it. Without too much trust.

But today, history is not about my love & hate relationship with Docker, but about deploying the GO application and VIPS library. A couple of problems appeared during the process, and it’s worth mentioning them for future generations because I could find much help around my issues.