What is WannaCry ransomware Attack

What is WannaCry ransomware Attack

It is type of malicious software program code which will affect computer and make it hostage. After that they ask for money in terms of Bitcoin transactions to release your computer software or make it old form. Basically they lock down your computer or related services that you are performing on your machine.

There are about 200,000 computers are affected due to this cyber attack. The majorly affected countries  are India, Russia, Italy, Germany, Vietnam etc..

The business area majorly affected are Hospitals, Electronics, Universities, City services, gas stations etc…

How much the WannaCry agents would have made so far – some internet reports say they made only $56,000 out of this as on Monday May 15, 2017. Indicating that very less affected people might have responded with money they asked compared to 200,000 affected computers.

The virus affected platforms are Windows Vista, Windows XP, Windows 10, Windows Server 2016, Windows Server 2012, 2012 R2 , Windows Server 2008, 2008 R2, Windows Server 2003, Windows 8.1, Windows RT 8.1, Windows 7 etc

The virus starts to encrypt local hard drives at the beginning and then it does a scan for associated network computers

The can reach via SMB in the network and affect the networked computers.

Temporary solutions or workaround to avoid virus attack

As per internet articles as below – (Disclaimer: please refer authorized articles before you perform below task, also use your discretion. I am not responsible for any other issues that may have caused due to this)

1) steps to disable the SMBV1 is temporary workaround to avoid affecting this virus until complete solution is provided by software industry experts on this virus.

i.Go to Windows Start menu’s Search box and Type “Regedit” ,

ii.click on Regedit.exe

iii.Navigate to the path “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\LanmanServer\Parameters”

there you change the Entry value “SMB1” of REG_DWORD: to 0  ( 0 means Disabled and 1 means Enabled)

Note:  If the Entry is not present, you can right click on “Parameters” and click New for “DWORD (32-bit)” Value

Name your Entry as “SMB1” and provide the value ‘0’ while creation

You may need to restart computer to take this in effect.

Note: There is an option to take a backup of registry prior doing the changes. Or later you can manually follow the above step and reverse the changes if complete patch is provided by security experts.

how to print alphabets using java programming

First Method:

char cAlpha = ‘A’;

do {
System.out.println(cAlpha );
cAlpha ++;
} while (cAlpha <= ‘Z’);

 

Second method:

char cAlpha = ‘a’;

while (cAlpha <= ‘z’) {
System.out.println(cAlpha);
cAlpha ++;
}

Third Method :

class PrintAlphabets
{
public static void main(String args[])
{
char chAlpha;

for( chAlpha= ‘a’ ; chAlpha<= ‘z’ ; chAlpha++ )
System.out.println(chAlpha);
}
}

Orthogonal array testing technique

Orthogonal array testing technique (OATS)

It is a black box testing using statistical methods to arrive the minimum number of test cases can do the maximum coverage to test scenarios/ test data,

steps:

  1. Enter column name as number of factors (e.g. header, table, middle, bottom)
  2. Find out the least number of levels or values of test data
  3. Prepare a standard orthogonal array – make sure column 1 is test case ID
  4. Remaining 4 columns are factors
  5. Then add levels and optimize the combinations array.

Java quick reference

Java quick reference

Java is object oriented(OOP) programming language. It is platform independent and can be run on any Operating system (OS) and it requires java interpreter (for bytecode to machine code transfer) in the system.

Java applets are one type of java program which is used within a web page however JSP is used to create web applications like PHP, ASP, JSP for the purpose of creating dynamic web pages. JavaBeans is like VB and it is reusable component and the purpose is to create advanced applications. J2EE is another Java program mainly used for data transfer e.g XML structured data.

Java Object:

Java object is a real world representation with its different state & behavior

Java Class:

Class is representation of objects or it is a template for objects.

Class has data members(attributes) and methods

Java constructors:

Java constructors are for initializing the objects of a class. Constructor name is same as class name and Constructors are invoked when objects are created. every class needs constructor and if we did not create one then the compiler will create default constructor. Java modifiers are not allowed for constructors. constructors cannot return values.

