Skip to content

Instantly share code, notes, and snippets.

Avatar

PJ Evans mrpjevans

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am mrpjevans on github.
  • I am mrpjevans (https://keybase.io/mrpjevans) on keybase.
  • I have a public key whose fingerprint is 5C88 EF5C 1AD8 94F6 D24A 278E 2EBA BCDD AB94 5B4A

To claim this, I am signing this object:

@mrpjevans
mrpjevans / kiosk.sh
Created Jun 30, 2020
Start Mopidy Iris in kiosk mode on Chromium on Raspberry Pi OS
View kiosk.sh
#!/bin/bash
unclutter -idle 0.5 -root &
sed -i 's/"exited_cleanly":false/"exited_cleanly":true/' /home/pi/.config/chromium/Default/Preferences
sed -i 's/"exit_type":"Crashed"/"exit_type":"Normal"/' /home/pi/.config/chromium/Default/Preferences
/usr/bin/chromium-browser --noerrdialogs --disable-infobars --kiosk http://127.0.0.1:6680/iris &
View smb.conf
[Shared]
comment = Shared
path = /var/shared
read only = no
browsable = yes
View smb.conf 2
[Huge]
comment = Huge
path = /mnt/huge
read only = no
browsable = yes
@mrpjevans
mrpjevans / install_plex.sh
Last active Aug 15, 2021
Install Plex on Raspberry Pi
View install_plex.sh
#!/bin/sh
# Plex's repository uses HTTPS as the transport, so we need to install support
sudo apt update
sudo apt install apt-transport-https ca-certificates curl
# Get Plex's public key and add the Plex repo
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
@mrpjevans
mrpjevans / install_mopidy.sh
Last active Aug 16, 2021
Install Mopidy and Iris
View install_mopidy.sh
#!/bin/sh
# Add Mopidy repo and install
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/buster.list
sudo apt update
sudo apt install mopidy
sudo adduser mopidy video
# Configure (be careful with this line!)
@mrpjevans
mrpjevans / smb.cnf
Last active Oct 22, 2021
Add Time Machine support to a Samba share
View smb.cnf
# To support macOS Time Machine backups in Samba
# Create a share that has the following properties
# in /etc/samba/smb.conf
# In this example we have a mounted drive called 'huge'
# with a directory called 'Time Machine'
[Time Machine]
comment = Time Machine
path = /mnt/huge/Time Machine
read only = no
View gist:c20e728c0dfd4cddc35a6e19e32d8381
Please run the following commands line-by-line, not as a script:
sudo apt -y update && sudo apt -y upgrade
sudo apt install -y python3 python3-dev python3-venv python3-pip libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0 tzdata
sudo useradd -rm homeassistant -G dialout,gpio,i2c
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3 -m venv .
View gist:7aea9373c5770f62771d9a9562c0e28b
wget -q -O - https://apt.mopidy.com/mopidy.gpg | sudo apt-key add -
sudo wget -q -O /etc/apt/sources.list.d/mopidy.list https://apt.mopidy.com/bullseye.list
sudo apt update
sudo apt install mopidy python3-pip
sudo adduser mopidy video
sudo pip3 install Mopidy-Iris
sudo pip3 install Mopidy-Local
sudo sh -c 'echo "mopidy ALL=NOPASSWD: /usr/local/lib/python3.9/dist-packages/mopidy_iris/system.sh" >> /etc/sudoers’
mkdir -p ~/Music
sudo systemctl enable mopidy
View gist:b648561bde5e401055f34c2ecf964d6d
[http]
hostname = 0.0.0.0
[audio]
output = alsasink
[local]
media_dir = /home/pi/Music