There are many guides to creating a system for the Raspberry Pi and this post is not an attempt to create another. I am putting this here for my own reference as much as to share. To make it helpful to beginners, I have added some explanations. You may prefer nano over vi as the file editor.
Please feel free to use the comments section to let people know what customization you like to make for your Pi systems.
Load image as usual
raspi-config runs first time
- expand file system
- Internationalization -> set locale -> TZ = US-Eastern
- Internationalization -> Keyboard = English(US)
- advanced -> hostname (RasPi-##-Purpose)
- advanced -> mem split 16 for GPU
- advanced -> enable SPI and I2C and Serial
reboot, and log in as pi (raspberry)
CPU overclocking would also be set up in raspi-config, but I haven't had any need to do this.
All of the following commands require root privilege. You can either put sudo before each command or enter sudo -i and run a shell as root.
Create a new user for myself, give it sudoer privilege.
echo "ted ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
Update the package database and upgrade all installed packages.
Install some new packages.
apt-get install samba screen libmysqlclient-dev libi2c-dev
Configure Samba (Windows file sharing)
uncomment "socket options = TCP_NODELAY"
delete all shares and add:
comment = opt
writable = yes
locking = no
path = /opt
public = yes
Restart the Samba service
service samba restart
Edit the SSH server config. Turning off DNS reverse lookups will speed up the connection process when to log in through SSH.
add "UseDNS no"
Edit the netwrok configuration and set static IP address and wifi config. The interface name for the wifi will be used below in the supplicant file.
iface eth0 inet static
iface home inet static
Edit the wifi supplicant file. The "id_str" setting connects back to the name used above.
Install Gordon's WiringPi library. I use this extensively in my C programming.
git clone git://git.drogon.net/wiringPi
git pull origin
Edit the kernel module configuration to enable SPI, I2C, and 1-Wire.
uncomment SPI and I2C devices
# SPI devices
# I2C devices
# 1-Wire devices
# 1-Wire thermometer devices
Finally, reboot the system again. Then log on as the new user you created and remove the default user.
If you don't do this last step and your system is accessible from the internet, then it will not be long (sometimes only hours or minutes) before a hacker finds it and does bad things. My firewall log shows constant attempts to brute force a login via SSH and "pi" is a common user name that is tried.