Electricity Bill Calculator

Electricity Bill Calculator

Electricity Bill Cost Calculator. Electricity Usage Consumption Calculator.

Select Country:  
Typical Appliance:
Power Consumption:
Hours Of Use Per Day: Hrs/Day
One Unit Cost (1 kWh ):
 
Electricity Cost Per Day:  
Electricity Cost Per Month:  
Electricity Cost Per Year:  

Note:- 1 Unit = 1 kwh (Kilo Watt Hour)

HTML tutorial

EBC-Ads

Social Message

Saturday, August 11, 2018

Centos (Linux) adding multiple IP addresses and adding NIC Routing

Centos (Linux) adding multiple IP addresses and adding NIC Routing


Step-1:-

NIC Interfaces config are as follow :

root#cd /etc/sysconfig/network-scripts

ETH0 :  (ifcfg-ens160)

TYPE="Ethernet"
NAME="ens160"
UUID="21a11fc4-899c-4d3c-bf55-82cb2b5b64ab"
ONBOOT="yes"
HWADDR="90:0C:29:fg:2B:44"
IPADDR=192.168.100.211
NETMASK=255.255.255.0
GATEWAY=192.168.100.1


ETH1 : (ifcfg-ens192)

TYPE="Ethernet"
IPADDR=103.58.120.120
NETMASK=255.255.255.240
GATEWAY=103.58.120.113
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
DNS1=103.58.200.2
DNS2=8.8.8.8
NAME="ens192"
ONBOOT="yes"
HWADDR="00:0c:29:ed:2b:11"
PEERDNS="yes"
PEERROUTES="yes"

Step-2:-

Add default External Geway address (Optional).

[ sysconfig]# cat /etc/sysconfig/network
GATEWAY=103.58.120.113

Step-3:-

Create Shell scripts adding both IP address gateway for simultaneous access.

root#vi /root/network.sh

#!/bin/sh

ip rule add from 103.58.120.112/28 pref 200 lookup 201
ip route add default via 103.58.120.113 dev ens192 table 201

ip rule add from 192.168.100.0/24 pref 200 lookup 202
ip route add default via 192.168.100.1 dev ens160 table 202

ip route flush cache

Reference Note:-

103.58.120.112/28 - Subnet
103.58.120.113 - Gateway

192.168.100.0/24 - Subnet
192.168.100.1 - Gateway

Step-4:-

Provide execute permission shell scripts.

root#chmod 755 /root/network.sh
root#chmod +x /root/network.sh

Step-5:-

Add shell script file path into init.d network file for auto adds the default gateway. if any node restart.

root#vi /etc/init.d/network

#! /bin/bash
#
# network       Bring up/down networking
#
# chkconfig: 2345 10 90
# description: Activates/Deactivates all network interfaces configured to \
#              start at boot time.
#
### BEGIN INIT INFO
# Provides: $network
# Should-Start: iptables ip6tables NetworkManager-wait-online NetworkManager
# Short-Description: Bring up/down networking
# Description: Bring up/down networking
### END INIT INFO

./root/network.sh

Step-6:-

Perform the restart command.

root#reboot

After successful Reboot the Linux system. It will accessible both IP address segments.

Reference other sites - https://serverfault.com/questions/567249/centos-multiple-nics-routing-issue

Friday, June 29, 2018

Nagios do2db-3x: mysql_error: 'Incorrect key file for table

Nagios do2db-3x: mysql_error: 'Incorrect key file for table

Nagios Error Code:-

