Search This Blog

Showing posts with label drvijayy2k2. Show all posts
Showing posts with label drvijayy2k2. Show all posts

Thursday, June 8, 2023

Why python django uploaded images not showing in angular UI profile or any screen ?

Option 1: 

    Note:  keep your images under media/ <folder> for upload and view 


Option 2: 

if you want to change the default media folder under your project root, 

then please go to settings.py 

MEDIA=<custom path> 

MEDIA_URL=<path after above media settings>


Now

http://<url:port>/media/customfolder/image.jpg



Tuesday, June 6, 2023

Ubuntu Port Firewall uwf - not via iptables

 step 1: apt install ufw

step 2: ufw enable

step 3:   sudo nano /etc/default/ufw

          #enable ipv6=yes

step 4: Added default deny of incoming and allow outgoing

   sudo ufw default deny incoming

   sudo ufw default allow outgoing


#. to see the list   

sudo ufw app list


step 5: #. Allow open ssh for all your login and other operations

sudo ufw allow OpenSSH

   sudo ufw allow ssh

   sudo ufw allow 22

   sudo ufw show added

   sudo ufw enable


step 6: #. Allow default web ports and custom ports

   sudo ufw allow http

   sudo ufw allow https

   sudo ufw allow 8099

   sudo ufw allow 88


 

#. To see the port list

   sudo ufw status verbose


#. To deny the ports

   sudo ufw deny <port>


Thank You

https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04



Thursday, June 1, 2023

Linux Ubuntu - SSH command to copy server to local or vice versa

 Copy file to Server to Local

    scp -P <port> <localfile path> <server user>@ip:<remote user home path>

    ex: > scp -P 22 mq/target/test.jar drvijay@192.2.2.2:/home/drvijay


Connect server : 

        ssh -p <port> <server user>@<IP>
        ssh -p 22 drvijay@182.2.2.2

Copy file from Server to Local
 





Note: ssh -p <port> small case for port option
          scp -P <port> upper -P for port specify.




Wednesday, May 31, 2023

Linux Ubuntu - See Running process with port number and details for that service

To see the pid details of running process

step 1.

lsof -i TCP:<port number>


lsof -i TCP:99


step 2

ps -ef | grep <pid>

ps -ef | grep 39100


step 3

kill -9 <pid>

Thursday, April 20, 2023

How to skip or exclude Spring Hibernate @entities @tables creation

 Step 1:

    In your application.properties 

spring.jpa.properties.hibernate.hbm2ddl.schema_filter_provider=<your class with pacakge>
spring.jpa.properties.hibernate.hbm2ddl.schema_filter_provider=com.drvijay.ExcludeFilter

or application.yml

spring:

  jpa:

    properties:

      hibernate:

        hbm2ddl:

          schema_filter_provider: com.drvijay.ExcludeFilter


Step 2: ExcludeFilter.java

package com.drvijay;

import java.util.Arrays;

import java.util.List;

import org.hibernate.boot.model.relational.Namespace;

import org.hibernate.boot.model.relational.Sequence;

import org.hibernate.mapping.Table;

import org.hibernate.tool.schema.spi.SchemaFilter;

import org.hibernate.tool.schema.spi.SchemaFilterProvider;

public class ExcludeFilter implements SchemaFilterProvider

{

@Override

public SchemaFilter getCreateFilter ()

{

return MySchemaFilter.INSTANCE;

}

@Override

public SchemaFilter getDropFilter ()

{

return MySchemaFilter.INSTANCE;

}

@Override

public SchemaFilter getMigrateFilter ()

{

return MySchemaFilter.INSTANCE;

}

@Override

public SchemaFilter getValidateFilter ()

{

return MySchemaFilter.INSTANCE;

}

}

class MySchemaFilter implements SchemaFilter

{

public static final MySchemaFilter INSTANCE = new MySchemaFilter ();

@Override

public boolean includeNamespace ( Namespace namespace )

{

return true;

}

@Override

public boolean includeTable ( Table table )

{

List <String> list = Arrays.asList ( "table1", "table2" );

if ( list.contains ( table.getName ().toLowerCase () ) )

{

return false;

}

return true;

}

@Override

public boolean includeSequence ( Sequence sequence )

{

return true;

}

}

Wednesday, March 29, 2023

ModuleNotFoundError: no module named 'gaze_tracking', but installed python 3.x

 #Gaze_tracking

1. Install with below command, 

pip install gaze_tracking

2. find site-packages path with below command

> python -m site


3. extract gaze_tracking.zip and copy into site-packages

        > download the zip and extract into site-packages folder

    > git clone https://github.com/Arsenal-iT/gaze_tracking.git



Tuesday, March 21, 2023

Install Python Specific version upgrade or downgrade and Also Virtual Environment with the specific Python Version

1. install python 3.7 and 3.7 virtual env 

**********************************

sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt update

sudo apt install python3.7

sudo apt install python3.7-venv



2. create environment
*******************
#goto your project root folder

python3.7 -m venv env3.7

source env3.7/bin/activate

now check version, all same
************************
python3 --version
python --version
python3.7 --version
pip --version
pip3 --version


3. upgrade pip
*************
python3.7 -m pip install --upgrade pip

Friday, February 24, 2023

