Thursday, December 31, 2015

How to install Mongo DB in Fedora?

Steps

  1. curl -o http://downloads.mongodb,org/linux/mongodb-linux-i686-2.6.3.tgz
  2. tar -zxvf mongodb-linux-i686-2.6.3.tgz
  3. mkdir -p mongodb
  4. cp -R -h mongodb-linux-i686-2.6.3/ mongodb  (to create the target folder)
Switch to the root user
mkdir -p /data/db
Create a mongodb.conf file and save it in /etc folder.
Create a folder named "mongodb" in /var/log

Then use below command

mongod --config /etc/mongodb.conf

After then
enter mongo in terminal to work on mongodb.

Monday, November 16, 2015

How to write a simple HTML?

<!Doctype html>
<html>
<head>
<title>This is the first html</title>
</head>
<body>
<h1> Hello World </h1>
<p> Hiiiiiiii, This is the begining of learning HTML </p>
</body>
</html>


Doctype tag describes that this is a html document. This tag helps browser to display webpage correctly.
<html> tag describes that this is html document.
<head> is for the details about the document.
<title> is for page title.
<body> describes the visible page content.
<h1> is for heading
<p> is for paragraph.


You can save above html code as somename.html. You can open it in any browser.
It will display

Hello World

Hiiiiiiii, This is the begining of learning HTML 

Versions of HTML

There have been many versions of HTML from the early days.
HTML in 1991
HTML 2.0 in 1995
HTML 3.2 in 1997
HTML 4.01 in 1999
XHTML in 2000
HTML 5.0 in 2014

Friday, October 23, 2015

How to use LEFT JOIN and RIGHT JOIN in mysql?

Assume that there are two tables Employees and Department.
Employees has employee_id, department_id, name, ......(employee_id is unique for Employees table)
Department has department_id, department_name, employee_id........(department_id is unique for Department table)

Get the Employees as the left table and Department as the right table.

Assume that you want to know the department name of each employees.
So what we can use to find the department name of each employees? LEFT JOIN or RIGHT JOIN?

First you have to know about LEFT JOIN and RIGHT JOIN before use them.

LEFT JOIN
It takes all the rows of left table. If the condition is true then it add right table column values to left table and make a single table. If the condition is false the column values come from right table will be NULL.


RIGHT JOIN
It takes all the rows of right table. If the condition is true then it add left table column values to right table and make a single table. If the condition is false the column values come from left table will be NULL.

For above example we need all the employees and the department name each employee is working
When we consider the Employees table as the left table the we can use LEFT JOIN

example:

SELECT department_name FROM Employees LEFT JOIN Department ON Employees.department_id=Department.department_id;

If there is a department_number in Employees table which is not in Department table then it will return NULL for department_name.

You can use RIGHT JOIN here using Department table as the left table and Employees table as the right table.


Thursday, October 22, 2015

How to install Xmind in Fedora (Xmind with deb package)?

Download the Xmind
Go to the downloaded Xmind directory.
Then do the following steps.

1. ar -x Xmind-linux-3.3.1.2201212250020-i386.deb
2. tar xvf data.tar.gz
3. cp -r usr/local/xmind/ /usr/local/
4. cp usr/share/mime/packages/xmind.xml /usr/share/applications
5. cp usr/share/applications/xmind.desktop /usr/share/applications/
6. tar -zxvf control.tar.gz
7. chmod 755 postinst
8. ./postinst

Thursday, October 8, 2015

පොතක් ගැන බිඳක්  - සසර සර (රමණි බුලත්සිංභල)

රමණි බුලතිසිණ්හල මහත්මිය විසින් ලියන ලද සසර සර නවකතාව ආත්ම දෙකක් පසුබිම් කරගෙන ලියන ලද්දකි. මෙම පොත කොටස් දෙකකින් සමන්විත වේ. අවසානය දක්වාම එක ලෙස රසවිදිය හැකි කතාවකි. එතුමියගේ භාෂා විලාසයද සිත් ගන්නා සුළුය. අනූෂා, අනූෂරී, කාවින්ද හා ශාවින්ද යන චරිත වල පෙර ආත්මයෙන් ගෙන එන චරිත ලක්ෂණ සහ කතාව ගලායන ආකාරය ආකර්ෂණීයය.  කාල වකවානූ දෙකකදී ගලා යන කතාවකි. පොතේ අවසානය දක්වාම පාඨකයාව කුතුහලයෙන් රදවා තබයි. කතාව පුරාවටම යුගයන් දෙකක සහ විවිධ සමාජ මට්ටම් වල සිටින පුද්ගලයකගේ හැසිරීම් රටාවන් මනාව විස්තර කොට ඇත. සෑම දෙනාටම එක සේ කියවා රසවිදිය හැකි පොතකි.

Tuesday, October 6, 2015

How to create a user in MySQL?

CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

For 'user' you can give any name. 'localhost' should be the IP address of your machine. If you are going to work on your own machine then  you can keep localhost as it is. Or you can use '127.0.0.1'. If you want to work on other PC then you have to give the IP  address of that machine instead of 'localhost'.

For 'password' you can give any password.

Monday, September 21, 2015

What is All in one?

This blog contains with lots of things. Books, Stamps, Nature, IT etc..........