Jun 23 16:15:40 eznag ndo2db-3x: mysql_error: 'Incorrect key file for table './nagios/nagios_timedevents.MYI'; try to repair it'
Jun 23 16:15:40 eznag ndo2db-3x: Error: mysql_query() failed for 'DELETE FROM nagios_timedeventqueue WHERE instance_id='1' AND scheduled_time<FROM_UNIXTIME(1529750740)'
Jun 23 16:15:40 eznag ndo2db-3x: mysql_error: 'Incorrect key file for table './nagios/nagios_timedeventqueue.MYI'; try to repair it'
Jun 23 16:15:40 eznag ndo2db-3x: Error: mysql_query() failed for 'INSERT INTO nagios_hostchecks SET instance_id='1', host_object_id='406', check_type='0', is_raw_check='0', current_check_attempt='1', max_check_attempts='10', state='0', state_type='1', start_time=FROM_UNIXTIME(1529750740), start_time_usec='126616', end_time=FROM_UNIXTIME(0), end_time_usec='0', timeout='30', early_timeout='0', execution_time='0.000000', latency='0.126000', return_code='0', output='', long_output='', perfdata='', command_object_id='1', command_args='', command_line='/usr/local/nagios/libexec/check_ping -H 192\.168\.10\.3 -w 3000\.0,80% -c 5000\.0,100% -p 5' ON DUPLICATE KEY UPDATE instance_id='1', host_object_id='406', check_type='0', is_raw_check='0', current_check_attempt='1', max_check_attempts='10', state='0', state_type='1', start_time=FROM_UNIXTIME(1529750740), start_time_usec='126616', end_time=FROM_UNIXTIME(0), end_time_usec='0', timeout='30', early_timeout='0', execution_time='0.000000', latency='0.126000', return_code='0', output='', long_output='', perfdata='''
Jun 23 16:15:40 eznag ndo2db-3x: mysql_error: 'Incorrect key file for table './nagios/nagios_hostchecks.MYI'; try to repair it'

Resolution:-

Run below Mysql Linux command on Nagios Linux node.

[ log]#mysqlcheck --user=nagios --password=nagios --repair --all-databases
[ log]#myisamchk --safe-recover /var/lib/mysql/*/*.MYI

Recover DB safer mode. You can see logs all status "OK".

[ log]# mysqlcheck -u nagios -p nagios
Enter password:
nagios.nagios_acknowledgements                     OK
nagios.nagios_commands                             OK
nagios.nagios_commenthistory                       OK
nagios.nagios_comments                             OK
nagios.nagios_configfiles                          OK
nagios.nagios_configfilevariables                  OK
nagios.nagios_conninfo                             OK
nagios.nagios_contact_addresses                    OK
nagios.nagios_contact_notificationcommands         OK
nagios.nagios_contactgroup_members                 OK
nagios.nagios_contactgroups                        OK
nagios.nagios_contactnotificationmethods           OK
nagios.nagios_contactnotifications                 OK
nagios.nagios_contacts                             OK
nagios.nagios_contactstatus                        OK
nagios.nagios_customvariables                      OK
nagios.nagios_customvariablestatus                 OK
nagios.nagios_dbversion                            OK
nagios.nagios_downtimehistory                      OK
nagios.nagios_eventhandlers                        OK
nagios.nagios_externalcommands                     OK
nagios.nagios_flappinghistory                      OK
nagios.nagios_host_contactgroups                   OK
nagios.nagios_host_contacts                        OK
nagios.nagios_host_parenthosts                     OK
nagios.nagios_hostchecks                           OK
nagios.nagios_hostdependencies                     OK
nagios.nagios_hostescalation_contactgroups         OK
nagios.nagios_hostescalation_contacts              OK
nagios.nagios_hostescalations                      OK
nagios.nagios_hostgroup_members                    OK
nagios.nagios_hostgroups                           OK
nagios.nagios_hosts                                OK
nagios.nagios_hoststatus                           OK
nagios.nagios_instances                            OK
nagios.nagios_logentries                           OK
nagios.nagios_notifications                        OK
nagios.nagios_objects                              OK
nagios.nagios_processevents                        OK
nagios.nagios_programstatus                        OK
nagios.nagios_runtimevariables                     OK
nagios.nagios_scheduleddowntime                    OK
nagios.nagios_service_contactgroups                OK
nagios.nagios_service_contacts                     OK
nagios.nagios_servicechecks                        OK
nagios.nagios_servicedependencies                  OK
nagios.nagios_serviceescalation_contactgroups      OK
nagios.nagios_serviceescalation_contacts           OK
nagios.nagios_serviceescalations                   OK
nagios.nagios_servicegroup_members                 OK
nagios.nagios_servicegroups                        OK
nagios.nagios_services                             OK
nagios.nagios_servicestatus                        OK
nagios.nagios_statehistory                         OK
nagios.nagios_systemcommands                       OK
nagios.nagios_timedeventqueue                      OK
nagios.nagios_timedevents                          OK
nagios.nagios_timeperiod_timeranges                OK
nagios.nagios_timeperiods                          OK
nagios.snmptt                                      OK
nagios.snmptt_archive                              OK
nagios.snmptt_unknown                              OK
[ log]#

