Search This Blog

Showing posts with label itarsenal. Show all posts
Showing posts with label itarsenal. Show all posts

Tuesday, August 31, 2021

Python - ImportError: cannot import name 'signature' from 'sklearn.utils.fixes'

 Please install funcsigs directly using

pip install funcsigs

and use from funcsigs import signature instead.


#ex:

#from sklearn.utils.fixes import signature

from funcsigs import signature



-- enjoy

Friday, July 23, 2021

How to install Gnome Extensions

 Extract the downloaded file. Copy the folder to ~/.local/share/gnome-shell/extensions directory. Go to your Home directory and press Crl+H to show hidden folders. Locate .local folder here and from there, you can find your path till extensions directory. 

Once you have the files copied in the correct directory, go inside it and open metadata.json file. Look for the value of uuid. 

Make sure that the name of the extension’s folder is same as the value of uuid in the metadata.json file. If not, rename the directory to the value of this uuid.

Manually install GNOME Shell extension
Name of extension folder should be the same as uuid

Almost there! Now restart GNOME Shell. Press Alt+F2 and enter r to restart GNOME Shell.

Restart GNOME Shell
Restart GNOME Shell

Restart GNOME Tweaks tool as well. You should see the manually installed GNOME extension in the Tweak tool now. You can configure or enable the newly installed extension here.

And that’s all you need to know about installing GNOME Shell Extensions.

Remove GNOME Shell Extensions

It is totally understandable that you might want to remove an installed GNOME Shell Extension.

If you installed it via a web browser, you can go to the installed extensions section on GNOME website and remove it from there (as shown in an earlier picture).

If you installed it manually, you can remove it by deleting the extension files from ~/.local/share/gnome-shell/extensions directory.

Wednesday, June 30, 2021

How to Host Flask Applications on Namecheap cPanel

Very good. 


1. Follow the link, 

 https://dev.to/lordghostx/how-to-host-flask-applications-on-namecheap-cpanel-299b


2. In Execute Python Script 

-m pip install --upgrade pip

-m pip install -r requirements.txt






Restart the server for app.py changes.


Joomla Wordpress - Friendly URL not working


1. Open Cpanel -> File Manager
    Top right corner ->Settings or find settings 
    Show Hidden Files. 

2. Goto public_html folder/.htaccess
paste the below block, save & close.

<IfModule mod_rewrite.c>
RewriteEngine On
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

3. Now goto global configuration ->joomla -> turn on Friend URL redirection.

Python - Image to Pdf

1. Install img2pdf

> pip/pip3 install img2pdf

2. img2pdfown.py


# importing necessary libraries

import img2pdf

from PIL import Image

import os

  

# CLI  img2pdf *jpg -o output_all_pngs.pdf

'''

img_path = "image1.jpg";

pdf_path = "output.pdf";

image = Image.open(img_path);

pdf_bytes = img2pdf.convert(image.filename);

file = open(pdf_path, "wb");

file.write(pdf_bytes);

image.close();

file.close();

'''


# convert all files ending in .jpg inside a directory

dirname = "dump/images/"

imgs = []

#dpix = dpiy = 300;

#layout_fun = img2pdf.get_fixed_dpi_layout_fun((dpix, dpiy))

for fname in os.listdir(dirname):

    if not fname.endswith(".jpg"):

        continue

    path = os.path.join(dirname, fname)

    if os.path.isdir(path):

        continue

    imgs.append(path)

    print ("\n" + path);

with open("dump/output.pdf", "wb") as f:

    #f.write(img2pdf.convert(imgs, layout_fun=layout_fun));

    f.write(img2pdf.convert(imgs));

  

'''    

imgs = ['dump/images/page_1.jpg', 'dump/images/page_2.jpg', 'dump/images/page_10.jpg']

with open("dump/output1.pdf", "wb") as f:

    f.write(img2pdf.convert(imgs))


# specify paper size (A4)

a4inpt = (img2pdf.mm_to_pt(210), img2pdf.mm_to_pt(297))

layout_fun = img2pdf.get_layout_fun(a4inpt)

with open("name.pdf", "wb") as f:

    f.write(img2pdf.convert('test.jpg', layout_fun=layout_fun))


# use a fixed dpi of 300 instead of reading it from the image

dpix = dpiy = 300;

layout_fun = img2pdf.get_fixed_dpi_layout_fun((dpix, dpiy))

with open("name.pdf", "wb") as f:

    f.write(img2pdf.convert('test.jpg', layout_fun=layout_fun))


# create a PDF/A-1b compliant document by passing an ICC profile

with open("name.pdf", "wb") as f:

    f.write(img2pdf.convert('test.jpg', pdfa="/usr/share/color/icc/sRGB.icc"))    

'''

    


