Saturday, 22 March 2014

Linux System Admin Interview Questions and Answers



   Q-1: - How are devices represented in UNIX?

   Ans: - All devices are represented by files called special files that are located in /dev directory.

   Q-2: - What is inode?

   Ans: - All UNIX files have its description stored in a structure called 'inode'. The inode contains          info about the file-size, its location, time of last access, time of last modification,
 permission and so    on. 
Q-3: - What are the process states in Unix?
Ans: - As a process executes it changes state according to its circumstances. Unix processes have the following states:
Running : The process is either running or it is ready to run .Waiting : The process is waiting for an event or for a resource.Stopped : The process has been stopped, usually by receiving a signal. Zombie : The process is dead but have not been removed from the process table.
Q-4: - What command should you use to check the number of files and disk space used and each user's defined quotas?
Ans: - repquota 
Q-5: - What command is used to remove the password assigned to a group?
Ans: - gpasswd -r
Q-6: - What can you type at a command line to determine which shell you are using?
Ans: - echo $SHELL
Q-7: -  Write a command to find all of the files which have been accessed within the last 30 days.Ans: - find / -type f -atime -30 > filename.txt
Q-8: - What is a zombie?
Ans: - Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table.
Q-9: - What daemon is responsible for tracking events on your system?
Ans: - syslogd 
Q-10: -  What do you mean a File System?
Ans: - File System is a method to store and organize files and directories on disk. A file system can have different formats called file system types. These formats determine how the information is stored as files and directories.
Q-11: -  Tell me the name of directory structure hierarchy for Linux
Ans: -
/root
/boot
/bin
/sbin
/proc
/mnt
/usr
/var
/lib
/etc
/dev
/opt
/srv
/tmp
/media  
Q-12: - What does /boot directory contains?
Ans: - The /boot/ directory contains static files required to boot the system, such as the Linux kernel, boot loader configuration files. These files are essential for the system to boot properly. 
Q-13: - If some one deletes /boot directory from your server, than what will happen?
Ans: - In that case your server will be in unbootable state. Your Server can’t boot without /boot directory because this directory contains all bootable files 
Q-14: - What does /dev directory contain?
Ans: - The /dev directory contains all device files that are attached to system or virtual device files that are provided by the kernel.
Q-15: -  What is the role of udev daemon?Ans: - The udev demon used to create and remove all these device nodes or files in /dev/ directory. 
Q-16: - Tell me the name of device file for PS/2 mouse connection.
Ans: - /dev/psaux
Q-17: - Tell me the name of device file for parallel port (Printers).
Ans: - /dev/lp0 
Q-18: - What does /etc/X11/ directory contains?

Ans: - The /etc/X11/ directory is for X Window System configuration files, such as xorg.conf.
Q-19: - What does /etc/skell directory contains?

Ans: - The /etc/skel directory contains files and directories that are automatically copied over to a new user's home directory when such user is created by the useradd or adduser command.
Q-20: - Tell me name of Linux File systems?
Ans: - Ext2, Ext3, Ext4.
For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Thursday, 20 March 2014

Install Canon Printer Driver for Ubuntu Linux 13.10, 13.04, 12.10, 12.04 Step by Step

In my this blog post i am showing how to install Canon Printer Driver for Ubuntu 13.10 Saucy, 13.04 Raring, 12.10 Quantal and 12.04 Precise.

There is now a PPA repository which contains official drivers of Canon printers and multifunction devices, included versions 2.20 and newer (2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.1, 3.2, 3.3, 3.4, 3.5, 3.6, 3.7, 3.8).


To get started, we need to add the PPA repository first by running following 2 commands in terminal (Press Ctrl+Alt+T to open it):


#sudo add-apt-repository ppa:michael-gruz/canon-stable


#sudo apt-get update


After that, find out the package name of your Canon printer in the list below. Then install the package using Synaptic Package Manager (install it in Ubuntu Software Center):


















Or, Install the package via apt-get command by terminal:


#sudo apt-get install PACKAGE-NAME-HERE


