How to access AWS EC2 Files

Let’s get started Amazon EC2 by launching, connecting to, and using a Linux instance. An instance is a virtual server in the AWS cloud. With Amazon EC2, you can set up and configure the operating system and applications that run on your instance.

1) Login to your AWS account using your Account ID and Password

2) Go to services >> Compute >>Ec2 Section

ec2-instance

3) Go to instance and connect
See Picture

aws-ec2-files-access

4) Open SSH (Using putty)

5) Connect your sever using given host and private Key

Select all data from MySQL where varchar date greater than today ?

To select all event from MySQL varchar date, that start from tomorrow onwards, for that we have a easy method via using  STR_TO_DATE function.It convert stored date and compare with CURDATE() function

Here in this example I have an even table, in that table event start date is stored in the filed named event_start_time, my requirement is to fetch all event that is greater than today date and ineed in the event date ascending order.

See MySQL query

SELECT * FROM event WHERE STR_TO_DATE(event_start_time, '%d-%m-%Y') > CURDATE() ORDER BY STR_TO_DATE(event_start_time,'%d-%m-%Y') Asc

To Fetch coming 7 days data event

SELECT * FROM event WHERE STR_TO_DATE(event_start_time, '%d-%m-%Y') > CURDATE() AND STR_TO_DATE(event_start_time, '%d-%m-%Y') <= CURDATE() + INTERVAL 7 DAY 

To Fetch coming one month data event

SELECT * FROM event WHERE STR_TO_DATE(event_start_time, '%d-%m-%Y') > CURDATE() AND STR_TO_DATE(event_start_time, '%d-%m-%Y') <= CURDATE() + INTERVAL 30 DAY 

To fetch Today’s Event

SELECT * FROM event WHERE STR_TO_DATE(event_start_time, '%d-%m-%Y') = CURDATE()

How To Install Free cPanel in Linux Centos ?

Unfortunately cpanel is not a free software it is asking around Cost of 15 USD per month.But we have lot of similar software doing exactly the same functionality,out of that Zpanel is free and most popular.In this article am elaborate how to intall Zpanel in your system

1)  Clean OS (This installer is designed to install and configure ZPanel on a clean OS installation only!) 

#rm -rf *

2) Reboot your OS
#reboot

3 ) Download the install files from Github

# wget https://raw.github.com/zpanel/installers/master/install/CentOS-6_4/10_1_1.sh

4)  Change the permissions

#chmod +x 10_1_1.sh
5)  Run the installer

#./10_1_1.sh

how to add facebook live chat in a website

One of the main difficulty most of the developers faced is to add live chat in a website. Nowadays thousand of online chat are available most of them have their on draw backs.But Facebook come up with new chat frame , it is one of the easiest and  light weight live chat .here we are discuss how we can add fb chat in a website

 

1) After <body> tag add this code

 <!-- Load Facebook SDK for JavaScript -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
 var js, fjs = d.getElementsByTagName(s)[0];
 if (d.getElementById(id)) return;
 js = d.createElement(s); js.id = id;
 js.src = 'https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js#xfbml=1&version=v2.12&autoLogAppEvents=1';
 fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<!-- Your customer chat code -->
<div class="fb-customerchat"
 attribution="setup_tool"
 page_id="281874699030661">
</div>

2) Replace page id ( now:281874699030661)

3) In FB page setting > Messenger platform add White-listed domains

facebook-live-chat-into-websites