Skip to content

Instantly share code, notes, and snippets.

@boneskull
Last active August 21, 2017 22:17
Show Gist options
  • Save boneskull/7f7ea414a48e8bddcbe1 to your computer and use it in GitHub Desktop.
Save boneskull/7f7ea414a48e8bddcbe1 to your computer and use it in GitHub Desktop.
raspbian setup script (jessie lite)

This is a note to myself about what I need to do to setup a Raspbian box.

  1. Username is pi and pw is raspberry. osmc/osmc if OSMC.
  2. apt-get update
  3. apt-get dist-upgrade -y
  4. apt-get install nfs-kernel-server openvpn software-properties-common vim git dnsutils -y
  • software-properties-common for adding PPAs
  1. apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 249AD24C
  • we can't use apt-add-repository because the Deluge PPA only has Ubuntu builds
  • key info is found here
  1. create /etc/apt/sources.list.d/deluge.list and pretend we're Ubuntu Trusty:
deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu trusty main 
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu trusty main 
  1. apt-get update to grab the info from the PPA
  2. apt-get install deluged deluge-web -y
  3. We need to fix the locale (reference). Choose en_US.UTF-8 where appropriate, and disable en_GB.UTF-8 where found:
  4. sudo locale-gen en_US.UTF-8 (optional? the second step seems to do this)
  5. sudo dpkg-reconfigure locales
  6. update hostname in /etc/hosts and /etc/hostname
  7. sudo service hostname.sh
  8. sudo shutdown -r now to reboot
  9. sudo useradd boneskull -G sudo,dialout -u 505 -m -U
  10. sudo passwd boneskull
  11. git clone https://github.com/boneskull/dotfiles.git # TODO: rcm, antigen, zsh setup etc
  12. cd dotfiles && bash bootstrap.bash -f
  13. mkdir -p ~/.ssh
  14. create ~/.ssh/authorized_keys and paste public key in there
  15. chmod -R go-r .ssh
  16. mkdir -p /var/log/deluge
  17. chown -R boneskull:dialout /var/log/deluge
  18. create /lib/systemd/system/deluged.service:
[Unit]
Description=Deluge Bittorrent Client Daemon
After=syslog.target network.target

[Service]
User=boneskull
Group=dialout

Type=simple
ExecStart=/usr/bin/deluged -d -L error -l /var/log/deluge/daemon.log
TimeoutStopSec=20
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target
  1. create /lib/systemd/system/deluge-web.service:
[Unit]
Description=Deluge Bittorrent Web Daemon
After=syslog.target network.target

[Service]
User=boneskull
Group=dialout

Type=simple
ExecStart=/usr/bin/deluge-web -L error -l /var/log/deluge/web.log
TimeoutStopSec=20
KillMode=process
Restart=always

[Install]
WantedBy=multi-user.target
  1. sudo systemctl enable deluged.service && sudo systemctl start deluged.service
  2. sudo systemctl enable deluge-web.service && sudo systemctl start deluge-web.service
  3. hit port 8112 w default pw of deluge and change pw
  4. get drive IDs with blkid
  5. add drives to /etc/fstab; UUID=xxxxxx
  6. mkdir -p /media/it /media/jason /media/samara
  7. mount -a
  8. sudo systemctl enable rpcbind.service
  9. /etc/exports:
/media/jason	10.0.0.0/24(rw,async,no_subtree_check,insecure)
/media/samara	10.0.0.0/24(rw,async,no_subtree_check,insecure)
/media/it	10.0.0.0/24(rw,async,no_subtree_check,insecure)
  1. sudo exportfs -fa
  2. sudo systemctl restart nfs-kernel-server.service
  3. run raspbi-config and expand fs
  4. go back to deluge and set it up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment