0% found this document useful (0 votes)
16 views61 pages

CC - Lab FINAL

Uploaded by

syedsuhel1843
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views61 pages

CC - Lab FINAL

Uploaded by

syedsuhel1843
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Ex.

No: 2 CREATE KEY BASED AUTHENTICATION AND LOGIN


VIRTUAL VIRTUAL MACHINE FROM THE LOCAL HOST
DATE: MACHINES. INSTALL REQUIRED SOFTWARE BY
CONNECTING WITH SSH or PUTTY

AIM:
To create key based authentication and login virtual machines from the host machines
and installing required software by connecting with SSH or PUTTY.

ALGORITHM:
1. Start Putty
2. Fill n the hostname or IP address of our VM from the Azure portal

3. Select the Connection > SSH > Auth category. Browse to and select your Putty
private
Key (.ppk file)

718CSP08-CLOUD COMPUTING (REGULATION - 2018


4. Click Open to connect to your VM.

RESULT:
Thus the key based authentication and login virtual machine from the host machines and
installation required software by connecting with SSH or Puny is executed successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Ex.No: 3 INSTALL WEB SERVER IN THE VIRTUAL MACHINE AND
CREATE SAMPLE WEB APPLICATION (HTML,JS) AND
DATE: HOST, RUN FROM THE BROWSER

AIM:
To install a web server in the virtual machine and create a sample web application using
HTML,JS,host and running it in the browser.

ALGORITHM:

1. Power on the virtual machine and note the virtual machine’s IP address.Ensure that the
IP address is set to Static.
2. Power off the virtual machine.
3. In the Vmware Workstation toolbar,click Edit > Virtual Network Editor.
4. Select the vmnet NAT adapter which you have configured on the particular virtual
machine.

5. Select the NAT Settings option. The NAT settings dialog appears.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


6. Click Add. The Map Incoming Port dialog appears.
7. Enter these details:
● The host port - An unused port. For example, you can use port 9997
● The virtual machine port - The port number of the Web server running inside the
virtual machine
● The virtual machine IP address - The IP address of the virtual machine that you
want to connect to the NAT connection, noted in Step 1
● Set the type as TCP
● Add a description.

8. Click OK.
9. Power on the virtual machine and configure the Web server as required. Ensure to use
the same port number that you configured in Step 7 for the Web server on the virtual
machine.

RESULT:

Thus the web server in the virtual machine is installed and a sample web
application using HTML,JS,host is created successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Ex.No: 4
CREATE SIMPLE BACKEND LOGIC AND
DATE: COMMUNICATION WITH FRONT END APP USING AJAX

AIM:
To create simple logic and communication with front end app using AJAX

ALGORITHM:
Step 1 : Prepare a picture for writing an AJAX program.Save the picture in the same folder
where you will save your html and text files displaying the Ajax program.
Step 2 : "ProgramInAjax" directory is set up inside the "wamp" folder under the "www"
directory where you installed WampServer.
Step 3: Open any text editor. Notepad++ is used as the text editor in this article.
Step 4: Create a new file in the text editor. Type the following,You may type whatever you want
inside the html tag <h2></h2> here.
Step 5: Save the file as a text document with the name of "ajax-data.txt."
Step б: Actually, you can name the file whatever you want but make sure you enter the same
file name to the coding in this line:
Step 7: Create a new file for a webpage. This file is for an HTML file to view the Ajax program
in a Web browser.
Step 8: Save the file. Click the save button on the menu bar. A "Save As" box is open. Enter a
name for your document. In this article, the name of the file is "index."
Step 9: At the "Save as type" field, click the drop down arrow to choose the file extension

PROGRAM:

<?php
session_start();
error_reporting(0);
include('includes/config.php');
if(strlen($_SESSION['login'])==0)
{
header('location:index.php');
}
else{
date_default_timezone_set('Asia/Kolkata'); // change according
timezone
if(isset($_POST['submit']))
{

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Suid-$_SESSION['id'];
Scategory=$_POST['category'];
$subcat=$_POST['subcategory'];
Snoc=$_POST['noc'];
$complaintdetails=$_POST[„complaintdetails‟];
$comfile=$_FILES[“compfile”][“name”];
$currdDate=date(“y-m-d”);
$currMonth=date(„m‟);
$curryYear=date(“y”);
move_upload_file(“complaintdocs/”.$_FILES[“compfile”][“tmp_name”
],”complaintdocs/”.$_FILES[“compfile”][“name”]);
$query=mysqli_query(“insert into
tblcomplaints(userId,category,subcategory,noc,complaintDetails,c
omplaaintFile,data,monthly,yearly)values(„$uid‟,‟$subcat‟,$noc,'
$complaintdetials', '$compfile', $currdDate','$currMonth',
'ScurryY ear')");
Ssql=mysql_query("select complaint Number from tblcomplaints
order by complaintNumber desc limit 1");

while($row=mysql_fetch_array($sql))
{
$cmpn=$row['complaintNumber'];
}
$complainno=$cmpn;
echo '<script> alert("Your complain has been successfully filled
and your complaintno is "+".$complainno."")</script>';
}
?>

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Dashboard">
<meta name="keyword" content="Dashboard, Bootstrap, Admin,
Template, Theme, Responsive, Fluid, Retina">
<title>CMS | User Register Complaint</title>
<!-- Bootstrap core CSS -->
<link href="assets/css/bootstrap.css" rel="stylesheet">
<!--external css-->

718CSP08-CLOUD COMPUTING (REGULATION - 2018


<link href="assets/font-awesome/css/font-awesome.css"
rel="stylesheet" />
<link rel="stylesheet" type="text/css"
href="assets/js/bootstrap-datepicker/css/datepicker.css" />
<link rel="stylesheet" type="text/css"
href="assets/js/bootstrap-daterangepicker/daterangepicker.css"/>
<link href="assets/css/style.css" rel="stylesheet">
<link href="assets/css/style-responsive.css" rel="stylesheet">
<script>
function getCat(val) {
//alert('val');
$.ajax({
$.ajax({
type: "POST",
url: "getsubcat.php",
data:'catid='+val,
success: function(data){
$("#subcategory").html(data);
}
});
</script>
</head>
<body>
<section id="container">
<?php include("includes/header.php");?>
<?php include("includes/sidebar.php");?>
<section id="main-content">
<section class="wrapper">
<h3><i class="fa fa-angle-right"></i> Register Complaint</h3>
<!-- BASIC FORM ELELEMNTS -->
<div class="row mt">
<div class="col-lg-12">
<div class="form-panel">
<?php if($successmsg)
{ ?>
<div class="alert alert-success alert-dismissable">
<button type="button" class="close" data-dismiss="alert"
aria-hidden="true">&times;</button>
<b>Well done!</b> <?php echo htmlentities($successmsg);?></div>
<?php } ?>
<?php if($errormsg)
<div class="alert alert-danger alert-dismissable">

718CSP08-CLOUD COMPUTING (REGULATION - 2018


<button type="button" class="close" data-dismiss="alert"
aria-hidden="true">&times:</button>
<b>Oh snap!</b> </b> <?php echo htmlentities
(Serrormsg);?></div>
<?php } ?>
<form class="form-horizontal style-form" method="post"
name="complaint" enctype="multipart/form-data">
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Category</label>
<div class="col-sm-4">
<select name="category" id="category" class="form-control"
onChange="getCat(this.value);" required="">
<option value="">Select Category</option>
<?php $sql=mysql_query("select id,categoryName from category ");
while ($rw=mysql_fetch_array($sql)) {
?>
<option value="<?php echo htmlentities($rw['id']);?>"><?php echo
htmlentities($rw['categoryName']);?></option>
<?php
}
?>
</select>
</div>
<label class="col-sm-2 col-sm-2 control-label">Complaint Type
</label>
<div class="col-sm-4">
<select name="subcategory" id="subcategory"
class="form-control">
<option value="">Select complaint type</option>
<?php $sql=mysql_query("select id,subcategory from subcategory
");
while ($rw=mysql_fetch_array($sql)) {
?>
<option value="<?php echo htmlentities($rw['id']);?>"><?php echo
htmlentities($rw['subcategory']);?></option>
<?php
?>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Nature of
Complaint</label>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


<div class="col-sm-4">
<input type="text" name="noc" required="required" value=""
required="" class="form-control">
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Complaint Details
(max 2000 words) </label>
<div class="col-sm-6">
<textarea name="complaindetails" required="required" cols="10"
rows="10" class="form-control" maxlength="2000"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 col-sm-2 control-label">Complaint Related
Doc(if any) </label>
<div class="col-sm-6">
<input type="file" name="compfile" class="form-control"
value="">
</div>
</div>
<div class="form-group">
<div class="col-sm-10" style="padding-left:25%"> <button
type="submit" name="submit" class="btn
btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
</section>
</section>
<?php include("includes/footer.php");?>
</section>
<!-- js placed at the end of the document so the pages load
faster --> <script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script class="include" type="text/javascript"
src="assets/js/jquery.dejqaccordion.2.7.js"></script>
<script src="assets/js/jquery.scrollTo.min.js"></script>
<script src="assets/js/jquery.nicescroll.js"
type="text/javascript"></script>
<!--common script for all pages-->

718CSP08-CLOUD COMPUTING (REGULATION - 2018


<script src="assets/js/common-scripts.js"></script>
<!--script for this page-->
<script src="assets/js/jquery-ui-1.9.2.custom.min.js"></script>
<!--custom switch--> <script
src="assets/js/bootstrap-switch.js"></script> <script
src="assets/js/jquery.tagsinput.js"></script>
<!--custom tagsinput-->
<!--custom checkbox & radio-->
<script type="text/javascript"
src="assets/js/bootstrap-datepicker/js/bootstrap-datepicker.js">
</script>
<script type="text/javascript"
src="assets/js/bootstrap-daterangepicker/date.js"></script>
<script type="text/javascript"
src="assets/js/bootstrap-daterangepicker/daterangepicker.js"></s
cript
<script type="text/javascript"
src="assets/js/bootstrap-inputmask/bootstrap-inputmask.min.js"><
/script>
<script src="assets/js/form-component.js"></script>
<script>
//custom select box
$(function(){
$('select.styled').customSelect();
});
</script>
</body>
</html>
<?php } ?>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


OUTPUT:

RESULT:
Thus the program was to create simple backend logic and communication with the front end app using
AJAX executed successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Ex.No: 5
CREATE SQL DB AND DESIGN SCHEMA FOR USER SESSION
DATE: DETAILS. RETRIEVE THE DETAILS FROM THE FRONT END
APPLICATION.

AIM:
To create sql db and design schema for user session details. retrieve the details of the
front end application.

ALGORITHM:
Step 1: Type a code in notepad++.
Step 2: Save the code with .php extension.
Step 3: Create a form name order management system.
Step 4: Create a database as ordered.
Step 5: Retrieve all the attributes by using the GET and POST method.

Index.php
<!DOCTYPE HTML>
<html>
<head>
</head>
<body background="feed.jpg”>
<center><h I >Order Management System</h1 ></center>
<center><table>
<form method="post" action="pro.php">
<th>
Buyer Name: <input type="text" name="name" >
<br><br>

Gender:<input type=”radio" name="gender" value="fema1e">Female

<input type=”radio" name="gender" value="male">Male

<br><br>

Buyer E-mail: <input type="text" name="email">

<br><br><center>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Contact Number: <input type="text" name="contact">

<br><br>

Buyer Address: <textarea type="text" name=”buyeraddr” rows=”5”


cols=”20"></textarea>

<br><br>
Delivery Address: <textarea type="text" name=”deleaddr" rows=”5”
cols="20”></textarea>

<br><br>

Product Names: <textarea name="productname" rows="5"


cols="40"></textarea>

<br><br>

<input type="submit" name="submit" value="Submit">

</form>

</th>

</table></center>

</body>

</html>

Pro.php

<!DOCTYPE html>

<html>

<head>

<title></title>

</head>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


<body background="f.jpg" >

<?php

// define variables and set to empty values

$nameErr = $emailErr = $genderErr = $contactErr =$deleaddrErr =


$buyeraddrEir =$productname = "";

$name = $email = $gender = $contact = $website =$deleaddr =


$buyeraddr =

$buyeraddr=$productname= "";

if($_SERVER["REQUEST_METHOD"] == "POST") {

if (empty($_POST["name"])) {

$nameErr = "Name is required";

} else {

$name = test_input($_POST["name”]);

// check if name only contains letters and whitespace

if (!preg_match("/^[a-zA-Z ]*$/",$name)) (

$nameErr = "Only letters and white space allowed”;

if (empty($_POST["email”])) {

$emailErr = "Email is required";

} else {

$email = test_input($_POST["email"]);

// check if e-mail address is well-formed

718CSP08-CLOUD COMPUTING (REGULATION - 2018


if (!filter_var($email,
FlLTER_VALIDATE_EMAIL)) {

$emailErr = "Invalid email format";

if (empty($_POST["buyeraddr”])) {

$buyeraddrErr = "Email is required";

} else {

$buyeraddr = test_input($_POST["buyeraddr"]);

// check if e-mail address is well-formed

if (!filter_var($buyeraddr, FILTER_VALIDATE_EMAIL)) {

$buyeraddrErr = "Invalid buyeraddr format";

if (empty($_POST["productname"])) {

$productname = "";

} else {

$productname = test_input($_POST["productname"]);

if (empty($_POST["gender"])) {

$genderErr = "Gender is required";

} else {

$gender = test_input($_POST["gender"]);

718CSP08-CLOUD COMPUTING (REGULATION - 2018


}

if (empty($_POST["contact"])) {

$contactErr = "contact is required";

} else {

$contact = test_input($_POST["contact"]);

if (empty($_POST["deleaddr"])) {

$deleaddrErr = "Email is required";

} else {

$deleaddr = test_input($_POST[”deleaddr"]);

// check if e-mail address is well-formed

if (!filter_var($deleaddr, FILTER_VALIDATE_EMAIL)) {

$deleaddrErr = "Invalid buyeraddr format";

function test_input($data) {

$data = trim($data);

$data = stripslashes($data);

$data = htmlspecialchars($data);

return $data;

718CSP08-CLOUD COMPUTING (REGULATION - 2018


?>

<?php

echo "<h2>Your Order:</h2>";

echo "<h2>Your name is :$name</h2>";

echo "<br>";

echo "<h2>Your gender is


:$gender</h2>";

echo "<br>";

echo "<h2>Your email is


:$email</h2>";

echo "<br>";

echo "<h2>Your Contact is


:$contact</h2>";

echo "<br>";

echo "<h2>Buyer address is


:$buyeraddr</h2>";

echo "< br>";

echo "<h2>Your Delivery address is :$deleaddr</h2>";


echo "<br>";
echo "<h2>Your Product Name is:$productname<fh2>";
echo "<br>";
?>
</body>
</html>

OUTPUT :

718CSP08-CLOUD COMPUTING (REGULATION - 2018


RESULT:
Thus the program using the php concept is get and retrieved data is executed
successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Ex.No: 6
CREATE USER NAME, STORE THE PASSWORD IN THE SQL.
DATE: LOGIN USING USER NAME/PASSWORD AND VALIDATE.

AIM:
To Create a user name, store the password in the SQL. Login using user name/password and
validate.
ALGORITHM:
Step 1: Type a code in Notepad++
Step 2: Save the code with .php extension.
Step 3: Create a form name as Login.
Step 4: Create Database as 'user_registration'

PROGRAM:
login.php
<!doctype html>
<html>
<head>
<title>Login</title>
<style>
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
background-color: azure ;
color: palevioletred;
font-family: verdana;
font-size: 100%
}

718CSP08-CLOUD COMPUTING (REGULATION - 2018


h1 {
color: indigo;
font-family: verdana;
font-size: 100%;
}
h3 {
color: indigo;
font-family: verdana;
font-size: 100%;
} </style>
</head>
<body>
<center><h1>CREATE REGISTRATION AND LOGIN FORM USING PHP AND
MYSQL</h1></center>
<p><a href="register.php">Register</a> | <a
href="login.php">Login</a></p>
<h3>Login Form</h3>
<form action="" method="POST">
Username: <input type="text" name="user"><br />
Password: <input type="password" name="pass"><br />
<input type="submit" value="Login" name="submit" />
</form>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['user']) && !empty($_POST['pass'])) {
$user=$_POST['user'];
$pass=$_POST['pass'];
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('user_registration') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE username='".$user."'
AND

718CSP08-CLOUD COMPUTING (REGULATION - 2018


password='".$pass."'");
$numrows=mysql_num_rows($query);
if($numrows!=0)
{
while($row=mysql_fetch_assoc($query))
{
$dbusername=$row['username'];
$dbpassword=$row['password'];
}
if($user == $dbusername && $pass == $dbpassword)
{
session_start();
$_SESSION['sess_user']=$user;
header("Location: member.php");
}
} else {
echo "Invalid username or password!";
}
} else {
echo "All fields are required!";
}
}
?>
</body></html>

register.php
<!doctype html>
<html>
<head>
<title>Register</title>
<style>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;
background-color: azure ;
color: palevioletred;
font-family: verdana;
font-size: 100%
}
h1 {
color: indigo;
font-family: verdana;
font-size: 100%;
}
h2 {
color: indigo;
font-family: verdana;
font-size: 100%;
}</style>
</head>
<body>
<center><h1>CREATE REGISTRATION AND LOGIN FORM USING PHP AND
MYSQL</h1></center>
<p><a href="register.php">Register</a> | <a
href="login.php">Login</a></p>
<center><h2>Registration Form</h2></center>
<form action="" method="POST">
<legend>
<fieldset>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Username: <input type="text" name="user"><br />
Password: <input type="password" name="pass"><br />
<input type="submit" value="Register" name="submit" />
</fieldset>
</legend>
</form>
<?php
if(isset($_POST["submit"])){
if(!empty($_POST['user']) && !empty($_POST['pass'])) {
$user=$_POST['user'];
$pass=$_POST['pass'];
$con=mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('user_registration') or die("cannot select DB");
$query=mysql_query("SELECT * FROM login WHERE
username='".$user."'"); $numrows=mysql_num_rows($query);
if($numrows==0) {
$sql="INSERT INTO login(username,password)
VALUES('$user','$pass')"; $result=mysql_query($sql);
if($result){
echo "Account Successfully Created"; }
else {
echo "Failure!";
}
}
else {
echo "That username already exists! Please try again with
another.";
}
}
else {
echo "All fields are required!";

718CSP08-CLOUD COMPUTING (REGULATION - 2018


}
}
?>
</body>
</html>

logout.php
<? php
session_start();
unset($_SESSION[„sess_user‟]);
session_destroy();
header(“location:login.php”)
?>
member.php
<?php
session_start();
if(!isset($_SESSION["sess_user"])){
header("location:login.php");
} else {
?>
<!doctype html>
<html>
<head>
<title>Welcome</title>
<style>
body{
margin-top: 100px;
margin-bottom: 100px;
margin-right: 150px;
margin-left: 80px;

718CSP08-CLOUD COMPUTING (REGULATION - 2018


background-color: azure ;
color: palevioletred;
font-family: verdana;
font-size: 100%
}
h2 {
color: indigo;
font-family: verdana;
font-size: 100%;
}
h1 {
color: indigo;
font-family: verdana;
font-size: 100%;
}
</style>
</head>
<body>
<center><h1>CREATE REGISTRATION AND LOGIN FORM USING PHP AND

MYSQL</h1></center>

<h2>Welcome, <?=$_SESSION['sess_user'];?>! <a


href="logout.php">Logout</a></h2> <p>
WE DO IT. SUCCESSFULLY CREATED REGISTRATION AND LOGIN FORM USING
PHP AND MYSQL
</p>
</body>
</html>
<?php
} ?>

718CSP08-CLOUD COMPUTING (REGULATION - 2018


logout.php
<?php
session_start();
unset($_SESSION['sess_user']);
session_destroy();
header("location:login.php");
?>
SQL query :
CREATE TABLE IF NOT EXISTS `login` (
`username` varchar(200) NOT NULL,
`password` varchar(200) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

OUTPUT

718CSP08-CLOUD COMPUTING (REGULATION - 2018


RESULT :
Thus the program for creating user name, storing the password in sql , login using username and
password has been validated Successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
718CSP08-CLOUD COMPUTING (REGULATION - 2018
Ex.No: 10
INSTALL AND CONFIGURE GOOGLE APP ENGINE
DATE:

AIM:
To Install and Configure Google App Engine.
PROCEDURE:
1. Create a Google Cloud Platform project, if you don't have one already.
2. Make sure that Python 2.7 is installed on your system:
python -V
Note: As of Cloud SDK version 206.0.0, the gcloud CLI has experimental support for running using a
Python 3.4+ interpreter (run gcloud topic startup for exclusions and more information on configuring your
Python interpreter). All other Cloud SDK tools still require a Python 2.7 interpreter.
3. Download the archive file best suited to your operating system. Most machines will run the 64-bit package.
If you'd like to check, run uname -m to verify if you're running a 64-bit system.

PLATFORM Package Size SHA256 Checksum


Linux 64-bit google-clou 25.6 b1c87fc9451598a76cf66978dd8aa06482bfced639b56cf31559dc2c
(x86_64) d-sdk229.0. MB 7f8b7b90
0-linuxx86
_64.tar.gz

Linux 32-bit google-clou 25.2 ee8c45f8018d0fee92b07c32cc6d8c891241da0b88bfe289d4e58e67


(x86) d-sdk229.0. MB 46c3f668
0-linuxx86.
tar.gz

4. Extract the archive to any location on your file system; preferably, your Home folder. On Linux, you can
extract the archive file by running this command:
tar zxvf [ARCHIVE_FILE] google-cloud-sdk
5. If you're having trouble getting the gcloud command to work, ensure your $PATH is defined appropriately.
Use the install script to add Cloud SDK tools to your path. You will also be able to opt-in to
command-completion for your bash shell and usage statistics collection during the installation process. Run
the script using this command:
./google-cloud-sdk/install.sh

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Restart your terminal for the changes to take effect.
Alternatively, you can call Cloud SDK after extracting the downloaded archive by invoking
its executables via the full path.
Initialize the SDK
Use the gcloud init command to perform several common SDK setup tasks. These include authorizing
the SDK tools to access Google Cloud Platform using your user account credentials and setting up the default
SDK configuration.
To initialize the SDK:
1. Run the following at a command prompt:
gcloud init
Note: To prevent the command from launching a web browser, use gcloud init --consoleonly instead.
To authorize without a web browser and non-interactively, create a service account with the
appropriate scopes using the Google Cloud Platform Console and use gcloud auth activate
service-account with the corresponding JSON key file.
2. Accept the option to log in using your Google user account:
To continue, you must log in. Would you like to log in (Y/n)? Y
3. In your browser, log in to your Google user account when prompted and click Allow to grant
permission to access Google Cloud Platform resources.
4. At the command prompt, select a Cloud Platform project from the list of those where you have
Owner, Editor or Viewer permissions:
Pick cloud project to use:
[1] [my-project-1]
[2] [my-project-2]
...
Please enter your numeric choice:
If you only have one project, gcloud init selects it for you.
5. If you have the Google Compute Engine API enabled, gcloud init allows you to choose a default
Compute Engine zone:
Which compute zone would you like to use as project default?
[1] [asia-east1-a]
[2] [asia-east1-b]
...
[14] Do not use default zone
Please enter your numeric choice:
gcloud init confirms that you have complete the setup steps successfully:

718CSP08-CLOUD COMPUTING (REGULATION - 2018


gcloud has now been configured!
You can use [gcloud config] to change more gcloud settings.
Your active configuration is: [default]
Run core gcloud commands
Run these gcloud commands to view information about your SDK installation:
1. To list accounts whose credentials are stored on the local system:
gcloud auth list
gcloud displays a list of credentialed accounts:
Credentialed Accounts
ACTIVE ACCOUNT
* [email protected]
[email protected]
2. To list the properties in your active SDK configuration:
gcloud config list
gcloud displays the list of properties:
[core]
account = [email protected]
disable_usage_reporting = False
project = example-project
3. To view information about your Cloud SDK installation and the active SDK configuration:
gcloud info
gcloud displays a summary of information about your Cloud SDK installation. This includes
information about your system, the installed SDK components, the active user account and
current project, and the properties in the active SDK configuration.
4. To view information about gcloud commands and other topics from the command line:
gcloud help
For example, to view the help for gcloud compute instances create:
gcloud help compute instances create
gcloud displays a help topic that contains a description of the command, a list of command
flags and arguments, and examples of how to use it.
How to Run Program:

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Now that we have finished installing the app engine, now it’s time to create and upload an app. In this case we
will be taking an example of a “HELLO WORLD” app in python.
1. As we already have made sure that we have python installed in our system, It will be easier for us
to clone existing code and deploy it rather than creating our own so we will use python docx sample. Run the
command “git clone https://github.com/GoogleCloudPlatform/python-docssamples”.
2. cd python docs- samples/appengine/standard/hello_world
3. dev_appserver.py app.yaml

718CSP08-CLOUD COMPUTING (REGULATION - 2018


RESULT
Thus the program to Install and Configure Google App Engine is implemented successfully.
718CSP08-CLOUD COMPUTING (REGULATION - 2018
Ex.No: 11
DESIGN AN ASSIGNMENT TO RETRIEVE, VERIFY, AND STORE
DATE: USER CREDENTIALS USING FIREBASE AUTHENTICATION, THE
GOOGLE APP ENGINE STANDARD ENVIRONMENT, AND
GOOGLE CLOUD DATASTORE.

AIM:
Design an Assignment to retrieve, verify, and store user credentials using Firebase Authentication, the
Google App Engine standard environment, and Google Cloud Data store.

PROCEDURE:
Before you begin
Step-I: Install Git,
sudo apt install git-all
Step-II: Install Python 2.7
Step-III: Sign in to your Google Account.
If you don't already have one, sign up for a new account.
Step-IV: Select or create a GCP project.
Note: If you don't plan to keep the resources you create in this tutorial, create a new project instead of
selecting an existing project. After you finish, you can delete the project, removing all resources associated
with the project and tutorial.
GO TO THE MANAGE RESOURCES PAGE
Step-V: Install and initialize the Cloud SDK.
If you have already installed and initialized the SDK to a different project, set the gcloud project
to the App Engine project ID you're using for Firenotes. See Managing Cloud SDK Configurations for
specific commands to update a project with the gcloud tool.
Step-VI: Cloning the sample app
To download the sample to your local machine:
Clone the sample application repository to your local machine:
git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git
Alternatively, you can download the sample as a zip file and extract it.
Navigate to the directory that contains the sample code:
cd python-docs-samples/appengine/standard/firebase/firenotes

718CSP08-CLOUD COMPUTING (REGULATION - 2018


Step-VII: Adding the Firebase Authentication user interface
To configure FirebaseUI and enable identity providers:
1. Add Firebase to your app by following these steps:
a. Create a Firebase project in the Firebase console.
o If you don't have an existing Firebase project, click Add project and enter either an existing Google
Cloud Platform project name or a new project name.
o If you have an existing Firebase project that you'd like to use, select that project from the console.
b. From the project overview page, click Add Firebase to your web app. If your project already has an app,
select Add App from the project overview page.
c. Use the Initialize Firebase section of your project's customized code snippet to fill out the following section
of the frontend/main.js file:
GO to given Path
appengine/standard/firebase/firenotes/frontend/main.js/appengine/standard/firebase/firenotes/frontend/main.js
VIEW ON GITHUB
// Obtain the following from the "Add Firebase to your web app"
dialogue
// Initialize Firebase
var config = {
apiKey: "<API_KEY>",
authDomain: "<PROJECT_ID>.firebaseapp.com",
databaseURL: "https://<DATABASE_NAME>.firebaseio.com",
projectId: "<PROJECT_ID>",
storageBucket: "<BUCKET>.appspot.com",
messagingSenderId: "<MESSAGING_SENDER_ID>"
};
2. Edit the backend/app.yaml file and enter your Firebase project ID in the environment variables:
appengine/standard/firebase/firenotes/backend/app.yaml
VIEW ON GITHUB
runtime: python27
api_version: 1
threadsafe: true
service: backend
handlers:
718CSP08-CLOUD COMPUTING (REGULATION - 2018
- url: /.*
script: main.app
env_variables:
# Replace with your Firebase project ID.
FIREBASE_PROJECT_ID: '<PROJECT_ID>'

3. In the frontend/main.js file, configure the FirebaseUI login widget by selecting which providers you want
to offer your users.
appengine/standard/firebase/firenotes/frontend/main.js
VIEW ON GITHUB
// Firebase log-in widget
function configureFirebaseLoginWidget() {
var uiConfig = {
'signInSuccessUrl': '/',
'signInOptions': [
// Leave the lines as is for the providers you want to offer your
users.
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
firebase.auth.GithubAuthProvider.PROVIDER_ID,
firebase.auth.EmailAuthProvider.PROVIDER_ID
],
// Terms of service url
'tosUrl': '<your-tos-url>',
};
var ui = new firebaseui.auth.AuthUI(firebase.auth());
ui.start('#firebaseui-auth-container', uiConfig);
}

4. Enable the providers you have chosen to keep in the Firebase console by clicking Authentication > Sign-in
method. Then, under Sign-in providers, hover the cursor over a provider and click the pencil icon.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


● Toggle the Enable button and, for third-party identity providers, enter the provider ID and secret from
the provider's developer site. The Firebase docs give specific instructions in the "Before you begin"
sections of theFacebook, Twitter, and GitHub guides. After enabling a provider, click Save.

RESULT:
Thus the program to Design an Assignment to retrieve, verify, and store user credentials using Firebase
Authentication, the Google App Engine standard environment, and Google Cloud Data store is implemented
successfully.

718CSP08-CLOUD COMPUTING (REGULATION - 2018


718CSP08-CLOUD COMPUTING (REGULATION - 2018

You might also like