Download x64 with Desktop (2022-09-22-raspios-bullseye-arm64.img.xz) - btw the Raspberry Pi Desktop (4gb) variant is for PC & MAC.
alternative
		
		
	
	
		 
	
Use Imager v1.7.3
		 
	
use PUTTYGEN.EXE to generate the SSH private / public / authorized keys, by following the instructions How to Setup Raspberry Pi SSH Keys for Authentication
by enabling the Set username and password on Imager^ the default user pi will not be created.
with PUTTYGEN we generated
those will be used on next steps.
The 30gb SD Card after 'creation' operation (btw - buy a microSD Class10 type)
	
	
	
		
		
		
		
	
	
		 
	
the device is here! you need to have the following :
	
	
	
		
2- find the raspberry IP from your router
		 or execute
	or execute
	
	
	
		
3- on windows side, run PUTTY.EXE input the private key under Connection > SSH > Auth > Credentials
		 
	
and on Session write the raspberry IP you got from router
		 (1) select the default settings, (2) click save, (3) click open..
	(1) select the default settings, (2) click save, (3) click open..
		 
	
	
	
	
		
		
		
		
	
	
		 
	
install RealVNC server through PuTTY
	
	
	
		
install RealVNC viewer on Windows, you only need these files ( download extract&use or download official installer )
	
	
	
		
		
		
		
	
	
		 
	
on first run will ask to connect online etc, press close or try to login (will fail due firewall) then the dialog closes (no need to have online account).
create a new connection
		 
	
connect first time
		 
	
input raspberry credentials
		 
	
WinSCP access
use raspberry user credentials for SFTP + click the Advanced button
		 
	
goto SSH > Authentication and set the private key file (use PuTTY)
		 
	
click Login incase incase 'passphrase' defined
		 
	
Cute, we have access :
SSH / SFTP
VNC
is time to unplug the mouse + hdmi monitor from raspberry ah?
but first we will make static the IP via
		 or in case needed to adjust by PuTTY
	or in case needed to adjust by PuTTY
	
	
	
		
