Tuesday, 18 August 2015

Kali Linux 2.0 Released

Finally waiting is over  :) Reloaded

https://www.kali.org/downloads/



Monday, 17 August 2015

Blogs list for learning Cloud

http://aws.amazon.com/articles/
https://aws.amazon.com/blogs/aws/
http://harish11g.blogspot.in/
http://sanketdangi.com/
http://highscalability.com/
http://www.ciphercloud.com/blog/
http://highscalability.com/
http://blogs.aws.amazon.com/security/blog

Sunday, 16 August 2015

Command to Start and Stop SAP instance and Oracle database in Unix

"stopsap all" - stop r3 and database.
"stopsap db" - stop only the database.
"stopsap r3" - stop r3 instance only.

"startsap all" - starts r3 and database.
"startsap db" - starts only the database.
"startsap r3" - starts r3 and assumes that the database is already started.

SAP Stoping Process in SUSE Linux Enterprise Server 11

Execute the following command  :

cloudadmin:ecdadm 51> stopsap all  
Checking ECD Database
Database is running
-------------------------------------------
stopping the SAP instance DVEBMGS00
Shutdown-Log is written to /home/ecdadm/stopsap_DVEBMGS00.log
-------------------------------------------
/usr/sap/ECD/DVEBMGS00/exe/sapcontrol -prot NI_HTTP -nr 00 -function Stop
Instance on host cloudadmin stopped
Waiting for cleanup of resources
...........
stopping the SAP instance ASCS01
Shutdown-Log is written to /home/ecdadm/stopsap_ASCS01.log
-------------------------------------------
/usr/sap/ECD/ASCS01/exe/sapcontrol -prot NI_HTTP -nr 01 -function Stop
Instance on host cloudadmin stopped
Waiting for cleanup of resources
.
Trying to stop ECD database ...
Log file: /home/ecdadm/stopdb.log
ECD database stopped
Checking ECD Database
Database is not available via R3trans

SAP Starting Process in SUSE Linux Enterprise Server 11

Given below the procedure for starting the SAP services.Change the host name and username as per your Deployment.

Login as oraecd user and execute the following commands:

Start Database:

cloudadmin:oraecd 51> sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 14 13:35:44 2014

Copyright (c) 1982, 2011, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 4576575488 bytes
Fixed Size                  2235848 bytes
Variable Size            2298479160 bytes
Database Buffers         2264924160 bytes
Redo Buffers               10936320 bytes
Database mounted.
Database opened.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Start Listener:

cloudadmin:oraecd 52> lsnrctl start

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 14-OCT-2014 13:36:42

Copyright (c) 1991, 2011, Oracle.  All rights reserved.

Starting /oracle/ECD/112_64/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 11.2.0.3.0 - Production
System parameter file is /oracle/ECD/112_64/network/admin/listener.ora
Log messages written to /oracle/ECD/saptrace/diag/tnslsnr/cloudadmin/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ECD.WORLD)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ECD)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cloudadmin.360.com)(PORT=1521)))

Connecting to (ADDRESS=(PROTOCOL=IPC)(KEY=ECD.WORLD))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production
Start Date                14-OCT-2014 13:36:46
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle/ECD/112_64/network/admin/listener.ora
Listener Log File         /oracle/ECD/saptrace/diag/tnslsnr/cloudadmin/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ECD.WORLD)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=ECD)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cloudadmin.360.com)(PORT=1521)))
Services Summary...
Service "ECD" has 1 instance(s).
  Instance "ECD", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
cloudadmin:oraecd 53>

Login as ecdadm user and start SAP services:

cloudadmin:ecdadm 57> startsap all cloudadmin
Checking ECD Database
Database is running
-------------------------------------------
Starting Startup Agent sapstartsrv
OK
Instance Service on host cloudadmin started
-------------------------------------------
starting SAP Instance ASCS01
Startup-Log is written to /home/ecdadm/startsap_ASCS01.log
-------------------------------------------
/usr/sap/ECD/ASCS01/exe/sapcontrol -prot NI_HTTP -nr 01 -function Start
Instance on host cloudadmin started
Starting Startup Agent sapstartsrv
OK
Instance Service on host cloudadmin started
-------------------------------------------
starting SAP Instance DVEBMGS00
Startup-Log is written to /home/ecdadm/startsap_DVEBMGS00.log
-------------------------------------------
/usr/sap/ECD/DVEBMGS00/exe/sapcontrol -prot NI_HTTP -nr 00 -function Start
Instance on host cloudadmin started
cloudadmin:ecdadm 58>

