Monday, March 30, 2015

HISTORY OF LINUX

In 1990, Linus Torvalds. A graduate student from the University of Helsinki.

He designed a UNIX like kernel on Intel hardware, but now a day’s Linux available different hardware architecture. Such as Intel, AMD etc.

Torvalds and other programmers added many new futures into Linux and they gave the kernel to open source foundation. There after it rises to many flavors.

The First version of Linux 1.0 released on March 1994.

Linux kernel bundled with so many software’s from various distributions.

Flavors of Linux: Red Hat, SUSE, Dabian etc.

Features of Linux:

  1. Open Source : Source Code is Open

  1. Multi-user : At a time multiple users can access the system.

  1. Multitasking : We can run multiple applications at a time.

  1. Portable : Linux OS can be installed any hardware platform, but UNIX not.

  1. Security : It have Inbuilt firewalls and other security features.

  1. Scalable : Linux OS can be used in multiple ways such as Servers,
Workstations editions etc. and Linux supports all n/w protocols and programming languages.

  1. Reliable : Operating System runs continuously without down time, Top 500 Super computers work on different flavors of UNIX.



HISTORY OF UNIX

  •   UNIX developed in 1970’s at AT&T Bell laboratories.

  • Dennis Ritchie and Ken Thompson Introduced a UNIX operating system at AT & T bell labs.

  • The First version of UNIX is written in 80% of “C” language and 20% of Assembly language, in 1973, UNIX totally re-written in “C” language.

  • Bell laboratories continued to develop on UNIX operating system, and they released several versions such as System-3 & System-4.

  • Bell Labs distributed UNIX Source-code to an “Educational Institutions” The University of California of Berkeley”.

  • U.C Berkeley added many new features into the UNIX operating system and they released first version of UNIX called BSD Unix (we known as 4.3 and 4.4 BSD.)

  • Like that UNIX raised many Flavors:

UNIX Flavors:

BSD - Berkeley Software Distribution

SUN - Stand ford University

AIX - Advanced IBM UNIX





 HPUX - Hewlett Packard

basic concepts of hardware and networking



Computer:
Computer is an electronic device which performs all asthmatic and logical operations to get the required output.

COMPUTER stands for:-
Common-operating-memory-perfect-use in-tired less-education –result

Hardware:
All the physical components which are connected externally called as hardware.
EX:-Monitor, Keyboard, Speaker etc.

Software: Set of programmers called software. It internally connects different hardware components of computer.

Operating System:
Operating system is a collection of programs. It co-ordinate the operations of computer hardware and software.
In simple terms it’s an Interface between the computer h/w components and software applications.

Kernel:
Kernel is a central component of ever operating system.
Kernel responsibilities are managing the system's resources.
Such as,
  • Memory management.
  • Input /output device management
  • Process management.
Shell:
Shell is a program; it is an interface between the user and kernel.
In Linux shell act as command line Interface, so whenever user execute any commands the shell interprets all the commands to kernel, after processing the commands the kernel gives reply to shell.

Network: Network is a communication path.
Networking: It enables communication of all inter-connected network devices.
Example:Computer, switches, routers etc.

LAN - Local Area Network: a communication network path established within a single room or building called LAN

MAN - Metropolitan Area Network: acommunication network path established between different areas in a city called MAN.

WAN - Wide Area Network: acommunication network path established between different places in world called WAN.

Hub:Hub is network device; it allows communication between all inter-connected network devices. It always does broad-cast (one too many)

Switch:Switch is intelligent network device. It allows communications between all inter-connected network devices, but it does uni-cast (one to one).

Router: Router is agateway between different networks; it allows communication between more different networks.

IP-Address:IP-Addressing is numerical number to identify each computer on TCP/IP Networks.
There are 2 versions of I.P-Address:
IPv4 is a 32 bit Address & IPv6 is a 128 bit Address.
Note:IPv6 for Increase computer networks in Future.

There are 5 classes of I.P-Address in IPV4:

Class A 0 to 126
Loop back address 127                              Networking purpose
Class B 128 to 191
Class C 192 to 223

Class D 224 to 239                                   Research purpose
Class E 240 to 255

Subnet mask:Subnet-mask also a numerical numbers to divide I.P-Address into the network portion and host portion.
Based on subnet mask only we can identify which computer belongs to witch network.
Subnet mask also 32 bits address.
Port Numbers: Port number is an entry and exit point of any network based service.
Each network application has default port number to send and receive the packets of network services over TCP/IP networks.
Around the world we have 65,534 port numbers.
From 0 to 1023 are reserved.
From 1024 to 65543 are un-reserved port numbers.
Ex:- HTTP - 80, FTP -20 & 21, DHCP – 68, DNS – 53, SMTP -25 etc.

Protocol:Set of rules and regulations in an order to manage for proper communication between different network services.
TCP /IP, UDP, HTTP, DHCP, FTP, LDAP etc.

Network Topologies:
Network topology, defines the structure of the network.
Physical topology, which is the actual layout of the media.
Logical topology, which defines how the media is accessed by the hosts for sending data.
Physical Topologies

Bus Topology:
Bus topology is a method of physical connectivity. Here all the hosts connect directly to single cable.
Media: BNC connector, Coaxial cable.
Ex: - Cable T.V Connections.

Ring Topology:
In Ring topology each host connects to the next host. Like all hosts connects each other.
Note: More cables and NIC card should use.
Ex:- usually this topology uses in Railways.

Star Topology:
In star topology all hosts connect to a central device is called as Hubs/ Switches.
Media: Hub, Switch, Cat cables, RJ45 Connectors.
Ex: - It common topology in LAN environment.

Extended Star Topology:
Extended star topology links individual stars together by connecting the hubs (or) switches.
Note: This topology can extend coverage of the network.

Hierarchical topology:
Hierarchical topology is combination of two/more topologies.
Ex: - star topology, ring topology etc.

Mesh topology:
Mesh topology each computer directly connects to other computer.
Mostly this topology uses in wireless communication.
Ex: - Telephone towers.

Firewall
Firewall is a gateway. It restricts and controls the network traffic, It monitors Incoming and outgoing traffic over networks.
As per firewall rule-sets it filters and redirects the packets based on source and destination IP-address, port-numbers and protocols.
It protects public access to private network resources such as production servers and It enables secure access of your servers and sensitive information over networks.

Types of firewalls:There are 4 categories of firewalls.
  1. Packet Filter
  2. Circuit level gateway
  3. Application level gateway
  4. State-full multilayer inspection firewall
UTM Firewall Features:
  • Shameful inspection
  • Bandwidth Management
  • Intrusion prevention system
  • VPN( SSL VPN, IPSec)
  • Anti-Virus
  • Anti-Spam
  • Content Filtering
Packet Switching:

Packet switching is a technology of dividing data into packets and sends and receives the packets over a network.

Packet:

Each packet contains packet-header information, source and destination address, uniq sequence number to re- assemble the packet, error control data).

Duplex/ Full Duplex: Capability of transmitting the data in both directions over a communication channel called Full duplex.

Half-Duplex: Capability of transmitting the data in only one direction at a time called Half-duplex.

Session: A logical connection created between two hosts to exchange data and load balancing.

Handshaking: A series of signals acknowledging that communication can take place between computers.



Telnet: Telnet is a protocol allows remote logins with command base terminal access of servers.

It is Non-secure protocol, because it sends all information in clear text format, include users password also.

Telnet program available almost ever operating systems. It works on 23 port.



Secure Shell: SSH allows remote logins of server.

It provides strong authentication and secure communications over unsecure channels.

It provides facilities to remote logins in secure format manner. So the data travels in Encryption manner. It works on 22 port number.



NAT: Network Address Translation
It is mostly used for to share the internet with perfect bandwidth and advantage of NAT is the client doesn’t know I.S.P I.P-Address that will know only router I.P Address.



Band Width: Band width is a capacity for data transfer, in other words how much data can be moved from one point to another point in a given amount of Time.

INTERNET

The Internet has revolutionized many aspects of our daily lives, it has affected the way we do business as well as way we spend our leisure time.