e.g. for parameterized constructor

class abc

{

public abc(int numb, String strval)

 {

  System.out.println(“abc is a parameterized constructor of class abc”);

 }

}

e.g. for default constructor

class abc

{

public abc()

 {

  System.out.println(“abc is a default constructor of class abc”);

 }

}

Java packages:

Java packages are group of similar classes or interfaces. Java packages are kind of containers for java classes.

Accessing a package is done by a) import package.*; or  b) import package.classname; etc

compile java files by “javac -d filename.java”

What is the difference between Web Layer (Presentation Tier) vs Application Layer (Logic Tier) vs Database Layer (Data Tier)

1. Presentation Layer is the interface to outside world e.g. web site.

2. Application Layer is a framework to create the interface to the Web site or Presentation Tier

3. Database Layer is the database and associated logic needed to query details.

Web Layer (Presentation Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains Apache web Server, Apache tomcat, Sun Java Web Server or MS Internet Information Services (IIS)

Application Layer (Logic Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains Apache tomcat, Red Hat JBoss, BEA Web Logic or IBM WebSphere app server

Database Layer (Data Tier)

Contains Virtual Machines and Physical Machines with OS can be Windows, UNIX or Linux

Contains SQL or Oracle

String reverse using java script split method

Assume given string ‘str’ value is “welcome”
 
function stringRev(str) {
var splitString = str.split(“”);// Use the reverse() method to reverse the array
var arrayReverse = splitString.reverse(); // equals to [“e”, “m”, “o”, “c”, “l”, “e”, “w”]// Use join() method to join the elements of the array into a string as below in comments
var joinArray = arrayReverse .join(“”); //  [“e”, “m”, “o”, “c”, “l”, “e”, “w”] to “emoclew”//Return the reversed string
return joinArray; // “emoclew”
}stringRev(‘welcome’);

Java quick reference

Java is object oriented(OOP) programming language. It is platform independent and can be run on any Operating system (OS) and it requires java interpreter (for bytecode to machine code transfer) in the system.

Java applets are one type of java program which is used within a web page however JSP is used to create web applications like PHP, ASP, JSP for the purpose of creating dynamic web pages. JavaBeans is like VB and it is reusable component and the purpose is to create advanced applications. J2EE is another Java program mainly used for data transfer e.g XML structured data.

 

Java Object:

Java object is a real world representation with its different state & behavior

Java Class:

Class is representation of objects or it is a template for objects.

Class has data members(attributes) and methods

Java constructors:

Java constructors are for initializing the objects of a class. Constructor name is same as class name and Constructors are invoked when objects are created. every class needs constructor and if we did not create one then the compiler will create default constructor. Java modifiers are not allowed for constructors. constructors cannot return values.

 

e.g. for parameterized constructor

 

class abc

{

public abc(int numb, String strval)

 {

  System.out.println(“abc is a parameterized constructor of class abc”);

 }

}

e.g. for default constructor

 

class abc

{

public abc()

 {

  System.out.println(“abc is a default constructor of class abc”);

 }

}

Java packages:

Java packages are group of similar classes or interfaces. Java packages are kind of containers for java classes.

 Accessing a package is done by a) import package.*; or  b) import package.classname; etc

compile java files by “javac -d filename.java”

How to print alphabets using java programming:

First Method:

char cAlpha = ‘A’;

do {
System.out.println(cAlpha );
cAlpha ++;
} while (cAlpha <= ‘Z’);

Second method :

char cAlpha = ‘a’;

while (cAlpha <= ‘z’) {
System.out.println(cAlpha);
cAlpha ++;
}

Third Method :

class PrintAlphabets
{
public static void main(String args[])
{
char chAlpha;

for( chAlpha= ‘a’ ; chAlpha<= ‘z’ ; chAlpha++ )
System.out.println(chAlpha);
}
}

 

Docker container raspberry pi

Docker container raspberry pi

