Node.js NGINX SSL Reverse Proxy with Websocket Support

While not a strict requirement of a Node.js web project, good non-thread-blocking reverse proxy software - such as NGINX - can never hurt. One of the reasons I always use one is for much simpler and mature SSL support, as well as being able to run multiple public-facing web apps on the same VPS.

However, I always find it a little tricky to go through all the configuration options - and websocket support is not always clear.

So here I am, sharing a typical configuration setup in /etc/nginx/sites-available/default for NGINX 1.10.3 on Debian 9.3:

Make sure you give it a test with sudo nginx -t and then restart nginx with sudo systemctl restart nginx.

The SSL ciphers specified should be more than secure for developers looking at some random webpage for security tips, but you can always change your configuration.

One thing that I still need to figure out is IPv6 support, but that only sometimes works. If you have an IPv6 setup that works with CloudFlare, please send me an email - I'd love to know how you got it working.

Opera 49 Linux Support for H.264

At some point over the last few updates, Opera on Linux (Ubuntu for me) lost support for the H.264 codec, meaning websites such as YouTube would have mixed results.


The issue is that the libffmpeg .so file isn’t in Opera’s library folder anymore. The quick fix is to put it back there.

I’m not about to get caught distributing anything without permission, so don’t expect me to give you a link to the file. However, it is well known that Chrome ships with it.

If you have chrome installed, you can simply type this command into your terminal and be on your way:

sudo cp /usr/lib/chromium-browser/ /usr/lib/x86_64-linux-gnu/opera/

Note that if you have Opera open, the browser will crash and restart. That’s not a problem, you would have needed to restart it anyway.

If you don’t have chromium installed, you could probably find it somewhere on the internet. Just make sure you can trust the source, of course.

You should now head over to the YouTube HTML5 video player support page to see if everything has been fixed, and you should be met with glorious blue check-marks all ‘round:

iPhone 6S CPU Score Halved Over A Year

[Update 2017-12-23]: As it turns out, Apple is actually intentionally slowing down iPhones as their batteries get older (link is non-ssl). This would explain my results, as I haven’t replaced my battery since getting it.

The performance degradation is still quite significant, and still not-becoming of a device that I own. I think I should be the one making the decision of weather to slow down my device or not, not Apple.

The fact that they didn’t even say they were doing this until now just rubs salt into the wound. What other Apple products do they do this to?


[Update 2018-06-27]: Another update on this, when the iOS update was released to show the battery degradation, mine was at around 83%. This doesn't explain the results shown below. Either my original theory was true, or Apple is under-reporting the battery degradation. Take from that what you will.


So apparently I purchased GeekBench some time ago for whatever reason, and I found it in one of my phone’s app folders just this morning.

I gave it a look and found some of my older CPU tests from early last year. Looked pretty good! My phone was about as fast as the average 6S - as one would expect.

However, what shocked me is when I ran a new test. The scores for both single and multi-core had almost halved.

Surely, there’s no way that this is by accident. No way would an engineer think that an update to a fairly new phone that nearly halved it’s performance is a good update.

My first thought when I discovered this was to check if the Geekbench scoring system had changed. A quick search led me to find that, yes, that was the case, but only with Geekbench version 4.1. I used version 3. The major versions are standalone. There should have been no difference.

The only reasons I can think of for there being any difference over time is: either the CPU is being throttled, or Apple was cheating the benchmarks around release - which may not be that outlandish, considering most Android manufaturers do this.

Versions and model

If you’re looking to reproduce:
  • Geekbench: v3.4.1 for iOS AArch64
  • iOS: 9.3.3 vs 11.0.3
  • Model (ID): iPhone 6S (iPhone8,1)
  • Motherboard: N71mAP
  • Processor (ID): Apple A9 @ 1.85 GHz dual (ARM)
  • L1 / L2 / L3 caches: 64KB / 3 MB / 0 B
  • Memory: 1.96 GB

Invalid Active Developer Path after Updating MacOS

I updated to the latest version of MacOS (High Sierra), which is really great. Nothing I used really changed but eh.

The only thing that did change was my ability to use some command line tools, for instance gcc and make stopped working. Originally, I thought it was because I uninstalled Xcode, but after re-installing I still didn’t have any luck.


A quick search led to me to this Stack Overflow article, which simply suggested to run the following command in the terminal:

xcode-select --install

According to the top response, the issue is that you have to explicitly accept the license agreement, for whatever reason it doesn’t ask you to agree when you install Xcode.

Get used to typing this in every time you upgrade your Mac, because it looks like this happens every update.


Debounce API Requests in a JS Class

I have a react application that needs to access an API endpoint on the client side - which is hit when a user clicks on a button, as well as...