Friday, June 18, 2021

React Native - Check Application is in Background or ForeGround with Time Diff - 10 seconds Move to Login Session Expired

 1. Install the below two mandatory npm plugins.

npm install --save react-native-async-storage

npm install --save moment


2. app.js


import React, { Component } from 'react';
import { StyleSheet, Text, View, AppState } from 'react-native';
//import Routing from "./src/routing/routing";
import AsyncStorage from '@react-native-async-storage/async-storage';
import moment from 'moment';
//import { Actions } from 'react-native-router-flux';

export default class App extends Component {
constructor() {
super();
this.state = {
appState: AppState.currentState
}
}
componentDidMount() {
AppState.addEventListener('change', this._handleAppStateChange);
}
componentWillUnmount() {
AppState.removeEventListener('change', this._handleAppStateChange);
}
_handleAppStateChange = async(nextAppState) => {
this.setState({ appState: nextAppState });
if (nextAppState === 'background') {
var previousTime = new Date();
await AsyncStorage.setItem( "previousTime", previousTime.toString() );
// Do something here on app background.
console.log( "App is in Background Mode @ ", previousTime );
}
if (nextAppState === 'active') {
// Do something here on app active foreground mode.
const start = moment( await AsyncStorage.getItem('previousTime') );
const end = moment();
//in original implementation, use minutes and check with N value.
//const range = end.diff(start,'minutes');
const range = end.diff(start,'seconds');
if ( range >= 10 ){
console.log ( "App is exit the Active Range, So moving to Login screen." );
/* Actions.login({"message":"Session Exit"} ); */
}
else{
console.log( "App is in Active Range, So continue your process ...");
}
}
if (nextAppState === 'inactive') {
// Do something here on app inactive mode.
console.log("App is in inactive Mode.")
}
};
render() {
return (
<View style={styles.MainContainer}>
{/* <Routing /> */}
<Text>Current state is: {this.state.appState}</Text>
</View>
);
}
}
const styles = StyleSheet.create({
MainContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
text: {
fontSize: 20,
color: '#000'
}
});

Tuesday, May 11, 2021

Eclipse - PHP Fatal error: Call to undefined function json_decode()

Add PHP 

1. Window->Preferences->Installed PHPs-> Add

    /usr/bin/<search php> select /usr/bin/php7.4.x

2. Check "Window->Preferences->Installed PHPs" checkbox "Use system default php.ini configuration" must be enabled. And I had to setup "apt install php-json" on my Ubuntu.

3. Enable Debug

   Open Terminal -> sudo apt-get install php-xdebug

4. Check "Window->Preferences->Installed PHPs" ->Debuger -> XDebug [from dropdown]



Enjoy

Monday, November 9, 2020

Forticlient SSL VPN - Ubuntu 16.x 18.x 20.x

 sudo apt update

 64 bit

wget https://hadler.me/files/forticlient-sslvpn_4.4.2333-1_amd64.deb


32 bit

wget https://hadler.me/files/forticlient-sslvpn_4.4.2333-1_amd32.deb

sudo dpkg -i forticlient-sslvpn_4.4.2333-1_amd64.deb 


After Installation

Just windows key or desktop search = type forticlient


Tuesday, October 13, 2020

Product Idea : Universal Hub for Patient Medical Records – UHPMR

 Idealist: D.R. Vijaykumar
Draft: Version 0.1

Why?
So far, Healthcare industry has been slow to adapt to a technology. Thus, the current healthcare ecosystem comprises in information systems that lack data security, interoperability, standardisation, sharing, collaborating and trust.

Who will do?
    This should avoid if a Single system handles the Patient Medical Records universally to storing all his Records electronically into a CENTRALIZED ARSENAL “CR” like Youtube for videos, which are imperative for seamless health information exchange to any System himself has a talking/collaborating facility and completely handle by Patient only only only.

