Thursday, October 15, 2015

Linux Interview Questions and Answers part3

1.A technician is going to install Linux on a workstation. The technician wants to customize the installation. What type of installation will the technician use to customize the installation?
Ans:- Only a custom installation can be used to customize what is installed during an installation. A custom installation will allow you to choose what packages you want to install and what packages you don’t want to install.

2.Where is the default location of passwd file in linux?
Ans:- The password file for Linux is located by default in the /etc/passwd location.

3.Which program is mostly used for remote login securely in Linux?
Ans:- SSH is used for secure login. SSH is the replacement of old unsecure services like telnet.

4.What command should you use to activate a swap partition?
Ans:- swapon command is used to activate the swap partition.

5. What command should you use to activate a swap partition?
Ans:- swapon command is used to activate the swap partition.

6. A technician is verifying the network configuration of a Linux server. Which command he should used to accomplish this?
Ans:- ifconfig is the proper command to examine network configuration.

7. A technician wants to assign IP addresses to all the systems that will connect to the server automatically. What type of server he should set up?
Ans:- He should set up DHCP Server which assigns IP address to client automatically on start up.

8. A technician wants to add a new user to the current domain. What command will the technician use to accomplish this?
Ans:- He should use useradd command followed by the username will create a new user or update default new user information. You need to specify the password separately with the passwd command.

9. What option a technician can use with usermod command to unlock to user’s password?
Ans:- The -U option is used with usermod command to unlock the user’s password.

10. What option of the mkfs command should you use to check the device for bad blocks before building the file system?
Ans:- The –c option when used with the mkfs command will check the device for bad blocks before building the file system.

11. What at command argument will send mail to the user when the job has completed, even if there was no output?
Ans:- -m argument with at command will send mail to the users when the job has completed even if there was no output.

12. A user wants to verify the current active shell. Which command will he use?
Ans:- He should use the env command to verify the current active shell

13.What command can a technician use to search for a specific file?
Ans:- He can use either find or locate command to search for a specific file.

14.How can you send the output of a file to another file?
Ans:- The > option is used to send the output of a file to another file.

15.What is the -t option with fsck command used for?
Ans:- The –t option used with fsck is used to specify the type of filesystem to be checked.

16.Which utility should you use to display the CPU processes?
Ans:- top utility lets you see all on one screen how much memory and CPU usage that you are currently using, and also the resource usage by each program and process.

17. A technician wants to delete the a user account. Which command should he use?
Ans:- The userdel command is used to delete a user from the system.

18.Which command is used to change from one directory to another?
Ans:- cd command is used to navigate the Linux hierarchical file system structure, use the cd command to change from one directory to another.

19. A user wants to copy a file from the /tmp directory to the his home directory. Which command would he use?
Ans:- He can use cp command to copy the files from one directory other directory.

20. What is the file extension of Red Hat Package manager?
Ans:- RPM extension is associated with the Red Hat Package manager

21. What command can you use to mount a CD-ROM drive?
Ans:- mount command will mount the CD-ROM.
mount -t iso9660 /dev/cdrom /media/

22. Which command a user can use to exit a login shell?
Ans:- The logout or exit command will exit him from a login shell.

23. A technician is having problems connecting to a mail server. What command can he use to test if the mail server is on the network?

Ans:- He can use ping command to test connectivity between local system and remote server.

Linux Interview Questions and Answers part2


1. You are tasked to build a new Linux workstation. User wants to install a word processor and spreadsheets that offers a similar version for Microsoft Windows system. Which office suite should you install?
Ans:- You should use Apache OpenOffice. Its free and open source project. And works fine on both Window and Linux systems.

2. A technician uses the ps command to see what processes are running. When the current running processes are shown, he notices a process that he terminated 10 minutes ago by using the kill command is still running. What command should he use next to terminate this process?
Ans:- He should use -9 argument with kill command that will send a kill signal to the process. This will terminate the specific process immediately.

