Raspberry Pi - Raspbian

RASPBIAN JESSIE LITE

No more SSH after flashing [Raspbian 2016-11-25]

Raspbian 2016-11-25 doesn't start SSH daemon when booting. You can trigger the start by adding a file named 'ssh' to /boot/. This can easily be done while after flashing the image.
It seems to be done improve support security for dorks.

Flashing (with ssh)

#wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2018-11-15/2018-11-13-raspbian-stretch-lite.zip
#wget http://director.downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-04-09/2019-04-08-raspbian-stretch-lite.zip
#wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-07-12/2019-07-10-raspbian-buster-lite.zip
wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2020-02-14/2020-02-13-raspbian-buster-lite.zip

open 2020-02-13-raspbian-buster-lite.zip
diskutil list
# in my case, SD card is /dev/disk3
diskutil unmountDisk /dev/disk3
sudo dd bs=1m if=2020-02-13-raspbian-buster-lite.img of=/dev/rdisk3
touch /Volumes/boot/ssh # This starts ssh when booting
#diskutil unmountDisk /dev/disk3
For headless wifi setup:
vi /Volumes/boot/wpa_supplicant.conf
country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="Name_SSID"
  psk="PASSWORD"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auth_alg=OPEN
}
Now unmount:
diskutil unmountDisk /dev/disk3

First contact

Use a Bonjour Browser or nmap to search for hostname raspberrypi.lan:
nmap -sn 192.168.1.0/24 | grep -i rasp
Nmap scan report for raspberrypi.lan (192.168.1.125)
ssh -l pi 192.168.1.110
raspberry
passwd
#raspberry
ssh-keygen 
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0J27cGQDggf6/Knf0/cyXNygD27/fecpNR512Ko61YWDlJcJ3m1DWzFf2opLaXdNFhMVRIvlFbeEPUyNuVCpc01OeAh4sRQzJ4cLS7c07aSGtJP73tSa6hKZr4If1UckEVRCjjzA2lYKVrYhiS8jyvqshYBdjwC67vF6oThRP93H1jiA0yVUx+S+JkfLkbTqy7urXGbkCGbZ7CHjJfYvlMeCD1rQTgnIspmNJb0/PNSDQL1ErqOb7uEyPzAIZ3PvLl+OMAN0aWpeKeevZzm61JqzYOlGtBXhUvVyMOIqPDcIljI+dVcZeXSmz4kK5ff/Q27M1vfAhIqL5LbkB1fYkQ==' > .ssh/authorized_keys

Basic installation, preparation

sudo apt-get update
sudo apt-get install -y vim
sudo echo "syntax on" >> ~/.vimrc
sudo raspi-config  
# -> Expand file size

Network

vi  /etc/network/interfaces

auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.123.137
netmask 255.255.255.0
gateway 192.168.123.254
dns-nameservers 192.168.123.254

Network - Wifi

sudo iwlist wlan0 scan
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf

country=CH
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  ssid="Name_SSID"
  psk="PASSWORD"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auth_alg=OPEN
}

Reboot

sudo reboot

Filesize with 4GB SD card

Filesystem      Size  Used Avail Use% Mounted on
/dev/root       3.6G  836M  2.6G  25% /

RPi Cam

sudo apt-get update
sudo apt-get dist-upgrade
#sudo rpi-update
sudo apt-get install -y git php libapache2-mod-php 

git clone https://github.com/silvanmelchior/RPi_Cam_Web_Interface.git
cd RPi_Cam_Web_Interface
chmod u+x RPi_Cam_Web_Interface_Installer.sh
./RPi_Cam_Web_Interface_Installer.sh install

RPi UniFi

echo 'deb http://www.ubnt.com/downloads/unifi/debian stable ubiquiti' | sudo tee -a /etc/apt/sources.list.d/ubnt.list > /dev/null
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv C0A52C50
sudo apt-get update

sudo apt-get install unifi -y

echo 'ENABLE_MONGODB=no' | sudo tee -a /etc/mongodb.conf > /dev/null

# Only for Raspi 1
#sudo rm /usr/lib/unifi/lib/native/Linux/armhf/libubnt_webrtc_jni.so
#cd /usr/lib/unifi/lib
#sudo rm snappy-java-1.0.5.jar
#sudo wget https://repo1.maven.org/maven2/org/xerial/snappy/snappy-java/1.1.4-M3/snappy-java-1.1.4-M3.jar
#sudo wget http://homecontrols.ch/bin/snappy-java-1.1.4-M3.jar
#sudo ln -s snappy-java-1.1.4-M3.jar snappy-java-1.0.5.jar

sudo apt-get install oracle-java8-jdk -y
sudo cp /lib/systemd/system/unifi.service /etc/systemd/system/

echo 'JAVA_HOME=/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt' | sudo tee /etc/default/unifi > /dev/null

sudo reboot

https://[raspberrypi]:8443

Check Board Version

cat /proc/device-tree/model