Thursday, 2 January 2014

Frequently used Exim Command

Frequently used Exim Command

============================================
============================================

#Print the total number of mail in mail queue.

 exim -bpc

#Print list of mails in the queue

 exim -bp

#Print summary of messages in queue

 exim -bp | exiqsumm

#Print what exim is currently doing now

 exiwhat

#Print message header

 exim -Mvh <message id>

#Print message's body

 exim -Mvb <message-id>

#Print a message logs

 exim -Mvl <message-id>

#It shows top 50 domains using mail server with options.

 eximstats -ne -nr /var/log/exim_mainlog

------------------------------------------------------------------------------------------------------------------------------------

#To remove a message from the queue

 exim -Mrm <message-id>

#To freeze a message

 exim -Mf <message-id>

#To remove all frozen mails in the queue

 exim -bp | grep frozen | awk '{ print $3 }' | xargs exim -Mrm

#To check how exim will route a given address

 exim -bt user@remotehost.com

#To search the queue for messages from a specific sender

  exiqgrep -f user@domain.com

#To search the queue for messages for a specific recipient/domain

  exiqgrep -r user@domain.com

#To print messages older than the specified number of seconds.

  exiqgrep -o <sec>

#To print messages that are younger than the specified number of seconds.

  exiqgrep -y <sec>

#To print the message-id of the entire queue

 exiqgrep -i

#To print a count of messages

  exiqgrep -c

#To remove all messages older than 10 day.

 exiqgrep -o 86400 -i | xargs exim -Mrm

#To freeze all queued mail from a given sender

 exiqgrep -i -f user@domain.com | xargs exim -Mf

# To remove all mail delivery failure mails.

   exiqgrep -i -f '<>'  | xargs exim -Mrm

Find Spam Mail in Cpanel server:Exim

Find Spam Mail in Cpanel server:Exim
====================================
====================================


#summary of mails in the mail queue.

 exim -bpr | exiqsumm -c | head

#To get all Message-ids of a Particular user

 exiqgrep -f <userid@mail.com>| grep '<' |cut -d"<" -f1 |awk '{print $3}'

 Provide username in above script

#Print message header

 exim -Mvh <message id>

#Print message's body

 exim -Mvb <message-id>

#To Delete all mail queue of a user by Message-id

exiqgrep -f <userid@mail.com>| grep '<' |cut -d"<" -f1 |awk '{print $3}' |xargs exim -Mrm

===================================================================
#To check the script that will originate spam mails:

 tail -f /var/log/exim_mainlog | grep cwd

 grep "cwd=/home" /var/log/exim_mainlog | awk '{for(i=1;i<=10;i++){print $i}}' | sort | uniq -c | grep cwd | sort -n

 awk '{ if ($0 ~ "cwd" && $0 ~ "home") {print $3} }' /var/log/exim_mainlog | sort | uniq -c | sort -nk 1

 grep 'cwd=/home' /var/log/exim_mainlog | awk '{print $3}' | cut -d / -f 3 | sort -bg | uniq -c | sort -bg

#To find exact spamming script currently running

  ps auxwwwe | grep <user> | grep --color=always "<location of script>" | head

  Provide username and location of script in above script

#Once you find the script ,following script will help you to find the ip address which is reponsable for the spamming.You can block the IP address 
 in  firewall

 grep "<script_name>" /home/username/access-logs/domain.com | awk '{print $1}' | sort -n | uniq -c | sort -n

 Provide Scriptname,username and domainname in above script

========================================================================

#In order to find “nobody” spamming, use the following command

 ps -C exim -fH ewww | awk '{for(i=1;i<=40;i++){print $i}}' | sort | uniq -c | grep PWD | sort -n

#To remove all frozen mails in the queue

 exim -bp | grep frozen | awk '{ print $3 }' | xargs exim -Mrm


#To remove a message from the queue

 exim -Mrm <message-id>