Raspberry Pi
Installing 2018-11-13-raspbian-stretch-full.img, I noticed the image performs more steps for the user, including...
- $ sudo apt-get update
- $ sudo apt-get upgrade
These commands prepare the unit for installation of new packages. Before installing packages, let's remove some packages that we will never use...
- $ sudo apt-get remove wolframscript
- $ sudo apt-get remove scratch
- $ sudo apt-get remove scratch2
- $ sudo apt-get remove nuscratch
- $ sudo apt-get remove sonic-pi
- $ sudo apt-get autoremove
Using the du command, I notice the image includes November 2018 issue of MagPi magazine
- $ rm -r ~/MagPi
$ df Filesystem 1K-blocks Used Available Use% Mounted on /dev/root 15203948 3335488 11185240 23% / devtmpfs 470116 0 470116 0% /dev tmpfs 474724 0 474724 0% /dev/shm tmpfs 474724 18292 456432 4% /run tmpfs 5120 4 5116 1% /run/lock tmpfs 474724 0 474724 0% /sys/fs/cgroup /dev/mmcblk0p1 44220 22540 21681 51% /boot tmpfs 94944 0 94944 0% /run/user/1000
$ sudo hostname Porky
- Change Digital Clock settings - format from "%R" to "%I:%M%p" I don't like 24 hour mode, and I don't like seconds displayed.
- Edit ~/.bashrc, change one of the commented out alias to
alias ll='ls -la --color=auto'
pi@Porky:~ $ cat /proc/version Linux version 4.14.79-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1159 SMP Sun Nov 4 17:50:20 GMT 2018
Add apache2, enable cgi, configure permissions group for i2c
$ sudo apt-get install apache2 $ sudo a2enmod cgi $ sudo service apache2 restart
Configure www-data as a member of group, i2c, such that it can use /dev/i2c-1
$ sudo usermod -aG i2c www-data or use $ sudo adduser www-data i2c
Copy cgi programs to /usr/lib/cgi-bin
$ sudo cp ~/projects/tempcgi/tempcgi.cgi /usr/lib/cgi-bin $ sudo chmod 755 /usr/lib/cgi-bin/tempcgi.cgi $ sudo chgrp www-data /usr/lib/cgi-bin/tempcgi.cgi
After having problems with CGI not being able to access /dev/i2c-1, restarting apache fixed the problem
$ sudo service apache2 restart
Raspberry Pi "pages" being serviced as CGI programs, reading room temperature with different I2C sensors:
merkle.hopto.org/cgi-bin/mcp9808.cgi merkle.hopto.org/cgi-bin/tempcgi.cgi merkle.hopto.org/cgi-bin/lm75a_cgi.cgi
Configure the screen size so VNC shows a larger display vs 640x480 when a display isn't attached to the Pi:
$ sudo leafpad /boot/config.txt
Find the following section and uncomment the framebuffer lines, or add your own.
I normally use a 1080P display...
# uncomment to force a console size. By default it will be display's size minus # overscan. #framebuffer_width=1280 #framebuffer_height=720 framebuffer_width=1920 framebuffer_height=1080