Tuesday, January 31, 2017

How to Install and Configure VNC on Ubuntu

Login into server using session or putty

Install  required packages

sudo -s
dpkg -l | grep vnc
apt-get install vnc4server
To make sure that vnc server is installed, type this command:
dpkg -l | grep vnc
apt-get install vnc4server
Sample output:
ii  vnc4server                                            4.1.1+xorg4.3.0-37ubuntu5    amd64        Virtual network    computing server software
After that, you need to start the vncserver with the user, for this user
su – administrator
administrator@ubuntutest:~$ vncserver 

Enable SSH in Ubuntu

To install it, open terminal (Ctrl+Alt+T) or log in Ubuntu server and run command:
sudo apt-get install openssh-server


Wednesday, January 11, 2017

Installing Nagios 4.2.0 and Nagios Plugin 2.1.2

Install Required Dependencies

yum install -y httpd php gcc glibc glibc-common gd gd-devel make net-snmp


yum install -y httpd php gcc glibc glibc-common gd gd-devel make net-snmp


Create Nagios User and Group

useradd nagios

groupadd nagcmd


Next, add both the nagios user and the apache user to the nagcmd group. 

 usermod -G nagcmd nagios
 usermod -G nagcmd apache

Download Nagios Core 4.2.0 and Nagios Plugin 2.1.2


Create a directory for your Nagios installation and all its future downloads. 

  mkdir /root/nagios
  cd /root/nagios

  wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-4.2.0.tar.gz
  wget https://www.nagios-plugins.org/download/nagios-plugins-2.1.2.tar.gz

Extract Nagios Core and its Plugins

#  tar -xvf nagios-4.2.0.tar.gz
#  tar -xvf nagios-plugins-2.1.2.tar.gz


# ls -l


total 13528

drwxrwxr-x. 18 root root 4096 Aug 20 2015 nagios-4.2.0
-rw-r--r--. 1 root root 11142182 Aug 20 2015 nagios-4.2.0.tar.gz
drwxr-xr-x. 15 root root 4096 Aug 1 21:58 nagios-plugins-2.1.2
-rw-r--r--. 1 root root 2695301 Aug 1 21:58 nagios-plugins-2.1.2.tar.gz

Configure Nagios Core
 # cd nagios-4.2.0
 # ./configure --with-command-group=nagcmd


Sample output:
Creating sample config files in sample-config/ ...
*** Configuration summary for nagios 4.2.0 08-01-2016 ***:
General Options:
-------------------------


Nagios executable: nagios
Nagios user/group: nagios,nagios
Command user/group: nagios,nagcmd
Event Broker: yes
Install ${prefix}: /usr/local/nagios
Install ${includedir}: /usr/local/nagios/include/nagios
Lock file: ${prefix}/var/nagios.lock
Check result directory: ${prefix}/var/spool/checkresults
Init directory: /etc/rc.d/init.d
Apache conf.d directory: /etc/httpd/conf.d
Mail program: /bin/mail
Host OS: linux-gnu
IOBroker Method: epoll
Web Interface Options:
------------------------
HTML URL: http://localhost/nagios/
CGI URL: http://localhost/nagios/cgi-bin/
Traceroute (used by WAP): /usr/bin/traceroute
Review the options above for accuracy. If they look okay,
type 'make all' to compile the main program and CGIs.


# make all

# make install

Sample output:
*** Exfoliation theme installed ***
NOTE: Use 'make install-classicui' to revert to classic Nagios theme
make[1]: Leaving directory '/root/nagios/nagios-4.2.0'
make install-basic
make[1]: Entering directory '/root/nagios/nagios-4.2.0'
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/libexec
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/var/archives
/usr/bin/install -c -m 775 -o nagios -g nagcmd -d /usr/local/nagios/var/spool/checkresults
chmod g+s /usr/local/nagios/var/spool/checkresults
*** Main program, CGIs and HTML files installed ***
You can continue with installing Nagios as follows (type 'make'
without any arguments for a list of all possible options):
make install-init
- This installs the init script in /etc/rc.d/init.d
make install-commandmode
- This installs and configures permissions on the
directory for holding the external command file
make install-config
- This installs sample config files in /usr/local/nagios/etc
make[1]: Leaving directory '/root/nagios/nagios-4.2.0'


 # make install-init

