====== Raspberry useful commands ======

===== Set static IP =====

Use nano (or any other text editor of your choice) to open the following file:
Copy Code

    nano /etc/dhcpcd.conf 

Add the following lines to the bottom of the file. If such lines already exist and are not commented out, remove them.

Replace the comments in brackets in the box below with the correct information. Interface will be either wlan0 for Wi-Fi or eth0 for Ethernet.

   #interface [INTERFACE]
   #static_routers=[ROUTER IP]
   #static domain_name_servers=[DNS IP]
   #static ip_address=[STATIC IP ADDRESS YOU WANT]/24

==== RPI4 ====
 


Open Network Manager UI with:
<code>
sudo nmtui
</code>
  * Choose “Edit connection”
  * Pick the connection you want to set to static, and select “Edit…” on the right.
  * Use the arrows on your keyboard to select the connection and the action button.






===== Set a password for root user=====


    #Set a password for root user:
    sudo passwd root

===== Allow root login =====


    #Allow root login
    sudo nano /etc/ssh/sshd_config
    #Authentication:  PermitRootLogin: yes
    #restart ssh service
    sudo service ssh restart

===== Useful commands =====

    #Gateway DNS
    route -n
    cat /etc/resolv.conf
     
    
    #Secure off
    sudo shutdown -h now
    
    #Memory
    free -m
    
    #disks
    lsblk -f
    
    #Version OS
    /cat/etc/osrelease
    lsb_release -a
    
    #Temperature
    vcgencmd measure_temp
    
    #switch to root
    sudo -su
    #install nmap
    apt install nmap
    #scan local network range to see who is up
    nmap -sP 192.168.0.1-254
    
===== Rapberry pi GPIO =====
  
GPIO RASPBERRY PI 3
  
{{ :raspberry_pi:pines-gpio.jpg?600 |}}

GPIO RASPBERRY PI 4

{{ :raspberry_pi:pinout-corrected-rpi4.jpg?600 |}}

Case cluster Pinout

{{ :raspberry_pi:pioutcase.jpg?600 |}}