Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -ex |
| 4 | |
| 5 | mkdir -p /root/bin |
| 6 | |
| 7 | # Give it a static IP |
| 8 | cp /tmp/dhcpcd.conf /etc/ |
| 9 | |
| 10 | # And provide a script to change it. |
| 11 | cp /tmp/change_hostname.sh /root/bin/ |
| 12 | chmod a+x /root/bin/change_hostname.sh |
| 13 | |
| 14 | chown -R pi.pi /home/pi/.ssh |
| 15 | |
Austin Schuh | 90c8278 | 2020-02-26 19:54:51 -0800 | [diff] [blame] | 16 | apt-get update |
| 17 | |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 18 | apt-get install -y vim-nox \ |
| 19 | git \ |
Austin Schuh | 90c8278 | 2020-02-26 19:54:51 -0800 | [diff] [blame] | 20 | python3-pip \ |
| 21 | cpufrequtils \ |
| 22 | libopencv-calib3d3.2 \ |
| 23 | libopencv-contrib3.2 \ |
| 24 | libopencv-core3.2 \ |
| 25 | libopencv-features2d3.2 \ |
| 26 | libopencv-flann3.2 \ |
| 27 | libopencv-highgui3.2 \ |
| 28 | libopencv-imgcodecs3.2 \ |
| 29 | libopencv-imgproc3.2 \ |
| 30 | libopencv-ml3.2 \ |
| 31 | libopencv-objdetect3.2 \ |
| 32 | libopencv-photo3.2 \ |
| 33 | libopencv-shape3.2 \ |
| 34 | libopencv-stitching3.2 \ |
| 35 | libopencv-superres3.2 \ |
| 36 | libopencv-video3.2 \ |
| 37 | libopencv-videoio3.2 \ |
| 38 | libopencv-videostab3.2 \ |
| 39 | libopencv-viz3.2 \ |
| 40 | python3-opencv |
Austin Schuh | ab8c0c5 | 2020-02-22 13:42:37 -0800 | [diff] [blame] | 41 | |
| 42 | echo 'GOVERNOR="performance"' > /etc/default/cpufrequtils |
| 43 | |
| 44 | # Add a .bashrc and friends for root. |
| 45 | if [[ ! -e "/root/.dotfiles" ]]; then |
| 46 | cd /root/ |
| 47 | git clone --separate-git-dir=/root/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles |
| 48 | rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /root/ |
| 49 | rm -r tmpdotfiles |
| 50 | git --git-dir=/root/.dotfiles/ --work-tree=/root/ config --local status.showUntrackedFiles no |
| 51 | # Run the vundle installer which installs plugins on the first run of vim. |
| 52 | vim -c ":qa!" |
| 53 | fi |
| 54 | |
| 55 | # Add a .bashrc and friends for pi. |
| 56 | if [[ ! -e "/home/pi/.dotfiles" ]]; then |
| 57 | cd /home/pi/ |
| 58 | su -c "git clone --separate-git-dir=/home/pi/.dotfiles https://github.com/AustinSchuh/.dotfiles.git tmpdotfiles" pi |
| 59 | su -c "rsync --recursive --verbose --exclude '.git' tmpdotfiles/ /home/pi/" pi |
| 60 | su -c "rm -r tmpdotfiles" pi |
| 61 | su -c "git --git-dir=/home/pi/.dotfiles/ --work-tree=/home/pi/ config --local status.showUntrackedFiles no" pi |
| 62 | # Run the vundle installer which installs plugins on the first run of vim. |
| 63 | su -c "vim -c ':qa!'" pi |
| 64 | fi |
| 65 | |
| 66 | # Make SSH work and not complain about pi being the username and pw still. |
| 67 | rm -f /etc/profile.d/sshpwd.sh |
| 68 | rm -f /etc/profile.d/wifi-check.sh |
| 69 | |
| 70 | systemctl enable ssh.service |
| 71 | |
| 72 | # Default us to pi-8971-1 |
| 73 | /root/bin/change_hostname.sh pi-8971-1 |