# make install-commandmode

# make install-config

Sample output:
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc
/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/etc/objects
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/nagios.cfg /usr/local/nagios/etc/nagios.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/cgi.cfg /usr/local/nagios/etc/cgi.cfg
/usr/bin/install -c -b -m 660 -o nagios -g nagios sample-config/resource.cfg /usr/local/nagios/etc/resource.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/templates.cfg /usr/local/nagios/etc/objects/templates.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/commands.cfg /usr/local/nagios/etc/objects/commands.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/contacts.cfg /usr/local/nagios/etc/objects/contacts.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/timeperiods.cfg /usr/local/nagios/etc/objects/timeperiods.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/localhost.cfg /usr/local/nagios/etc/objects/localhost.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/windows.cfg /usr/local/nagios/etc/objects/windows.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/printer.cfg /usr/local/nagios/etc/objects/printer.cfg
/usr/bin/install -c -b -m 664 -o nagios -g nagios sample-config/template-object/switch.cfg /usr/local/nagios/etc/objects/switch.cfg
*** Config files installed ***
Remember, these are *SAMPLE* config files. You'll need to read
the documentation for more information on how to actually define
services, hosts, etc. to fit your particular needs.


Customizing Nagios Configuration

Open the “contacts.cfg” file with your choice of editor and set the email address associated with the nagiosadmin contact definition to receiving email alerts.

# vi /usr/local/nagios/etc/objects/contacts.cfg


Sample Output 

###############################################################################
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################
# Just one contact defined by default - the Nagios admin (that's you)
# This contact definition inherits a lot of default values from the 'generic-contact'
# template which is defined elsewhere.
define contact{
contact_name             nagiosadmin                    ; Short name of user
use                              generic-contact                ; Inherit default values from generic-contact    template (defined above)
alias                             Nagios Admin                ; Full name of user

}


Install and Configure Web Interface for Nagios

make install-webconf

 # htpasswd -s -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

New password:
Re-type new password:
Adding password for user nagiosadmin

Restart Apache to make the new settings take effect.

Restart Apache to make the new settings take effect.
# service httpd restart

Compile and Install Nagios Plugin

/root/nagios, Go there and configure and install it as directed below.

# cd /root/nagios

 # cd nagios-plugins-2.1.2/

 # ./configure --with-nagios-user=nagios --with-nagios-group=nagios

 # make
 # make install


Verify Nagios Configuration Files

# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg


Sample Output

Nagios Core 4.2.0
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-01-2016
License: GPL
Website: https://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...
Running pre-flight check on configuration data...
Checking objects...
Checked 8 services.
Checked 1 hosts.
Checked 1 host groups.
Checked 0 service groups.
Checked 1 contacts.
Checked 1 contact groups.
Checked 24 commands.
Checked 5 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 1 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 5 timeperiods
Checking global event handlers...
Checking obsessive compulsive processor commands...
Checking misc settings...
Total Warnings: 0
Total Errors: 0
Things look okay - No serious problems were detected during the pre-flight check


Add Nagios Services to System Startup 

To make Nagios work across reboots, we need to add nagios and httpd with chkconfig and systemctlcommand.

On RHEL/CentOS 6/5 and Fedora
# chkconfig --add nagios
# chkconfig --level 35 nagios on
# chkconfig --add httpd
# chkconfig --level 35 httpd on

Restart Nagios to make the new settings take effect. 

# service nagios start [On RHEL/CentOS 6/5 and Fedora]

 Login to the Nagios Web Interface

Your nagios is ready to work, please open it in your browser with “http://Your-server-IP-address/nagios” 


Nagios Web Dashboard

Thursday, January 5, 2017

CentOS 7 Installation steps by steps

Installing steps on linux insert the media or attach the iso file.
Then run the setup next window will appear.

Select the options as per your need  Install CentOS or Test the media.

After the welcome screen will come select your language.

Next ,  set the date , time and keyboard  language. Then the installation media and software selection .
.

Generally we select server with GUI. You can select it your as per your environment
Also select the installation destination and set network & hostname.


Set System Hostname
Enable Ethernet Interface


Enter Network Settings

Click on Begin Installation

Select Root Password and give as per your eaisy.

Now, Select user creation create a local for linux.