Apache2 disable directory listing

Step 1: The best way to do this is disable it with webserver apache2. In my Ubuntu 14.X - open /etc/apache2/apache2.conf change from


Sample

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

to

<Directory /var/www/>
        Options FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

Thursday, January 12, 2023

Solution Ubuntu - Anydesk Gtalk Teams Skype Screen Sharing Not Working

 Step 1: type below command in terminal

    > echo $XDG_SESSION_TYPE


Step 2: Open this file and remove the Comment # like below & reboot

> sudo nano /etc/gdm3/custom.conf

WaylandEnable=false


>reboot

Wednesday, December 14, 2022

Monday, November 21, 2022

Ubuntu - Apache2 403 forbidden after changing the directory path apache2.conf Solution

 Step 1 

Always better to create a folder under your home/user folder.

for ex:

    mkdir /home/drvijay/html

    cd /home/drvijay/

    chmod -R 775 html/

    chown drvijay:drvijay html/

 

Step 2

> sudo nano /etc/apache2/sites-available/000-default.conf

#Comment the older root path and add yours

#       DocumentRoot /var/www/html

        DocumentRoot /home/drvijay/html 


Step 3

> gedit /etc/apache2/apache2.conf

#add your block and comment the /var/www/html block



Step - 4

 systemctl restart apache2


Enjoy

http://localhost



Monday, November 7, 2022

AnyDesk - Remote Server Display Not Supported Solution

Step 1 - OPEN the custom.conf 

        >sudo gedit /etc/gdm3/custom.conf

             or

        > sudo vi /etc/gdm3/custom.conf


Step 2- Uncomment the below line and change user1 to $USERNAME  [current user name]

          WaylandEnable=false

          AutomaticLoginEnable = true

          AutomaticLogin = $USERNAME    


Step 3- Then restart your PC, then try to login remotely again.    

Step 4- Execute the below services.

        sudo service gdm3 restart

        sudo service gdm restart 



ENJOY

Thursday, September 22, 2022

Unable to resolve module react-native-reanimated


step 1. npm i react-native-reanimated


step 2. add plugin babel.config.js


module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
   plugins: [
          'react-native-reanimated/plugin',
      ],
};

step 3 When trying to run the code after close the terminal I still I'm facing same issue

  Error: Reanimated 2 failed to create a worklet, maybe you forgot to add Reanimated's babel plugin


step 4. After that, i close the current terminal and run this command

npm start -- --reset-cache 


Enjoy !

Tuesday, September 20, 2022

React Native TypeError: cli.init is not a function Error !

1. Dont use react-native init <ProjectName>


use like below.

npx react-native init YourProjectName --version 0.68.2



Monday, September 19, 2022

Android Virtual Device - AVD Setup

 1. Install Andriod SDK

2. Set environment for ANDROID_HOME=/home/android/sdk...

3. Install AVD or Android Studio

4. Open Android Studio 

           /home/android-studio/bin/

                        ./studio.sh


5. In that android Studio, you can see Configure Button -> AVD



6. Create Virutal Device or AVD like below. 



7. Start The Emulator by click Play button



8. Add environment variable.

      8.1  goto /etc/profile.d/    [create one file.sh] ex: > sudo vi myenv.sh
         
      export ANDROID_HOME=$HOME/Library/Android/sdk
      export PATH=$PATH:$ANDROID_HOME/emulator
      export PATH=$PATH:$ANDROID_HOME/tools
      export PATH=$PATH:$ANDROID_HOME/tools/bin
      export PATH=$PATH:$ANDROID_HOME/platform-tools

9. > source /etc/profile




Monday, February 21, 2022

How to enable JavaScript in your Chrome browser for localhost

 

Google Chrome

  1. On the web browser menu click on the "Customize and control Google Chrome" and select "Settings".
  2. In the "Settings" section click on the "Show advanced settings..."
  3. Under the the "Privacy" click on the "Content settings...".
  4. When the dialog window opens, look for the "JavaScript" section and select "Allow all sites to run JavaScript (recommended)".
  5. Click on the "OK" button to close it.
  6. Close the "Settings" tab.
  7. Click on the "Reload this page" button of the web browser to refresh the page.


Tuesday, October 26, 2021

Ubuntu Linux - Connect Postgresql from Psql and also PGadmin Remotely

 Step 1 :

> sudo su

> vi /etc/postgresql/10/main/postgresql.conf

#listen_addresses = 'localhost'
to 
listen_addresses = '*'

>vi /etc/postgresql/10/main/pg_hba.conf
# IPv4 local connections:
host all all 127.0.0.1/32 md5

to
host all all 0.0.0.0/0 md5


>sudo ufw allow 5432/tcp
>sudo systemctl restart postgresql


>psql -h localhost -d databasename -U userrolename
...enterpasswordfor-userrolename






Tuesday, September 7, 2021

Eclipse - Python Import Libraries or Error issues fixes

 step 1) Removing the interpreter, auto configuring it again

step 2) Window - Preferences - PyDev - Interpreters - Python Interpreter Go to the Forced builtins tab Click on New... Type the name of the module (tensorflow in my case) and click OK

step 3) Right click in the project explorer on whichever module is giving errors. Go to PyDev->Code analysis.

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.

Hit Counter


View My Stats