software

ApplePi Baker

Macdownload.informer.com/applepi-bak…

System image

www.raspberrypi.org/downloads/r…

Install the system

Select the disk in the box list in the upper left corner of ApplePi Baker, select the IMG image extracted from the zip you just downloaded on the right, and click Restore Backup

After the mirror is written, insert the card reader (TF card) again, and the system will identify a boot partition.

Open the terminal, go to the boot directory, and create an empty SSH file

touch ssh
Copy the code

Create the wifi configuration file wpa_supplicant.conf

vim wpa_supplicant.conf
Copy the code

Write the following

Country =CN ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ssid="wifi name "PSK ="wifi password" key_mgmt=WPA-PSK priority=1 }Copy the code

Remove the TF card from the MAC, insert the raspberry PI, wait about 5 minutes, you can see the raspberry PI in the device list of the router, and record the Intranet IP address of the raspberry PI

Open the MAC terminal and log in to raspberry PI over SSH

The default username is PI

Default password: raspberry

Change the computer name and enable the root account

Change computer name

Sudo vim /etc/hosts # open the hostname configuration file and change it to the hostname you want to changeCopy the code

Enabling the root Account

Sudo passwd root # Change the password of user root. Sudo passwd --unlock root # Start user rootCopy the code

Allow user root to log in to the system using SSH

sudo vim /etc/ssh/sshd_config
Copy the code

find

#PermitRootLogin prohibit-password
Copy the code

to

PermitRootLogin yes
Copy the code

Restart to take effect

Apt accelerated image

Backup Source List

cd /etc/apt/
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak
Copy the code

Edit vim /etc/apt/sources.list and insert in the first line. Deb indicates that the installation is performed through the. Deb file. Deb -src is a source file that can be installed

deb http://mirrors.neusoft.edu.cn/raspbian/raspbian buster main contrib non-free rpi
deb-src http://mirrors.neusoft.edu.cn/raspbian/raspbian buster main contrib non-free rpi
Copy the code

Editor vim/etc/apt/sources list. D/raspi. The list, in the first row inserts.

deb http://mirrors.neusoft.edu.cn/raspbian/raspbian buster main ui
deb-src http://mirrors.neusoft.edu.cn/raspbian/raspbian buster main ui
Copy the code

Making the configuration Effective

sudo apt-get update
sudo apt-get upgrade
Copy the code

Douban accelerates PIP

mkdir -v ~/.pip && echo -e "[global]\ntimeout = 60\nindex-url = https://pypi.douban.com/simple" > ~/.pip/pip.conf
Copy the code

Open the SMB

Insert a partitioned portable hard drive and install NTFS support

sudo apt-get install ntfs-3g
sudo reboot
Copy the code

Viewing the Hard Drive List

sudo fdisk -l
Copy the code

Create a mount directory

mkdir /mnt/disk
chmod 744 /mnt/disk
Copy the code

Modify the vim /etc/fstab configuration file, insert a line, and sudo reboot to take effect

PARTUUID=1bcc1146-01    /mnt/disk      auto    defaults,nofail        0       0
Copy the code

You can run the sudo blkid command to obtain PARTUUID

The first column can be the actual partition name, the second column is the mount point, the third column is the file system type of the partition, the fourth column is the mount option, the fifth column is backup, and 0 is not backup. For details, see the following

Installing the SMB Service

sudo apt-get install samba samba-common-bin
Copy the code

Select No

Modify the SMB configuration file sudo vim /etc/samba/smb.conf by adding:

[<disk>]
   comment = <disk>
   path = /mnt/<disk>
   browseable = yes
   writable = yes
   guest ok = no
   
   vfs object = recycle   
   recycle:repository = /samba/trash/
   recycle:keeptree = Yes
   recycle:versions = Yes
   recycle:maxsixe = 0
Copy the code


is replaced with the desired mount name and path. For details on other SMB configuration files, see here

Setting an access password

sudo smbpasswd -a root
Copy the code

Mount the raspberry PI directory to your Mac system by pressing Ctrl+K in the Mac Finder, entering the raspberry PI address, user name, and password, and selecting a disk

Remote desktop

Command line installation

sudo apt-get install tightvncserver xrdp
tightvncserver
Copy the code

Visual installation

Modify the RASPberry PI VNC configuration

sudo raspi-config
Copy the code

Entering the GUI

Modify resolution

After the driver configuration is complete, download Realvnc from the Mac

The connection cannot be attemptedrm /tmp/.X2-lockOr restart the servicevncserver

MySQL

Tested the mirrors.tuna.tsinghua.edu.cn source to install, raspberries on limit can only be installed

sudo apt-get install mariadb-server -y
Copy the code

Select 2345 in the mysql row on the configuration page. [x] indicates enable

sudo apt-get install sysv-rc-conf -y
sysv-rc-conf
Copy the code

Open the network port access vim/etc/mysql/mariadb. Conf. D / 50 – server. CNF found

The bind - address = 127.0.0.1Copy the code

Instead of

The bind - address = 0.0.0.0Copy the code

Empty password To log in to the database sudo mysql -u root, set the root password

use mysql;
update user set plugin='mysql_native_password' where user='root';
UPDATE user SET password=PASSWORD('root') WHERE user='root';
flush privileges;
Copy the code

Set an account for remote login

use mysql; GRANT ALL PRIVILEGES ON *.* TO 'user '@'%' IDENTIFIED BY' user 'WITH GRANT OPTION; flush privileges; exit;Copy the code

At this point, you can use Navicat to link to the database