CentOS 7 Installation Process start

CentOS 7 Installation Complete…

Enabling Auto Logins in CentOS 6

Head over to the trusty command line and edit /etc/gdm/custom.conf. The file already contains several sections, all of which are empty by default.
# GDM configuration storage
[daemon]
AutomaticLogin Enable = true
AutomaticLogin = admin

Disabling the Keyring Dialogue

you may experience a Keyring Dialogue which will ask for your root password every time after a restart. This isn’t much better than the login screen. This may or may not happen, depending on your current configuration:


One article I found suggested to head over to System – Preferences – Startup Applications and simply un-check  from the list .

All we have to do is
– head over to the Network Connections Icon at the top of the screen
– and right-click it
– select Edit Connections…
– pick your current wireless connection and select Edit
– provide the root password (only necessary this once)
– check the tick box Available to all users

Wait! My system boots into the Command Line interface, even though I have GNOME installed. What gives?

You can tell your system in which mode to start. To do this, edit your /etc/inittab file:
// change this line id:3:initdefault: // to id:5:initdefault:

Configuring VNC Server on Linux

Install the VNC Server.
( Method – 1 )
For RHEL , CentOS ,OEL.
 # yum install tigervnc-server
 For Ubuntu.
 # apt-get install tigervnc-server
 Edit the “/etc/sysconfig/vncservers” file to configure the required displays.
The following entries enable VNC for display numbers “:2” and “:3”. Notice multiple “display:user” pairs are defined on a single line, but the arguments for each display are defined separately.
 VNCSERVERS=”2:root 3:admin”
VNCSERVERARGS[2]=”-geometry 1280×1024 -nolisten tcp -localhost”
VNCSERVERARGS[3]=”-geometry 1280×1024″
 Press Shift +C
 :wq!
 Set the VNC password for any users defined in the “/etc/sysconfig/vncservers” file.
 # su admin
# vncpasswd
Password:
Verify:
Enable the “vncserver” service for autostart and start the service.
# chkconfig vncserver on
# service vncserver start
 You should now be able to use a VNC viewer to connect to system using the display numbers and passwords defined.
Use the following commands to stop the service and disable autostart.
# service vncserver stop
# chkconfig vncserver off
 (Method -2 )
 Install the VNC Server.
 # yum install tigervnc-server
 Create a new configuration file for each of the display numbers you want to enable. In the following case, I am setting up the display number “:3”. Notice how the display number is included in the configuration file name.
 # cp /lib/systemd/system/vncserver@.service  /lib/systemd/system/vncserver@:3.service
 Run the following command.
 # systemctl daemon-reload
 Set the VNC password for the user defined in the new configuration file.
 # su – oracle
$ vncpasswd
Password:
Verify:
$ exit
Enable the service for autostart and start the service.
# systemctl enable vncserver@:3.service
# systemctl start vncserver@:3.service
 You should now be able to use a VNC viewer to connect to system using the display number and password defined.
Use the following commands to stop the service and disable autostart.
 # systemctl stop vncserver@:3.service
# systemctl disable vncserver@:3.service
Done. Thanks

Linux commands in brief

pstree                                Processes and parent-child relarionships
top                                     Show top processes
ps -auxw                           process status
vmstat                               Monitor virtual memory
free                                   Display amount of free and used memory
in the system. (Also: cat /proc/meminfo)
map                                Display/examine memory map and
libraries (so). Usage: pmap pid
cat /proc/sys/vm/freepages
Display virtual memory “free pages”.
One may increase/decrease this limit:
echo 300 400 500 > /proc/sys/vm/freepages
uname -a                          print system information
cat /proc/version Display Linux kernel version in use.
cat /etc/redhat-release Display Red Hat Linux Release.
(also /etc/issue)
uptime                              Tell how long the system has been
running. Also number of users and
system’s load average.
w                                       Show who is logged on and what they are doing.
 /sbin/lsmod                       List all currently loaded kernel modules. Same as cat /proc/modules