Here’s the list of Canon Printers and package names of the Ubuntu Drivers:

  1. Canon iP100 series: cnijfilter-ip100series
  2. Canon iP1800, iP1880, iP1890: cnijfilter-ip1800series
  3. Canon BJ F9000 series: cnijfilter-bjf9000series
  4. Canon BJ F900 series: cnijfilter-bjf900series
  5. Canon BJ S300 series: cnijfilter-bjs300series
  6. Canon BJ S500 series: cnijfilter-bjs500series
  7. Canon BJ S700 series: cnijfilter-bjs700series
  8. Canon PIXMA E500 series: cnijfilter-e500series
  9. Canon PIXMA E510 series: cnijfilter-e510series
  10. Install Canon PIXMA E600 series: cnijfilter-e600series
  11. Canon PIXMA E610 series: cnijfilter-e610series
  12. Canon i250 series: cnijfilter-i250series
  13. Canon i255 series: cnijfilter-i255series
  14. Canon i550 series: cnijfilter-i550series
  15. Canon i560 series: cnijfilter-i560series
  16. Canon i850 series: cnijfilter-i850series
  17. Canon i860 series: cnijfilter-i860series
  18. Canon i950 series: cnijfilter-i950series
  19. Canon i990 series: cnijfilter-i990series
  20. Canon iP1900 series: cnijfilter-ip1900series
  21. Canon iP2200 series: cnijfilter-ip2200series
  22. Canon iP2500 series: cnijfilter-ip2500series
  23. Canon iP2600 series: cnijfilter-ip2600series
  24. Canon iP2700 series: cnijfilter-ip2700series
  25. Canon iP3000 series: cnijfilter-ip3000series
  26. Canon iP3300 series: cnijfilter-ip3300series
  27. Canon iP3500 series: cnijfilter-ip3500series
  28. Canon iP3600 series: cnijfilter-ip3600series
  29. Canon iP4000 series: cnijfilter-ip4000series
  30. Canon iP4200 series: cnijfilter-ip4200series
  31. Canon iP4300 series: cnijfilter-ip4300series
  32. Canon iP4500 series: cnijfilter-ip4500series
  33. Canon iP4600 series: cnijfilter-ip4600series
  34. Canon iP4700 series: cnijfilter-ip4700series
  35. Canon iP4800 series: cnijfilter-ip4800series
  36. Canon iP4900 series: cnijfilter-ip4900series
  37. Canon iP5000 series: cnijfilter-ip5000series
  38. Canon iP5200 series: cnijfilter-ip5200rseries
  39. Canon iP6600 series: cnijfilter-ip6600dseries
  40. Canon iP7200 series: cnijfilter-ip7200series
  41. Canon iP7500 series: cnijfilter-ip7500series
  42. Canon iP8500 series: cnijfilter-ip8500series
  43. Canon iP90 series: cnijfilter-ip90series
  44. Canon iX6500 series: cnijfilter-ix6500series
  45. Canon MG2100 series: cnijfilter-mg2100series
  46. Canon MG2200 series: cnijfilter-mg2200series
  47. Canon MG3100 series: cnijfilter-mg3100series
  48. Canon MG3200 series: cnijfilter-mg3200series
  49. Canon MG4100 series: cnijfilter-mg4100series
  50. Canon MG4200 series: cnijfilter-mg4200series
  51. Canon MG5100 series: cnijfilter-mg5100series
  52. Canon MG5200 series: cnijfilter-mg5200series
  53. Canon MG5300 series: cnijfilter-mg5300series
  54. Canon MG5400 series: cnijfilter-mg5400series
  55. Canon MG6100 series: cnijfilter-mg6100series
  56. Canon MG6200 series: cnijfilter-mg6200series
  57. Canon MG6300 series: cnijfilter-mg6300series
  58. Canon MG8100 series: cnijfilter-mg8100series
  59. Canon MG8200 series: cnijfilter-mg8200series
  60. Canon MP140 series: cnijfilter-mp140series
  61. Canon MP160 series: cnijfilter-mp160series
  62. MP190, MP210, MP230, MP240, MP250, MP270, MP280, MP490, MP495, MP500, MP510, MP520, MP540, MP550, MP560, MP600, MP610, MP620, MP630, MP640, MP750, MP780: cnijfilter-mp***series (you know, relpace *** with the numbers)
  63. MX320, MX330, MX340, MX350, MX360, MX370, MX390, MX410, MX410, MX430, MX450, MX510, MX520, MX710, MX720, MX860, MX870, MX880, MX890, MX920: cnijfilter-mx***series
  64. Canon PIXMA IP1000, PIXMA IP1500: cnijfilter-pixmaip1000series cnijfilter-pixmaip1500series
  65. Canon Pixus250i, Pixus255i, Pixus550i, Pixus560i, Pixus850i, Pixus860i, Pixus950i, Pixus990i, Pixus ip3100, Pixus ip4100, Pixus ip8600: cnijfilter-pixus***series
  66. After the driver is installed, connect your Canon printer to computer and turn it on. Your printer will automatically be detected by the system.
For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Tuesday, 18 March 2014

Installing LAMP Server in Ubuntu Linux 13.10

In my this blog post here's the quickest way to get LAMP Server (Apache, MySQL and PHP) in Ubuntu Linux 13.10.
To start installation process press Ctrl + Alt + T on your keyboard to open the terminal. When it's open, run the following command to install them with a single command:

#sudo apt-get install lamp-server






To verify Apache service, just type localhost in your web browser:














To verify PHP run the commands below to create a test page in the root directory on the web-server:


#sudo gedit /var/www/test.php


and add the below line into the file and save it.


<?php phpinfo();?>
























Now to verify PHP type the below link into your web browser:

http://localhost/test.php

























Finally, to verify MySQL run the below command .

You have to must type the password which is you have created for MySQL during the installation:

#mysql -u root -p


#mysql>


For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Thursday, 13 March 2014

Disable Guest Account from Ubuntu Linux 13.10 Login Screen


If you have not noticed, at the login screen of Ubuntu, anyone can select the “Guest Session” and login to your computer without password. Of course, the guest won’t be able to access your files and folders. What they will see is the default Ubuntu desktop and they won’t be able to store any file permanently as all saved files are deleted on reboot

In my this post i am going to show beginners how to disable the Guest session from Ubuntu 13.10 Saucy LightDM Login Screen.


Guest Session comes default in Ubuntu Unity, which anyone can log into from the login screen without password. You can easily remove it by the steps below:



Step-1: Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, copy and paste below command and press enter:

#sudo gedit /etc/lightdm/lightdm.conf.d/50-unity-greeter.conf


Step-2: It opens the config file. now we need to do is add below line into the file and click save:


allow-guest=false


#sudo restart lightdm


Alternatively, we can restart the system.

For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Upgrade to Ubunut Linux 13.04 to Ubuntu Linux 13.10 using terminal or console step by step

The Ubuntu team was released Ubuntu 13.10 for Desktop, Server, Cloud, Phone, and Core products on 17th Oct 2013. In my this post i am explaining how to upgrade from Ubuntu Linux 13.04 (Raring) to Ubuntu Linux 13.10 (Saucy)

Before upgrading the version, it is recommended for you to update the system. Open your terminal and run this command:

Step-1:
We need to update the system first. Open the terminal (CTRL + ALT + T) and insert this command below:

# sudo apt-get update && sudo apt-get dist-upgrade

Step-2: Update Manager
When system has been updated, press ALT + F2 to open the command box. Then type update-manager -d.
click on update-manager -d to run it when it appears in the dash.

#sudo update-manger -d

Step-3: Upgrade
Once it has finished checking the sources for available updates, you should see the following message:
                         The software on this computer is up to date.
                         However Ubuntu 13.10 is now available (you have Ubuntu 13.04).

Click on the Upgrade button and follow the instructions afterwards.

For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Screenshot tour of Ubuntu Linux 13.10 Saucy Salamander

Here is the screenshot tour for the Ubuntu 13.10 Saucy Salamander Ubunut Linux 13.10 comes with great look and some improved design.
You can upgrade or download and enjoy Ubuntu 13.10.












For any query please feel free to contact me my email id is sashwatkatore@gmail.com.

Wednesday, 12 February 2014

How to setup a lamp server on Linux.

Lamp is an open source web development platform that uses Linux as the operating system. Apache as the Web server. MySQL as the relational database management system. and PHP as the object-oriented scripting language.

Install Apache server on CentOS Linux:
Apache is the most popular HTTP or web server specially designed for Unix/Linux environment, but now you can also install Apache on Windows platform nowadays. Apache supports many web server features (CGI, SSL, Virtual Domain and more)

#Yum Install httpd

To run Apache automatically by default when the system boot/reboot:


#chkconfig httpd on


To start Apache on your CentOS Linux:

#service httpd start


To restart Apache on your CentOS Linux:


#service httpd restart


To stop Apache on your CentOS Linux:


#service httpd stop


Now your Apache server should be running, You can check it with your web browser by going to http://yourvpsip or http://yourdomain


Install MySQL server on CentOS Linux:
MySQL is an open source standard query language database that is fast, reliable, easy to use and suitable for all application of any sizes.

#yum install mysql-server

To run MySQL automatically by default when the system boot/reboot:

#chkconfig mysqld on


To start MySQL on your CentOS Linux:

#service mysqld start


To restart MySQL on your CentOS Linux:


#service mysqld restart


To stop MySQL on your CentOS Linux:


#service mysql stop



Install PHP on CentOS Linux:
PHP (PHP Hypertext Preprocessor) is a very widely used open source server side scripting language which also free to download and use. PHP can run on many platforms (Linux, Unix, Mac OS, Windows…) Many web CMS (content management systems) are written in PHP include WordPress, PHPbb, Joomla, Drupal, Moodle, even Facebook and Digg.

#yum install php*

For any query please feel free to contact me my email id is - sashwatkatore@gmail.com.