Skip to content

Instantly share code, notes, and snippets.

@mnadjit
Last active April 10, 2018 14:45
Show Gist options
  • Save mnadjit/dd80b63538db2f42dc9af8b02ad12c07 to your computer and use it in GitHub Desktop.
Save mnadjit/dd80b63538db2f42dc9af8b02ad12c07 to your computer and use it in GitHub Desktop.
Debian Raspberry Pi (Raspbian) Scripts
#!/bin/bash
sudo apt-get remove docker docker-engine docker.io
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
echo "Please enter username to add to Docker group to run Docker as non-root user:"
read username
sudo usermod -aG docker $username
#!/bin/bash
# Raspbian version 9
# Set variables
ssid=myssid
wifipasswd=mypassword
userpasswd=userpassword
rootpasswd=rootpassword
# -------------------------------- Run under login user ------------------------------
# Change locality
setxkbmap us # Set Keyboard layout to English (US) for this user
# TODO Set keyboard layout variant
# TODO Set WiFi Country
# -------------------------------- Run under ROOT user -------------------------------
# Switch to root user and change its password
sudo su
passwd
$rootpasswd
$rootpasswd
# --------------------------------
# Set locality
setxkbmap us # Set keyboard layout to English (US) for root user
localectl set-locale LANG="en_AU.UTF-8" #
# --------------------------------
# Set Timezone
"Australia/Melbourne" > /etc/timezone
export TZ=Australia/Melbourne
# --------------------------------
# Configure Wifi connection
wpa_passphrase "$ssid" "$wifipasswd" >> /etc/wpa_supplicant/wpa_supplicant.conf # add encrypted passphrase to config file
# TODO: remove free text from config file
wpa_cli -i wlan0 reconfigure # reset wireless interface
# --------------------------------
# Enable/Disable Run/Stop Services
systemctl enable ssh # enable ssh
systemctl start ssh # start ssh
systemctl stop bluetooth # stop bluetooth
systemctl disable bluetooth # disable bluetooth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment