Skip to content

Instantly share code, notes, and snippets.

@git-zombie
Last active March 22, 2019 18:11
Show Gist options
  • Save git-zombie/c64fe143e57f5b4456d2ea3a5724c286 to your computer and use it in GitHub Desktop.
Save git-zombie/c64fe143e57f5b4456d2ea3a5724c286 to your computer and use it in GitHub Desktop.
Setup RPi
ssh -t pi@$ADDRESS \
"sudo apt-get -y update;
sudo apt-get -y upgrade;
sudo apt install -y openssh-server;
sudo adduser $NEWUSER;
sudo adduser $NEWUSER sudo";
ssh -t $NEWUSER@$ADDRESS \
"sudo deluser -remove-home pi"
export HN=hostname; echo "$HN" | sudo tee /etc/hostname; sudo hostname $HN
curl -sSL get.docker.com | sh && \
sudo usermod $USER -aG docker
sudo dphys-swapfile swapoff && \
sudo dphys-swapfile uninstall && \
sudo update-rc.d dphys-swapfile remove
echo Adding " cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory" to /boot/cmdline.txt
sudo cp /boot/cmdline.txt /boot/cmdline_backup.txt
orig="$(head -n1 /boot/cmdline.txt) cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory"
echo $orig | sudo tee /boot/cmdline.txt
sudo reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment