Skip to content

Instantly share code, notes, and snippets.

@PhilipTrauner
Last active March 25, 2017 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PhilipTrauner/ab31ca038f180f38a1c41f23be5bf0f5 to your computer and use it in GitHub Desktop.
Save PhilipTrauner/ab31ca038f180f38a1c41f23be5bf0f5 to your computer and use it in GitHub Desktop.
Enable SSH and Ethernet over USB on any Raspberry Pi running Raspbian
# Mac specific, edit to suit your needs
cd /Volumes/boot
# Enable ssh
touch ssh
# Append dtoverlay=dwc2 to config.txt
if ! grep -Fxq "dtoverlay=dwc2" config.txt
then
echo "dtoverlay=dwc2" >> config.txt
fi
# Append modules-load=dwc2,g_ether after rootwait
python3 -c 'if not "modules-load=dwc2,g_ether" in open("cmdline.txt", "r").read(): c = "rootwait modules-load=dwc2,g_ether".join(open("cmdline.txt", "r").read().split("rootwait")); open("cmdline.txt", "w").write(c)'
# Don't forget to run 'localedef -i en_US -f UTF-8 en_US.UTF-8'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment