Download centos 7(CentOS-Userland-7-armv7hl-RaspberryPI-Minimal-4-2009-sda.raw.xz 2020-10-30 11:07 307M) in the link below:
Index of /pub/linux/centos-altarch/7.9.2009/isos/armhfp
Flash SD Card by Etcher, in exFat format.
How To Install CentOS 8 in Raspberry PI
after the first boot up, rootfs-expand, then reboot.
Insert the LAN cable, nmcli d to check the state, set the wifi by nmtui, then yum -y update, yum -y upgrade, install GNOME GUI for CentOS 7 by sudo yum -y groups install "GNOME Desktop", echo "exec gnome-session" >> ~/.xinitrc, startx, systemctl set-default graphical.target, you can see the link below:
https://www.fosslinux.com/8570/how-to-install-gnome-gui-on-centos.htm
or watch the youtube link:
As for the default setting, you need to make the Power saving mode off:
setterm -powersave off -blank 0
add information below into /etc/rc.local
/usr/bin/setterm -powersave off -blank 0
for the case if the monitor not in full screen, then edit the /boot/config.txt, make sure disable_overscan=1 is uncommented, then reboot.
to install Golang for the arm architecture, download such as go1.16.7.linux-armv6l.tar.gz at this link: Downloads
similar method to install Golang is in this link below:
https://www.tecmint.com/install-go-in-linux/
Put customized packages in the default directory where /usr/local/go/src, for centos, or /usr/share/go-1.18/src, for ubuntu
check go env, confirm that GO111MODULE="off", if it is not, use the command go env -w GO111MODULE=off to make it off.
to install Python3, check the link below, set alias python='/usr/bin/python3' is essential, as the Python 2 is already installed initially in centos7:
https://www.ino-shika-cho.com/index.php/2020/10/16/post-1212/
to install the numpy and pandas, you need to execute the commend below at first, as Ollegn’s answer at this link
Problems with pip install numpy – RuntimeError: Broken toolchain: cannot link a simple C program
sudo yum install python3-devel
sudo yum install make automake gcc gcc-c++ gcc-gfortran
sudo yum install redhat-rpm-config
sudo yum install subversion
then install numpy and pandas
sudo pip3 install numpy
sudo pip3 install pandas
to schedule the task with solving the permission problem, use:
sudo crontab -u yourUserName -e
schedule python task, eg:
41 14 * * * /usr/bin/python3 /home/username/xxx.py
how to install mysql on raspberry:
you can refer to this article:
Setup a Raspberry Pi MYSQL Database
yum install mariadb-server
sudo systemctl start mariadb
sudo mysql_secure_installation
the default password is none, so enter enter-key as none initially.
You should answer “Y” to all prompts when asked to answer “Y” or “N“. such as:
Remove anonymous users? [Y/n] y
try login use: sudo mysql -u root -p
to connect raspberry through remote connection from windows:
How to Generate & Set Up SSH Keys on CentOS 7
windows setting like below:
first make a publickey in windows like, about the cryptography check this link:
ssh-keygen -o -a 100 -t ed25519 -f D:\certificationName -C "any comment"
check this link about flag -a:
How many KDF rounds for an SSH key?
then copy the certificationName.pub (-rw-r–r–)to the linux server directory like below:
/home/userName/.ssh
then change the sshd_config content using the command sudo vi /etc/ssh/sshd_config to edit like below:
PermitRootLogin no
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/certName.pub
PasswordAuthentication no
then restart the sshd service:
sudo systemctl restart sshd.service
refer this link to set the firewall:
then you can try login the remote server through the command like:
ssh -v -i D:\certificationName -p portNumber username@ipAddress
port forwarding(for Windows, objectServerHostPort default is 3389):
ssh -v -i D:\certificationName -p portNumber jumpBoxUsername@jumpBoxIpAddress -L UsedinLocalClientPort:objectServerHostName:objectServerHostPort
if object server is linux system:
ssh -v -i D:\certificationName -p UsedinLocalClientPort objectServerUserAccount@localhost
if obeject server is windows system:
open mstsc, localhost:UsedinLocalClientPort, then login
to copy file from windows to linux server:
scp – Permission denied (publickey,gssapi-keyex,gssapi-with-mic)
eg: scp -P portNumber -rp -i certificationName D:\xxx.txt userName@ipAddress:/home/userName/Downloads
to copy file from linux server to windows:
eg: scp -P portNumber -rp -i certificationName userName@ipAddress:/home/userName/test.txt D:\xxx
to prevent from /dev/shm/ being removed automatically:
Why are the contents of /dev/shm/ is being removed automatically
There are two possible solutions:
Create the files with/for a system user — a user created with the system option (adduser -r or adduser –system)
or
Edit /etc/systemd/logind.conf, uncomment the line RemoveIPC=yes, change it to RemoveIPC=no, save, and reboot the system
if you use Raspberry Pi OS, you can use sudo raspi-config to set the configuration
How To Disable WiFi Power Management On Raspberry Pi:
vi /etc/rc.local to add the content:
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
printf "My IP address is %s\n" "$_IP"
fi
iwconfig wlan0 power off
exit 0
iwconfig to confirm it and reboot
add the content at last in: /etc/xdg/lxsession/LXDE-pi/autostart
@xset s noblank
@xset s off
@xset dpms
change and make sure the content below in /etc/lightdm/lightdm.conf, and reboot
xserver-command=X -s 0 -dpms
to install opencv and test:
sudo apt update
sudo apt install libopencv-dev python3-opencv
python3 -c "import cv2; print(cv2.version)"
remove the GUI from Raspbian/Debian:
sudo apt-get remove --purge x11-common
sudo apt-get autoremove
How to fix “Package is in a very bad inconsistent state” error:
sudo dpkg --remove --force-remove-reinstreq packageName
sudo apt-get install packageName
Install nmtui on Raspberry Pi OS
How To Set Up Raspberry Pi As A DNS Server
Install Transmission on the Raspberry Pi For An “Always-on” Torrent Client
settings.json location changed: /var/lib/transmission-daemon/.config/transmission-daemon/settings.json
(you need to stop the service and then change those files)
set inbount IP address:
"rpc-whitelist": "192.168.1.*",
add epel.repo to CentOS armv7:
cat > /etc/yum.repos.d/epel.repo << EOF
[epel]
name=Epel rebuild for armhfp
baseurl=https://armv7.dev.centos.org/repodir/epel-pass-1/
enabled=1
gpgcheck=0
EOF
yum clean all
yum update
Driver of 3.5 Inch 480×320 TFT Display with Touch Screen for Raspberry Pi
search by IP list: nmap -iL targetsIPList.txt
scan machine by: eg: sudo nmap -sn 192.168.1.0/24
agressive mode: nmap -A IPaddress
trace route: nmap --traceroute IPaddress
check system: nmap -O IPaddress
check service version: nmap -sV IPaddress
check first 1000 ports: nmap -F IPaddress
check for certain port: nmap -p port/serviceName IPaddress
eg: nmap -p yourPortNumber 192.168.1.0/24
* if the certain port is open, you can confirm that server.
check every port: nmap -p- IPaddress
display only opened port: nmap --open IPaddress
to install the mailx:
sudo apt -y install bsd-mailx
How do I change the color for directories with ls in the console?
Changing colors for user, host, directory information in terminal command prompt
How to Setup a Raspberry Pi Plex Server
pivpn troubleshooting:
you may meet the issue when install pivpn after ufw set:
$ sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
ERROR: problem running ufw-init
Bad argument `COMMIT'
Error occurred at line: 14
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
ip6tables-restore v1.8.7 (nf_tables): host/network `' not found
Error occurred at line: 13
Try `ip6tables-restore -h' or 'ip6tables-restore --help' for more information.
Problem running '/etc/ufw/before.rules'
Problem running '/etc/ufw/before6.rules'
as it changed content in /etc/ufw/before.rules and /etc/ufw/before6.rules, check ERROR: problem running ufw-init
pivpn -d debug mode and it corrected the issue
pivpn installer failing to run iptables-save.
How to set up OpenVPN on Linux (with detailed Linux Mint tutorial)