Raspberry Pi

Raspberry Pi
Photo by Stefan Cosma / Unsplash

Update/Upgrade

apt-get update
apt-get upgrade -y
apt-get dist-upgrade -y

swap increase

dphys-swapfile swapoff

vi /etc/dphys-swapfile
CONF_SWAPSIZE=1024

dphys-swapfile setup
dphys-swapfile swapon

Disable motd for user

touch ~/.hushlogin

sysinfo

#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU  temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"

wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
	ssid="network 2.4GHz"
	psk=""
}

Locale warning

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

dpkg-reconfigure locales
vi /etc/default/locale

LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_ALL=en_US.UTF-8

Install Ruby with Rbenv on Raspberry Pi 4

setarch armv7l zsh # zsh
setarch armv7l bash # bash

git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'eval "$(~/.rbenv/bin/rbenv init - zsh)"' >> ~/.zshrc
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build

CONFIGURE_OPTS="--disable-install-doc" rbenv install 3.2.2