[Desktop Entry]
Version=1.0
Name=Kodi
GenericName=Media Center
Comment=Manage and view your media
Exec=kodi-standalone
Icon=kodi
Terminal=false
Type=Application
Categories=AudioVideo;Video;Player;TV;
Note: Update the lines above with your own NAS IP address, mount directory, username, UID and GID accordingly. For devices running older versions of Samba you may need to add ,vers=1.0 after ro or rw above.
Now run this to mount the NAS:
sudo mount -a
Create a handy symlink to the NAS on the desktop:
sudo ln -s /media/NAS ~/Desktop/NAS
Mount USB Drive
Find the UUID of the USB drive:
sudo blkid
ls -l /dev/disk/by-uuid/
The output should look something like the following. Note the UUID value:
Once you're happy it works you can add it to your user's crontab:
crontab -e
Add the following contents to it to run it every night at 1am:
SHELL=/bin/bash
0 1 * * * $HOME/Backups/backup.sh
You can add the --exclude option to exclude a specific pattern of files or directories, and the --delete-after option to ensure files deleted from the target are also removed from the destination.
You can see the last backup log by viewing the file contents:
cat ~/Logs/nas_backups_YYYY-MM-DD.txt
You can see what environment variables are available in the cron environment by adding the following to your crontab (you'll need to add whatver * * * * * you want):
env >> $HOME/Backups/cron_env.txt
You can also ensure any macOS hidden "dotfiles" are deleted by create a dotfiles.sh script:
# This rule is needed for basic functionality of the controller in
# Steam and keyboard/mouse emulation
SUBSYSTEM=="usb", ATTRS{idVendor}=="28de", MODE="0666"
# This rule is necessary for gamepad emulation; make sure you
# replace 'pgriffais' with the username of the user that runs Steam
KERNEL=="uinput", MODE="0660", GROUP="group", OPTIONS+="static_node=uinput"
Note: Replace group with the group of user (e.g. pi).
Now reload udev:
sudo udevadm control --reload
Start the driver and your controller should work:
sc-desktop.py start
To start the driver automatically at the desktop create the file:
ziadoz/raspberry-pi-3-setup
Raspberry Pi 3 Setup
The steps I took get my Raspberry Pi 3 up and running.
Upgrade Jessie
Run the following commands to upgrade Jessie to Pixel, which includes Chromium with hardware video support:
Change Password
Run the following command, then enter the current password and a new password twice to confirm:
Setup SSH
Launch the Raspbery Config:
Go to
9 Advanced Options
thenA4 SSH
and choose<Enable>
.Open the
/etc/ssh/sshd_config
file and add the following:Then restart the SSH service:
Disable Automatic Desktop Login
Run the configuration command:
Go to
3 Boot Options
thenB3 Desktop
and choose<Ok>
.Setup Display
Ensure the display works nicely over HDMI:
Add the following lines to the bottom of the file:
In order to disable HDMI CEC you also need to drop a config file on the recovery partition:
Now reboot the system:
Install Kodi
Update repositories and install Kodi packages:
Create a Kodi shortcut on the desktop that boots in standalone mode (avoids blackscreen on exit):
Add the following contents to the file:
Install FAT32, ExFAT and NTFS File System Support
Install the following packages:
Mount NAS
Ensure the CFIS packages are installed:
Create a credentials file for the username and password:
Add the following contents, replacing the username and password:
Change the permissions of the credentials file:
Make a directory to mount the NAS to:
Test you can mount the NAS manually:
Any mounting problems can be found by checking the logs:
You can find out your users UID and GID with these commands:
Alternatively you can just use your username and group instead.
Now update the
/etc/fstab
file to auto mount the NAS as read-only:Or for full read and write add this to the
/etc/fstab
instead:Note: Update the lines above with your own NAS IP address, mount directory, username, UID and GID accordingly. For devices running older versions of Samba you may need to add
,vers=1.0
afterro
orrw
above.Now run this to mount the NAS:
Create a handy symlink to the NAS on the desktop:
Mount USB Drive
Find the UUID of the USB drive:
The output should look something like the following. Note the UUID value:
Make a directory to mount the USB drive to:
Test mounting the drive manually to make sure it works:
Now add the following to the
/etc/fstab
to auto mount the USB drive:Note: Update the line above with your own UUID, mount directory, file system, UID and GID accordingly.
Now run this to mount the USB drive:
Create a handy symlink to the USB drive on the desktop:
To repair an exFAT drive on Windows run the following command:
Note: Replace Z: with the relevant drive letter.
Create EXT4 Drive
You can format a partition as EXT4:
You can also change the drive label afterwards:
And you can easily mount it in the
/etc/fstab
as follows:Backup NAS to USB Drive
First, create a directory to store the backup logs in:
Then create an rsync ignore file, this will exclude unneccesary Windows and macOS files from being backed up:
And add the following contents:
Do a dry run (the
-n
flag) to ensure the correct files are being backed up:Next, create a script to handle the backups:
With the following contents:
Once you're happy it works you can add it to your user's crontab:
Add the following contents to it to run it every night at 1am:
You can add the
--exclude
option to exclude a specific pattern of files or directories, and the--delete-after
option to ensure files deleted from the target are also removed from the destination.You can see the last backup log by viewing the file contents:
You can see what environment variables are available in the cron environment by adding the following to your crontab (you'll need to add whatver
* * * * *
you want):You can also ensure any macOS hidden "dotfiles" are deleted by create a
dotfiles.sh
script:And then adding the following contents to it:
Note: The filesystem must be writeable for this to work.
You can also add this to the crontab:
Setup Steam Controller
The following instructions should allow you to use the Steam Controller wirelessly.
Download and install the Steam Controller Python drivers:
Now create the file rules file:
Then add the following to it:
Note: Replace
group
with the group of user (e.g.pi
).Now reload udev:
Start the driver and your controller should work:
To start the driver automatically at the desktop create the file:
Add the following contents to the file:
You can also install an on-screen keyboard:
And then create a shortcut to it on the desktop:
Then add the following contents to the file:
Install Steam Link
Install Docker
Install Pi Hole
Install DNS over HTTPS
Follow Pi Hole's official instructions: https://docs.pi-hole.net/guides/dns-over-https/
Install Useful Packages
Notes
You can see the icons available for desktop shortcuts in
/usr/share/pixmaps/
Links