Docker functions like Virtual machine but has got more merits than Virtual machines. Mainly performance and easiness of implementation. Docker manages the software infrastructure and runs as container containing the software and dependencies.  Docker image can be created which can be a software and its dependencies. This docker image can be deployed to many machine where docker is installed which will be working exactly like the source system where software and dependencies are running.

Raspberry pi is a low cost computer which runs using mobile adaptor power . Raspberry pi has multiple ports which connects to keyboard, mouse to take user inputs and output display can be connected to TV monitor using HDMI cable.

Docker image is available in Docker official website and Docker can be installed to Raspberry pi(rpi) using terminal of rpi by a single line command.

 

 

Summary of SQL

What are the SQL MAX() and MIN() Functions?

The MAX() function returns the largest value in the selected column.

The MIN() function returns the smallest value in the selected column.

SELECT MAX(Weight) AS LargestWeight

FROM CricketBats ;

SELECT MIN(Weight) AS SmallestWeight

FROM CricketBats ;

What are the SQL AVG(), COUNT() and SUM() Functions

The SQL AVG() function returns the average value in a numeric values column.

e.g.

SELECT AVG(Weight)

FROM Cricketbats;

The SQL COUNT() function returns the number of rows count that matches with a specified criteria.

SELECT COUNT(ProductID)

FROM Cricketbats;

The SQL SUM() function returns the total sum of a numeric values in a specific column.

e.g

SELECT SUM(Weight)

FROM Cricketbats;

What is SQL UPDATE Statement?

The SQL UPDATE statement is used for modifying the existing records in the selected table.

e.g as below:

UPDATE Users

SET UserContactName=’First name Last name’, City=’City1′

WHERE UserID=1;

What is SQL ORDER BY Keyword

The purpose of ORDER BY keyword is to sort the results in ascending or descending order.

example for ascending order

SELECT * FROM Users

ORDER BY State ASC;

or

SELECT * FROM Users

ORDER BY State;

example for descending order

SELECT * FROM Users

ORDER BY State DESC;

What is a NULL Value in SQL?

NULL values can not be compared using operators =, <, or <> so we will need to use the “IS NULL” or “IS NOT NULL” operators instead.

SELECT UserName, UserContactName, Address FROM Persons

WHERE Address IS NULL;

SELECT UserName, UserContactName, Address FROM Persons

WHERE Address IS NOT NULL;

What is SQL INSERT INTO Statement?

The INSERT INTO statement is used for inserting new records to a table.

e.g.

INSERT INTO Users (UserName, UserContactName, UserAddress, City, ZipCode, State, Country)

VALUES (‘Test1′,’Firstname last name’,’address 1, 2,3 ‘,’City namer’,’99999′,’Statename’,’Countryname’);

What is SQL INSERT INTO SELECT Statement?

The SQL INSERT INTO SELECT statement is used for copying data from one table and then to insert to someother table.

e.g. as below:

INSERT INTO Users (UserName, UserCity, Country)

SELECT VendorName, VendorCity, Country FROM Vendors;

What is the SQL DELETE Statement?

The SQL DELETE statement is used for deleting the existing records in the selected table.

e.g as below:

DELETE FROM Users

WHERE UserName=’Firstname1 Lastname1′;

What is AND, OR and NOT Operators in SQL

AND, OR, and NOT operators are combined with the WHERE clause to get the desired filtered results.

e.g

SELECT * FROM Users

WHERE State =’illinois’ AND City=’Chicago’;

SELECT * FROM Users

WHERE City=’Chicago’ OR City=’New York’;

SELECT * FROM Users

WHERE NOT State =’Chicago’;

What is SQL WHERE Clause?

SQL WHERE clause is used to filter records and its added as below

e.g.

SELECT States FROM Users where Usersgroup = ‘1’;

What is the SQL SELECT TOP Clause ?

The SELECT TOP clause is used to specify the number of records to return.

e.g as below:

SELECT TOP 100 * FROM Users;