Monday, April 23, 2018

Install google chrome in CentOS 7

Step 1: From Firefox Go to  https://www.google.com/chrome/



Step 2 : 


Click on "Download Chrome"

Step 3 : 

Select Download package:






For Centos / fedora / redhat  ... select 64.rpm 


Step 4:


Accept and Install



Step 5:

Save file to disk





Step 6:



Go to Downloads folder




Step 7:  right click and Open Terminal 







Step 8:
Run the following command int the terminal:

$ sudo yum localinstall google-chrome-stable_current_x86_64.rpm 




press y and enter 



Done !  google chrome is successfully installed.

Step 9 : run the google chrome using the following command
$ google-chrome




you can also run it from Application > Internet Menu






Enjoy!



Thursday, April 19, 2018

How To Install Nginx on CentOS 7

About Nginx

Nginx is a high performance web server software. It is a much more flexible and lightweight program than Apache HTTP Server.
This tutorial will teach you how to install and start Nginx on your CentOS 7 server.

Step One—Add Nginx Repository

To add the CentOS 7 EPEL repository, open terminal and use the following command:
sudo yum install epel-release

Step Two—Install Nginx

Now that the Nginx repository is installed on your server, install Nginx using the following yum command:
sudo yum install nginx
After you answer yes to the prompt, Nginx will finish installing on your virtual private server (VPS).

Step Three—Start Nginx

Nginx does not start on its own. To get Nginx running, type:
sudo systemctl start nginx
If you are running a firewall, run the following commands to allow HTTP and HTTPS traffic:
sudo firewall-cmd --permanent --zone=public --add-service=http 
sudo firewall-cmd --permanent --zone=public --add-service=https
sudo firewall-cmd --reload
You can do a spot check right away to verify that everything went as planned by visiting your server's public IP address in your web browser (see the note under the next heading to find out what your public IP address is if you do not have this information already):
http://server_domain_name_or_IP/
You will see the default CentOS 7 Nginx web page, which is there for informational and testing purposes. It should look something like this:
CentOS 7 Nginx Default
If you see this page, then your web server is now correctly installed.
Before continuing, you will probably want to enable Nginx to start when your system boots. To do so, enter the following command:
sudo systemctl enable nginx
Congratulations! Nginx is now installed and running!

How To Find Your Server's Public IP Address

To find your server's public IP address, find the network interfaces on your machine by typing:
ip addr
1. lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN

. . .
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

. . .
You may see a number of interfaces here depending on the hardware available on your server. The lointerface is the local loopback interface, which is not the one we want. In our example above, the eth0interface is what we want.
Once you have the interface name, you can run the following command to reveal your server’s public IP address. Substitute the interface name you found above:
ip addr show eth0 | grep inet | awk '{ print $2; }' | sed 's/\/.*$//'

Server Root and Configuration

If you want to start serving your own pages or application through Nginx, you will want to know the locations of the Nginx configuration files and default server root directory.

Default Server Root

The default server root directory is /usr/share/nginx/html. Files that are placed in there will be served on your web server. This location is specified in the default server block configuration file that ships with Nginx, which is located at /etc/nginx/conf.d/default.conf.

Server Block Configuration

Any additional server blocks, known as Virtual Hosts in Apache, can be added by creating new configuration files in /etc/nginx/conf.d. Files that end with .conf in that directory will be loaded when Nginx is started.

Nginx Global Configuration

The main Nginx configuration file is located at /etc/nginx/nginx.conf. This is where you can change settings like the user that runs the Nginx daemon processes, and the number of worker processes that get spawned when Nginx is running, among other things.

How To Create a Sudo User (Admin user) on CentOS

Introduction

The sudo command provides a mechanism for granting administrator privileges, ordinarily only available to the root user, to normal users. This guide will show you the easiest way to create a new user with sudo access on CentOS, without having to modify your server's sudoers file. If you want to configure sudo for an existing user, simply skip to step 3.

Steps to Create a New Sudo User


Step 1:  Log in to your server as the root user.
  • $ ssh root@server_ip_address
Step 2: Use the adduser command to add a new user to your system.
Be sure to replace username with the user that you want to create.
  • $ adduser username
Use the passwd command to update the new user's password.

    • $ passwd username
  • Set and confirm the new user's password at the prompt. A strong password is highly recommended!
  • Set password prompts:
    Changing password for user username. New password: Retype new password: passwd: all authentication tokens updated successfully.

Step 3: Use the usermod command to add the user to the wheel group.
  • $ usermod -aG wheel username
By default, on CentOS, members of the wheel group have sudo privileges.