Count the ways we used the Internet recently, we can sent E-mails to business associate , paid the utility bills, read the newspapers, read so many books, researched so many topic, train reservations, buses reservations and booked the hotel all by using the Internet, so that’s way Internet is a communication system.

A network is a group of connected communicating devices such as computer and printers. An Internet has composed of hundreds of thousands of interconnected networks.

Private organization as well as various government agencies, school, corporations and libraries in more than 100 countries using the Internet, millions of people are users, yet this extraordinary communication system only came into begin in 1969.




Monday, November 25, 2013

DHCP client overwriting resolv.conf how to stop it on linux

prevent resolv.conf updates only, the fastest way is to redefine the function to do nothing:
create flowing file 
# cat /etc/dhclient-enter-hooks
make_resolv_conf() {
exit 0
}
Then save the file and ensure it is executable:
# chmod a+x /etc/dhclient-enter-hooks
Note that, as explained in the man page, the dhclient-script is not standard so if this configuration doesn’t work, please read the man page.

Thursday, October 17, 2013

backup zenoss monittoring server in linux

It is important to back your Zenoss data up. The default location it wants to dump the backup to is /tmp when you kick off a backup from the GUI. Most times this is fine, but every now and then you will run into /tmp  filling up during a Zenoss backup. Here is how to use zenbackup from the command line and specify a specific backup directory.
Procedure 1. SSH into the server and su to the zenoss user.
2. Make a backup directory under $ZENHOME/backup/tmp if it doesn't exist already.
   zenoss@servername$ mkdir -p $ZENHOME/backup/tmp
3. Change directory into the $ZENHOME/backup/ and kick off the backup:
   zenoss@servername$ cd $ZENHOME/backup 
zenoss@servername$ zenbackup --temp-dir=./tmp --file=Zenoss.Backup.July.12.2012
INFO:zenbackup:Getting MySQL dbname, user, password from ZODB.
2012-07-12 14:31:15,045 INFO zenbackup: Backing up events database.

zenoss-4 installation steps on linux server

Here is getting Zenoss 4 up and running on  CentOS 6 server. This guide was originally tested on a freshly patched CentOS 6.3 on August 12, 2012. Zenoss 4.2 was the current version of Zenoss.

two types of installation.
1.Auto Deploy

There is a nice auto install script available now - it is recommended you use this method on a new install. Example is for Zenoss 4.2.4 - always check the Zenoss site for new versions before starting. 


# wget --no-check-certificate https://github.com/zenoss/core-autodeploy/tarball/4.2.4 -O auto.tar.gz
# tar xvf auto.tar.gz
# cd zenoss-core-autodeploy-*
# ./core-autodeploy.sh
 
Navigate to your server using a web browser:
http://server-ip:8080

2.Manual Way
Install EPEL repos.
rpm -ivh http://fedora.mirror.nexicom.net/epel/6/i386/epel-release-6-8.noarch.rpm
yum check-update
Disable SELinux (or configure it properly)
Disable iptables (or configure it - see Firewall Ports)

Procedure

1. Setup /home/zenoss directory.
useradd -m -d /home/zenoss -c "Zenoss User" zenoss 
chown zenoss:zenoss /home/zenoss
2. Remove conflicting packages
rpm -qa | grep -i matahari
rpm -qa | grep -i qpid
rpm -e --nodeps <package>
3. Remove Old Mysql - if any:
service mysql stop
rpm -qa | grep -i mysql
rpm -e --nodeps <package>
4. Install / Update prerequisites:

