Search This Blog

Friday, August 7, 2020

Python AutoBot - ChatterBot Plugin

 >install python 3.8

> create your app folder

> pip or pip3 install  chatterbot
> pip or pip3 install   chatterbot-corpus

>Program mychat.py

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer

# Create a new chat bot named ArsenaliT
chatbot = ChatBot('ArsenaliT')

trainer = ListTrainer(chatbot)

trainer.train([
    "Hi",
    "Hi, can I help you?",
    "Sure, I'd like to book a flight to Iceland.",
    "Your flight has been booked."
])

user = "hi";
print("User : ", user)
response = chatbot.get_response(user)
print("Bot : ", response)

user = "I'd like to book a flight ";
print("User : ", user)
response = chatbot.get_response(user)
print("Bot : ", response)


> OUTPUT

User :  hi
Bot :  Hope you are safe and good
User :  I'd like to book a flight
Bot :  Your flight has been booked.



ENJOY

Wednesday, July 15, 2020

Tuesday, July 14, 2020

Mysql : replace special characters or any words in perticular column in UPDATE statement

Replace # symbol with empty in the given column.
 

SET SQL_SAFE_UPDATES = 0;

update table_name set col_name = replace (col_name,'#','');

Install HP Printer in Ubuntu 20.04

Goto https://developers.hp.com/hp-linux-imaging-and-printing/gethplip
download the hplib with for your OS.

> cd /home/drvijay/Downloads/

> sudo chmod +x hplip-3.20.6.run
> ./hplip-3.20.6.run

or

> sudo apt install hplip-gui

#if any error, then below command will fix

> sudo apt install $(echo $(apt-cache search hplip | sed 's/ - .*$//g'))


















windows key -> type -> hp tool box

Sunday, July 5, 2020

MySQL - Linux Ubuntu Environemnt - which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

please see one of the step will work

Step-1
In your mysql benchmark

SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));

Restart your mysql service.
> service mysql restart

OR

Step-2

In Linux Terminal > sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf Go to last line and add > sql_mode = "" Restart mysql server.
> service mysql restart

Friday, July 3, 2020

Failed to configure SaslClientAuthenticator Caused by: org.apache.kafka.common.KafkaException: Principal could not be determined from Subject, this may be a transient failure due to Kerberos re-login

#php
sasl.mechanisms = PLAIN

#java
//sasl.mechanism = java


props.put ( "ssl.endpoint.identification.algorithm","https");                  
props.put ( "sasl.jaas.config", "org.apache.kafka.common.security.plain.PlainLoginModule required serviceName=\"kafka\" username=\"XX\" password=\"xxx\";" );
props.put ( "sasl.mechanism", "PLAIN" );                //if it is java sasl.mechanism, for php = sasl.mechanisms


Tuesday, June 30, 2020

Spring Boot Hibernate 5 com.zaxxer.hikari.pool. active Connection is not Release

1. maxpoolsize = 100
2. idle time out = reduced to 10 seconds
3. save method in repo/services classes should close in entityManager
close in finally block {}
4. also told spring to use hibernate5.SpringContext in application.properties

 
4th application.properties

spring.datasource.hikari.leak-detection-threshold=10000
spring.jpa.properties.hibernate.current_session_context_class=org.springframework.orm.hibernate5.SpringSessionContext

1 & 2 in HikariPool Datasource settings

url=xxx
username=xx
password=xx
driverClassName=com.mysql.jdbc.Driver
connectionTimeout=30000
maxPoolSize=100
idleTimeout=10000
minIdle=10
poolName=xxxdb-connection-pool


3rd - EntityManager Connection close
 EntityManager entityManager = entityManagerFactory.createEntityManager ();
        try
        {
            if ( entityManager != null )
            {
                entityManager.getTransaction ().begin ();
                entityManager.merge ( xxx );
                entityManager.getTransaction ().commit ();
            }
        }
        catch ( Exception e )
        {
            System.out.println ( e.getMessage () );
        }
        finally
        {
            if ( entityManager != null )
            {
                entityManager.close ();
            }
        }






Wednesday, June 24, 2020

Ubuntu Linux - Gnome Disk Boot Uninstall - Asking new user profile at booting 52MB new Loop disk

sudo apt-get remove gnome-disk-utility sudo apt-get remove --auto-remove gnome-disk-utility sudo apt-get purge gnome-disk-utility sudo apt-get purge --auto-remove gnome-disk-utility sudo apt update

Tuesday, June 23, 2020

Connect Watchgaurd VPN in linux ubuntu 20.04

1. Go to Pritunl https://client.pritunl.com/
2. Scroll to bottom, Select your linux OS, for ex: Ubuntu 20.04
3. Copy and paste the steps in your terminal
4. Windows Key in your keyboard, type pritunl, Open Pritunl GUI

5. Go to windows machine which watchgaurd is already installed.
     “%Appdata%\Watchguard\Mobile VPN\
6. Copy the following files to your linux machine for ex: /home/drvijay/watchgaurd
     client.ovpn
     ca.crt
    client.crt
    client.pem

7. Now in pritunl -> click import profile -> select the client.ovpn
8. Select connect and Enter your user/pwd from the top left settings









-ENJOY
 

Hit Counter


View My Stats