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.
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
Pdf_Helper. I’m using PhpUnit as my testing frameworks. And in case you’re wondering PDFLib is a paid PHP library. Once installed, the library adds many global functions. …
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.
First, update and and upgrade. We want to get the latest version of our repositories and make any package upgrade where necessary. …
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 using it previously because it was slightly buggy previously, but this time round after trying it out of a month. …
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.
So, I actually was stuck here for quite a while. I wasn’t sure which approach to use, but I finally decided to use the
dhcpcd.conf approach. …
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.
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’ could look something the following. …
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.
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.
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 an easy process, but there were some hiccups and I thought I document this down so future me would be able to access this information relatively quickly and set this up again in the blink of an eye. …
Using airconnect, we can instantly convert your Sonos Network into airplay supported network — oh did I mention also that it is entirely free?
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.
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 install openvpn…
Here are my go-to steps to decide which python string formatting to use.
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.
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. …