**RASPBERRY PI NOTES** By placing Raspberry Pi 4 in a vertical position. This improves airflow around the components and is surprisingly effective at keeping the temperature down. cat /proc/device-tree/model vcgencmd measure_temp # to measure temperature cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq # cpu speed vcgencmd measure_clock arm * CPU ====== Headline ====== [[https://www.seeedstudio.com/blog/2020/02/12/how-to-safely-overclock-your-raspberry-pi-4-to-2-147ghz/|Overclocking]] ---- INSTALLATION:\\ fdisk /dev/mmcblk01 W95 FAT32 (LBA) mkfs.vfat /dev/mmcblk0p1 umount /dev/mmcblk0p1 fsck.vfat /dev/mmcblk0p1 -V hdparm -t /dev/mmcblk0p1 # https://www.raspberrypi.org/downloads/raspberry-pi-os/ cd /run/media/jaime/7041-8377 unzip /home/jaime/Downloads/2020-02-13-raspbian-buster-full.zip wget https://balena.io/etcher/static/etcher-rpm.repo -O /etc/yum.repos.d/etcher-rpm.repo yum install -y balena-etcher-electron Or dd bs=1M if=/home/jsantosa/Downloads/2021-03-04-raspios-buster-armhf-full.img of=/dev/mmcblk0; sync # destination is whole disk, not partition! dd if=Damaso256GB.img of=/dev/sdc status=progress bs=4M \\ FOR HEADLESS INSTALLATION: * enable ssh , setup pi credentials (no default credentials anymore) + wifi (if needed) can be done with the IMAGER application itself. See [[https://cycool29.github.io/post/000001]] POST INSTALLATION:\\ * Boot from usb drive [[https://www.tomshardware.com/how-to/boot-raspberry-pi-4-usb]] * After burning raspbian. Do this to prolonge the sdcard life [[https://ideaheap.com/2013/07/stopping-sd-card-corruption-on-a-raspberry-pi/]] * To force fsck at boot: [[https://raspberrypi.stackexchange.com/questions/61723/raspberry-pi-3-and-raspbian-jessie-how-to-run-fsck-at-boot/61739]] ---- **OPENVPN SERVER RASPBERRY PI** [[https://dzone.com/articles/how-to-setup-an-openvpn-server-on-a-raspberry-pi]]\\ curl -L https://install.pivpn.io | bash # set it as static, you should have configured the dhcp reservation and port forwarding in the gw before this!. Nornally not required but this is the server config file /etc/openvpn/server.conf pivpn add nopass # to create profiles. IMPORTANT: in the .ovpn you have the static pub ip, Replace it with the DNS entry! # ^ .ovpn is generated and stored in /home/pi/ovpns # /var/log/openvpn-status.log # just 3-4 lines with status /var/log/openvpn.log /etc/openvpn/server.conf # all fields nicely explained here : https://github.com/OpenVPN/openvpn/blob/master/sample/sample-config-files/server.conf \\ watch cat /var/log/openvpn-status.log # to monotor the connections real time from the server side egrep myfavvpn /var/log/openvpn.log # myfavvpn is the name of the vpn (the ovpn file we imported). The below is the result of a successful connection. Apr 17 10:15:04 rpi2 ovpn-server[12760]: myfavvpn/77.227.75.59:3578 Data Channel: using negotiated cipher 'AES-256-GCM' Apr 17 10:15:04 rpi2 ovpn-server[12760]: myfavvpn/77.227.75.59:3578 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key Apr 17 10:15:04 rpi2 ovpn-server[12760]: myfavvpn/77.227.75.59:3578 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key \\ ! after generating the .ovpn in the server, we scp it to the client and place it in 'camarrealb' uci set openvpn.camarrealb=openvpn uci set openvpn.camarrealb.nordvpn.enabled='1' uci set openvpn.camarrealb.config='/etc/openvpn/camarrealb.ovpn' uci commit openvpn ---- WIREGUARD: curl -L https://install.pivpn.io | bash # installs server pivpn add nopass # to create profiles. * install client OL8 [[https://www.wireguard.com/install/]] * Import config file from server and bring up tunnel [[https://engineerworkshop.com/blog/how-to-set-up-a-wireguard-client-on-linux-with-conf-file/ ]] service wg-quick@wg0 status Requires private and private key in both ends: * Server rpi2 (don't forget ip forwarding enabled) * root@rpi2:/etc/wireguard/wg0.conf [Interface] SaveConfig = false PostUp = iptables -t nat -I POSTROUTING -o eth0 -j MASQUERADE PreDown = iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE ListenPort = 1094 PrivateKey = bbbbbbbbbbbbbbbbb [Peer] PublicKey = panda-pub AllowedIPs = 192.168.0.0/24, 10.100.100.0/24 * Client openwrt ( less /etc/config/network ): config interface 'wg0' option proto 'wireguard' option private_key '...' option mtu '1412' list addresses '10.100.100.2/24' list dns '8.8.8.8' config wireguard_wg0 option public_key 'cama-pi-pub' option route_allowed_ips '1' option endpoint_host 'camarreal.duckdns.org' option endpoint_port '1094' option persistent_keepalive '25' list allowed_ips '0.0.0.0/0' list allowed_ips '192.168.1.0/24' * Setup: server and client : [[https://www.linode.com/docs/guides/set-up-wireguard-vpn-on-ubuntu/|External Link]] * Client luci: [[https://www.vpnunlimitedapp.com/help/manuals/open-wrt-wireguard-setup|External Link]] ---- **ANYCONNECT CLIENT RASPBERRY PI** \\ [[https://www.paulligocki.com/cisco-anyconnect-vpn-client-on-raspberry-pi/]] sudo openconnect -u username -b vpn.server.com sudo kill -9 $(pgrep openconnect | awk '{print $1}') ---- INSTALL ANTIVIRUS:\\ [[https://pimylifeup.com/raspberry-pi-clamav/]] apt update apt upgrade apt install clamav clamscan # wait 5-10 mins before running this or will error REMOTE DESKTOP:\\ # server ( install vnc server) vncpasswd -service raspi-config # change it so it boots in desktop mode # CLIENT vncviewer If security errors, try [[https://superuser.com/questions/1194583/tigervnc-viewer-no-matching-security-types|this]] ---- RETROPIE:\\ /home/pi/.emulationstation /root/RetroPie/roms \\ LFUSE: * most of the times keyboard * A in joypad to select emulator: lr-fuse (libreto fuse) * Set 'RetroPad' * overlay keyboard * menu: select-x > retroarch menu > quick menu > * settings > input > user1device-type > Kempston REICAST:\\ * [[https://retropie.org.uk/forum/topic/20087/reicast-controller-configuration/2]] * [[https://retropie.org.uk/docs/Dreamcast/#controls]] ---- SD CARD READY: sudo apt update sudo apt upgrade sudo apt install code ! Now teams for linux sudo apt update sudo apt install snapd sudo reboot sudo snap install core sudo snap install teams-for-linux sudo apt install terminator ! zoom via web, camera, keyboard via bluetooth all work ! reinstall chromuim and stick to it ---- === DISPLAY CONFIGURATION (AND DUAL MONITORS) === Monitor issues fixes by tuning the config.txt file : [[https://forums.raspberrypi.com/viewtopic.php?t=34061]] Issues with dual monitor in raspberry pi 4. config.txt samples: hdmi_force_hotplug:0=1 hdmi_group:0=2 hdmi_mode:0=1 hdmi_ignore_edid:0=0xa5000080 config_hdmi_boost:0=7 hdmi_force_hotplug:1=1 hdmi_group:1=2 hdmi_mode:1=1 hdmi_ignore_edid:1=0xa5000080 config_hdmi_boost:1=7 # or with sections # monitor 0 [HDMI:0] hdmi_force_hotplug=1 hdmi_group=2 hdmi_mode=1 hdmi_ignore_edid:0=0xa5000080 config_hdmi_boost=7 # monitor 1 [HDMI:1] hdmi_force_hotplug=1 hdmi_group=2 hdmi_group=1 hdmi_ignore_edid:=0xa5000080 config_hdmi_boost=7 xrandr --output HDMI-2 --on * [[https://forums.raspberrypi.com/viewtopic.php?t=299193]] * [[https://github.com/raspberrypi/firmware/issues/1159#issuecomment-528273080]] * [[https://www.elecrow.com/download/product/SER54080A/Raspberry_Pi_4B_Single_and_Dual_Screen_Settings.pdf]] * [[https://learning.oreilly.com/library/view/raspberry-pi-user/9781119264361/11_9781119264361-ch07.xhtml#h2-3]]