Last active
November 7, 2021 17:51
-
-
Save lamberta/6400567 to your computer and use it in GitHub Desktop.
Useful settings for my Raspberry Pi.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Finish headless installation via `ssh [email protected]` | |
# See /boot/config.txt | |
sudo apt-get update && sudo apt-get --purge dist-upgrade | |
sudo raspi-config | |
# Add locale en.us-utf8 (but keep en.gb-utf8) | |
sudo dpkg-reconfigure locales | |
# Timezone | |
sudo dpkg-reconfigure tzdata | |
# Update firmware | |
sudo rpi-update | |
# Create new user, enable sudo and video privileges | |
$ sudo adduser username | |
$ sudo adduser username sudo | |
$ sudo adduser username video | |
# Increase font size on tv console [utf-8, guess optimal, Terminus, 16x32] | |
$ sudo dpkg-reconfigure console-setup | |
# Echo command to tv console (as root) | |
> /usr/games/nethack >> /dev/tty1 | |
## /etc/rc.local | |
# Turn off screen blanking | |
/usr/bin/setterm -blank 0 -powerdown off | |
## ~/.bash_aliases | |
alias l='ls' | |
alias ll='ls -lAh' | |
alias df='df -H' | |
alias du='du -h' | |
# Blank screen before playing. I never remember the r-pi media player name. | |
alias omxplayer='omxplayer --blank --refresh' | |
alias mplayer='omxplayer' | |
# Echo ssh console to tv console | |
alias mirror-console="sudo script --flush --command 'sudo -u $USER bash' /dev/tty1" | |
## USB drive | |
## /etc/fstab | |
/dev/sda1 /media/usb ext4 nofail,auto,rw,user 0 0 | |
# change permissions | |
sudo mount /dev/sda1 /media/usb | |
sudo chown pi:pi /media/usb | |
sudo chmod 777 /media/usb | |
#USB for fat formatted drive | |
#sudo apt-get install usbmount | |
## /etc/usbmount/usbmount.conf | |
# Mount a VFAT formatted USB drive as username for read/write permissions. | |
#FS_MOUNTOPTIONS="-fstype=vfat,uid=pi,gid=pi" | |
# Fix usb disk | |
sudo fdisk -l #for device | |
sudo umount /dev/sda1 | |
sudo fsck.ext4 /dev/sda1 | |
sudo dosfsck -t -a -w /dev/sda1 | |
sudo mkfs.ext4 /dev/sda1 -L WDUSB4T #format as ext4 w/ label | |
## OSX Networking | |
# Finder > Go > Connect to Server: afp://ip... | |
# Edit /etc/netatalk/AppleVolumes.default to select directories | |
sudo apt-get install netatalk | |
# zeroconf remote access with 'raspberrypi.local' | |
#sudo apt-get install avahi-daemon avahi-discover libnss-mdns | |
## Print server with CUPS | |
# Edit /etc/cups/cupsd.conf to allow remote admin | |
sudo apt-get install cups | |
sudo usermod -a -G lpadmin pi | |
sudo service cups restart | |
## Some helpful commands | |
tvservice #list hdmi info | |
vcgencmd #info about the rpi board. 'vcgencmd commands' for list of commands | |
vcgencmd measure_temp #=> temp=42.2'C |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment