Having to mock global functions might be more common than you think, but thankfully, since PHP 5.3, we can do that simply with namespaces.

Photo by Steve Harvey on Unsplash

Quick Overview

If you were like me, unsure about when to use testing methods like these, I think it’s easier to paint you a picture of a recent use-case I had for a project that I was involved in recently.

The quick background of the project was, let’s imagine I have to make some changes to a wrapper class that was essentially wrapping the PDFLib class. For uniformity sake, let’s call this wrapper class . I’m using PhpUnit…

Photo by Scheier .hr on Unsplash

Setup your own free private streaming service with Plex and Raspberry Pi. Takes less than 15 minutes! Let’s go.

I’m using a raspberry pi 4, with built in wifi. Before this, I’ve set the raspberry pi up as a headless set up. If you’re interested installing raspberry the same way, check out my earlier article here.

Next, to get my video collection up onto raspberry pi, I also setup my raspberry pi to work as NAS. So if you’re interested, take a look at my earlier article on how I converted a 4TB external USB drive into a NAS.

Let’s Start!


I’ve been using Dropbox for a long time, but recently I’m really in love with Resilio Sync. Well if you have 30mins spare time and raspberry laying around, let’s go!

I was slightly annoyed at how dropbox isn’t working in countries like China and the fact that the free version now only works on a limited number of devices. Also, I’m not a huge fan of the subscription model — not in this use-case at least.

Recently, I revisited the idea of trying out BT Sync again. Apparently, the then BT Sync is now rebranded as Resilio Sync. I stop…

With a built-in WIFI module, true Gigabit Ethernet ports and multiple USB3 ports, the raspberry was turning to be a real candidate.


I’m using a Raspberry 4 Model B for this project, but feel free to use older versions but your mileage might vary. I will be using the raspberry in headless mode, so checkout my previous articles on how to setup the raspberry pi incase you haven’t.

Also, if you want to know what other optimizations to work on after the installation, check out my article on 10 tweaks.


  • Raspberry PI
  • Rasbian Buster
  • External USB HDD

Setup static IP

So, I actually…

Different versions of Raspberry Pis

Here is a list of tweaks to make right after installing Rasbian on your Rasberry Pi.

Right. Before we start, some housekeeping out of the way; unless otherwise mentioned, the commands that we execute here will be ran on the Rasberry via ssh.

Incase you haven’t installed the latest Rasbian on your Raspberry pi, have a look here.

1. Create A ‘ChangeLog’

I think this is a good practice, it helps to keep things in place. Many times, we forget what we change and tinker along the way. Getting in the habit of writing down what we changed is a nice idea.

A ‘ChangeLog’…

Setup your raspberry directly from your Windows, macOS or Linux machine without the need for any extra I/O devices.


So I wanted to set up the new raspberry pi 4 that I purchased recently, but I forgot to purchase the micro HDMI cable?! I really didn’t want to pay for this cable since my raspberry was never every really going to need a display other than for the initial installation. So this guide will show you how to quickly set this up so you can get on with your projects.


  1. Raspberry Pi (Any version)
  2. Computer (Windows, macOS or Linux)
  3. microSD…

Here is me documenting my journey as I set up a temporary FTP server for quick access before removing it at the end of the project.

Photo by Taylor Vick on Unsplash

The quick overview as to why I needed this article was to serve as a reminder for my future self on how to get this running quickly. So, recently I needed to run an FTP server quick and dirty because I needed to get a huge amount of files quickly to another party. Unfortunately, other storage solution wasn’t possible for this project, such as S3, so here we go…

Initially I thought it was…

Using airconnect, we can instantly convert your Sonos Network into airplay supported network — oh did I mention also that it is entirely free?

Photo by Michał Borowczyk on Unsplash


I own one Sonos Play:1 speaker. It sounds great and I loved that it is one of the cheaper Sonos speakers that still sounded really good. Recently, I was considering getting a second speaker and learnt that the Sonos One supported Airplay. Also, I found out I could potentially convert my Sonos Network by adding a Sonos One onto my network. …

My documented journey as I go through the entire process of setting up Stunnel + OpenVPN on Ubuntu 18.04.


The article assumes you already have a Ubuntu 18.04 machine setup somewhere, maybe with one of the cloud providers.

If you are looking to install this on Ubuntu 16.04, look at my previous article. There are quite a number of differences, so if you are looking to use this on 18.04, read on.

Installing OpenVPN and Stunnel

We will be installing these applications. OpenVPN and Stunnel from package repository. Also, we are going to update the latest version of OpenVPN

$ sudo -s$ apt-get…

Here are my go-to steps to decide which python string formatting to use.

Photo by Sandrachile . on Unsplash


There are different ways to format strings in Python. I quickly summarize the different methods here. You should dig deeper to see how these techniques can be used in your respective scenarios.

  1. Formatting with the % operator
  2. Formatting with .format() method
  3. Using f-strings
  4. Using Template strings

Method 1: Formatting with % operator

Here’s one of the oldest method among the four techniques described above. Included here only so we know it exists and when we come across it in older legacy or Python 2.6 code, we understand it is doing string formatting. …

Jayden Chua

An avid web developer constantly looking for new web technologies to dabble in, more information can be found on bit.ly/jayden-chua

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store