Step 4:  Test sudo access on new user account
  • Use the su command to switch to the new user account.
    • $ su - username
  • As the new user, verify that you can use sudo by prepending "sudo" to the command that you want to run with superuser privileges.
    • $ sudo command_to_run
  • For example, you can list the contents of the /root directory, which is normally only accessible to the root user.
    • $ sudo ls -la /root
  • The first time you use sudo in a session, you will be prompted for the password of the user account. Enter the password to proceed.
    Output:
    [sudo] password for username:
    If your user is in the proper group and you entered the password correctly, the command that you issued with sudo should run with root privileges.

Cheers!

Wednesday, April 18, 2018

An introduction to Tmux (terminal multiplexer)

Tmux is a terminal multiplexer: it’s like a power-up for terminal programming. You can manage several terminals under a session, split terminal screens, detach and re-attach sessions and much more. If you do most of your programming at the command line, you’ll find using a terminal multiplexer invaluable.


Tmux Panes


Find more details here:
https://www.perl.com/article/an-introduction-to-tmux/

Tips:

When you open lots of terminal window it is very useful to be able to rename the Window. the default window name is big and hard to read.









Syntax :

bind-key , command-prompt -I #W "rename-window '%%'" 

E.g Ctrl +B    then comma(,)


List all the available session: 

$ tmux list-sessions                   



Kill session:

tmux kill-session -t 3



Tuesday, February 20, 2018

Software Requirement

What is a Requirement? 


One of the most critical aspects of Software Product Management deal with conditions known as requirements. Many definitions have been developed to describe “requirements.” A requirement is most easily understood as a specific description of your client’s needs, which can be used to help create a real-world product.

The Institute of Electrical and Electronics Engineers (IEEE) defines a requirement as:

1. A condition or capability needed by a user to solve a problem or achieve an objective.
2. A condition or capability that must be met or possessed by a system or system component to satisfy a contract, standard, specification, or other formally imposed documents.
3. A documented representation of a condition or capability as in (1) or (2). (IEEE, 1990). Well-defined requirements help make sure client needs are understood and addressed and also
help detect potential problems before they become large and expensive to fi

Requirements Activities 

 Requirements are established during activities at the beginning of a project. It determines the purpose of a product and how the product can meet that purpose.

This course will explore five important requirements activities:

1. Eliciting requirements
2. Expressing requirements
3. Prioritizing requirements
4. Analyzing requirements
 5. Managing requirements

With these activities, the right requirements can be established, written in proper form, and even improved


Eliciting Requirements 

The activity of eliciting requirements is an interactive and investigative process, which occurs when meeting with the client and users.  

Clients often have ideas about what features they would like in a product and what these features should look like. Many clients, however, have limited knowledge of how software is built and vague ideas regarding what makes a project successful. It can be difficult then for clients to understand what they truly require in a product. It is the role of the software product manager to help the client figure out what they “want” and what they “need.”

A “want” is usually a functionality or feature that the client would like the product to have, which may add value, but is not necessarily core to the product itself. A “need,” on the other hand, is a core functionality that the product must have in order to fulfill the product’s purpose. Needs should take priority in product development.

The best way to discover and develop “needs” and “wants” with your client is through eliciting requirements, where you engage in discussion about the product with your client. Through discussion, the software product manager and team can help provide insights on what the client “needs” and “wants” the product to do, and how these goals can be feasibly achieved. It may be that the initial vision the client had of the product will have changed, but through involvement with the software product team, any changes should feel proactive and the client should feel reassured that the team understands users’ needs.

Note that eliciting requirements as “needs” and “wants” does not necessarily mean that all the client’s features and ideas that fall in the “want” category are not doable or should be dismissed. In fact, these ideas may be very good. But it is the role of the software product manager to make sure that the goals are feasible, client expectations are realistic, and the product produced is the best possible result.




Eliciting requirements should not be confused with “requirements gathering.” “Requirements gathering” is the more passive approach of simply asking the client what they would like done, and it often puts the development team in a reactive process. Eliciting requirements, however, engages in in-depth discussion and collaboration from the start of product development, so both the client and the development team work together to build a successful product.

Expressing Requirements

 Once client needs have been established by eliciting requirements, the activity of expressing requirements comes into play. Expressing requirements involves framing the requirements identified through discussion in a way that allows a product to be built. 

Often, requirements are first described through notes from meetings with clients. From there, better and more concrete representations can be used for expressing requirements. Typical representations include use cases, user stories, or storyboards, among others. These are often tailored to the project. They could be simple or complex, textual or visual. It is up to the software product manager and team to determine and use representations that would work best for the project at hand.