Nagios ndomod Still unable to connect to data sink Error

Nagios ndomod Still unable to connect to data sink Error


Nagios Error Code:-

[ log]# tail -f messages
Jun 17 03:51:44 eznag nagios: ndomod: Still unable to connect to data sink.  3585388 items lost, 5000 queued items to flush.
Jun 17 03:52:00 eznag nagios: ndomod: Still unable to connect to data sink.  3585561 items lost, 5000 queued items to flush.
Jun 17 03:52:16 eznag nagios: ndomod: Still unable to connect to data sink.  3585774 items lost, 5000 queued items to flush.
Jun 17 03:52:32 eznag nagios: ndomod: Still unable to connect to data sink.  3585877 items lost, 5000 queued items to flush.
Jun 17 03:52:48 eznag nagios: ndomod: Still unable to connect to data sink.  3585970 items lost, 5000 queued items to flush.

Resolution:-

Run below Linux commands.

[ log]#service nagios stop

Delete the sock file.
[ log]#rm /usr/local/nagios/var/ndo.sock

[ log]#service nagios start

Check logs, It will stop "Still unable to connect to data sink" error logs.

[ log]# tail -f messages
Jun 23 16:31:43 eznag nagios: ndomod: Successfully connected to data sink.  8 queued items to flush.
Jun 23 16:31:43 eznag nagios: ndomod: Successfully flushed 8 queued items to data sink.
Jun 23 16:31:43 eznag nagios: Event broker module '/usr/local/nagios/bin/ndomod-3x.o' initialized successfully.
Jun 23 16:31:43 eznag nagios: npcdmod: Copyright (c) 2008-2009 Hendrik Baecker () - http://www.pnp4nagios.org
Jun 23 16:31:43 eznag nagios: npcdmod: /usr/local/nagios/etc/npcd.cfg initialized
Jun 23 16:31:43 eznag nagios: npcdmod: spool_dir = '/usr/local/nagios/var/spool/'.
Jun 23 16:31:43 eznag nagios: npcdmod: perfdata file '/usr/local/nagios/var/perfdata.dump'.
Jun 23 16:31:43 eznag nagios: npcdmod: Ready to run to have some fun!
Jun 23 16:31:43 eznag nagios: Event broker module '/usr/local/nagios/lib/npcdmod.o' initialized successfully.
Jun 23 16:31:43 eznag nagios: Finished daemonizing... (New PID=10457)

Friday, November 24, 2017

Error 404 page not found on Blogger Custom Domain

Error 404 page not found on Blogger Custom Domain


If anybody facing issue blogger below error message. please implement the below steps in your blogger settings.

  • 404 error page not found
  • Error 404 instead of my blogger custom domain
  • domain 404 error issue in Blogger


Solution:-

Settings -> Publishing -> Blog Address -> Edit -> Simply enable checkbox Redirect warje.com to www.warje.com -> Click Save Option.







Friday, November 10, 2017

MySQL Database Purge Binary Logs on any Windows / Linux Platforms

MySQL Database Purge Binary Logs on any Windows / Linux Platforms

The binary log is a set of files that contain information about data modifications made by the MySQL server. The log consists of a set of binary log files.

The PURGE BINARY LOGS statement deletes all the binary log files listed in the log index file prior to the specified log file name or date. BINARY and MASTER are synonyms. Deleted log files also are removed from the list recorded in the index file, so that the given log file becomes the first in the list.

How to Delete Binary Logs and Master Logs on Windows Platforms Steps.

First Open MySQL admin command prompt. Type root id and root user password.

Step -1

Show list of binary logs files on MySQL Server.

mysql>SHOW BINARY LOGS;



Step -2

Display master logs file and Delete master log file using command marked Red color in a screenshot.

mysql>SHOW MASTER STATUS;
mysql>RESET MASTER;




Step -3

Delete single binary log file using command marked Red color in a screenshot.




Step -4

Delete all binary log file using command marked Red color in a screenshot. Specify the correct date which dates older files you want to delete.

mysql>PURGE BINARY LOGS BEFORE '2017-10-27 00:00:00';



Step -5

