Raspberry Pi

model 3b

树莓派系统:Linux raspberrypi 5.10.52-v7+ #1441 SMP Tue Aug 3 18:10:09 BST 2021 armv7l GNU/Linux

常用命令

vcgencmd measure_temp # 查看温度

连接无线网

sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=CN

network={
        ssid=""
        psk="password"
}

这篇文章指导下,编辑了 /etc/netplan/50-cloud-init.yaml

直接重启之后,无法连接无线网,插入网线接入网络也不起作用。

  • Testing: sudo netplan --debug try (continue even if there are errors)

  • Generate: sudo netplan --debug generate (provides more details in case of issues with the previous command)

  • Apply: sudo netplan --debug apply (if no issues during the previous commands)

使用 Gitlab(EE)

树莓派配置太低,带不动 Gitlab。

sudo apt-get install curl openssh-server ca-certificates apt-transport-https perl
curl https://packages.gitlab.com/gpg.key | sudo tee /etc/apt/trusted.gpg.d/gitlab.asc
sudo apt-get install -y postfix
sudo curl -sS https://packages.gitlab.com/install/repositories/gitlab/raspberry-pi2/script.deb.sh | sudo bash
sudo EXTERNAL_URL="https://gitlab.example.com" apt-get install gitlab-ce
# sudo EXTERNAL_URL="http://192.168.1.100" apt-get install gitlab-ce
sudo EXTERNAL_URL="http://10.0.2.15" apt-get install gitlab-ce

Output:

Adding group 'postfix' (GID 115) ...
Done.
Adding system user 'postfix' (UID 109) ...
Adding new user 'postfix' (UID 109) with group 'postfix' ...
Not creating home directory '/var/spool/postfix'.
Creating /etc/postfix/dynamicmaps.cf
Adding group 'postdrop' (GID 116) ...
Done.
setting myhostname: raspberrypi
setting alias maps
setting alias database
mailname is not a fully qualified domain name.  Not changing /etc/mailname.
setting destinations: $myhostname, raspberrypi, localhost.localdomain, , localhost
setting relayhost:
setting mynetworks: 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
setting mailbox_size_limit: 0
setting recipient_delimiter: +
setting inet_interfaces: all
setting inet_protocols: all
/etc/aliases does not exist, creating it.
WARNING: /etc/aliases exists, but does not have a root alias.

Postfix (main.cf) is now set up with a default configuration.  If you need to
make changes, edit /etc/postfix/main.cf (and others) as needed.  To view
Postfix configuration values, see postconf(1).

After modifying main.cf, be sure to run 'service postfix reload'.

ref:

  1. https://zhuanlan.zhihu.com/p/349823805

  2. https://blog.lussac.net/archives/57/

  3. https://openwrt.org/toh/raspberry_pi_foundation/raspberry_pi

  4. https://www.wxvoid.com/index.php/archives/21/

  5. https://raspberrytips.com/gitlab-installation-raspberry-pi/