![Create Alarm and Monitoring on Custom Memory and Disk Metrics for Amazon EC2](https://images.ctfassets.net/vzl5fkwyme3u/2HgdCq2lZucMyuiYyYiQie/b7376c29a2f94799613e8c1cb8ff4d3b/AdobeStock_91111530.jpeg?w=1000)
Today I am going write a blog on how to Monitor Memory and Disk custom metrics and creating alarm in Ubuntu.
To do this, we can use Amazon CloudWatch, which provides a flexible, scalable and reliable solution for monitoring our server.
Amazon Cloud Watch will allow us to collect the custom metrics from our applications that we will monitor to troubleshoot any issues, spot trends, and configure operational performance. CloudWatch functions display alarms, graphs, custom metrics data and including statistics.
## Installing the Scripts
Before we start installing the scripts for monitoring, we should install all the dependent packages need to perform on Ubuntu.
First login to your AWS server, and from...
![Creating a URL shortener application in PHP & MySQL](https://images.ctfassets.net/vzl5fkwyme3u/3OjKfmylv2k8eWayqeCUWG/6d8e996fc7c757135df7fdd322fd50a4/AdobeStock_65694631.jpeg?w=1000)
In this post we will learn how to create your URL shortening application in PHP and MySQL.
You may also use this app as an API by calling the URLs from another application.
## Step 1: Creating a Table
CREATE TABLE IF NOT EXISTS `url_shorten` (
`id` int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
`url` tinytext NOT NULL,
`short_code` varchar(50) NOT NULL,
`hits` int(11) NOT NULL,
`added_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=latin1;
## Step 2: Create a file `index.php` and add database credentials in it
$servername = 'localhost';
$username = 'root';