Show list of binary logs files on MySQL Server. Now showing only one, rest all deleted.



Thursday, March 16, 2017

Run Multiple Instances of Google Drive on Windows 7 / 8 /10 to Sync Multiple Accounts

Run Multiple Google Backup and Sync Accounts
Configure on Windows 7 / 8 /10 

Step 1: 

Please Install Google Drive Backup and Sync on your computer. Download available below link.

https://www.google.com/drive/download/


After installation, Please configure your First Google Drive account.

Step 2: 

For Second Google Drive account; Please create one New folder at any location on your windows 7/8/10 system/laptop.

Create one new mohan.bat or XXXXXX.bat file and open in notepad , add below mention entry.

@ECHO OFF
SET USERNAME=mohan@ gmail.com
SET USERPROFILE=%~dp0%USERNAME%
MD "%USERPROFILE%\AppData\Roaming">nul
MD "%USERPROFILE%\AppData\Local\Application Data">nul
MD "%USERPROFILE%\Application Data">nul
MD "%USERPROFILE%\Local Settings\Application Data">nul
MD "%USERPROFILE%\My Documents">nul
MD "%USERPROFILE%\Documents">nul
START googledrivesync
                                                                                                                                                        

Reference Note:-

mohan à Replace with your mail account name [Or] Other name which you like "My mail" or "My Inbox". Remaining scripts Don't change / Don't  Remove any space between letter/words.


Step 3:


Copy googledrivesync.exe file from Existing installed google drive location 
(C:\Program Files (x86)\Google\Drive ) to New folder location which you created. Refer below screen shot.



Step 4:

Simply open mohan.bat (XXXXX.bat)  file. It will open new google drive backup and sync login windows (Reference below screen shot)..You can add another gmail account and configure it.






After configure you can see Two Google Drive icon in task bar.



Step 5:

New Google Drive Account Auto start option. Create shortcut using mohan.bat / XXXXX.bat file and cut, paste shortcut to windows startup location.

Windows 10 windows startup location:

C:\Users\Dell\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup



After the reboot of system. Google drive second account will start automatically.




If need more account to be configure. Please follow Step 2 to Step 5.



Saturday, January 14, 2017

Setup External SMTP Server to Send Nagios Notifcation Alerts on CentOS/Linux

Setup External SMTP Server to Send Nagios Notifcation Alerts on Linux


Setup up Nagios to use an external SMTP server.


1. Download the SendEmail setup tar file from below link.

[or ]   Directly use wget command on Linux command prompt.

root#wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz

2. Extract, and copy sendEmail to /usr/local/bin

root#tar -xvzf sendEmail-v1.56.tar.gz
root#cp sendEmail-v1.56/sendEmail /usr/local/bin

3. SendEmail requires the Net::SSLeay and IO::Socket::SSL perl modules be installed to function, so install these if they're not already:

root#yum install perl-Net-SSLeay
root#yum install perl-IO-Socket-SSL

For Testing run below command on Linux command prompt. You will get Test Mail. If receiving Test mail. Your external mail server installed successfully.

root#/usr/local/bin/sendEmail -f -t -u TestMail -m TestMail -s smtp.mail.com:587 -xu -xp -o tls=yes

Note:- Change below Parameters respectively to your mail config details.

-> From Address
smtp.mail.com -> SMTP Outgoing Server 
587 -> SMTP Server port with TLS
-> Mail Server Username
-> Password


4. Now modify the notify-host-by-email and notify-service-by-email commands in Nagios' commands.cfg file as follows:

root#vi /usr/local/nagios/etc/objects/commands.cfg

define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/local/bin/sendEmail -f -s smtp.mail.com:587 -xu -xp -o tls=yes -u "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" -t $CONTACTEMAIL$
}

define command{
command_name notify-service-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/local/bin/sendEmail -f -s smtp.mail.com:587 -xu -xp -o tls=yes -u "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" -t $CONTACTEMAIL$
}


5.Update below entry on contacts.cfg file.

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

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

        email                            ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS *****

service_notification_period             24x7
host_notification_period        24x7
        service_notification_options            w,u,c,r,f,s
        service_notification_commands           notify-service-by-email
        host_notification_period                24x7
        host_notification_options               d,u,r,f,s
        host_notification_commands              notify-host-by-email
        }


define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 nagiosadmin
        }


