Thursday, March 12, 2020

Google Colab Session and keeping that alive

Google colab takes 90 minutes if we close the browser to disconnect the session. 12 hours if we keep the browser open. Additionally, if we close our browser with a code cell is running, if that same cell has not finished, when we reopen the browser it will still be running (the current executing cell keeps running even after browser is closed).
some times we have to keep out loaded data for long time. Usually google colab keeps disconnecting after 30 mins automatically if we do not respond. And our data is lost.
We can prevent this just by running the following code in the console and it will prevent  from disconnecting. Ctrl+ Shift + i to open inspector view . Then go to console.
function ClickConnect(){
console.log("Working"); document.querySelector("colab-toolbar-button#connect").click() } setInterval(ClickConnect,60000)
It would keep on clicking the page and prevent it from disconnecting. It will solve the issue for us.

Wednesday, March 11, 2020

How to reset the Weblogic admin server password


In some case we need to change the weblogic password, and then we can follow the below steps to reset it.

Step 1:

Set the following environment variables (update the domain name    as appropriate):

export FMW_HOME=/u01/app/oracle/product/middleware
export DOMAIN_HOME=$FMW_HOME/user_projects/domains/
export CLASSPATH=$CLASSPATH:$MW_HOME/wlserver_10.3/server/lib/weblogic.jar

NOw we will run the env as shown below.
. $DOMAIN_HOME/bin/setDomainEnv.sh

Step 2:

Need to shut down weblogic domain:
$DOMAIN_HOME/bin/stopWebLogic.sh

Step 3:

Rename and backup the DefaultAuthenticatorInit.ldift file as shown below,

cd $DOMAIN_HOME/security
mv DefaultAuthenticatorInit.ldift DefaultAuthenticatorInit.ldift.old

Now run the following command to generate a new DefaultAuthenticatorInit.ldift file. ((here ‘weblogic’ is default username))

java weblogic.security.utils.AdminAccount .

Note: Don't forget the period "." at the end of the this command, otherwise you will get "Error: Invalid arguments"

Rename and backup the following LDAP directory.

mv $DOMAIN_HOME/servers/AdminServer/data/ldap $DOMAIN_HOME/servers/AdminServer/data/ldap.old
(This ldap directory will be recreated once weblogic server startup time)

Step 4:


Back and Edit the boot.properties file and update the new password. (Above new_password)

cd $DOMAIN_HOME/servers/AdminServer/security
cp boot.properties  boot.properties_old

vi boot.properties
password=
username=

(Note: New password will be encrypted once server starts)

Step 5:


Now start your weblogic domain.

[oracle@appserver01 bin]# cd /root/MW_home/user_projects/domains/base_domain/bin/
[oracle@appserver01 bin]# ls
nodemanager  nohup.out  server_migration  service_migration  setDomainEnv.sh 
startManagedWebLogic.sh  startWebLogic.sh  stopManagedWebLogic.sh  stopWebLogic.sh
[oracle@appserver01 bin]# nohup ./startWebLogic.sh &
[oracle@appserver01 bin]# nohup: appending output to `nohup.out'
[oracle@appserver01 bin]# tail -f nohup.out 

Server state during the startup:
 
 
 
 
 
 

Now we can access your weblogic console page.

Sunday, February 23, 2020

AI vs ML vs DL vs DS


The most fundamental question of data science is what the basic difference among AI(Artificial Intelligence), ML(Machine Learning), DL(Deep Learning) and DS(Data Science). Many of us have confusion regarding this.

AI(Artificial Intelligence) enables the machine to think so that without human intervention the machine is capable of making its own decision. This is the final goal of an AI application.

Machine Learning is the sub-set of AI. It provides us with a statistical tool to explore and analyze the data for understanding. It has 3 different approaches:

   

  Supervised ML: 
Using this, Prediction is done on basis of past labeled data
Unsupervised ML:
It provides us the clustering technique . Base on similarities of data, it tries to group the data together. Hierarchical clustering,K-means clustering,K-NN (k nearest neighbors),Principal Component Analysis,Singular Value Decomposition,Independent Component Analysis
Reinforcement/ Semi Supervised ML:
This approach is used when some part of data is labeled and some are not labeled.



Deep learning: Sub-set of Machine Learning: 
It makes the machine learn to think like how the human brain does.
Multi Neural Network Architecture is used for the purpose. Its main target is to mimic the human brain.  Different techniques sued for this are:


ANN
If Data Input is in numeric form.

Convolutional Neural Networks (CNN)
If input is im images, videos ..
It generally used in the field of computer vision.
RNN
If input is in form of time series form of data




Data Science: Its a technique tries to apply all the above processes. Statistics, Probability, Linear Algebra, Differential Calculus. All the above things will have to be learnt for becoming a data scientist.  Data science is an inter-disciplinary field that uses scientific methods, processes, algorithms and systems to extract knowledge and insights from structured and unstructured data.[1][2] Data science is related to data mining and big data.