3. A technician quickly notices a kernel error message on the screen during the boot process. Unfortunately, the error message disappear so quickly for the technician to read it all. What log directory can the technician use to examine boot-time messages?
Ans:- Linux system keeps almost all log files under the /var/log directory. Most of the boot messages 
are kept in buffer, which can be accessed by using the dmesg command. He can examine the /var/log/dmesg.log file. For boot time message he can also check the /var/log/boot.log file.

4. A technician wants to view a list of all running processes on the server. How can he do this?
Ans:- He should use the ps command with -ef argument. ps -ef command will show a list of all running process.

5. Where inittab file is located?
Ans:- Default location of inittab file is /etc directory. This file describes which process would be start at boot time.

6. A technician want to boot the system in CLI mode on start up. Which runlevel should he assign and in which file ?
Ans:- He could assign runlevel 3 as the default runlevel in /etc/inittab file.

7. What program a technician can use to analyze program’s core dump files and to debug the application while it is actually running?

Ans:- He can use gdb program to analyze program’s core dump files and also debug the application while it is actually running.

8. As a technician you want to shutdown the Linux system. What command should you use?
Ans:- You could use shutdown command. shutdown -h now

9.  As a technician you need to perform a scheduled shutdown that will occur in 10 minutes. What should you use to shut down the server in 10 minutes.?
Ans:- You can use -h argument with shutdown command which allows you to specify the time in second. To shutdown the system in 10 minute you should run shutdown -h 600 command.

10. What command will halt the system?
Ans:- halt will halt the system.

11. As a technician you need to restart the Apache Web Server. What command should you use.?
Ans:- You could use following command to restart the Apache web server.
#service httpd restart    or /etc/init.d/httpd restart

12. Which command will restart the FTP Server?
Ans:- #service vsftpd restart  or /etc/init.d/vsftpd restart
Above command will restart the FTP server.

13. What line printer control command is used to control the operation of the line printer system?
Ans:- lpc command is used with various argument to control the operations of line printer system.

14. A technician wants to terminate an active spooling daemon on the local host immediately and then disables printing for the specified printers. What command should he use?
Ans:- He should use lpc command with abort options. lpc abort lpc abort terminates an active spooling daemon on the local host immediately and then disables printing for the specified printers,

15. What print command stops a spooling daemon after the current job completes and disables printing?
Ans:- The lpc stop command stops a spooling daemon after the current job completes and disables printing

16. What command allows you to directly see what jobs are currently in a printer queue?
Ans:- The lpc command allows you to directly see what jobs are currently in a printer queue

17. A technician wants to halt the Linux server. What command should he use ?
Ans:- He can use init 0 command to halt the Linux server.

18. What line printer command lets you remove print jobs from the printer queue?
Ans:- The lprm command will let you remove print jobs from the printer queue.

19. What is the default text editor of Linux which include almost every version of Linux?
Ans:- Default editor of Linux is vi editor that can used to edit any ASCII text.

20. What command is used for combining a large number of files into one single file for archival to tape?
Ans:- vi is a text editor that can be used to edit any ASCII text. It is especially useful for editing programs.

21. Where do all your configurations for your services, programs, and daemons reside by default?
By default, all configurations for your services, programs, and daemons reside in the /etc directory.

22. What type of backup tape will only back up files that have changed since the previous backup and clear the archive bit?
Ans:- An Incremental backup will backup only files that have changed since the previous backup and clear the archive bit.

23. Which argument is used with tar command to create a new archive file?
-c argument is used to create new archive file.

24. Which argument is used with tar command to extract the files from archive ?
Ans:-  x argument is used with tar command to extract the files form archive.

25. What is default name of super or administrator account name in Linux?

Ans:- Super or administrator account in Linux is known as root user.

Wednesday, September 23, 2015

Explain each system calls used for process management in linux ?


Process management uses certain system calls. 

They are explained below.

1. fork () is used to create a new process.
2. exec () is used to run a new program.
3. wait () is used to make the process to wait.
4. exit () is used to terminate the process.
5. getpid () is used to find the unique process id.
6. getppid () is used to find the parent process id.
7.  nice () is used to bias the currently running process property.


Saturday, September 19, 2015

List of Free And Open Source Monitoring System

The Linux monitoring systems are often used to follow system resources, such as CPU load, the amount of free RAM, network traffic statics or memory consumption. Which are ones from the most important tasks for every administrators. Furthermore, those tools notify the network administrator (via email, SMS or other alarms) when something interrupts or goes down which makes their life easier.

From those monitoring tools we will list the 7 most important in this article which will be described and identified by giving their features and mentioning their current version.

Nagios:

One from the most known, open source, powerful monitoring systems nowadays is Nagios. It enables organizations to identify and resolve IT infrastructure problems before affecting critical business processes.

Nagios is licensed under GNU General Public License which gives you permission to copy, broadcast and/or change it under certain conditions obviously. For more details, you can check the license as either as by using the LICENSE file of the Nagios distribution or by reading the online version of license.
Concerning its features we can list the following:
Ø  Monitor network services (SMTP, POP3, HTTP, NNTP, and PING), applications, operating systems, network protocols and system metrics with the same tool.
Ø  Detect infrastructure outages rapidly and send e-mail, SMS or call phone notifications to the right people when a problem is detected.
Ø  Define network host hierarchy
Ø  Users can easily develop their own services due to the simple plugin design of Nagios.
Ø  Ability to check the current network status, notifications and problem history
Ø  Open source software, full access to source code, licensed under GPL.
Seriously, Nagios is one awesome IT infrastructure monitoring tool which I strongly recommend it for every administrator wishes to make his work easier and organized but it is good also to use it with other monitoring tools since Nagios doesn’t show any graphs such as the network interface.

Cacti:

Cacti is another monitoring system licensed also under GPL but unlike Nagios, Cacti is a network graphing solution designed to exploit the power of RRDTool in storing data and building graphs.

It enables users to view CPU load graphs, RAM usage and other information collected from different hosts. Like Nagios, Cacti supports SNMP that makes it possible to monitor: Linux’s, BSD’s and windows hosts.
We can list the following features of Cacti:
Ø  Unlimited number of graph items.
Ø  Graph data can be manipulated using the CDEF math functions built in RRDTools.
Ø  Support all RRDTool’s graph items including AREA, STACK, LINE, COMMENT, VRULE, and HRULE.
Ø  Data sources can be created by utilizing RDDTool’s functions.
Ø  Permissions can be specified per-graph for each user.
But unlike Nagios, Cacti doesn’t notify users while problems appear so it is recommended to use other flexible tools supporting alerts.

 Centreon:

Centreon is our third type of free monitoring systems. Mostly called CES referencing to the Centreon Enterprise Server, is the choice of some world’s largest company. It lets company supervise all their infrastructure and applications comprising their information system.

Centreon has many advantages, we can list the following:
Ø  Enable to monitor the user’s servers, active elements and applications.
Ø  Real-time operating and component management console.
Ø  Ability to maintain and support the whole platform using the publisher solution.
Ø  Unlimited number of uses and extensions via open software mechanisms.
Ø  Currently there are 4 different solutions available to suit different organizations with evolving business needs.
Ø  The CES Standard is the only open and unlimited trial version. Unless it has a free access, a powerful industry-standard monitoring solution is offered.
Ø  CES Essentials is CES Standards including access to new software products and services such as Platinum level supports and various software extensions which allow users to automate the daily tasks of administration and monitoring.
Ø  CES Advanced is CES Essentials adding also the Centreon’s complementary plugin pack and different templates comprising databases, applications and infrastructure services.
Ø  The last one is CES Complete which is the mix of all the centreon software products and modules, including BI, BAM and Map. It is also delivered with Platinum level support.

Zabbix :                              

Zabbix is our fourth free monitoring system which is licensed as Nagios and Cacti under GPL and it is written in PHP. We can say that Zabbix is the mix of Nagios and Cacti functions: it is characterized by its simple way of monitoring data with graphs and its alerts sending to user in case of any problem.