6. Restart your Nagios service.

root# /etc/init.d/nagios restart
Your done. Nagios will now send alert notifcations via your external SMTP server.


How to Change Nagios Default Context Path

Nagios Default Context Path Change Steps

If you want change nasios default /nagios context path to new context path.

**Marked Red color New context path

root#vi /etc/httpd/conf.d/nagios.conf

Alias /mohantool/ /usr/local/nagios/share/
Alias /mohanadmin/ /usr/local/nagios/eznag/php/mmi/

root#vi /usr/local/nagios/etc/cgi.cfg

url_html_path=/mohantool

[ conf]# /usr/sbin/apachectl stop

[ conf]# /usr/sbin/apachectl start

After that try below URL on any browser.

http://172.0.0.1/mohantool/   --> Nagios Main Page

http://172.0.0.1/mohanadmin/   --> Nagios Admin Page




How To Change Timezone IST on a CentOS 6 and 7

Change Timezone  IST and Update NTP Time 

on a CentOS 6 and 7

Step: 1

First login CentOS Linux putty session.

Step: 2

Run NTP update command using NTP Server or Google Server.

[ objects]# ntpdate 192.168.100.11
22 May 11:06:26 ntpdate[7057]: the NTP socket is in use, exiting

Step: 3

You willl see NTP Socket is in use Error. Run below commands.

[ objects]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]

Step: 4

NTP Command. Time updated successfully.

[ objects]# ntpdate 192.168.100.11
22 May 11:07:34 ntpdate[7096]: step time server 192.168.100.11 offset 51.408174 sec

Step:5

If you want change IST time/date format,Try below commands.

[ objects]# ln -sf /usr/share/zoneinfo/Asia/Calcutta /etc/localtime
[ objects]# date
Sun May 22 20:40:29 IST 2016






Wednesday, July 20, 2016

Microsoft SQL Server Databases Stuck in Restoring State

Microsoft SQL Server Databases Stuck in Restoring State


Overview

The RESTORE ... WITH RECOVERY option puts the database into a usable state, so users can access a restored database. 


This is likely caused by the restore script adding the WITH NO RECOVERY parameter to make the database ready for a transaction log apply after the restore. The database is now waiting for the latest transaction log file.
You can either:
  1. Apply the latest transaction log (Using RESTORE LOG... WITH RECOVERY)... or
  2. Restore the database again, but this time using WITH RECOVERY ... or
  3. Force the database out of restoring mode by executing: RESTORE DATABASE YourDb WITH RECOVERY
Before you do this, please make sure you understand the implications of these options. You may cause data loss if you are not careful.

Run below commands in SQL Query windows

RESTORE DATABASE AdventureWorks WITH RECOVERY

Optional more Recovery commands:-
Restore full backup WITH RECOVERY
RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH RECOVERY
GO


Recover a database that is in the "restoring" state


RESTORE DATABASE AdventureWorks WITH RECOVERY
GO


Restore multiple backups using WITH RECOVERY for last backup


RESTORE DATABASE AdventureWorks FROM DISK = 'C:\AdventureWorks.BAK'
WITH NORECOVERY
GO
RESTORE LOG AdventureWorks FROM DISK = 'C:\AdventureWorks.TRN'
WITH RECOVERY
GO


Thursday, March 24, 2016

How to Reduce File System Size on Linux

How to Reduce File System Size on Linux


Before starting, it is always good to backup the data, if something goes wrong. Easily restore from backup.

To Reduce a logical volume / file system there are 5 steps needed to be done very carefully.
While extending a volume we can extend it while the volume under mount status (online) but for reduce we must need to unmount the file system before reducing.

Fallow the below 5 steps


  • unmount the file system for reducing.
  • Check the file system after unmount.
  • Reduce the file system.
  • Reduce the Logical Volume size than Current size.
  • Recheck the file system for error.
  • Remount the file-system back to stage.


Step 1:

# lvs

  LV      VG           Attr   LSize   Origin Snap%  Move Log Copy%  Convert
  lv_home vg_test01 -wi-ao 431.79g
  lv_root vg_test01 -wi-ao  50.00g
  lv_swap vg_test01 -wi-ao  17.72g

# df -h

Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_test01-lv_root
                       50G  4.9G   42G  11% /
