18 dic 2024

scp 2 copy and paste files && tunnelling ssh 2 make use of vncserver:

 
kfoewfj9042u890jf8035vj3489vjn385vn358vhn358vh35809hv5
vgj34ivh38gfh3789vh34280vh408923vh835809vh358hb+3hb+035b
gvjbvh3589hv8vhj    3pçgjk    204guj340935nb3r5jbitbç
gvjriovbhj83409hvnuvb3r8hv3r8ivbheruobniernb er9jhb439ugj423

__________________________________________________________________________________________________
tunnelling ssh

so to make use of vncserver:

+--------------------------------------------+
|ssh -L 5901:localhost:5901 USER@REMOTE_IP   |
+--------------------------------------------+

prompt pass and leave open.


in remote machine (hereby) lets check server is up and runnin
for rpi, maight have to do this:

+-------------------------------------+
| $ sudo apt install tightvncserver   |
| $ tightvncserver                    |
| $ vncpasswd                         |
+-------------------------------------+

after that create init.d script...

+-------------------------------------+
|  sudo nano /etc/init.d/vncboot      |
+-------------------------------------+

...........................................................


#! /bin/sh
# /etc/init.d/vncboot

### BEGIN INIT INFO
# Provides: vncboot
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VNC Server at boot time
# Description: Start VNC Server at boot time.
### END INIT INFO

USER=pi
HOME=/home/pi

export USER HOME

case "$1" in
 start)
  echo "Starting VNC Server"
  #Insert your favoured settings for a VNC session
  su - $USER -c "/usr/bin/vncserver :1 -geometry 1280x600 -depth 24"
  ;;

 stop)
  echo "Stopping VNC Server"
  /usr/bin/vncserver -kill :1
  ;;

 *)
  echo "Usage: /etc/init.d/vncboot {start|stop}"
  exit 1
  ;;
esac

exit 0

...........................................................


after this done, change permissions on vncboot file recently created

+--------------------------------------+
| $ sudo chmod 755 /etc/init.d/vncboot |
+--------------------------------------+


Now leave this terminal and go to local machine, the one you are using ;-)


as root, install:

+---------------------------------+
| apt-get install xtightvncviewer |
+---------------------------------+

then promt -not as root!-:
+-----------+
| vncviewer |
+-----------+
and fill server and port (if copnfigured as uphere, yourser.ver:5901)
and password created...


Renember, in server side, to stop the server:
+----------------------------------------+
| vncserver –kill :1 (pick your display) |
+----------------------------------------+

...and to start it again
+-------------------------------------------+
| vncserver :1 –geometry 1024x600 –depth 24 |
+-------------------------------------------+

4 example!

=)
__________________________________________________________________________________________________

Oh!. Sorry. What you were looking for:

+----------------------------------------------------+
| scp /path/to/file username@a:/path/to/destination  |
|                                                    |
| scp username@b:/path/to/file /path/to/destination  |
+----------------------------------------------------+

Really. This command is most amazing!!!

__________________________________________________________________________________________________

sources:

https://www.techrepublic.com/article/how-to-connect-to-vnc-using-ssh/

https://librebit.github.io/raspberry/raspbian/vnc/server/2016/09/14/habilitar-vnc-server-en-raspberry-pi.html

https://www.tightvnc.com/vncviewer.1.php



fewrhufio43qh8f843yt14789tyty 9pyhfewu8fy 8247r bh7r575kj
 tr76498 75 bn7t58041 7rbn57n8 nt0 t3rqq3er qergeqrg3qr9
t 9886  8n9pq3fuiq3r`f82134f80     98f4¡3 9gae50giq3 ger f
refgq953qt 14¡39ie0fi w'782481yhru ogu0984239 tu423pgi0df

18 nov 2024

HOW TO make a online available folder store images downloaded from internet website in a certain interval of time.

--> Create your apache webserver. 
Then go  /var/www/html/ and make sure no index.html file is present. 
This way we will access the folder directly to access raw data.

Do not forget to mount yor external data drive (in order not to 
overcome OS drive capability with time) and EDIT YOUR /etc/bash.rc 
file adding the info bellow to do it every time you reboot. Best practice here!

--> Now create the script that will run to download images, starting from boot 
and lasting for computer's uptime. 

both things are done by editing the /etc/rc.local file in your raspberry pi.        
____________________________________________________________________________________________________________________
|   sudo mount /dev/sda1 /var/www/html &                                                                            |
|                                                                                                                   |
|   sudo watch -n 14400 wget -P /var/www/html/ https://sdo.gsfc.nasa.gov/assets/img/latest/latest_2048_HMII.jpg &   |
|                                                                                                                   |
|   exit 0                                                                                                          |
|___________________________________________________________________________________________________________________|

--> Run the necesary permissions update command

    
    sudo chmod +x /etc/rc.local


--> here -as an example- we are downloading a sun picture provided by nasa, 
every 4 hours (time in seconds)

... Now we wait and see the results.

I used imagemagick convert to create the funny ani.gif file! 
	
	sudo convert -delay 20 -loop 0  *.jpg.* ani.gif
	
...rollin`good up to date!