Prioritizing Requirements Once a vision of what needs to be done for the project has been established through both eliciting and expressing requirements, it is important to prioritize client needs, especially in Scrum methodology.

Questions to help establish priorities include:
  •   What requirements must be completed for the project and product to be successful?
  •  What requirements should be done? In other words, what is important but is not as time-critical or could be satisfied another way or at a later time on the project?
  •  What could be done to improve the project or product but is not necessary? 


These priorities are usually only included if both time and resources allow for it.

Analyzing Requirements The process of examining the listed requirements of a project to ensure that they are clear, complete, and consistent is known as analyzing requirements. Analyzing requirements helps ensure that the product is the best one possible. It is an important process, and a constant one. A project must be continually evaluated and requirements improved as it progresses. This adaptive nature is important in Agile systems.

MORE INFORMATION

The questions outlined here closely follow the MoSCoW method of prioritization, developed by Dai Clegg. This method is used to help reach an understanding with clients on the importance of each requirement. “MoSCoW” is an acronym for the categories of “Must have”, “Should have”, “Could have” and “Would like but won’t get.” By asking the questions suggested here, requirements can be placed in these categories.




Analyzing requirements

The process of examining the listed requirements of a project to ensure that they are clear, complete, and consistent is known as analyzing requirements. Analyzing requirements helps ensure that the product is the best one possible. It is an important process, and a constant one. A project must be continually evaluated and requirements improved as it progresses. This adaptive nature is important in Agile systems. 

Analyzing requirements  helps to resolve any potential conflicting requirements or to identify problems between requirements that might not be easily seen at first glance. It also ensures that the requirements identified truly reflect and relate to the product being built.


Managing Requirements 


The activity of managing requirements is also a continuous process. It involves the organizing and re-organizing of requirements and possibly reusing subsets of requirements in different stages. It also involves keeping track of priorities, analyses, and changes in requirements. This is very important because everything is connected in a project. If something changes in one requirement, it will affect other requirements and the development of the product.

Managing requirements also means ensuring that the identified requirements are central to the many processes of product creation, including coding, testing, and change logs.



Types of Requirements 

Now that we’ve covered what requirements are and the activities involved with getting them right, let’s dive into a little more detail and introduce some different types of requirements.


  •  Business requirements
  •  Business rules 
  •  User requirements
  •  Functional requirements
  •  Non-functional requirements 
  •  External interfaces 
  •  Physical product settings 
  • Development constraints  

While business requirements and business rules can influence the project, it’s user requirements, functional requirements, and non-functional requirements that are considered the most essential requirements. Finally, external interfaces, physical product settings, and development constraints are requirements that add context for design and implementation of the product



Design Patterns

Design Patterns

In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations.

Uses of Design Patterns

Design patterns can speed up the development process by providing tested, proven development paradigms. Effective software design requires considering issues that may not become visible until later in the implementation. Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.
Often, people only understand how to apply certain software design techniques to certain problems. These techniques are difficult to apply to a broader range of problems. Design patterns provide general solutions, documented in a format that doesn't require specifics tied to a particular problem.
In addition, patterns allow developers to communicate using well-known, well understood names for software interactions. Common design patterns can be improved over time, making them more robust than ad-hoc designs.


Behavioral Patterns


  • Command
  • Iterator
  • Observer
  • Strategy
    • https://dzone.com/articles/java-the-strategy-pattern

Creational patterns


  • Abstract Factory
  • Factory Method
  • Prototype
  • Singleton

 

Structural patterns



  • Adapter
  • Bridge
  • Composite
  • Facade
  • Proxy

Software Testing

Software Testing is the process of identifying the correctness and quality of software program. The purpose is to check whether the software satisfies the specific requirements, needs and expectations of the customer. In other words, testing is executing a system or application in order to find software bugs, defects or errors. The job of testing is to find out the reasons of application failures so that they can be corrected according to requirements.

Testing Levels 

Functional Testing 

  • Unit Testing
  • Integration Testing
  • Smoke Testing
  • Sanity Testing
  • System Testing
  • Regression Testing
  • User Acceptance Testing  - UAT
    • Alpha Testing & Beta Testing
  • End-to-End Testing

Non Functional Testing 

  • Performance Testing
  • Load Testing
  • Stress Testing
  • Security Testing
  • Reliability Testing 



5 Strategies for Getting More Work Done in Less Time

Summary.    You’ve got more to do than could possibly get done with your current work style. You’ve prioritized. You’ve planned. You’ve dele...