tmpfs                 7.8G   88K  7.8G   1% /dev/shm
/dev/sda1             485M   35M  425M   8% /boot
/dev/mapper/vg_test01-lv_home
                      426G  199M  404G   1% /home

# umount -v /home
/dev/mapper/vg_test01-lv_home umounted

Step 2:

# e2fsck -ff /dev/mapper/vg_test01-lv_home
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vg_test01-lv_home: 11/28303360 files (0.0% non-contiguous), 1827094/113190912 blocks

Step 3:

# resize2fs /dev/mapper/vg_test01-lv_home 250G
resize2fs 1.41.12 (17-May-2010)
Resizing the filesystem on /dev/mapper/vg_test01-lv_home to 65536000 (4k) blocks.
The filesystem on /dev/mapper/vg_test01-lv_home is now 65536000 blocks long.


Step 4:

# lvreduce -L -250G /dev/mapper/vg_test01-lv_home
  WARNING: Reducing active logical volume to 181.79 GiB
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce lv_home? [y/n]: y
  Reducing logical volume lv_home to 181.79 GiB
  Logical volume lv_home successfully resized

Step 5


mount /home (or) mount -f /home
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_test01-lv_root
                       50G  4.9G   42G  11% /
tmpfs                 7.8G   88K  7.8G   1% /dev/shm
/dev/sda1             485M   35M  425M   8% /boot
/dev/mapper/vg_test01-lv_home
                       50G  4.9G   42G  11% /home


Successfully reduced /home file system size.



Sunday, March 20, 2016

Cisco Network Time Protocol (NTP) and Change Time format to Indian Standard (IST)


Cisco Network Time Protocol (NTP) and Change Time format to IST Indian Standard

NTP (Network Time Protocol) is used to allow network devices to synchronize their clocks with a central source clock. For network devices like routers, switches or firewalls this is very important because we want to make sure that logging information and time stamps have the accurate time and date.

MOHAN-SUNDARAM#show clock
*14:09:12.784 UTC Sun Mar 18 2016 --> Incorrect timezone.

How to Change Time / Date format to IST Indian Standard, Try below commands

MECT-D-Block-SW#conf t
Enter configuration commands, one per line.  End with CNTL/Z.

MECT-D-Block-SW(config)#clock timezone UTC +5 30

MOHAN-SUNDARAM(config)#do show clock
*15:12:59.784 UTC Sun Mar 20 2016

How to Configure Cisco Switch / Firewall  NTP Server:-

MOHAN-SUNDARAM(config)#do show clock
*15:12:59.784 UTC Sun Mar 20 2016  -->  Still showing incorrect time and Clock unsynchronized.

MOHAN-SUNDARAM#show ntp status
Clock is unsynchronized, stratum 16, no reference clock
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**10
reference time is 00000000.00000000 (05:30:00.000 UTC Mon Jan 1 1900)
clock offset is 0.0000 msec, root delay is 0.00 msec
root dispersion is 50.12 msec, peer dispersion is 0.00 msec
loopfilter state is 'FSET' (Drift set from file), drift is 0.000000000 s/s
system poll interval is 8, never updated.

Try below step by step commands.

Step 1:

Use Google DNS Server.

MOHAN-SUNDARAM(config)#ip name-server 8.8.8.8

Step 2:

Synchronize using clock with the public NTP server.

MOHAN-SUNDARAM(config)#ntp server pool.ntp.org
Translating "pool.ntp.org"...domain server (8.8.8.8) [OK]


Above we see the show ntp associations command that tells us if our clock is synchronized or not. The ~ in front of the IP address tells us that we configured this server but we are not synchronized yet. You can see this because there is no * in front of the IP address and the “st” field (stratum) is currently 3.


Step 3:

MOHAN-SUNDARAM(config)#do show ntp associations

  address         ref clock       st   when   poll reach  delay  offset   disp
*~123.108.200.124 125.62.193.121   3      4     64     1 46.982   1.985 188.53
 * sys.peer, # selected, + candidate, - outlyer, x falseticker, ~ configured


Step 4:

MOHAN-SUNDARAM(config)#do show ntp status
Clock is unsynchronized, stratum 16, no reference clock
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**10
reference time is 00000000.00000000 (05:30:00.000 UTC Mon Jan 1 1900)
clock offset is 0.0000 msec, root delay is 0.00 msec
root dispersion is 50.12 msec, peer dispersion is 0.00 msec
loopfilter state is 'FSET' (Drift set from file), drift is 0.000000000 s/s
system poll interval is 8, never updated.