/sbin/runlevel                   Displays the system’s current runlevel .
hostname                          Displays/changes the system’s nodename . (Must also manually change
hostname setting in /etc/sysconfig/network . Command will change entry in                                          /etc/hosts) service Display status of system services.
Example: service –status-all
Help: service –help
df -k                                  report filesystem disk space usage.
(-k reports in Kbytes)
du -sh                                Calculates file space usage for a given
directory. (and everything under it) (-s option summarizes)
mount                               Displays all mounted devices, their
mountpoint, filesystem, and access. Used
with command line arguments to mount file system.
cat /proc/filesystems Display filesystems currently in use.
cat /proc/mounts Display mounted filesystems currently in use.
showmount                      Displays mount info for NFS filesystems.
cat /proc/swaps Displays swap partition(s) size, type and
quantity used.
cat   /proc/ide/hda/anyfile
Displays disk information held by kernel.
who                                   Displays currently logged in users.
Use who -uH for idle time and terminal info.
users                                 Show all users logged in.
w                                       Displays currently logged in users and processes they are running.
whoami                             Displays user id.
 groups                              Display groups you are part of.
Use groups user-id to display groups for a given user.
set                                      Display all environment variables in your current environment.
id                                       Display user and all group ids. Use id user-id to display info for another user id.
last                                    Show listing of last logged in users.
history                              Shell command to display previously entered commands

Installing SoapUI on Linux/Unix

Prerequisite
  • Make sure that you have Java (JRE) installed on your system
Installation
  1. Download the Linux binary zip (no JRE) from http://www.soapui.org/
  2. Unzip it into a preferable directory such as your home folder or /opt
  3. Make sure that you have proper permissions on the unziped soapUI folder
  4. Go into the folder and run $ bin/soapui.sh (open source) or $ bin/soapui-pro.sh (Pro)

32-bit systems
Once you’ve downloaded the installer the installation is pretty strait forward. Start it by just double-clicking on it. After preparing the installation which takes only a few seconds you’ll see the starting screen:

Just click Next to continue. You’ll be asked to accept our license agreement

After accepting and clicking Next you’ll be able to select the destination folder which by default is set to home/User/SmartBear/SoapUI-5.2.0 but can be changed.

Next step gives you an opportunity to optionally include, as additional components, SoapUI source files, Hermes installation and tutorials.

If you’ve chosen to install Hermes, next you’ll get the Hermes license agreement

If you have chosen to install tutorials, you will then be prompted to specify the tutorials location.

After that, specify the location where SoapUI will place symbolic links to.

After that, a window appears where you’ll be asked to select if a desktop icon should be created.

Finally, click Next to start the installation.
After a couple of minutes at most, the installation should be finished and you should see the next screen.



Now you are ready to use it. Good luck

Run System File Checker in Safe Mode, Boot Time or Offline on Windows 7 / 8

How to run System File Checker in Safe ModeOffline or at Boot Time in Windows 8.1. This is useful if SFC will not run or start.
  • One of the useful tool Microsoft introduced on Windows, is the ability to run system file checker to check the stability of core system files.
  • One of the most effective ways to run this tool or SFC is to run in Safe Mode or at boot-time. This may be an option you may want to consider, if you find that your system file checker run does not complete successfully. At boot time, system files won’t be connected to any other Windows services so it could be easier for the to complete its run successfully and replace the files.

Run System File Checker in Safe Mode

Simply boot in Safe Mode, open an elevated command prompt, type sfc/scannow and hit Enter. System File Checker will run in Safe Mode too.

Run System File Checker at boot

On Windows XP we have a command called sfc /scanboot. It scans all protected system files every time the computer is booted. Running sfc /scanonce would run it once only at the next reboot. Unfortunately, these commands have been removed on later versions of Windows. So in order to run this command, we have to go to Windows RE and run it from here. We can also call it Run Offline System File Checker.

Run Offline System File Checker

To execute this run, do the following:
Insert the Windows installation disc or USB flash drive, or a system repair disc, and then shut down your computer. Then restart your Computer When prompted, press any key, and then follow the instructions that appear.
On the Install Windows page, or on the System Recovery Options page, choose your language and other preferences, and then click Next.

Click Repair your computer.
Select the Windows installation you want to repair, and then click next.
On the System Recovery Options menu

Click on Command prompt, then type in the following command and hit Enter:
sfc /scannow /offbootdir=d:\ /offwindir=d:\windows  
Refer the second image above. I have used D, since the Windows drive is D.
Once it has completed the repair, type Exit and then reboot the system. In case the command does work or if the Windows failed to repair, then you need to run a Repair Windows 7 or Refresh Windows 8 to fix those corrupted files.