Personally, I like the way how Zabbix can check and make report about every authorized or not change happen at one of the user’s servers.  This free monitoring tool, can from remote hosts where Zabbix is used. It offers different types of graphs such as network statistics, CPU load and others.
It is a little bit complicate for beginners and some additional time to be familiar with this monitoring system is recommended.
Zabbix as I mentioned offers the functions of Nagios and Cacti at same time, we can list the following features of this tool:
Ø  It is fully open source, free for commercial and non-commercial use.
Ø  It enables users to easily monitor their servers, network devices and applications, collecting appropriate statistics and performance data.
Ø  It is designed to scale from small environments with a few devices to large ones with thousands of monitored devices.
Ø  Like Nagios, it can send notification messages via e-mail, SMS for each notable event.

OpenNMS:

OpenNMS is another free network monitoring system and it is the world’s first enterprise grade monitoring tool which can be used a big number of unlimited devices. It enables users to discover and monitor services or nodes automatically in their network.

OpenNMS has many advantages make it a very beneficial free network monitoring tool when we can list the following:
Ø  Automatic Service Discovery and Provisioning
Ø  Performance Data Collection Protocols (such as HTTP, JDBC, JMX, SNMP, XML etc)
Ø  Multi-Resource Performance Reports
Ø  Best Practical Solutions RT (Request Tracker)
Ø  Import of nodes, interfaces, and services from external provisioning system
Ø  Performance Data Export via simple XML Schema
Ø  Possibility to send e-mail or SMS notifications to the administrators

Icinga:

Icinga is another enterprise grade free monitoring system which enables users to follow network and its resources and also notifies them when any problem appear. This tool can monitor as either as complex or large environments across various locations.

Some of its various features include:
Ø  Its capability to monitor different network services (SMTP, POP3, HTTP, NNTP, PING…)
Ø  Also monitor host resources (CPU load, disk usage…)
Ø  It allows users to easily develop their own services checks due to its simple plugin design.
Ø  It has support for monitoring redundant monitoring hosts.
Ø  It notifies users when service or host problems occur and when they also get resolved.

MRTG:

MRTG (Multi Router Traffic Grapher) is our last type of free monitoring system. It is simpler than Nagios, Cacti and Zabbix which can be more beneficial to use it with small projects. Mostly, it is used for monitoring network interfaces, CPU, memory and network interfaces statistics.

Regarding its features, we can list the following:
Ø  It works on most UNIX platforms and Windows NT.
Ø  It is written with Perl and delivered with full source.
Ø  No need to install any external SNMP package since MRTG uses a highly portable SNMP implementation written fully in Perl.
Ø  It creates visual representations of the traffic seen during the last week, month and year.
Ø  It is possible to monitor 200 or more network links from any halfway decent UNIX box.
Ø  It is also possible to monitor any SNMP and to assemble to data sources in one graph.

 Thank you for reviewing our article and please don’t forget to share it.

Monday, September 14, 2015

How to install eclipse on ubuntu 14.04

Eclipse is a open-source development environment used to develop applications . In this article we can see about installing eclipse in ubuntu 14.04 Manually.

Step 1 » Update repostories.
sudo apt-get update

Step 2 »check the java version
java  -version

Step 3 »Install Java by the below command.
sudo apt-get install openjdk-7-jdk

Step 4 » Download latest eclipse from here ( Download Eclipse )
Download from below link

Step 5 » Move the downloaded package to /opt/ directory.
sudo mv Downloads/eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz  /opt/

Step 6 » Unzip the downloaded file.

cd  /opt/
sudo tar -xvf eclipse-standard-kepler-SR2-linux-gtk-x86_64.tar.gz

Step 7 » Create a new file eclipse.desktop in /usr/share/applications/ and add the below code .

cd /usr/share/applications/

sudo nano eclipse.desktop

[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=eclipse.desktop

Step 8 » Now install that desktop file using the below command.

sudo desktop-file-install /usr/share/applications/eclipse.desktop

sudo ln -s /opt/eclipse/eclipse /usr/local/bin

you can launch by