The router tells us that we are unsynchronized and that there is no reference clock.
we will just wait a couple of minutes and take a look at these commands again.


MOHAN-SUNDARAM(config)#do show ntp status

Clock is synchronized, stratum 4, reference is 123.108.200.124
nominal freq is 250.0000 Hz, actual freq is 250.0000 Hz, precision is 2**10
reference time is DA994010.8C49BBE0 (20:58:16.548 UTC Sun Mar 20 2016)
clock offset is 1.9850 msec, root delay is 356.06 msec
root dispersion is 4047.21 msec, peer dispersion is 188.53 msec
loopfilter state is 'CTRL' (Normal Controlled Loop), drift is 0.000000000 s/s
system poll interval is 64, last update was 28 sec ago.

Step 5:

NTP Server time updated successfully.

MOHAN-SUNDARAM#show clock detail
*14:39:41.930 UTC Sun Mar 20 2016
Time source is NTP



Saturday, February 20, 2016

Windows 10 Hangs when creating a new folder and hangs again when Renaming Folder

Windows 10 Hangs when creating a new folder and hangs again when Renaming Folder


Click Windows Start Click "File Explorer " option - Click "View" option – Click "Options" and then "Change folder and search options"


Under Privacy:


Deselect “Show frequently use folders in Quick access.”
Deselect “Show recently used folders in Quick access.”
Then click on “Clear” and OK to save your preferences.





Sunday, February 14, 2016

MySQL Database Installation Using RPM Package on Redhat & Other Linux

MySQL Database Installation Using RPM Package on 

Redhat & Other Linux 


Download below RPM Packages below MySQL Site.

http://dev.mysql.com/downloads/mysql/

[ ~]# ls -ltr
-rwxrwxr-x. 1 root root   3806848 Feb  5 10:59 mysql-community-devel-5.7.10-1.el6.x86_64.rpm
-rwxrwxr-x. 1 root root  23788680 Feb  5 11:21 mysql-community-client-5.7.10-1.el6.x86_64.rpm
-rwxrwxr-x. 1 root root 140055132 Feb  5 11:41 mysql-community-server-5.7.10-1.el6.x86_64.rpm
-rwxrwxr-x. 1 root root   2229848 Feb  5 12:04 mysql-community-libs-5.7.10-1.el6.x86_64.rpm
-rw-r--r--. 1 root root    332252 Feb  5 12:29 mysql-community-common-5.7.10-1.el6.x86_64.rpm

Install RPM Packages:

[ ~]# rpm -ivh mysql-community-common-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-common-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-common ########################################### [100%]
[ ~]# rpm -ivh mysql-community-libs-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-libs-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-libs   ########################################### [100%]
[ ~]# rpm -ivh mysql-community-client-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-client-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-client ########################################### [100%]
[ ~]# rpm -ivh mysql-community-server-5.7.10-1.el6.x86_64.rpm
warning: mysql-community-server-5.7.10-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ########################################### [100%]
   1:mysql-community-server ########################################### [100%]

MySQL stop / start Service:

[ ~]# service mysqld stop
Stopping mysqld:                                           [  OK  ]
[ ~]# service mysqld start
Starting mysqld:                                           [  OK  ]
[ ~]# service mysqld status
mysqld (pid  3138) is running...

Get Temp. MySQL Password:

[ ~]# grep 'temporary password' /var/log/mysqld.log
2016-02-05T07:28:43.322922Z 1 [Note] A temporary password is generated for : e%clot#eT4he

[ ~]# mysql -uroot -p
Enter password: Type Above Temp. password "e%clot#eT4he"
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.10

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

Reset the password:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '';
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[ ~]# mysql -uroot -p
Enter password: Type New Password ""
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.7.10 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> quit
Bye

Check MySQL Service Running Status Commands:

[ ~]# ps -eaf | grep mysql

root      2942     1  0 12:59 pts/0    00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql
mysql     3138  2942  0 12:59 pts/0    00:00:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root      3249  2279  0 13:05 pts/0    00:00:00 grep mysql
[ ~]#