To Whom?
Let’s begin with a Story!
A boy named Kumar from a South Indian middle class family, he lived with his parents. His father used to collect all his Son used items, photos, videos, dresses and all activities at each and every stage including his son’s school bills rather than medical records as a part of memories, When I asked his father, Why are you keeping school bills?, He replied with caution, School bills may useful if the school says, you didn’t pay your son tuition fees and he pointed out with smile, Not only to me!, most of the families are doing the same. Days went and I started watching his family activities, noted one thing and realize they didn’t keep the medical records as a part of activities.
Every time he took his son Mr. Kumar to the hospital whether Minor/Major problems. They will go like the first time visitor, because he doesn’t keep the medical records in their hand. He gave less important to his son medical records until his son diagnosed with unknown disease. A good doctor named Vijay, stepped into his son problem to analyse when it starts, initially he don’t have clue and faced many problems, Such as
•    When he faced similar kind of problems.
•    Which Physician or Hospital he visits.
•    What Doctors prescribed.
•    What course he went.
•    After what other medical issues faced in-between.
•    Is this a genetically inherited.  
•    Even well educated person will ignore the prescriptions prescribed by doctors on minor problems like cold, cough, headache, rashes, but they don’t aware even a headache is the symptoms for brain cancer and it can route to death.
At last a Good Doctor finds the reason that it is a “genetically inherited” which he got it from his own Mother where she passed away when he was kid. Unfortunately his son died, I was deeply saddened and want to know what happened to him, so I can build Software to overcome these situations between patient and doctor. So I personally contact the Good Doctor and discussed, here are the points he furnished with emotions.
As I am a Doctor, My duty is to cure all patients whoever visiting to our hospital. So we created a healthy ecosystem to give natural immune power to patients. Also we build Software where we can store all the Patient information’s and his visiting histories. But WE LAGGING AND LACKING to get all information’s about Patients. Even though Healthcare industry has grown far, still I am facing a problem, such as.
•    Only I can access the patient information which is stored in my Hospital Database.
#. But that is not sufficient to start prescribing a medicines to patient, because we cannot assure the patient is always visiting our hospital only.

•    Now Hospital Software systems are improved and its starts collaborating between Hospitals to share the Patient Medical Information based on the Patient request and consent approval.
#. But anytime the hospital himself can withdraw the sharing features, because it is not legalize yet.
#. They cannot serve, due to technical failure and it will impact when patient is in urgent.
#. Any changes from either a side will impact the smooth transition of PMR “Patient Medical Record”.
•    Even though Technology has helped the healthcare ecosystem to optimise these complex workflows by connecting the various stakeholders and providing real-time information that helps in delivering enhanced patient care.
#. But still all above problem exists.



What I “CR” do?    

    CENTRALIZED ARSENAL is the only solution where a Patient can keep his/her Medical Records electronically at one place.
•    Patients can upload his PMR at any time anywhere at any point and order it into right folder.
•    Patient can re-order the records at his/her convenient.
•    Global Internal SEO will make sure the patient can filter or search the records at any point.
•    Hospital can push the record via multiple channels to this centralized arsenal after patient consent.
•    No expiry for the records stored inside centralized arsenal.
•    Patient can directly share his MR “Medical Record” to doctor/hospital who installed the same UHPMR app or via web browsers.
•    It will be secure and not allowing Doctor to download.
•    Patient only can download or delete the PMR on his/her records.
•    Patient itself can set the expiry DT while sharing to doctor app.
•    Patient can revert at any time and no need to wait until the expiry DT set previously.


More Points will add @Draft V0.2

Monday, October 5, 2020

Ubuntu - Maven - SSL Error while doing mvn clean install

sudo dpkg --purge --force-depends ca-certificates-java sudo apt-get install ca-certificates-java sudo update-ca-certificates -f

Friday, September 25, 2020

Java Contains Byte String - Back to Original Content String from Byte Array String

Code


String str = "hello";
byte [] x = str.getBytes ();
System.out.println ( new String (x) );
String byStr = "104, 101, 108, 108, 111";
String a [] = byStr.split ( "," );
byte xx [] = new byte[a.length];
int count = 0;
for ( String s :  a)
{
xx[count++] = Byte.parseByte ( s.trim () );
}
System.out.println ( new String (xx) );


Output

hello

hello




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

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