bash script backup mysql database

Bash script backup MySql database

As we all know, databases is one of the most important thing you need to backup before you want to upgrade, move to new server or before you want to do a task but do not really sure about the impact. I have written a article about the command line to MySql database - How to Backup and Restore. In this article, I will show you a little bash script backup MySql database at regular intervals and deleting backups which older than 15 days from current.

This Bash script backup MySql will contain your database information so please make sure you set the right permissions, more over please don’t place the backup folder in public_html folder othervise other people will be able to see the content of your database. Continue Reading

Find ip address in php

How to find ip address in php

Whatever you do, make sure not to trust data sent from the client.
$_SERVER['REMOTE_ADDR'] contains the real IP address of the connecting party. That is the most reliable value you can find.

$_SERVER['REMOTE_ADDR'] is the actual physical IP address that the web server received the connection from and that the response will be sent to. Anything else is just arbitrary and voluntary information. There’s only one scenario in which you can trust this information: you are controlling the proxy that sets this header. Meaning only if you know 100% where and how the header was set should you heed it for anything of importance. Continue Reading

Regular expression pattern

Regular expression pattern

This article will show a list of most common regular expression pattern that we usually to validating and formatting common types of user input. Such as email address, phone numbers, url … If you are not familar with Regular expression please check article Regular expressions - Overview first.

Beyond helping you get the job done by eliminating invalid input, these recipes can also improve the user experience of your applications. Messages such as “no spaces or hyphens” next to phone or credit card number fields often frustrate users or are simply ignored. Continue Reading

phpmyadmin login screen

phpMyAdmin installation on Ubuntu 14.04

phpMyAdmin is a free and open source tool written in PHP intended to handle the administration of MySQL with the use of a web browser. It can perform various tasks such as creating, modifying or deleting databases, tables, fields or rows; executing SQL statements or managing users and permissions. This tutorial will show you the way to install phpMyAdmin on Ubuntu 14.04


Before you get start, you need to have a LAMP(Linux, Apache, MySQL and PHP) installation on your Ubuntu 14.04 server. You can follow this tutorial Install LAMP in Ubuntu server to more detail what you need to have first. Continue Reading

Regular expressions

Regular expressions – Overview


Regular expressions is a special text string for describing a search pattern. A pattern consists of one or more character literals, operators, or constructs. You can use Regular expressions to find out a parttern in very short way such as: codeail, Phone format, Password rules, etc… It is very powerful whether that code is written in Perl, PHP, Java, a .NET language or a multitude of other languages. Continue Reading

detect PowerPoint PPTX layout

Detect PowerPoint PPTX layout easily by PHP

What is PowerPoint?

PowerPoint is a visual and graphical application, primarily used for creating presentations. With PowerPoint, you can create, view, and present slide shows that combine text, shapes, pictures, graphs, animation, charts, videos, and much more.

What is PHP?

PHP is a server-side scripting language designed for Web development but also used as a general-purpose programming language. Originally created by Rasmus Lerdorf in 1994, the PHP reference implementation is now produced by the PHP Group. While PHP originally stood for Personal Home Page, it now stands for the recursive backronym PHP: Hypertext Preprocessor.

Detect PowerPoint PPTX layout – Case study

If you have to build a web application which allow users upload a PowerPoint PPTX presentation template. But users have only allowed to upload PowerPoint pptx in a particular layout or some of layout format. Then you need to detect PowerPoint pptx layout. Continue Reading

Linux Users and Groups

Linux Users and Groups – Base knowledge

Linux Users and Groups are very important knowledged. If you are new to Linux/Unix, then the concept of permissions may be confusing. This guide will provide you with an explanation of what permissions are, how they work, and how to manage them.

Definition: User and Group Permissions

As other operation system, Linux/Unix has the ability to multitask in a manner. However, Linux’s major difference from other operating systems is its ability to have multiple users and allow more than one user to have access to the system at the same time. In order for this multi-user design to work properly, there needs to be a method to protect users from each other. This is where permissions come. Continue Reading

Vi command line

Learn Linux: use vi command

Vi command overview

In other post, we showed you some most useful Linux commands, you can check that article here. Today, we will show you detail about a very useful command when we working with linux. That is vi command. VI command is on almost every UNIX and Linux system. This tutorial will show you how to

  • Navigate a document using vi command
  • Use basic vi modes
  • Insert, edit, delete, copy and find text by vi command

Continue Reading