0% found this document useful (0 votes)
3 views

r

o

Uploaded by

pesonem377
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)
3 views

r

o

Uploaded by

pesonem377
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/ 50

[Type here]

CERTIFICATE

This is to certify that Mr. Tushar Kumar Saini with


enrolment no. 2303031550045 has successfully completed
his/her laboratory experiments in the OPEN SOURCE
SOFTWARE LABORATORY (303105101) from the
department of COMPUTER SCIENCE &
ENGINEERING during the academic year 2023 – 2024.

Date of Submission: ......................... Staff In charge: ...........................

Head Of Department: ...........................................

Page 1 of 50
Table of Contents

Sr. Experiment Title Page No Date of Date of Sign Marks(out


No Start submission of 10)

From To
1.
Demonstration of Basic Linux
commands.
2.
Executing C program using gcc
compiler
3.
Demonstration of gprof
command using linux
4. Create and Edit documents using
Google Docs.
5.
Create Presentations using
Google Slides.
6.
Demonstration of different
Arithmetic and Logical Formulas
using google sheets.
7.
Use of HTML to create simple
webpage.
8.
Demonstration of MathML a
markup language for
describing mathematical notation.
9.
Demonstration of virtualization
using Docker Container
10.
Demonstration GitHub Facility.

Page 2 of 50
FACULTY OF ENGINEERING AND TECHNOLOGY
BACHELOR OF TECHNOLOGY

OPEN SOURCE SOFTWARE LABORATORY


(303105103)

Ist – SEMESTER
(OPEN-SOURCE SOFTWARE LABORATORY)
Computer Science & Engineering
Department

LABORATARY MANUAL

Page 3 of 50
PRACTICAL NO:1

AIM: Demonstration of Basic Linux commands.

Command shell: A program that interprets commands is Command shell.

Shell Script: Allows a user to execute commands by


typing them manually at aterminal, or automatically in
programs called shell scripts.
A shell is not an operating system .It is a way to interface with the

operating system and runCommands. BASH (Bourne Again Shell)

∙ BashisashellwrittenasafreereplacementtothestandardBourneS
hell(/bin/sh)originally written by Steve Bournefor UNIX
systems.


IthasallofthefeaturesoftheoriginalBourneShell,plusadditionsthat
makeiteasiertoprogr amwith and use from the command line.

∙ SinceitisFreeSoftware, it has been adopted as the default shell on most


Linux systems.

BASIC LINUX COMMANDS:

1. p

wd

Pri

nt

Page 4 of 50
or

ki

ng

Di

rec

tor

yD

ES

RI

PT

IO

N:

pwd print the full directory.

SYNTAX:

pwd

EXAMPLE:

$pwd

/home/directory_name

Page 5 of 50
2. cd: Change

Di

re

cto

ry

ES

RI

PT

IO

N:

It allows you to change your working directory.You use it to move around within
hierarchy yourf
1
Filesystem.

SYNTAX:

cddirectory_name

EXAMPLE:

To Change Into“work directory”in“documents”I Need to write the following.

Page 6 of 50
Input:$cd/documents/work

3. cd..

DESCRIPTION:

Moveup onedirectory.

SYNTAX:

cd..

EXAMPLE:

If you are in work directory and want to

go to documents thenWrite cd..

Youwillendupin/documents.

4. ls

list

all
Page 7 of 50
the

files

and

dire

ctor

ies

DE

SC

RIP

TI

ON

Listallfilesandfoldersinthecurrentdirectoryinthecolumn format.

SYNTAX:

ls[options]

EXAMPLE:Using Various Options

∙ Lists the total files in the directory and subdirectories, the names
of the files in the
currentdirectory, their permissions, the number of subdirectories in
directories listed, thesize of the file,and the date last modification.

ls-l
Page 8 of 50
∙ List All Files Including Hidden Files

ls-a
you can see the whole list of files, including the hidden files.

5. cat DESCRIPTION:

Page 9 of 50
catstandsfor"catenate".Itreadsdatafromfiles,andoutputstheirco
ntents.Itisthesimplestwa yto display the contents of a file at the
command line.

SYNTAX:

cat filename

EXAMPLES:

∙ Print the contents of files mytext.txt and


your text.txt cat text.text your text.txt

∙ Print the cpu information using cat

commandcat/proc/cpuinfo

∙ Print The Memory

Information

Using Cat

Command

cat/proc/meminf

Page 10 of 50
6. Head DESCRIPTION:

head,by default, printsthefirst10linesof


eachFILEtostandardoutput.WithmorethanoneFILE,it
precedes each set of output withaheaderidentifyingthe
filename.

IfnoFILEisspecified,orwhenFILEisspecifiedasadash("-

"),head reads from standardinput. SYNTAX:

hea
d[o
ptio
n]
…[f
ile/
dire
ctor
y]

EXAMPLE:

Display firsttenlinesofmyfile.txt.

hea
dmy
file.t
xt

Page 11 of 50
7. tail

4
DESCRIPTION:

tail is a command which prints the last few number of lines (10
lines by default) of acertain file,then terminates.

SYNTAX:

tail[option]…[file/directory]

EXAMPLE:

Output the

last

100

line

s of

the

file

my

file

.txt

.tai

lm

yfil

e.tx

t-n

100
Page 12 of 50
8. mv

:Moving

(andRen

aming)Fi

les

DESCRI

PTION:

Themvcommandletsyoumoveafilefromonedirectorylocationtoanother. It
Also Lets You
Rename a file(there is no separate rename command).

SYNTAX:
mv[option]sourcedirectory

EXAMPLE:

∙ Moves the file myfile.txt

to the directory

destination

directory.mvmyfil

e.txt

destination_direct

ory

Page 13 of 50
∙ Movethefilemyfile

.txtintoth

eparentdi

rectory.

mvmyfil

e.txt../

∙ In this case, if JOE1_expenses does not exist, it


will be created with the exact
contentofjoe_expenses,and joe_expenses will
disappear.

If JOE1_expenses already exists, its content will be


replaced withthatofjoe_expenses (andjoe_expenses
willstill disappear).

mvjoe_expensesJOE1_expenses

9. m

di

Page 14 of 50
r

ir

ec

to

5
Ifthespecifieddirectorydoesnotalreadyexist, mkdir creates it.Morethannone
Page 15 of 50
Directory May beSpecified when calling mkdir.

SYNTAX:

mkdir[option]directory

EXAMPLE:

Page 16 of 50
y

o
Page 17 of 50
r

10. c

s
Page 18 of 50
D

Thecpcommandisusedtomakecopyoffilesanddirectories.

SYNTAX:

cp[option]sourcedirectory

EXAMPLE:

Creates a copy of the file in the currently working directory


named orig file. The copywill be named a new file,and will
be located in the working directory.

Cp orig file new file

Page 19 of 50
11. r

di

ir

ec

to

Page 20 of 50
R

Thermdircommandisusedtoremoveadirectorythatcontainsotherfilesordirect
ories

. SYNTAX:

rmdirectory_name

EXAMPLE:

Delete my dir directory along with all files and directories


within that directory. Here, -ris forrecursive and –fis forforcefully.

Page 21 of 50
Practical 2

AIM: Execute C Program using gcc compiler.

Step 1. Open up a terminal


Search for the terminal application in the Dash tool

Step 2. Use a text editor to create the C source code.

Type the command

gedithello.c

and enter the C source code below:

#include <stdio.h>

main()
{
printf("Hello World\n");
}

Close the editor window.

Page 22 of 50
Step 3. Compile the program.
Type the command

gcc -o hello hello.c

This command will invoke the GNU C compiler to compile the file hello.cand output (-o)
the result to an executable called hello.

Page 23 of 50
Step 4. Execute the program.

Type the command

./hello

This should result in the output


HelloWorld

Page 24 of 50
PRACTICAL :03

AIM: Demonstration of gprof command using Linux.


THEORY:
The objective of profiling is to analyze your program code and see which part of the code is
taking a large amount of time for execution such that the part of the code can be rewritten.
This will enable the program to achieve desired execution speed. In addition, profiling can
prove to be very handy in spotting codes that are potentially error-prone, and then they can be
sorted out via refactoring.
Using the gprof is quite simple. First, you need to enable the profiling when you compile the
code. Now, when you execute the program, profile data is generated. Finally, you can run the
gprof tool on the profiling data generated during execution. This will produce an analysis file.
This file contains several tables, including a flat profile and a call graph.

Enable profiling while compiling

To enable profiling while compiling, simply add the -pg option in the compilation step.
The pg flag generates extra code for profiling that is used by the gprof command. The
following command illustrates how we can compile profiling information:

$ gcc -Wall -pg program.c program_new.c -o program

Execute the code to generate profile information

The binary file generated above can be executed to generate profile information. The
following line executes the code:

$./program

This will also generate a file gmon.out in the current working directory. To see what files are
generated via execution of the above command, simply type ls as follows:

$ls

Run the gprof tool


Page 25 of 50
Now, we will run the gprof tool providing as an argument the output file and gmon.out file.
This will produce the profiling information:

$ gprof program gmon.out > analysis.txt

PROGRAM CODE:

main.c file

Page 26 of 50
foo.c file:

Foo.h file

Page 27 of 50
OUTPUT:

Page 28 of 50
Page 29 of 50
Practical 4
AIM: Create and Edit documents using Google Docs.

Step 1: Create a document


To create a new document:
1. On your computer, open the Docs home screen at docs.google.com.

2. In the top left, under "Start a new document," click Blank New.

You can also create new documents from the URL docs.google.com/create.

Page 30 of 50
Step 2: Edit and format
To edit a document:

1. On your computer, open a document in Google Docs.

2. To select a word, double-click it or use your cursor to select the text you want to change.

Page 31 of 50
3. Start editing.

4. To undo or redo an action, at the top, click Undo Undo or Redo Redo.

Page 32 of 50
 Format paragraphs or font

 Add a title, heading, or table of contents

Page 33 of 50
Step 3: Share & work with others

Page 34 of 50
Practical 5

AIM: Create Presentation using Google Slides.

Go to Google's home page and click on the grid in the upper right hand corner.
click on the Drive icon. You will be redirected to a log in page if you are signed out, if not you
will be taken to your Drive.
You can also just type in https://slides.google.com, log in if you haven't already, and will be
taken to the Slides page.

From your Drive, click the blue New button on the left side of the page. Select "Google Slides"
from the drop-down menu.
For more options, hover over the arrow on the right edge of the Google Slides option, where a
smaller drop-down menu will appear. From here you can select to create a presentation from a
template or a blank slide.

Page 35 of 50
If you are on the slides page, select an option from the top of the page to create a new slide.
You can press the white square with a plus sign for a blank slide, or click one of the templates.
Click on the Template Gallery option, where more templates will show up.

Name your slide and select a theme.

Page 36 of 50
Add new slides.

Insert images.

Page 37 of 50
Add text.

Animate.

Page 38 of 50
When you are done editing, press the share button to edit permissions for your presentation.

View the finished product by clicking "Present" on the upper right hand corner.

Page 39 of 50
Page 40 of 50
Practical 6

AIM: Demonstration of different Arithmetic and Logical Formulas using


OpenOffice Calc.
OpenOffice Calc, the spreadsheet program offered free of charge by openoffice.org, allows you
to perform calculations on data entered into the spreadsheet.

OpenOffice Calc formulas for basic number crunching, such as addition or subtraction, as well
as more complex calculations such as payroll deductions or averaging a student's test results.

In addition, if you change the data, Calc will automatically recalculate the answer without you
having to re-enter the formula.

The following step Create and use a basic formula in OpenOffice Calc.

Entering the Data

The steps used to create this formula are the same ones to follow when writing more complex
formulas. The formula will add the numbers 3 + 2. The final formula will look like this:

= C1 + C2

Page 41 of 50
Select the cell C1 and enter 3, then press Enter.

Select the cell C2 and enter 2, then press Enter.

Now select cell C3. This is where we'll enter the basic addition formula.

Page 42 of 50
When creating formulas in Open Office Calc, you always start by typing the equals sign. Type it in the
cell where you want the answer to appear.

Following the equals sign, we add in the cell references of the cells containing our data.

By using the cell references of our data in the formula, the formula will automatically update the
answer if the data in cells C1 and C2 changes.

Page 43 of 50
Practical 7

AIM: Use of HTML to create simple web page.


Step 1: Open a Text Editor (Notepad)

Step 2: Write Some HTML Code


We are now going to add the HTML boiler plate code. This is the code that will allow the browser
to correctly display your webpage.

<!DOCTYPE html>
<html>
<head>
<title>Your Title Here</title>
</head>
<body>
Your content here.
</body>
</html>

Save the html page by pressing CTRL + S or click on file option then save option. Ensure that you
name the file in the following format: “name” then “.html” examples index.html, cooking.html.

this.

Page 44 of 50
Step 3: Add the Text Content
Add the content between the body tags.

Refresh the webpage on the browser. It will look like a blob of text with no paragraphs or headings
shown below.

Step 4: Add the HTML Tags

Headings
First, we shall tackle the headings. Check which part or the text was the main heading. In our
example it is “Insect eating: The ultimate guide to eating crickets”.

Place this text between h1 tags as shown below:

<h1>Insect eating: The ultimate guide to eating crickets</h1>


Save your work and check the result on the browser.

Page 45 of 50
Paragraphs
For the paragraphs of text, place each paragraph of text between the <p></p> html tags. Example:

<p>
When you hear about eating insects most people gross out. However, Insects are
concidered a delicacy in many parts of the world. Most of the insects eaten
are farm grown but in some places, they don' shy away from eating insects
collected from the wild.
</p>
<p>Eating insects is concidered:</p>
healthy since insects have less fat content. enviromentally friendly: It takes
less amount of food/plants to rear insects compared to cows. people who don't
eat milk and meat products can try out insects as protein substitute.
View the result on the browser.

Page 46 of 50
Step 6: Add a List
Lists make reading a group of things easier on our eyes and brain. Lets add a bullet points type list:

<ul>
<li>healthy since insects have less fat content.</li>
<li>
enviromentally friendly: It takes less amount of food/plants to rear insects
compared to cows.
</li>
<li>
people who don't eat milk and meat products can try out insects as protein
substitute.
</li>
</ul>
Refresh and view the result on the browser.

Page 47 of 50
Step 7: Add Images

We are going to use the HTML’s img tag <img src="URL" alt="Shown when image cannot load"> to add
your images on the webpage.

<img
src="https://avicndugu.github.io/practice-projects-html/cricket-eating/final/img/fried-crickets.jpg"
alt="Fried crickets on display"
/>

Page 48 of 50
Step 8: Embed a Youtube Video
Search for relevant video on youtube. Once you have found it, click on share button/ link. You
will get a popup. Click on embed option.

<iframe

Page 49 of 50
width="310"
height="160"
src="https://www.youtube.com/embed/BwC4WRKi5QY"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>

Page 50 of 50

You might also like