reference
raspberrypi - Introduction to Remote Access++ (github)
The Raspberry Pi Guide
ssh-keygen / OpenSSH & PuTTY keys comparison
1st setup no monitor + install double commander
commands
	
	
	
		
commands2
	
	
	
		
gitea vs gogs
	
	
	
		
Most probably I will turn it by default to headlessIOS, via installing the official Raspberry Pi OS Lite 289mb vs Raspberry Pi OS with desktop 783mb I have now...
restart / shutdown variants
	
	
	
		
Pi-hole
installing was never easier
	
	
	
		
it will ask
It will ask for webserver aka Pi-hole control panel (will be available at http://pi.hole/admin), of course needed, to alter the black/white list domains.
It will ask for DNS server, choose OpenDNS.
after installation finished, goto your router control panel and set the raspberry IP as Primary DNS Server
you are done! reference [2]
		 
	
Now, when browsing from Windows machine over your network, nothing appears to Pi-hole control panel (?)
will be fine!
PiHole Blocklists
Do you want to run the Pi-hole server on another port ?
	
	
	
		
restrict the logs for 5 days
	
	
	
		
Pi-hole coming with lighttpd for the webadmin panel, you can create a new folder myshare and enable the dir listing via :
	
	
	
		
shodan - Test your IP for vulnerabilities
shodan - The Complete Guide, Featured on TryHackMe (2023) [ip2asn] [example https://www.shodan.io/search?query=asn:AS14061]
Block web scanners with ipset & iptables
Fixing slow Firefox loading when using Pi-Hole
setup fail2ban to lighttpd
	
	
	
		
SSL - self-signed certificate - https://www.erikmoberg.net/article/self-hosting-your-website-on-a-raspberry-pi-zero
2022 - Raspberry Pi 4: Review
2020 - Checking Out Raspberry 4 Pi OS 64-Bit and Known issues
2019 - Raspberry Pi 4 launches with BCM2711
Raspberry Pi 4 B (Broadcom BCM2711) Benchmark, Test and specs
ARM and x86 Processor Cores
Edit file remotely
VSCode addon - Microsoft.Remote - SSH (using OpenSSH) (howto)
 VSCode addon - liximomo.SFTP (use OpenSSH) or other shits
 VSCode addon - liximomo.SFTP (use OpenSSH) or other shits
Sublime Text addon - codex (use PuTTY), is commercial (you have to File > Open Folder then Map a SFTP folder)
Using [rmate] on remote machine (which originally developed for TextMate (mac))
-Sublime Text with RemoteSubl addon
-VSCode addon Remote VSCode
VNC Softwares
domain created
(2001) TightVNC cross platform (due JAR) - setup - creates a completely new desktop, not attached to any actual screen.
(2002) RealVNC cross platform ( viewer for windows ) - Headless Raspberry Pi with VNC Connect
(2005) UltraVNC windows only
Firewalls
OpenSnitch is a GNU/Linux application firewall (raspberry supported) - blocks per application youtube
UFW Firewall on the Raspberry Pi - Firewall Rules
Portmaster - A New Era for Privacy - dont know if is raspberry compatible
OPNsense [2] | OpenWrt [2] | reference
Crontab
How to Add Jobs to Cron
Setup And Run PHP Script as a Cron Job
https://crontab.guru/
https://crontab-generator.org/
Cronjob for the First Monday of Every Month
(2023) Cron AI - Words to cron expression
PiHole - Youtube ad blocking
Is not ideal and not as good as running a proper ad blocker in a browser. Use uBlock Origin (chrome / firefox) alternative filters. source
ntfy - Send push notifications to your phone via PUT/POST
VSCodium on a Raspberry Pi
(2016) Create a hardened Raspberry Pi NAS++ (Optimize GPU memory-split + Docker)
An extensive tutorial on how to setup a Pi-Hole
Alternative Raspberry like devices
Raspberry Pi 5 vs Orange Pi 5 Plus vs Rock 5 Model B
Odroid XU4Q | Odroid - Go Ultra (Handheld Emulation System)
Orange Pi 800
Cool Pi 4
The Great Pi Zero Showdown
Lichee Pi 4a
LattePanda V1
			
			alternative
- DietPi OS is plain CLI offers ready packages for use, see DietPi-Software [2], has also Amiberry variant aka Amiga emulator.
- YunoHost - democratize self-hosting.
- nextcloudpi | owncloud
- Kali Pi [2] (includes MetaSploit application)
- awesome RaspberryPi
 
	Use Imager v1.7.3
 
	use PUTTYGEN.EXE to generate the SSH private / public / authorized keys, by following the instructions How to Setup Raspberry Pi SSH Keys for Authentication
by enabling the Set username and password on Imager^ the default user pi will not be created.
with PUTTYGEN we generated
- authorized keys ( used only on Imager^ )
- public/private keys
- ssh alias (key comment)
- ssh passphrase
those will be used on next steps.
The 30gb SD Card after 'creation' operation (btw - buy a microSD Class10 type)
 
	the device is here! you need to have the following :
- raspberry device
- raspberry power adapter
- case
- lan cable
- ( in case of a problem ) mini HDMI cable / spare mouse / hdmi monitor, no keyboard!
		Bash:
	
	sudo apt-get update
sudo apt-get upgrade2- find the raspberry IP from your router
 
	
		Bash:
	
	ifconfig3- on windows side, run PUTTY.EXE input the private key under Connection > SSH > Auth > Credentials
 
	and on Session write the raspberry IP you got from router
 
	 
	 
	install RealVNC server through PuTTY
		Bash:
	
	#install RealVNC server
sudo apt update
sudo apt install realvnc-vnc-server
#enable VNC > Interfacing Options > VNC › Yes
sudo raspi-configinstall RealVNC viewer on Windows, you only need these files ( download extract&use or download official installer )
 
	on first run will ask to connect online etc, press close or try to login (will fail due firewall) then the dialog closes (no need to have online account).
create a new connection
 
	connect first time
 
	input raspberry credentials
 
	WinSCP access
use raspberry user credentials for SFTP + click the Advanced button
 
	goto SSH > Authentication and set the private key file (use PuTTY)
 
	
 
	Cute, we have access :
SSH / SFTP
VNC
is time to unplug the mouse + hdmi monitor from raspberry ah?
but first we will make static the IP via
 
	
		Bash:
	
	#https://raspberrypi-guide.github.io/networking/set-up-static-ip-address
#find the network interface name (Iface)
netstat -nr
#edit
sudo nano /etc/dhcpcd.conf
# 192.x.x.x - raspberry IP
# 192.168.1.1 - your router IP
interface eth0
inform 192.x.x.x
static routers=192.168.1.1
static domain_name_servers=192.168.1.1reference
raspberrypi - Introduction to Remote Access++ (github)
The Raspberry Pi Guide
ssh-keygen / OpenSSH & PuTTY keys comparison
1st setup no monitor + install double commander
commands
		Bash:
	
	#see network info
netstat -nr
ifconfig
#Pi ARM CPU temperature -- https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$((cpu/1000)) c"
#GPU temperature
vcgencmd measure_temp
# memory status - Free vs Available https://haydenjames.io/free-vs-available-memory-in-linux/
free -m
# list all process
#https://geek-university.com/list-running-processes/
#https://sites.google.com/site/petersraspi/learning-linux-1/showallrunningprocessesinraspbian
top
#lists active services running on ports
sudo lsof -iTCP -sTCP:LISTEN -Pcommands2
		Bash:
	
	#prevent package to be updated / upgraded - https://askubuntu.com/a/18656
sudo apt-mark hold xxx
#restart an application
sudo systemctl restart xxx
#list folder contents - https://www.tecmint.com/15-basic-ls-command-examples-in-linux/
ls -l
ls -lh //shows sizes formatted
ls -R -l //recursively
#create folder
mkdir xx
#the -p tag will create any directories in our path that doesn’t already exist
mkdir -p /home/pi/git/myFirstRepository
# remove a folder with all contents https://linuxhint.com/delete-a-folder-in-bash/
rm -rf xx
#view a text file
cat xx
#https://www.geeksforgeeks.org/od-command-linux-example/
#view as oct
od -c -tx1 xx
#view as hex
od -c -Ax -tx1 xx
#list of installed packages
apt list --installed
dpkg --get-selections
#list the manually installed packages in the Raspberry OS
apt-mark showmanual
#list of packages which are installed automatically on the Raspberry Pi OS
apt-mark showauto
#infromation of the package -- https://www.opentechguides.com/how-to/article/raspberry-pi/84/package-management.html
apt show apache2
#delete the cache files by /var/cache/apt/archives
sudo apt clean
#install synaptic app manager
sudo apt-get install synapticgitea vs gogs
doh, no I will not install mysql to use git..gitea is a fork of gogs the reason gitea created /gogs mod start giving write permissions to more people/ source
		Bash:
	
	#https://pimylifeup.com/raspberry-pi-git-server/ -- https://pimylifeup.com/raspberry-pi-gitea/
#https://docshield.kofax.com/RPA/en_US/11.0.0_qrvv5i5e1a/help/BestPracticesHelp/rpa_rlm_best_practices/c_initialize_bare.html
#install git if is not already in the system
sudo apt install git
#set your information
sudo git config user.name "name"
sudo git config --global user.email "the@email"
#make a folder to store the repos
sudo mkdir -p /home/git/example.git
#navigate to specific repo
cd /home/git/example.git
#init the repo
sudo git init --bare
#go back one dir and chown
cd ..
sudo chown -R pi example.git
#clone the repo
sudo git clone example.git
cd example
#done a dummy commit
sudo git commit --allow-empty -m 'initial commit'
#push to repo
sudo git push origin
#on windows side - clone the repo
#in case you have problem due SSH PuTTY private key read -- https://www.pipiscrew.com/threads/16486/post-50959
git clone pi@192.168.xxx.xxx:/home/git/example
#open your favorite gitGUIMost probably I will turn it by default to headlessIOS, via installing the official Raspberry Pi OS Lite 289mb vs Raspberry Pi OS with desktop 783mb I have now...
restart / shutdown variants
		Bash:
	
	#https://jamesjdavis.medium.com/how-to-restart-raspberry-pi-safely-and-quickly-488243907fa3
#reboot
sudo reboot
sudo shutdown -r now
sudo shutdown -r 10 # after 10 minutes
sudo init 6
#shutdown
sudo halt
sudo poweroff
sudo shutdown -h now
sudo shutdown -h 10 # after 10 minutes
sudo init 0Pi-hole
installing was never easier
		Bash:
	
	#https://docs.pi-hole.net/main/basic-install/
curl -sSL https://install.pi-hole.net | bashit will ask
yes log all.Select a privacy mode for FTL
It will ask for webserver aka Pi-hole control panel (will be available at http://pi.hole/admin), of course needed, to alter the black/white list domains.
It will ask for DNS server, choose OpenDNS.
after installation finished, goto your router control panel and set the raspberry IP as Primary DNS Server
you are done! reference [2]
 
	Now, when browsing from Windows machine over your network, nothing appears to Pi-hole control panel (?)
ipconfig /renew
ipconfig /flushdns
will be fine!
PiHole Blocklists
Pi-hole FTL DNS uses the well-known relational database management system SQLite3 source
Do you want to run the Pi-hole server on another port ?
		Bash:
	
	#https://raspberrypi.stackexchange.com/a/117849
cd etc/lighttpd
#edit the file (is empty by default)
sudo nano external.conf
#add
server.port := 8000
#save
#restart server
sudo systemctl restart lighttpdrestrict the logs for 5 days
		Bash:
	
	# https://docs.pi-hole.net/ftldns/configfile/
# https://www.reddit.com/r/pihole/comments/s7u6ca/comment/htgvwmv/
# https://www.reddit.com/r/pihole/comments/g55b8p/comment/fo1fyqv/
# edit the
sudo nano /etc/pihole/pihole-FTL.conf
#paste
MAXDBDAYS=5
# restart the service
sudo service pihole-FTL restart
#------------------------
# apart from sqlite cleanup^ cleans also the log file
sudo nano /var/log/pihole/pihole.log
# empty log file - https://docs.pi-hole.net/core/pihole-command
pihole flushPi-hole coming with lighttpd for the webadmin panel, you can create a new folder myshare and enable the dir listing via :
		Bash:
	
	# https://www.cyberciti.biz/faq/stop-lighttpd-server/
# https://www.cyberciti.biz/tips/howto-lighttpd-enable-disable-directory-listing.html
#make the new folder myshare
sudo mkdir =p /var/www/html/myshare
#edit config
sudo nano /etc/lighttpd/lighttpd.conf
#add this line
$HTTP["url"] =~ "^/myshare($|/)" { server.dir-listing = "enable" }
#restart
sudo /etc/init.d/lighttpd restart
#-----
# to write a file by PHP, the directory must belong to www-data, go one dir back by your_folder_name
# https://stackoverflow.com/a/11282294
sudo chown www-data your_folder_name
# **OR** the file must belong to www-data group
# (not tried) password protected directory
https://www.cyberciti.biz/tips/lighttpd-setup-a-password-protected-directory-directories.htmlshodan - Test your IP for vulnerabilities
shodan - The Complete Guide, Featured on TryHackMe (2023) [ip2asn] [example https://www.shodan.io/search?query=asn:AS14061]
Block web scanners with ipset & iptables
Fixing slow Firefox loading when using Pi-Hole
setup fail2ban to lighttpd
		Bash:
	
	# https://raspiblog.noblogs.org/post/2018/04/09/securing-lighttpd/
# https://www.digitalocean.com/community/tutorials/how-to-protect-an-apache-server-with-fail2ban-on-ubuntu-14-04SSL - self-signed certificate - https://www.erikmoberg.net/article/self-hosting-your-website-on-a-raspberry-pi-zero
2022 - Raspberry Pi 4: Review
2020 - Checking Out Raspberry 4 Pi OS 64-Bit and Known issues
2019 - Raspberry Pi 4 launches with BCM2711
Raspberry Pi 4 B (Broadcom BCM2711) Benchmark, Test and specs
ARM and x86 Processor Cores
Edit file remotely
VSCode addon - Microsoft.Remote - SSH (using OpenSSH) (howto)
warning installing Visual Studio Code Server on remote machine
 VSCode addon - liximomo.SFTP (use OpenSSH) or other shits
 VSCode addon - liximomo.SFTP (use OpenSSH) or other shitsSublime Text addon - codex (use PuTTY), is commercial (you have to File > Open Folder then Map a SFTP folder)
Codelobster (using OpenSSH, no support for passphrase)Using [rmate] on remote machine (which originally developed for TextMate (mac))
-Sublime Text with RemoteSubl addon
-VSCode addon Remote VSCode
VNC Softwares
domain created
(2001) TightVNC cross platform (due JAR) - setup - creates a completely new desktop, not attached to any actual screen.
(2002) RealVNC cross platform ( viewer for windows ) - Headless Raspberry Pi with VNC Connect
(2005) UltraVNC windows only
Firewalls
OpenSnitch is a GNU/Linux application firewall (raspberry supported) - blocks per application youtube
UFW Firewall on the Raspberry Pi - Firewall Rules
Portmaster - A New Era for Privacy - dont know if is raspberry compatible
OPNsense [2] | OpenWrt [2] | reference
Crontab
How to Add Jobs to Cron
Setup And Run PHP Script as a Cron Job
https://crontab.guru/
https://crontab-generator.org/
Cronjob for the First Monday of Every Month
(2023) Cron AI - Words to cron expression
PiHole - Youtube ad blocking
Is not ideal and not as good as running a proper ad blocker in a browser. Use uBlock Origin (chrome / firefox) alternative filters. source
- due the mechanism on how ads implemented the domains are not standard, updating all the time + a domain can serve ads and real videos.
- adblockers - blocking the needed html elements and javascripts that doing the ad mess, if you think it, is more harder (for G) to update the code than the domains (as easily can be dynamic by code).
ntfy - Send push notifications to your phone via PUT/POST
VSCodium on a Raspberry Pi
(2016) Create a hardened Raspberry Pi NAS++ (Optimize GPU memory-split + Docker)
An extensive tutorial on how to setup a Pi-Hole
Alternative Raspberry like devices
Raspberry Pi 5 vs Orange Pi 5 Plus vs Rock 5 Model B
Odroid XU4Q | Odroid - Go Ultra (Handheld Emulation System)
Orange Pi 800
Cool Pi 4
The Great Pi Zero Showdown
Lichee Pi 4a
LattePanda V1
 
				 
 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
	 
  
	