Resetting the ‘root’ password of your VM on Digital Ocean

Sometime back I had a digital ocean instance running with Ubuntu 16.04. On which I had disabled the ssh login to the root account as a security measure. For performing day to day tasks, I had created a user account called ‘test’. I enabled public key authentication for ‘test’ so that I can use some ssh client (putty or bitwise ssh client) to log into the server without needing to type the password every time. …

If you are on windows, the easiest way to install composer is by grabbing a copy of windows installer provided by the official composer website. The instruction are outlined below. Make sure you already have PHP installed in your system. It comes bundled with XAMPP, WAMP or otherwise you can install independently by downloading the package from Once you got PHP running, you have to know where php.exe is located before proceeding with the composer installation.

Here are the steps you should follow:

Windows doesn’t come with built in SSH support so you have to rely on some third party software. There are several options available. You can install Git for Windows that includes Git Bash which supports making ssh connections. You can install Bitwise SSH Client. PuTTY and Cygwin are also among popular alternatives. I am using both Git Bash as well as Bitwise SSH Client for my daily tasks. In this tutorial I’ll be explaining how to get this thing done with Git Bash.

First thing we have to do is generating an SSH key-pair. A key-pair is made of a…

Comparison operators are used to create expressions that evaluates to either TRUE or FALSE when used in a conditional test. Lets go through each of those operators to understand how they work.

Equals Operator (==)

Two equal signs (==) collectively known as the ‘equals’ operator. It checks for the equality of its two operands. If both operands are equal in their values, the expression evaluates to TRUE. If two operand values are different from each other, then the expression evaluates to FALSE.

Consider below two variables:

<?php$myname = 'steve';$yourname = 'bill';

Here, if we say $myname == $yourname , it is…

A Null variable is a variable that doesn’t have a value. A variable is considered Null in following scenarios:

When creating a variable in PHP, you don’t always need to assign a value to it. You can just define the variable without a value by skipping its assignment part as shown in the below example:


As you can see in the above example, we have defined a variable called $username but we have intentionally skipped assigning a value to it. When you have created a variable in this way, then that variable is considered a NULL variable.

Another situation where a variable can become NULL is that…

Kindly check for the complete article.


The following PHP snippet can be used to display a countdown timer on a web page.

Start by creating a new PHP page in your code editor. In the beginning of the code we need to start a PHP session by calling the session_start() function:


Then set the default time zone for your region. I am in Sri Lanka so I set it to Asia/Colombo:


Next add below code block:

$_SESSION['expire'] = time()+3600;

In that part we were checking to see…

Kindly check for the complete article.


You can format any numeric value to have decimal points by the use of PHP’s number_format() function. This is ideal when you want to deal with currency values. Below I have shown an example of how this works:

On line 3…

Kindly check for the complete article.


In this post I am going to show you how to create a form that allows uploading multiple files at once. There is nothing much complex about this. As you’ll see the trick is in how we configure the file upload field.

Here is the basic HTML form:

In the above markup, pay your attention to the code that defines the form. There are few things that you should take a note:

  • enctype attribute value is set to…

Kindly check for the complete article.


First lets try to get some understanding of what a Modal is and What it does?

Models represents the data objects of an application. For an example in an E-Commerce site, what are the data objects that you can think of? If it is selling books, then a Book is a data object. Then there are Users. A User is also a data object, When some one places an Order which is also a data object. If it selling magazines, then a Magazine is also a data object. etc. As another example lets take a vehicle reservation web site. It…

Click here to visit official Codeigniter download page.

You should see there are several download options made available representing different CodeIgniter versions. You should look for the current stable version of the framework. As of this writing, Codeigniter 3.X appears to be the current stable version. Go ahead and click the download button for Codeigniter 3.X. It will download a .zip archive containing the source code for Codeigniter 3.1.5

As per the documentation, Codeigniter 3.X requires a web server running PHP version 5.6 or newer along with MySQL server version 5.1+. So make sure your local WAMP or LAMP stack…

Amila Kalansooriya

Thinker, Scholar, Teacher, problem solver, and a self-made web developer

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