HTTP/2 performance comparison (case study)


Couple of days ago nginx released nginx-1.10.0 stable version with http2 support.
I was already running nginx from their repos on couple of servers, and as the upgrade was possible just by running apt-get upgrade and adding a single parameter to config file, I decided to give it a try immediately.

I knew http2 use should impact sites with lots of http requests the most, so I compared the results from my hobby site for Latvian gamers – – which has quite a lot of small images and other assets. I removed 3rd party ads so they don’t impact the load times and run couple of tests using The results were pretty impressive for changing a single line of code. Continue reading

How to import an excel file into a MySQL database using PHP

Excel to MySQL illustration

I will provide basic code that’s needed to turn Excel or LibreOffice Calc file (.xlsx, .xls, .csv, .ods and some other formats) into a MySQL table with all the corresponding fields and data. This code will assume the first row of the document contains (unique) column names. That’s pretty much the only requirement.

First thing we need is PHPExcel package (it’s free and open source) for reading spreadsheet files. You can download it here: Download, extract and move it a folder where you can execute php files. We will include them in the following scripts. Continue reading

How to launch Chrome window with proxy using any ssh server

I will show how to use any server with ssh as a proxy, I’m doing this on Debian Linux, but it should be the same on all Debian derivatives, and very similar on any other Linux distribution. I use this method to watch Netflix and bypass country restrictions, and to test website access speed from different locations, but it can be used for many other purposes. Continue reading

How to kill processes by running time


Heres a little trick to kill of unwanted processes that are running for more than X minutes on Linux.

I use this on a production server, where imagemagick and ffmpeg are executed many thousands of times per day and in normal conditions each process takes 0.x to 30 seconds. On rare cases they seem to run out of control and never finish execution or take longer than seems reasonable and worthwhile for the particular task. To free up resources taken by such processes, I decided it would be ok to just kill them if they are running for more than 10 minutes. It may not be a very safe and beautiful way to deal with such processes, but it’s working well for me for years now, so I’ll share… Continue reading

How to migrate WordPress site to CloudFlare SSL

In this article I’m going to show you how to enable CloudFlare Flexible SSL for your WordPress website.

Cloudflare flexible SSL is the simplest method, to get your site running under SSL (HTTPS) fast and free. Using CloudFlare, you don’t need to purchase an SSL certificate and do any complicated server configuration, pretty much any host will work.
I will try to create very detailed guide on how to do this right, with proper redirects for non-SSL content and HSTS. Don’t be afraid of it’s length, the steps are fairly simple.

What you gonna need

  • A WordPress site with admin access and ability to install plugins.
  • Access to your domains DNS records. In the example I’m going to use a domain name registered at, but any other registrar should work, you just have to look for an option to change name servers.
  • CloudFlare account. You can create one for free here:

Continue reading