Cisco VPN installation on Window 10

First , Download these two setups links are
create a system restore Point
Dell Sonic Wall
http://www.firewall.cx/downloads/cisco-tools-a-applications/170-sonicwall-vpn-clent-1/file.html
Cisco VPN
http://www.firewall.cx/downloads/cisco-tools-a-applications/40-cisco-vpn-client-64bit-version/file.html
Install Dell Sonic Wall setup first. After Installation complete .
Install Cisco VPN setup .Once setup is complete .
Uninstall Dell Sonic setup and uncheck both the Delete preference  options when ask and next & finish it.
Now you can import the VPN pcf  files into Cisco VPN client .

How to remove Search Box/Bar above header/logo on Wordpress

To remove the search bar, you’ll need to remove it from header.php. Just go to Appearance → Editor → Header (header.php) and find this line:
 <div id="nav_search">
<?php get_search_form(); ?>
</div>


<?php get_search_form(); ?>
</div>
</div><!-- #navbar -->
<div class="clear"></div>
</div>
</header><!-- #masthead -->
</div>

How to Upgrade PHP 5.3 to PHP 5.4 on CentOS 6.7

1. Confirm your version of PHP is the CentOS 6.7 default
Type in the following:
rpm -qa | grep php
Should output similar to the following:
php-cli-5.3.3-46.el6_6.x86_64
php-common-5.3.3-46.el6_6.x86_64
php-5.3.3-46.el6_6.x86_64
Great, let’s move on.
2. Install and activate the REMI and EPEL RPM Repositories
Type in the following to download and install the required files:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm && rpm -Uvh epel-release-latest-6.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm && rpm -Uvh remi-release-6*.rpm
Now to enable the REMI repository globally:
nano /etc/yum.repos.d/remi.repo
Under the section that looks like [remi] make the following changes:
[remi]
name=Remi's RPM repository for Enterprise Linux 6 - $basearch
#baseurl=http://rpms.remirepo.net/enterprise/6/remi/$basearch/
mirrorlist=http://rpms.remirepo.net/enterprise/6/remi/mirror
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
Press CTRL-O to save, and CTRL-X to exit, and we can continue.
3. Update PHP from 5.3 to 5.4
Easy as pie, simply type in the following:
yum -y update php*
Once that’s done, we can verify:
rpm -qa | grep php
And we should see something similar to the below:
php-common-5.4.45-1.el6.remi.x86_64
php-5.4.45-1.el6.remi.x86_64
php-cli-5.4.45-1.el6.remi.x86_64
Make sure PHP is working correctly:
php -v
You should see something similar to the following:
PHP 5.4.45 (cli) (built: Sep 2 2015 18:54:00) 
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Installing Apache ActiveMQ on Windows

Follow the instructions below to install Apache ActiveMQ on Windows.

Step 1. Download Apache ActiveMQ

1. Open a Web browser and access the following URL:
http://activemq.apache.org
2. Apache ActiveMQ home page opens.  There is a link to the latest version on the homepage. Follow this link if the version is compatible with the WSO2 product you intend to use.
3. The link to the latest stable version is usually at the top of the page, separated from the general list. Follow the link.
4. Go to the "Getting the Binary Distributions" section of the page and follow the download link for Windows.
5. The link redirects to the page suggesting a mirror site for the download. Follow the link on the page.
6. The download dialog opens. Click "OK" to start the download.

Step 2. Extract The Archive

After the download is complete, extract files to a user-defined folder. For example, C:\WSO2\apache-activemq-5.5.0.

Step 3. Run Apache ActiveMQ

Follow the instructions below to run Apache ActiveMQ.
1. Open the Windows command prompt (CMD).
2. Use the following command to change the current directory to the ActiveMQ installation directory:
cd <activemq_install_dir>
where "<activemq_install_dir>" is the directory where ActiveMQ files were extracted to. For example,
3. Execute the following command to run ActiveMQ:
bin\activemq
4. Apache ActiveMQ will start running.The operation log will be displayed.

Oracle Database 19c Installation on Oracle Linux 7

Pre-installation settings before installing Oracle Database 19c SELinux If the OS is to be used for an Oracle installation, it is ...