Saturday, 22 October 2016

Maths secrets :


  • Reverse of squares of 12 and 13 is equal to the squares of 21 and 31 respectively .


             12 x 12  = 144 | 441 = 21 x 21
             13 x 13  = 169 | 961 = 31 x 31


  • After 7 all prime numbers end with 1,3,7 or 9 . 

             For eg - 11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 etc


  • All squares of numbers are multiples of 4 or multiples of 4 +1 

            For eg - 9 =  4 x 2 + 1
                 16 =  4 x 4
                 25 =  4 x 6 + 1
                 36 =  4 x 9





Thursday, 6 October 2016

Decrypting Weblogic Password


If you forget your weblogic password , you can recover it as it is stored in boot.properties file in encrypted format .
NOTE : You have to make boot.properties file in AdminServer/security folder first, it is not automatically present .


Step 1 : 
  Create a script decrypt.py in $DOMAIN_HOME/security directory and paste the following code into it:

from weblogic.security.internal import *
from weblogic.security.internal.encryption import *

#This will prompt you to make sure you have SerializedSystemIni.dat file under #current directory from where you are running command

raw_input("Please make sure you have SerializedSystemIni.dat inside the current directory, if yes press ENTER to continue.")


# Encryption service

encryptionService = SerializedSystemIni.getEncryptionService(".")

clearOrEncryptService = ClearOrEncryptedService(encryptionService)


# Take encrypt password from user

pwd = raw_input("Please enter encrypted password (Eg. {3DES}Bxt5E3...): ")


# Delete unnecessary escape characters

preppwd = pwd.replace("\\", "")


# Decrypt password


print "Your password is: " + clearOrEncryptService.decrypt(preppwd)

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

Step 2 :
 
Go to $WL_HOME/server/bin folder
Run the below command to set environment
. ./setWLSEnv.sh ( make sure you have two dots separated by a space)

Step 3:
Goto $DOMAIN_HOME/servers/AdminServer/security/boot.properties file and copy the encrypted username 
Step 4 :
Run the script in $DOMAIN_HOME/security folder as 
java weblogic.WLST decrypt.py 
and enter the encrypted password when prompted and then press enter .
You will get the original password !!



Monday, 3 October 2016

How to run Weblogic's Admin / Managed / Nodemanager in background :



  • Open terminal
  • Navigate to $DOMAIN_HOME/servers/AdminServer
  • Create a new directory named security .
  • Go to security and create a file boot.properties
  • Enter the username and password in it 
  • eg -
  • username=weblogic
  • password=Welcome_1
  • ~
  • ~
  • NOTE : do not leave extra spaces ; the next line after password should have "~" sign .
  • Save this file and copy this file to managed server also . 
  • Then go to $DOMAIN_HOME/bin and run AdminServer as
  • nohup ./startWeblogic.sh &
  • Press enter to come out of it 
  • Then run tail command as
  • tail -f nohup.out
  • Now the server has been started in background 
  • You can close the terminal without affecting the severs . 


CHEERS !!