Search This Blog

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.




Hit Counter


View My Stats