Oracle Java → 1.6 Update 31 or later. 1.7 is NOT supported. The one in yum is 1.5.x. DO NOT use this version. Get 1.6.
wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=65508
chmod +x jre-6u33-linux.x64-rpm.bin*
./jre-6u33-linux.x64-rpm.bin
Test with:
java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03, mixed mode)
RRDtool → 1.4.7 or later.
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
yum -y --nogpgcheck localinstall rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
vi /etc/yum.repos.d/rpmforge.repo and set enabled to 0.
yum -y --enablerepo=rpmforge-extras install rrdtool-1.4.7
MySQL Community Server → 5.5.25 or later. Go to: http://dev.mysql.com/downloads/mysql → Select Oracle & Red Hat Linux 6
Download the following:
MySQL Client Utilities (currently MySQL-client-5.5.25a-1.el6.x86_64.rpm)
MySQL Server (currently MySQL-server-5.5.25a-1.el6.x86_64.rpm)
MySQL Shared (currently MySQL-shared-5.5.25a-1.el6.x86_64.rpm)
SCP them to your server.
yum -y --nogpgcheck localinstall MySQL*
DO NOT set mysql password.
Add the following to /etc/my.cnf (create if not already existing)
[mysqld]
max_allowed_packet=16M
innodb_buffer_pool_size=256M
innodb_additional_mem_pool_size=20M
Start up MySQL:
service mysql start
chkconfig --add mysql
chkconfig --level 2345 mysql on
If you see the following message when you start mysql:
A RANDOM PASSWORD HAS BEEN SET FOR THE MySQL root USER ! You will find that password in '/root/.mysql_secret'.
Then you will need to check the /root/.mysql_secret file for the current password. This appears to be fairly new behaviour (MySQL-server.x86_64 0:5.6.11-1.el6 )


Configure blank root password for the Zenoss installer (add the -p option to be prompted for password if you find that a password was generated for you during first mysql start):
mysqladmin -u root password ''
mysqladmin -u root -h localhost password ''
RabbitMQ → 2.8.4 or later.
wget http://www.rabbitmq.com/releases/rabbitmq-server/v2.8.4/rabbitmq-server-2.8.4-1.noarch.rpm
yum -y --nogpgcheck --enablerepo=epel localinstall rabbitmq-server-2.8.4-1.noarch.rpm
service rabbitmq-server start
chkconfig rabbitmq-server on
Nagios Plugins → 1.4.15 or later.
yum --enablerepo=epel install nagios-plugins 
Erlang → (was installed during rabbitmq install if you didnt notice)

6. Download the latest version of ZenOSS to your server. Current in example is 4.2.
wget http://sourceforge.net/projects/zenoss/files/zenoss-4.2/zenoss-4.2.0/zenoss-4.2.0.el6.x86_64.rpm/download
yum -y --enablerepo=epel --nogpgcheck localinstall zenoss-4.2.0.el6.x86_64.rpm
7. Fire up the last few services:
service memcached start
chkconfig memcached on
service snmpd start
chkconfig snmpd on
8. Start up Zenoss - watch for errors or complaints.
service zenoss start
9. Hit the Zenoss WebGUI at <serverip>:8080 and finish walking through the wizard to complete the install.
10. Install Zenpacks:
wget http://sourceforge.net/projects/zenoss/files/zenpacks-4.2/zenpacks-4.2.0/zenoss-core-zenpacks-4.2.0.el6.x86_64.rpm
yum -y --nogpgcheck localinstall zenoss-core-zenpacks-4.2.0.el6.x86_64.rpm
11. Next fine tune your Zenoss installation. See Performance Tuning section.

Errors

Symlinking /usr to /local/usr or something of that nature breaks zenoss startup script.
service zenoss start
env: /etc/init.d/zenoss: No such file or directory
No skip to dashboard button off install.
Rebooted server. Fixed it - there were no errors during install when this happened.

 

Friday, September 20, 2013

How to install Cisco VPN client on ubuntu 13.04

This tutorial explain how to install Cisco VPN client on ubuntu 13.04.On Ubuntu, you don't need to install the Cisco VPN Client: NetworkManager includes support for Cisco IPSec VPNs.
Procedure to follow
Install network-manager-vpnc using the following command from your terminal
sudo apt-get install network-manager-vpnc
This will install vpnc, network-manager-vpnc and network-manager-vpnc-gnome.
Now you need to left click on your network manager applet (Located in your notification area) And choose "Configure VPN..."

Now you need to click on Add

Choose VPN connection type as "Cisco Compatible VPN(VPNC)" and click on create

Enater your cisco VPN details under VPN tab

Now you need to select IPV4 Settings tab click on routes

Here you need to select "Use this connection only for resources on its network" click ok otherwise your traffic significantly slowed down

To start your new VPN, just follow the steps again, but instead of "Configure VPN", you'll click on the entry you created.