Weblogic interview questions and answers
Posted by Raj
Weblogic interview questions and answers
In this article, I have selected Weblogic interview questions and answers for freshers and experienced candidates.This article includes weblogic admin interview questions,weblogic server interview questions and weblogic portal interview questions and answers.
The system that loads the class files is called the classloader.
2.Startup and shutdown classes
startup classes - classs files that need to be loaded/executed while the server is booting up.
shutdown classes - weblogic server runs shutdown classes before shutting down the server.
3.There is one test.class file in lib folder and second one in some other folder, which class will be loaded?
if both directories are in the CLASSPATH both will be loaded.
4.How to search a word in zip file
using pgrep
5.What are the different activities involved in performance tuning?
6.Difference between load balance and failover?
7.What is virtual host?
8.What is eden size and perm size?
9.What is Work manager?
10.What is Weblogic shrink?
11.What is diff b/w JNDI and JDBC?
12.How to find Weblogic Version?
13.What is the use of log4j?
14.What are the different types of drivers?
2.How will you configure Node Manager as Windows Service?
3.Explain about Weblogic server Log Message Format?
4.How many log Message Severity levels are there in Weblogic?
5.How can you specify the logging implementation in Weblogic?
6.What are the default Weblogic provided Groups for security realm?
7.What are the default Weblogic provided Roles for security realm?
8.What are the elements of the Administration console?
9.What are the Tool Bar elements in Weblogic?
10.How will you enable the Administration Console?
2.What are components of weblogic portal?
3.How to create streaming portal?
4.What is the difference between Genes and chromosomes?
5.What is the difference between skin and skeleton?
6.What is shell?
7.Difference types of portlets?
8.portlet states Types?
9.What is the difference between URL instance and URLConnection instance?
10.What are the features of portal?
11.What is backing file?
12.What are portlet modes?
In this article, I have selected Weblogic interview questions and answers for freshers and experienced candidates.This article includes weblogic admin interview questions,weblogic server interview questions and weblogic portal interview questions and answers.
Weblogic admin interview questions and answers
1.Class loaderThe system that loads the class files is called the classloader.
2.Startup and shutdown classes
startup classes - classs files that need to be loaded/executed while the server is booting up.
shutdown classes - weblogic server runs shutdown classes before shutting down the server.
3.There is one test.class file in lib folder and second one in some other folder, which class will be loaded?
if both directories are in the CLASSPATH both will be loaded.
4.How to search a word in zip file
using pgrep
5.What are the different activities involved in performance tuning?
6.Difference between load balance and failover?
7.What is virtual host?
8.What is eden size and perm size?
9.What is Work manager?
10.What is Weblogic shrink?
11.What is diff b/w JNDI and JDBC?
12.How to find Weblogic Version?
13.What is the use of log4j?
14.What are the different types of drivers?
weblogic server interview questions and answers
1.What is the Node Manager Default Behavior?2.How will you configure Node Manager as Windows Service?
3.Explain about Weblogic server Log Message Format?
4.How many log Message Severity levels are there in Weblogic?
5.How can you specify the logging implementation in Weblogic?
6.What are the default Weblogic provided Groups for security realm?
7.What are the default Weblogic provided Roles for security realm?
8.What are the elements of the Administration console?
9.What are the Tool Bar elements in Weblogic?
10.How will you enable the Administration Console?
Weblogic portal interview questions and answers.
1.What is the difference between a website and a portal?2.What are components of weblogic portal?
3.How to create streaming portal?
4.What is the difference between Genes and chromosomes?
5.What is the difference between skin and skeleton?
6.What is shell?
7.Difference types of portlets?
8.portlet states Types?
9.What is the difference between URL instance and URLConnection instance?
10.What are the features of portal?
11.What is backing file?
12.What are portlet modes?
C Program to print star pattern pyramid
Posted by Raj
C Program to print star pattern pyramid form
In this article,I will show how to write C program to print Star Pattern pyramid form.
Example: Print Star pattern in C
#include
#include
void main()
{
int s=5,a,b,c,n=0;
clrscr();
for(a=1; a<=s; a++)
{
if(a%2!=0)
{
n=(s-a)/2;
for(c=0; c
{
printf<<(" ");
}
for(b=0; b
{
printf<<(" * ");
}
printf<<("\n");
}
}
getch();
}
OUTPUT:
*
* * *
* * * * *
In this article,I will show how to write C program to print Star Pattern pyramid form.
Example: Print Star pattern in C
#include
#include
void main()
{
int s=5,a,b,c,n=0;
clrscr();
for(a=1; a<=s; a++)
{
if(a%2!=0)
{
n=(s-a)/2;
for(c=0; c
{
printf<<(" ");
}
for(b=0; b
{
printf<<(" * ");
}
printf<<("\n");
}
}
getch();
}
OUTPUT:
*
* * *
* * * * *
Turbo C Shortcut Keys
Posted by Raj
Turbo C Shortcut Keys - Computer Keyboard Shortcuts
In this article,I will explain how to use keybord Shortcut Keys in Turbo C.we have to use Keyboard Shortcut Keys to Speed up progamming skills.I have selected list of most commonly-used keyboard shortcut keys for turbo C and C++.
Shortcut Keys used in turbo c programming
Shortcut Keys(Hot Keys) Operation
In this article,I will explain how to use keybord Shortcut Keys in Turbo C.we have to use Keyboard Shortcut Keys to Speed up progamming skills.I have selected list of most commonly-used keyboard shortcut keys for turbo C and C++.
Shortcut Keys used in turbo c programming
Shortcut Keys(Hot Keys) Operation
- Alt + F - Open file
- Alt + F3 - Close
- Alt + F + N - New file
- Alt + X - Exit turbo c
- Alt + F5 - Output Screen
- Alt + F + L - Check programme load or not.
- Alt + ENTER - Full screen
- Shift + Del - Cut
- Shift + Insert - Paste
- Ctr + Insert - Copy
- Alt+F9 - Compile a program
- Ctr + F8 Bbreak point
- Ctrl+F9 - To run a program
- Ctrl+s - To save a program
- Alt + BkSp - Undo
- Ctr + K + H - Deselect point
- Shift + Alt + BkSp - Redo
- Ctr + Del - Clear.
- Ctr + Y - Delete Line
- Alt + F7 - Previous Error
- Alt + F8 - Next Error
- Ctr + F2 - Program reset
- F1 - Help
- F2 - Save file
- F3 - Open file
- F5 - Minimize/Maximize
- F6 - Jump From One file to another
- F7 - Debug
- F8 - Step Over
- CTRL + KB - point to the start of a line to copy.
- CTRL + KK - point to the end of the line to copy.
- CTRL + KC - line of text to copy.
- CTRL + KV - PASTE
JQuery interview questions and Answers
Posted by Raj
JQuery interview questions and Answers Advanced (Multiple Choice)- JQuery Quiz.
In this tutorial, I have selected advanced and basic Jquery Interview questions and answers with examples for freshers and 1 to 3 year experienced candidates.I have also included Objective Jquery ajax interview questions.
Advanced JQuery interview questions and Answers:
What is Jquery?
jQuery is a JavaScript Library.
Which of the following is correct?
jQuery is a JavaScript Library
jQuery is a JSON Library
Answer :jQuery is a JavaScript Library
jQuery uses CSS selectors and XPath expressions to select elements?
False
True
Answer: True
Which sign does jQuery use as a shortcut for jQuery?
$ sign
% sign
? Sign
Answer: $ sign
Is jQuery a W3C standard?
Yes
No
Answer: NO
$("span"). What does it select?
All span elements
The first span element
Answer: All span elements
Is jQuery a library for client scripting or server scripting?
Client scripting
Server scripting
Answer: Client scripting
Is it possible to use jQuery together with AJAX?
Yes
No
Answer: Yes
The jQuery html() method works for both HTML and XML documents
True
False
Answer :False
jQuery code to set the background color of all span elements to blue?
$("span").style("background-color","blue");
$("span").manipulate("background-color","blue");
$("span").css("background-color","blue");
$("span").layout("background-color","blue");
Answer: $("span").css("background-color","blue");
$("span.intro"). What does it select?
The first span element with class="intro"
The first span element with id="intro"
All span elements with id="intro"
All span elements with class="intro"
Answer: All span elements with class="intro"
jQuery method to hide selected elements?
visible(false)
hidden()
display(none)
hide()
Answer: hide()
jQuery method to set one or more style properties for selected elements?
style()
css()
html()
Answer: css()
jQuery method is used to perform an asynchronous HTTP request?
jQuery.ajaxAsync()
jQuery.ajaxSetup()
jQuery.ajax()
Answer: jQuery.ajax()
What scripting language is jQuery written in?
VBScript
C++
JavaScript
C#
Answer: JavaScript
$("div#id1 .cl1"). What does it select?
The first element with id="cl1" inside any div element with class="id1"
All elements with class="cl1" inside the first div element with id="id1"
All div elements with id="id1" or class="cl1"
Answer: All elements with class="cl1" inside the first div element with id="id1"
Difference between onload() and document.ready() function used in jQuery?
JQuery Methods used to provide effects?
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()
What are the different type of selectors in Jquery?
1. CSS Selector
2. XPath Selector
3. Custom Selector
What does .size() method of jquery return ?
.size() method of jquery returns number of element in the object.
How do you get the text value?
$("#textbox1").val();
How do you check or uncheck a checkbox input or radio button?
1.$('#num1').attr('checked', true);// Check #num1
2.$('#num1').attr('checked', false);// Uncheck #num1
3.$("#num1").attr('checked', 'checked');// Check #num1
4.$("#num1").removeAttr('checked');// Uncheck #num1
Ajax Request in Jquery
$.ajax({
url: 'test.php',
success: function(response) {
alert(response);
},
error: function(res) {
alert(res.status);
}
});
Explain the each() function.
$("#num").click(function(){
$("li").each(function(){
document.write($(this).text())
});
});
In this tutorial, I have selected advanced and basic Jquery Interview questions and answers with examples for freshers and 1 to 3 year experienced candidates.I have also included Objective Jquery ajax interview questions.
Advanced JQuery interview questions and Answers:
What is Jquery?
jQuery is a JavaScript Library.
Which of the following is correct?
jQuery is a JavaScript Library
jQuery is a JSON Library
Answer :jQuery is a JavaScript Library
jQuery uses CSS selectors and XPath expressions to select elements?
False
True
Answer: True
Which sign does jQuery use as a shortcut for jQuery?
$ sign
% sign
? Sign
Answer: $ sign
Is jQuery a W3C standard?
Yes
No
Answer: NO
$("span"). What does it select?
All span elements
The first span element
Answer: All span elements
Is jQuery a library for client scripting or server scripting?
Client scripting
Server scripting
Answer: Client scripting
Is it possible to use jQuery together with AJAX?
Yes
No
Answer: Yes
The jQuery html() method works for both HTML and XML documents
True
False
Answer :False
jQuery code to set the background color of all span elements to blue?
$("span").style("background-color","blue");
$("span").manipulate("background-color","blue");
$("span").css("background-color","blue");
$("span").layout("background-color","blue");
Answer: $("span").css("background-color","blue");
$("span.intro"). What does it select?
The first span element with class="intro"
The first span element with id="intro"
All span elements with id="intro"
All span elements with class="intro"
Answer: All span elements with class="intro"
jQuery method to hide selected elements?
visible(false)
hidden()
display(none)
hide()
Answer: hide()
jQuery method to set one or more style properties for selected elements?
style()
css()
html()
Answer: css()
jQuery method is used to perform an asynchronous HTTP request?
jQuery.ajaxAsync()
jQuery.ajaxSetup()
jQuery.ajax()
Answer: jQuery.ajax()
What scripting language is jQuery written in?
VBScript
C++
JavaScript
C#
Answer: JavaScript
$("div#id1 .cl1"). What does it select?
The first element with id="cl1" inside any div element with class="id1"
All elements with class="cl1" inside the first div element with id="id1"
All div elements with id="id1" or class="cl1"
Answer: All elements with class="cl1" inside the first div element with id="id1"
Difference between onload() and document.ready() function used in jQuery?
- We can add more than one document.ready() function in a page.
- we can have only one onload function.
- Document.ready() function is called as soon as DOM is loaded.
- body.onload() function is called when everything (DOM, images..)gets loaded on the page.
JQuery Methods used to provide effects?
1. Show()
2. Hide()
3. Toggle()
4. FadeIn()
5. FadeOut()
What are the different type of selectors in Jquery?
1. CSS Selector
2. XPath Selector
3. Custom Selector
What does .size() method of jquery return ?
.size() method of jquery returns number of element in the object.
How do you get the text value?
$("#textbox1").val();
How do you check or uncheck a checkbox input or radio button?
1.$('#num1').attr('checked', true);// Check #num1
2.$('#num1').attr('checked', false);// Uncheck #num1
3.$("#num1").attr('checked', 'checked');// Check #num1
4.$("#num1").removeAttr('checked');// Uncheck #num1
Ajax Request in Jquery
$.ajax({
url: 'test.php',
success: function(response) {
alert(response);
},
error: function(res) {
alert(res.status);
}
});
Explain the each() function.
$("#num").click(function(){
$("li").each(function(){
document.write($(this).text())
});
});
One to One relationship example in database
Posted by Raj
One to One relationship example in database(oracle, MYSQL, SQl, Ms access)
In this Article, I will explain how to create one to one relationship between two tables.In a relational database such as Mysql,SQl,Ms access, you can create relationships between pairs of tables like..
1.one-to-one
2.one-to-many
3.many-to-many.
One-to-one relationships in a relational database:
one-to-one relationships are bidirectional relationships.each row in one database table is linked to one and only one other row in another table.
An example of a one-to-one relationship is a Person can have only one Passport and that a Passport can belong to only one Person.
we are designing Database with a One To One Relationship between Person and Passport Table.
You may not use one-to-one relationships very usually, but you should know how to create them.
There are other types of database relationships, one to many and many to many relationships.
In this Article, I will explain how to create one to one relationship between two tables.In a relational database such as Mysql,SQl,Ms access, you can create relationships between pairs of tables like..
1.one-to-one
2.one-to-many
3.many-to-many.
One-to-one relationships in a relational database:
one-to-one relationships are bidirectional relationships.each row in one database table is linked to one and only one other row in another table.
An example of a one-to-one relationship is a Person can have only one Passport and that a Passport can belong to only one Person.
we are designing Database with a One To One Relationship between Person and Passport Table.
You may not use one-to-one relationships very usually, but you should know how to create them.
There are other types of database relationships, one to many and many to many relationships.
MySql queries interview questions and answers
Posted by Raj
MySql queries interview questions and answers - MySql Database Tutorial
MySql queries Interview Questions & Answers
In this section, I have selected advanced MYSQL queries interview questions and answers for all levels of candidates(entry level, advanced level, expert level).Last few months I have been working to select best MYSQL queries for MYSQL interview questions.
This article introduces MYsql Database queries:
Suppose we have to tables
1.Employee
2.Employee Salary
CREATE TABLE `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`photo` varchar(100) DEFAULT NULL,
`first_name` varchar(100) DEFAULT NULL,
`last_name` varchar(100) DEFAULT NULL,
`gender` varchar(11) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
employees
id name
1 Admin
2 Employee1
3 Employee2
4 Employee3
5 Employee4
CREATE TABLE `employee_salary` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`employee_id` int(10) DEFAULT NULL,
`salary` varchar(50) DEFAULT NULL,
`created_on` datetime DEFAULT NULL,
`created_by` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1
id employee_id salary
1 1 10000
2 2 20000
3 3 10000
4 4 40000
5 5 30000
1. Find Second highest paid employees withou using LIMIT function.
Query:
SELECT MAX(salary) FROM employee_salary WHERE salary <(SELECT MAX(salary) FROM employee_salary)
2.Skip repeating values
Query:
SELECT salary FROM employee_salary GROUP BY salary
3.Reset Auto-increment next value
Query:
ALTER TABLE tablel SET AUTO_INCREMENT=val;
4.Find the Size of database
Query:
SELECT
s.schema_name AS 'database',
SUM(t.data_length) AS DATA,
SUM( t.index_length ) AS INDEXES,
SUM(t.data_length) + SUM(t.index_length) AS 'Mb Used',
IF(SUM(t.data_free)=0,'',SUM(t.data_free)) AS 'Mb Free',
COUNT(table_name) AS TABLES
FROM information_schema.schemata s
LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema
GROUP BY s.schema_name
5.First and Last Date of Month
Last day of next month:
SELECT LAST_DAY (DATE_ADD(CURDATE(), INTERVAL 30 DAY))
Last day of Previous month:
SELECT LAST_DAY (DATE_SUB(CURDATE(), INTERVAL 30 DAY))
First day of next month
SELECT CONCAT(LEFT(CURDATE() + INTERVAL 1 MONTH, 8), '01');
6.Display every Nth row
Query:
SELECT id
FROM employees
GROUP BY id
HAVING MOD(id, N) = 0;
7.Age in years
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS('1991-07-01')), '%Y') + 0;
8.Difference between two dates
SELECT DATEDIFF('2002-07-15','2001-07-15')
9. Update Table using Join
UPDATE employee e LEFT JOIN employee_salary s ON e.id=s.employee_id
SET s.salary='50000'
where e.first_name='Admin'
10. DELETE Table using Join
Delete employee_salary FROM employee_salary LEFT JOIN employee ON employee.id=employee_salary.employee_id
WHERE employee.first_name='Admin'
MySql queries Interview Questions & Answers
In this section, I have selected advanced MYSQL queries interview questions and answers for all levels of candidates(entry level, advanced level, expert level).Last few months I have been working to select best MYSQL queries for MYSQL interview questions.
This article introduces MYsql Database queries:
Suppose we have to tables
1.Employee
2.Employee Salary
CREATE TABLE `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`photo` varchar(100) DEFAULT NULL,
`first_name` varchar(100) DEFAULT NULL,
`last_name` varchar(100) DEFAULT NULL,
`gender` varchar(11) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`mobile` varchar(100) DEFAULT NULL,
`password` varchar(100) DEFAULT NULL,
`active` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=latin1
employees
id name
1 Admin
2 Employee1
3 Employee2
4 Employee3
5 Employee4
CREATE TABLE `employee_salary` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`employee_id` int(10) DEFAULT NULL,
`salary` varchar(50) DEFAULT NULL,
`created_on` datetime DEFAULT NULL,
`created_by` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=32 DEFAULT CHARSET=latin1
id employee_id salary
1 1 10000
2 2 20000
3 3 10000
4 4 40000
5 5 30000
1. Find Second highest paid employees withou using LIMIT function.
Query:
SELECT MAX(salary) FROM employee_salary WHERE salary <(SELECT MAX(salary) FROM employee_salary)
2.Skip repeating values
Query:
SELECT salary FROM employee_salary GROUP BY salary
3.Reset Auto-increment next value
Query:
ALTER TABLE tablel SET AUTO_INCREMENT=val;
4.Find the Size of database
Query:
SELECT
s.schema_name AS 'database',
SUM(t.data_length) AS DATA,
SUM( t.index_length ) AS INDEXES,
SUM(t.data_length) + SUM(t.index_length) AS 'Mb Used',
IF(SUM(t.data_free)=0,'',SUM(t.data_free)) AS 'Mb Free',
COUNT(table_name) AS TABLES
FROM information_schema.schemata s
LEFT JOIN information_schema.tables t ON s.schema_name = t.table_schema
GROUP BY s.schema_name
5.First and Last Date of Month
Last day of next month:
SELECT LAST_DAY (DATE_ADD(CURDATE(), INTERVAL 30 DAY))
Last day of Previous month:
SELECT LAST_DAY (DATE_SUB(CURDATE(), INTERVAL 30 DAY))
First day of next month
SELECT CONCAT(LEFT(CURDATE() + INTERVAL 1 MONTH, 8), '01');
6.Display every Nth row
Query:
SELECT id
FROM employees
GROUP BY id
HAVING MOD(id, N) = 0;
7.Age in years
SELECT DATE_FORMAT(FROM_DAYS(TO_DAYS(NOW()) - TO_DAYS('1991-07-01')), '%Y') + 0;
8.Difference between two dates
SELECT DATEDIFF('2002-07-15','2001-07-15')
9. Update Table using Join
UPDATE employee e LEFT JOIN employee_salary s ON e.id=s.employee_id
SET s.salary='50000'
where e.first_name='Admin'
10. DELETE Table using Join
Delete employee_salary FROM employee_salary LEFT JOIN employee ON employee.id=employee_salary.employee_id
WHERE employee.first_name='Admin'
XSS Prevention in PHP Cheat sheet pdf - Cross Site Scripting examples
Posted by Raj
XSS Prevention in PHP Cheat sheet pdf - Cross Site Scripting examples
XSS (Cross Site Scripting) Prevention in PHP
In this Article,I will show how to prevent XSS in PHP. Cross Site Scripting occurs, when an attacker uses a Web Application to send a malicious script(Javascript,VBScript,HTMl Script), Most often Malicious Data comes from the HTTP request.This script can access cookies,sessions and other information stored by your browser.These scripts even change the content of HTML Page.
There are Two types of XSS Attackes:
1.Stored XSS Attackes: Malicious code permanantly stored on server such as in Database ,Comment..etc
2.Reflected XSS Attacks: Injected Code reflected off the Web server such as error message,Search results..etc
- Untrusted User Input Data:
Most often Malicious Data comes from the HTTP request.Never trust data coming from the user.you should not insert or send it anywhere without taking steps to make sure that any attacks are detected .you have to validate all user input data using PHP functions before Insert into database or send it to anywhere.
- Validation:
Validate all user input data ($_GET, $_POST, $_REQUEST, $_COOKIE) using Regular expressions,Javascript and PHP functions to prevent XSS attacks.
- Some PHP functions that helps you to prevent XSS attacks
1.htmlspecialchars: htmlspecialchars Converts all special characters to HTML entities.(<, >, &, ‘, “.).
2.strip_tags: Used to strip HTML and PHP tags from a string.
3.mysql_real_escape_string: Escapes special characters in a string for use in an MySQL statement
4.Encode URL Query String Parameters.
- You can use htmlentities and stripslashes php functions for Retrieving and Displaying the Data From the Database.
- Use Escape methods (HTML Escape,Javascript Escape,CSS Escape) for XSS (Cross Site Scripting) Prevention.
- Always Use XHTML.
I hope This article will help you to prevent XSS Attacks.
For more Inforamation about XSS Cheat sheet click here
XSS (Cross Site Scripting) Prevention in PHP
In this Article,I will show how to prevent XSS in PHP. Cross Site Scripting occurs, when an attacker uses a Web Application to send a malicious script(Javascript,VBScript,HTMl Script), Most often Malicious Data comes from the HTTP request.This script can access cookies,sessions and other information stored by your browser.These scripts even change the content of HTML Page.
![]() |
1.Stored XSS Attackes: Malicious code permanantly stored on server such as in Database ,Comment..etc
2.Reflected XSS Attacks: Injected Code reflected off the Web server such as error message,Search results..etc
XSS (Cross Site Scripting) Prevention in PHP Cheat sheet:
- Untrusted User Input Data:
Most often Malicious Data comes from the HTTP request.Never trust data coming from the user.you should not insert or send it anywhere without taking steps to make sure that any attacks are detected .you have to validate all user input data using PHP functions before Insert into database or send it to anywhere.
- Validation:
Validate all user input data ($_GET, $_POST, $_REQUEST, $_COOKIE) using Regular expressions,Javascript and PHP functions to prevent XSS attacks.
- Some PHP functions that helps you to prevent XSS attacks
1.htmlspecialchars: htmlspecialchars Converts all special characters to HTML entities.(<, >, &, ‘, “.).
2.strip_tags: Used to strip HTML and PHP tags from a string.
3.mysql_real_escape_string: Escapes special characters in a string for use in an MySQL statement
4.Encode URL Query String Parameters.
- You can use htmlentities and stripslashes php functions for Retrieving and Displaying the Data From the Database.
- Use Escape methods (HTML Escape,Javascript Escape,CSS Escape) for XSS (Cross Site Scripting) Prevention.
- Always Use XHTML.
I hope This article will help you to prevent XSS Attacks.
For more Inforamation about XSS Cheat sheet click here
Mobile phone number validation regex in php - Regex for Indian Phone Numbers
Posted by Raj
Mobile phone number validation regex in php - Regex for Indian Phone Numbers
In this article,I will explain how to validate Mobile phone number using regex in php.I have written simple php script using regular expression to validate all mobile phone numbers.
e.g.+910000000000,0000000000,910000000000,+91 0000000000,+91-0000000000...etc
PHP regular expressions help your application to validate Mobile Numbers,Emails,phone numbers,..etc.
The first sign (^) represents that it is the beginning of the string and ($) represents the end of the string.
I have a function which checks to see if a Indian telephone/Mobile number is valid or not.
Example: Regular Expression Mobile Number Validation in PHP
<?php
$mobile="910000000001";
function phoneNumbervalidation($mobile)
{
if(preg_match('/^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1})?([0-9]{10})$/', $mobile,$matches)){
print_r($matches);
return true;
}
else
return false;
}
phoneNumbervalidation($mobile);
?>
I hope above example will help you to validate Indian Mobile numbers.You can refer above Regular expressions to validate international phone numbers.
In this article,I will explain how to validate Mobile phone number using regex in php.I have written simple php script using regular expression to validate all mobile phone numbers.
e.g.+910000000000,0000000000,910000000000,+91 0000000000,+91-0000000000...etc
PHP regular expressions help your application to validate Mobile Numbers,Emails,phone numbers,..etc.
The first sign (^) represents that it is the beginning of the string and ($) represents the end of the string.
I have a function which checks to see if a Indian telephone/Mobile number is valid or not.
Example: Regular Expression Mobile Number Validation in PHP
<?php
$mobile="910000000001";
function phoneNumbervalidation($mobile)
{
if(preg_match('/^((\+){0,1}91(\s){0,1}(\-){0,1}(\s){0,1})?([0-9]{10})$/', $mobile,$matches)){
print_r($matches);
return true;
}
else
return false;
}
phoneNumbervalidation($mobile);
?>
I hope above example will help you to validate Indian Mobile numbers.You can refer above Regular expressions to validate international phone numbers.
Convert string to date in Javascript /Jquery
Posted by Raj
Convert string to date in Javascript /Jquery
In this article,I will explain how to convert string to date in Javascript/Jquery. You can use the JavaScript Date Object to convert the string to Date in JavaScript.
JavaScript supports the following Date formats :
MM/dd/yyyy
MMMM dd, yyyy
MMM dd, yyyy
MM-dd-yyyy
yyyy/MM/dd
we have to convert a string date to a Javascript Date object.
Example:String to Date Conversion using JavaScript
<!DOCTYPE html>
<html>
<title>Convert string to date in Javascript</title>
<body>
<script type="text/javascript">
function showDate(){
var d=document.getElementById('date').value;
var d1 = Date.parse(d);
var dt=new Date(d1);
alert(dt);
alert("Date : " + dt.getDate());// Date
alert("Month : " + dt.getMonth());// Month
alert("Year : " + dt.getFullYear()); //Year
var x = document.getElementById("result");
x.innerHTML="Date:"+dt+"<br> Date : " + dt.getDate()+" <br> Month : " + dt.getMonth()+" <br> Year : " + dt.getFullYear();
//There are four ways of initiating a date:
//new Date() // current date and time
//new Date(milliseconds) //milliseconds since 1970/01/01
//new Date(dateString)
//new Date(year, month, day, hours, minutes, seconds, milliseconds)
}
</script>
<table>
<tr>
<td> Date:</td><td><input type='text' name='date' id='date'> </td>
</tr>
<tr>
<td colspan=2 align=center><input value="Convert" type=button onclick='javascript:showDate()' /></td>
</tr>
</table>
<p id="result"></p>
</body>
</html>
In this article,I will explain how to convert string to date in Javascript/Jquery. You can use the JavaScript Date Object to convert the string to Date in JavaScript.
JavaScript supports the following Date formats :
MM/dd/yyyy
MMMM dd, yyyy
MMM dd, yyyy
MM-dd-yyyy
yyyy/MM/dd
we have to convert a string date to a Javascript Date object.
Example:String to Date Conversion using JavaScript
<!DOCTYPE html>
<html>
<title>Convert string to date in Javascript</title>
<body>
<script type="text/javascript">
function showDate(){
var d=document.getElementById('date').value;
var d1 = Date.parse(d);
var dt=new Date(d1);
alert(dt);
alert("Date : " + dt.getDate());// Date
alert("Month : " + dt.getMonth());// Month
alert("Year : " + dt.getFullYear()); //Year
var x = document.getElementById("result");
x.innerHTML="Date:"+dt+"<br> Date : " + dt.getDate()+" <br> Month : " + dt.getMonth()+" <br> Year : " + dt.getFullYear();
//There are four ways of initiating a date:
//new Date() // current date and time
//new Date(milliseconds) //milliseconds since 1970/01/01
//new Date(dateString)
//new Date(year, month, day, hours, minutes, seconds, milliseconds)
}
</script>
<table>
<tr>
<td> Date:</td><td><input type='text' name='date' id='date'> </td>
</tr>
<tr>
<td colspan=2 align=center><input value="Convert" type=button onclick='javascript:showDate()' /></td>
</tr>
</table>
<p id="result"></p>
</body>
</html>
I hope this example will help you to Convert string to date in Javascript
JQuery Change background color based on radio button Click Event - JQuery Script
Posted by Raj
JQuery Change background color based on radio button Click Event-JQuery Script
In this article,I will Explain how to change background colour based on Radio button value in JQuery and how to use Radio button Click event using Javascript.I want to change the background Colour to the latest radio button clicked value.
I have written radio buttons background color change script using JQuery.
Example:Change div /Span background Colour color with active chcecked radio button.
<!DOCTYPE html>
<html>
<title>how to change the background color of a radio button.<</title>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<form>
<div>
<DIV><b>Change background color on radio select</b></DIV>
<div>
<input type="radio" name="1" value="Red" class="hi">
<span id="Red">Red</span>
</div>
<div>
<input type="radio" name="1" value="Green" class="mid">
<span id="Green">Green</span>
</div>
<div>
<input type="radio" name="1" value="Blue" class="lo">
<span id="Blue">Blue</span>
</div>
</div>
</form>
<script>
$("input").click(function() {
$("span").css('background','white');
var id=$(":checked").val();
$('#'+id).css('background',id);
});
</script>
</body>
</html>
OUTPUT
In this article,I will Explain how to change background colour based on Radio button value in JQuery and how to use Radio button Click event using Javascript.I want to change the background Colour to the latest radio button clicked value.
I have written radio buttons background color change script using JQuery.
Example:Change div /Span background Colour color with active chcecked radio button.
<!DOCTYPE html>
<html>
<title>how to change the background color of a radio button.<</title>
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
</head>
<body>
<form>
<div>
<DIV><b>Change background color on radio select</b></DIV>
<div>
<input type="radio" name="1" value="Red" class="hi">
<span id="Red">Red</span>
</div>
<div>
<input type="radio" name="1" value="Green" class="mid">
<span id="Green">Green</span>
</div>
<div>
<input type="radio" name="1" value="Blue" class="lo">
<span id="Blue">Blue</span>
</div>
</div>
</form>
<script>
$("input").click(function() {
$("span").css('background','white');
var id=$(":checked").val();
$('#'+id).css('background',id);
});
</script>
</body>
</html>
OUTPUT
Set cron job in linux Server using PHP Script
Posted by Raj
Set cron job in linux Server using PHP Script
In this Article,I will show how to set cron job in linux using PHP Script.we can execute a Linux Cron Jobs Every Second Using Crontab.we can also schedule tasks on Linux using crontab.I have written PHP Script to set cronjob on linux server.
Example: Set cron job in linux Server using PHP Script
<?php
$vpath= str_replace("\\","/",$local_ directory=dirname(__FILE__));
/*
Minute :(0-59)
Hour: (0-23)
Day of Month: (1-31)
Month : (1-12)
Day of Week:(0-6)
*/
// Suppose we have to set a cronjob to run every 10 minutes
$schedule="10 * * * *"; //`Minute` `Hour` `Day of month` `Month` `Day of Weeek`
$cron_path="cron/test_cron. php";
$cron_path=$vpath."/$cron_ path";
$cron_string=$schedule." php -q ".$cron_path;
// e.g. :php -q /home/test/public_html/cron/ test.php
$data=$cron_string;
$cronFile ="/var/spool/cron/root";
$fl = fopen($cronFile, 'w') or die("can't open file");
$data = $data;
fwrite($fl, $data);
fclose($fl);
?>
Difference between HTML 4 and HTML5
Posted by Raj
Difference between HTML 4 and HTML5
In this article, I will explain Main difference between HTML 4 and HTML5
HTML:
New Features are included in HTML5.
1.The <video> and <audio> element.
2.<article>,<footer>,<header>
3.The <canvas>element for 2D Drawing.
4.New Form controls like Calendar,date,time...etc
5.Full CSS3 Support
6.Video and Audio
7.2D/3D Graphics
8.Local Storage
9.Local SQL Database
10.Web Applications
Some elements are removed from HTML5:
<applet>,<basefont>,<big>,<center>,<dir>,<font>,<frame>,<frameset>,<noframes>,<strike>,<tt>
In this article, I will explain Main difference between HTML 4 and HTML5
HTML:
- HTML is the core language of the World Wide Web.
- HTML is used to build static webpages.
- HTML is Case-Insensitive
- HTML5 is the latest version of HTML and XHTML.
- HTML5 is the fifth major revision of HTML,CSS3, and JavaScript APIs
- HTML5 introduces many new features to create apps and websites with the speed, performance.
- HTML5 has separate conformance requirements for authors and user agents there is no longer a need for marking features "deprecated".
- HTML5 allows for MathML and SVG elements.
- In HTML5 no necessary to add the type attribute to your link and script tags.
- In HTML5 there is only one declaration
- All Major Browsers(Firefox,Internet Explorer, Opera, Safari, Chrome) supports HTML5 features.
New Features are included in HTML5.
1.The <video> and <audio> element.
2.<article>,<footer>,<header>
3.The <canvas>element for 2D Drawing.
4.New Form controls like Calendar,date,time...etc
5.Full CSS3 Support
6.Video and Audio
7.2D/3D Graphics
8.Local Storage
9.Local SQL Database
10.Web Applications
Some elements are removed from HTML5:
<applet>,<basefont>,<big>,<center>,<dir>,<font>,<frame>,<frameset>,<noframes>,<strike>,<tt>
Group Discussion topics for it companies - latest MBA,CAT GD topics
Posted by Raj
Group Discussion topics for it companies - latest MBA,CAT GD topics
In this article, I have selected latest Group Discussion Topics for interview in IT Companies.It will be helpful for all levels of candidates(fresher and experienced).Last few months I have been working to select best Group Discussion Topics set for IT Companies.
list of Current Group Discussion Topics for it companies:
In this article, I have selected latest Group Discussion Topics for interview in IT Companies.It will be helpful for all levels of candidates(fresher and experienced).Last few months I have been working to select best Group Discussion Topics set for IT Companies.
list of Current Group Discussion Topics for it companies:
- How to Deal with High Petrol Prices?
- Indian Economy
- Is Globalization Really Necessary?
- Is the Lokpal Bill Good for India?
- Should INDIA the dialouge policy with PAKISTAN??
- Passive smoking is equally harmful.
- Indian Cricket team.
- Corruption and Democracy.
- Indian Premier League.
- Impact of recession on IT.
- Cell phone should allowed in college or not.
- Impact Of Television Channels In Cross Cultural Tolerance.
- Can India Become a Global Power Ahead of China,US.
- BPO’s in India.
- Women are good managers.
- The role of NGOs in economics and politics.
- Current politics of India .
- The future of Indian IT industry.
- Women's reservation.
Computer Science Paper Presentation Topics-Recent Paper Presentations
Posted by Raj
Computer Science Paper Presentation Topics-Recent Paper Presentations
In this Article,I have selected advanced Computer Science Paper Presentation Topics,Latest Technical Paper Presentation Topics for Computer science.
COMPUTER SCIENCE PAPER PRESENTATION TOPICS:
In this Article,I have selected advanced Computer Science Paper Presentation Topics,Latest Technical Paper Presentation Topics for Computer science.
COMPUTER SCIENCE PAPER PRESENTATION TOPICS:
- Curl: A Gentle Slope Language For The Web
- Multiple client’s communication
- Mobile Paradigm
- Embedded Configurable Operating system
- Concurrent Programming and Parallel distributed O.S.
- Data over Cable System (DOCSIS)
- Multimedia Broadcasting via Satellite
- GRASSHOPPER Operating System
- Fluorescent Multilayer Optical Data Storage
- LOC technology (Lab On a Chip)
- Gesture recognition
- Data Warehouse
- Internet Searching
- Digital Media Broadcasting
- Real Time Operating System
- Cyborgs
- Object oriented technologies
- Advanced Databases
- Image processing and applications
- Mobile Networking
- Natural Language Processor
- Advanced algorithms
- Neural networks and applications
- Software advances in wireless communication
- Data Mining and Data Warehousing
- Image processing in computer vision
- Pervasive computing
- Distributed and parallel systems
- Elliptical Curve Cryptography(ECC)
- Main memory databases
- Java Messaging Service (JMS)
- Digital Media Broadcasting
- Micro Mouse
- Media gateways
- DataBase Migration
- Knowledge discovery and data mining
- Plasmonics
- Nano-technology and application
- ATM networks
- Network security
- Generic algorithm
- Atm, wap, bluetooth
- Reconfigurable computing
- Nanocomputing
- Mobile Computing
- Encrypted Text chat Using Bluetooth
- Firewalls
- Fusion Memory
- Honeypots
- Internet Networking
- GSM Security And Encryption
- Internet Cryptopraphy
- Cryogenic Processor
- Java Class Loader
- High Performance Computing
- Distributed Firewalls
- Micro Total analysis systems
- MPEG-7
- Hyper-Threading Technology
- Information Extraction modes & techniques
- Earth Simulator- Fastest Supercomputer
- Computational neuroscience
- Gnu Emacs
- Cyber Crime and Security
- Embedded Linux
- Intel MMX Technology
- Future of business Computing
- Multiple Domain Orientation
- Distributed database management system
- multimedia-oriented web based instructional system
- Molecular Keypad Lock
- Light Pen
- Distributed and Parallel Computing
- Fuzzified Computer-Automated Crane Control System
- Improving tcp performance over mobile ad hoc networks
- Microcontroller Based Power Theft Identification
- Global Positioning System
- Mining the Web: Searching, Integration and Discovery
- Global System for Mobiles
- Intelligent RAM : IRAM
- Image compression
- Future of Satellite Communication
- Form Processing
- Computer Forensics
- iSCSI: The future of Network Storage
- Introduction to LaTeX
- Dynamic spectrum access
- DNA Computing
- Data Management in Sensor Networks
- Digital Imaging
- Distributed computing
- High Altitude Aeronautical Platforms
- Magnetic RAM
- Grid Data Farm for Petascale
- Dual Energy X-ray Absorptiometry
- Cluster computing
- HAVi: Home Audio Video Interoperability
- GABOR Wavelet
- Co-operative LINUX
- Epsilon nets and transversal of hypergraphs
- Future of the internet
- Datagram Congestion Control Protocol (DCCP)
- Mobile Networking
- Mobile agent
- Data Mining concepts & Models
- Future Programming Techniques and Concepts
- Cyborgs
- Computational Photography
- MAC address
- Management Information System
- HomeRF- localized wireless technology optimized for the home environment
- E-wallet
- Mobile Infrastructure Management
- Digital Visual Interface
- Holographic Versatile Disc
- Computational Intelligence and Linguistics
- Internet Telephony
- Mesh Based Geometric data processing
- Integrating Structural Design and Formal Methods in RealTime System Design
- Content Management
- Mobile ad hoc network
- High Speed Data In Mobile Networks
- Fiber optic communication
- Mobile Casts
- High Performance DSP Architectures
- Managing Data with emerging technologies
- Facial Recognition System
- Flexible CRT Displays
- Java Cryptography Architecture (JCA)
- Fluorescent Multilayer Disc (FMD)
- Mobile Library Management
- eXtensible Bindings Language (XBL)
- MANET:-The Art of Networking without a Network
- JIRO – Java-based technology
- IDMA – Future of Wireless Technology
- Computer vision
- Digital audio
- Graphical Processing Unit
- Ext3 Filesystem
- Evolutionary Programming
- Crusoe Processors
- Encrypted Hard disks
- Cross Platform Component Object Model
- Micro Hard disk Drives
- Genetic Programming
- Fingerprint recognition system by neural networks
- Digital Rights Management
- Knowledge discovery and Data Mining
- Mobile Computing
- Grid Computing
- Image processing and applications
- Generic algorithm
- Digital Signal Processing and their applications
- Data Mining and Data Warehousing
- Microcontroller Based Automation
- Clustering
- DNA Based computer
- Micro chip production using extreme uv lithography
- Mail server Management
- MIMO
- Genetic Algorithm
Linux command to check the number connections to port
Posted by Raj
Linux command to check the number connections to port
In this tutorial, I will explain how to check the number of connections to port using linux command.
check the number of connections to database
Command :netstat -antp | grep :3306 | wc -l
//3306 is Mysql port Number
check the number of connections to FTP
Command :netstat -antp | grep :21 | wc -l
//21 is FTP port number
Some Important Linux Port Numbers:
21 => FTP
443 =>HTTP Secure
22 => SSH
23 = > Telnet
2086 = > CPANEL WHM
2087 = > CPANEL WHM - Secure/SSL
2095 = > cpanel webmail
111 = > rpcbind
953 = > rndc
143 = > IMAP Protocol
993 = > IMAP Secure
3306 = > MysQL Server
4643 = > Virtuosso Power Panel
2082 = > CPANEL
2083 = > CPANEL - Secure/SSL
Plesk Control Panel = > 8443
DirectAdmin Control Panel = > 2222
Webmin Control Panel = > 10000
2096 = > cpanel webmail - secure/SSL
25 = > SMTP Mail Transfer
43 = > WHOIS service
53 = > name server (DNS)
80 = > HTTP (Web server)
110 = > POP protocol (for email)
995 = > POP over SSL/TLS
9999 = > Urchin
In this tutorial, I will explain how to check the number of connections to port using linux command.
check the number of connections to database
Command :netstat -antp | grep :3306 | wc -l
//3306 is Mysql port Number
check the number of connections to FTP
Command :netstat -antp | grep :21 | wc -l
//21 is FTP port number
Some Important Linux Port Numbers:
21 => FTP
443 =>HTTP Secure
22 => SSH
23 = > Telnet
2086 = > CPANEL WHM
2087 = > CPANEL WHM - Secure/SSL
2095 = > cpanel webmail
111 = > rpcbind
953 = > rndc
143 = > IMAP Protocol
993 = > IMAP Secure
3306 = > MysQL Server
4643 = > Virtuosso Power Panel
2082 = > CPANEL
2083 = > CPANEL - Secure/SSL
Plesk Control Panel = > 8443
DirectAdmin Control Panel = > 2222
Webmin Control Panel = > 10000
2096 = > cpanel webmail - secure/SSL
25 = > SMTP Mail Transfer
43 = > WHOIS service
53 = > name server (DNS)
80 = > HTTP (Web server)
110 = > POP protocol (for email)
995 = > POP over SSL/TLS
9999 = > Urchin
Write to a google spreadsheet using php Script
Posted by Raj
Write to a google spreadsheet using php Script
In this article,I will explain how to write to a google docs spreadsheet using php Script.
I have written simple PHP Script to create a new google spreadsheet using MYSQL Database data.
You can Write/Save any type of files(e.g. *.txt,*.doc,*.csv......etc) to a google Docs Spreadsheet using below Script.
Suppose you want to write to a Google Spreadsheet from a PHP script. Here's an example.
writeSpreadheet.php
createxls.php
I hope this example will help you to write google Spreadsheets.
Cheer :)
In this article,I will explain how to write to a google docs spreadsheet using php Script.
I have written simple PHP Script to create a new google spreadsheet using MYSQL Database data.
You can Write/Save any type of files(e.g. *.txt,*.doc,*.csv......etc) to a google Docs Spreadsheet using below Script.
![]() |
| Google Spreadsheet |
Suppose you want to write to a Google Spreadsheet from a PHP script. Here's an example.
writeSpreadheet.php
<?php
/*Author: Rajesh S(rajeshstutorials.blogspot.com)
*/
ini_set('max_execution_time', 3600);
ini_set("display_errors","1");
/************************************ Login Process at google Doc
*******************************************************/
// Construct an HTTP POST request
$client_url = "https://www.google.com/accounts/ClientLogin";
$client_post = array(
"accountType" => "HOSTED_OR_GOOGLE",
"Email" => "test@gmail.com",
"Passwd" => "test",
"service" => "writely",
"source" => "Reports"
);
// Initialize the curl object
$curl = curl_init($client_url);
// Set some options (some for SHTTP)
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $client_post);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
// Execute
$response = curl_exec($curl);
// Get the Auth string and save it
preg_match("/Auth=([a-z0-9_\-]+)/i", $response, $matches);
$auth = $matches[1];
echo "The auth string is: " . $auth."
";
/********************Login Process at google Doc close*******************************************************/
$address_url="http://localhost/createxls.php";
curl_setopt($curl, CURLOPT_URL, $address_url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$data = curl_exec($curl);
$filesize=strlen($data);
$title = "test.tsv";
$headers = array(
"Authorization: GoogleLogin auth=" . $auth,
"GData-Version: 3.0",
"Content-Length: ". $filesize,
"Content-Type: text/plain",
"Slug: ". $title
);
curl_setopt($curl, CURLOPT_URL, "
https://docs.google.com/feeds/default/private/full");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$response = curl_exec($curl);
echo $response."
";
curl_close($curl);
?>
createxls.php
<?php
$host="localhost";
$username="root";
$password="";
$dbname="mydb";
$conn = mysql_connect($host,$username,$password,true);// Connection with
localhost
$db = mysql_select_db($dbname, $conn) or die ("Couldn't select database.");
header("Content-Type: text/plain");
$flag = false;
$result="SELECT `first_name`, `email`, `mobile` FROM `employees` ";
$query=mysql_query($result,$conn);
if(mysql_num_rows($query)>0)
{
while(($rows = mysql_fetch_assoc($query)))
{
$row = array
(
"EmpName" => $rows['first_name'], "Email" => $rows['email'], "Mobile" =>
$rows['mobile']
);
if(!$flag)
{
echo implode("\t", array_keys($row)) . "\n";
$flag = true;
}
echo implode("\t", array_values($row)) . "\n";
}
}
else
{
echo "No data found";
}
?>
I hope this example will help you to write google Spreadsheets.
Cheer :)
Configure ssh server on Ubuntu Linux - Setup OpenSSH Server on Redhat,fedora
Posted by Raj
Configure ssh server on Ubuntu Linux - Setup OpenSSH Server on Redhat,fedora
In this article,I will explain how to setup OpenSSH Server on Redhat,fedora,Ubuntu Linux.
1. Open Terminal and login as root user.
2.Run below command from a terminal window to install SSH Server
# sudo apt-get install ssh.
3.Type the following two command to install both ssh client and server:
# sudo apt-get install openssh-server openssh-client
4. Type the following command to Test.
# ssh localhost
The authenticity of host ‘localhost (127.0.0.1)’ can’t be established.RSA key fingerprint is 98:8a:b8:b2:9e:8a:84:e0:d4:08:27:fb:74:f0:de:d4.Are you sure you want to continue connecting (yes/no)?
5.Type yes to continue
6. Ctrl-C to stop.
7. Done.
In this article,I will explain how to setup OpenSSH Server on Redhat,fedora,Ubuntu Linux.
1. Open Terminal and login as root user.
2.Run below command from a terminal window to install SSH Server
# sudo apt-get install ssh.
3.Type the following two command to install both ssh client and server:
# sudo apt-get install openssh-server openssh-client
4. Type the following command to Test.
# ssh localhost
The authenticity of host ‘localhost (127.0.0.1)’ can’t be established.RSA key fingerprint is 98:8a:b8:b2:9e:8a:84:e0:d4:08:27:fb:74:f0:de:d4.Are you sure you want to continue connecting (yes/no)?
5.Type yes to continue
6. Ctrl-C to stop.
7. Done.
Difference between BOOL BIT and TINYINT in MySQL?
Posted by Raj
Difference between BOOL BIT and TINYINT in MySQL?
BOOL:
BOOL is used to store Boolean values (0 and 1)
0 being false and 1 being true.
TINYINT:
- A TINYINT is an 8-bit integer value
- A very small integer value. (range is -128 to 127) and unsigned range is 0 to 255 occupies 1 byte.
BIT:
- A BIT field can store between 1 to 64 bits [ BIT(N)] (N indicates the number of bits per value, from 1 to 64)
- BIT data type can be used only for binary data.
- BIT data type can store up to 8 bytes.
Prior to MySQL 5.0.3: BOOL, BIT and TINYINT are all synonyms.After MySQL 5.0.3: BIT data type can store 8 bytes of data and should be used for binary data.
BOOL:
BOOL is used to store Boolean values (0 and 1)
0 being false and 1 being true.
TINYINT:
- A TINYINT is an 8-bit integer value
- A very small integer value. (range is -128 to 127) and unsigned range is 0 to 255 occupies 1 byte.
BIT:
- A BIT field can store between 1 to 64 bits [ BIT(N)] (N indicates the number of bits per value, from 1 to 64)
- BIT data type can be used only for binary data.
- BIT data type can store up to 8 bytes.
Prior to MySQL 5.0.3: BOOL, BIT and TINYINT are all synonyms.After MySQL 5.0.3: BIT data type can store 8 bytes of data and should be used for binary data.
shell script to check whether a string is palindrome or not -Unix Program
Posted by Raj
shell script to check whether a string is palindrome or not -Unix Program
In this Tutorial, I will explain how to write shell script to check whether a string is palindrome or not.
Program: shell script to identify the given string is palindrome or not?
In this Tutorial, I will explain how to write shell script to check whether a string is palindrome or not.
Program: shell script to identify the given string is palindrome or not?
clear echo"Enter string:" read str str1=$str i='expr$str| wc-c' s='expr$i-1 While [$s-gt 0] do n='expr $str|cut-c$s' j=$r$n s='expr$s-1 done echo $j if[$str1==$j] then echo"String is palindrome" else echo"Not palindrome" fi
FIND_IN_SET() - Mysql String Function
Posted by Raj
FIND_IN_SET() - Mysql String Function
FIND_IN_SET() is used to find string within another string containing comma-separated values.
FIND_IN_SET() function Return the first occurence of the first string within the second string .
This function Returns 0 when search string does not exist in the string, and Returns NULL if either string is NULL.
Syntax:
FIND_IN_SET (string, list)
Examples:
mysql> SELECT FIND_IN_SET('d','a,b,c,d,e,f,g,h');
-> 4
mysql> SELECT FIND_IN_SET(NULL,'a,b,c,d,e,f,g,h');
-> NULL
mysql> SELECT FIND_IN_SET('z','a,b,c,d,e,f,g,h');
->0
FIND_IN_SET() is used to find string within another string containing comma-separated values.
FIND_IN_SET() function Return the first occurence of the first string within the second string .
This function Returns 0 when search string does not exist in the string, and Returns NULL if either string is NULL.
Syntax:
FIND_IN_SET (string, list)
Examples:
mysql> SELECT FIND_IN_SET('d','a,b,c,d,e,f,g,h');
-> 4
mysql> SELECT FIND_IN_SET(NULL,'a,b,c,d,e,f,g,h');
-> NULL
mysql> SELECT FIND_IN_SET('z','a,b,c,d,e,f,g,h');
->0











