Skip to content

Instantly share code, notes, and snippets.

@lcdss

lcdss/emby-server.service

Last active Sep 15, 2018
Embed
What would you like to do?
Ubuntu 18.04 Setup
[Unit]
Description=Emby Media Server
Requires=docker.service
After=docker.service
[Service]
Restart=always
ExecStart=/usr/bin/docker start -a emby-server
ExecStop=/usr/bin/docker stop -t 5 emby-server
[Install]
WantedBy=default.target
wget -O - https://gist.githubusercontent.com/lcdss/70e69dfc6123fc2ae3536de9719dddd6/raw/setup.sh | bash
[Unit]
Description=No-IP Dynamic DNS Update Client
After=network.target
[Service]
Restart=always
ExecStart=/usr/local/bin/noip2
[Install]
WantedBy=default.target
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
# Dependencies
sudo apt-get install -y apt-transport-https ca-certificates curl software-properties-common \
build-essential cmake autoconf libcurl4-openssl-dev libxml2-dev libssl-dev libcurl4-openssl-dev \
libjpeg-dev libpng-dev libreadline-dev libpq-dev libmagick++-dev libossp-uuid-dev libedit-dev \
libncurses5-dev libevent-dev libyaml-dev libsqlite3-dev re2c bison tk-dev libffi-dev libjemalloc-dev
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
}
COMPOSE_VERSION=$(get_latest_release docker/compose)
# Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Add Microsoft's GPG key
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
sudo sh -c 'echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list'
sudo add-apt-repository -y ppa:numix/ppa
sudo add-apt-repository -y ppa:mc3man/mpv-tests
sudo add-apt-repository -y ppa:qbittorrent-team/qbittorrent-stable
sudo add-apt-repository -y ppa:hluk/copyq
sudo add-apt-repository -y ppa:neovim-ppa/stable
sudo add-apt-repository -y ppa:linrunner/tlp
sudo add-apt-repository -y ppa:plushuang-tw/uget-stable
sudo add-apt-repository -y ppa:fish-shell/release-2
sudo apt-get install -y gnome-tweak-tool numix-gtk-theme numix-icon-theme-circle tilix \
tlp mpv qbittorrent copyq git neovim code docker-ce uget fish neofetch chrome-gnome-shell
# Install Docker Compose
sudo curl -L https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# Increase max user watches for projects with many files
sudo sh -c 'echo "fs.inotify.max_user_watches=524288" >> /etc/sysctl.conf'
sudo sysctl -p
# Install asdf
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch master --depth=1
# Fish
echo 'source ~/.asdf/asdf.fish' >> ~/.config/fish/config.fish
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/asdf.fish ~/.config/fish/completions
# Use neofetch as a greeting for fish
echo -e 'function fish_greeting\n neofetch\nend' > ~/.config/fish/functions/fish_greeting.fish
# Bash
echo -e '\n. $HOME/.asdf/asdf.sh' >> ~/.bashrc
echo -e '\n. $HOME/.asdf/completions/asdf.bash' >> ~/.bashrc
# Load asdf script to the session context
source ~/.bashrc
asdf plugin-add ruby
asdf plugin-add postgres
asdf plugin-add nodejs
asdf plugin-add erlang
asdf plugin-add elixir
asdf plugin-add java
asdf plugin-add python
ASDF_RUBY_VERSION=$(asdf list-all ruby | sort --general-numeric-sort | grep -v preview | grep -v dev | tail -1)
ASDF_POSTGRES_VERSION=$(asdf list-all postgres | sort --general-numeric-sort | tail -1)
ASDF_NODEJS_VERSION=$(asdf list-all nodejs | sort --general-numeric-sort | tail -1)
ASDF_JAVA_VERSION=$(asdf list-all java | sort --general-numeric-sort | tail -1)
ASDF_ERLANG_VERSION=$(asdf list-all erlang | sort --general-numeric-sort | grep -v rc | tail -1)
ASDF_ELIXIR_VERSION=$(asdf list-all elixir | sort --general-numeric-sort | tail -1)
ASDF_PYTHON_VERSION=$(asdf list-all python | sort --general-numeric-sort | grep -v dev | grep -v b | tail -1)
RUBY_EXTRA_CONFIGURE_OPTIONS="--with-jemalloc --with-readline"
POSTGRES_EXTRA_CONFIGURE_OPTIONS="--with-ossp-uuid"
echo -e "bundler\npry" > ~/.default-gems
echo -e "gem: --no-document" > ~/.gemrc
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyring
asdf install ruby $ASDF_RUBY_VERSION
asdf install postgres $ASDF_POSTGRES_VERSION
asdf install nodejs $ASDF_NODEJS_VERSION
asdf install java $ASDF_JAVA_VERSION
asdf install erlang $ASDF_ERLANG_VERSION
asdf install elixir $ASDF_ELIXIR_VERSION
asdf install python $ASDF_PYTHON_VERSION
asdf global ruby $ASDF_RUBY_VERSION
asdf global postgres $ASDF_POSTGRES_VERSION
asdf global nodejs $ASDF_NODEJS_VERSION
asdf global java $ASDF_JAVA_VERSION
asdf global erlang $ASDF_ERLANG_VERSION
asdf global elixir $ASDF_ELIXIR_VERSION
asdf global python $ASDF_PYTHON_VERSION
sudo snap install mailspring spotify insomnia http
sudo snap install --classic slack
sudo snap install --classic chromium
# Games
# sudo snap install openra minecraft
# wget -c http://media.steampowered.com/client/installer/steam.deb -O /tmp/steam.deb && \
# sudo dpkg -i /tmp/steam.deb
# Install Emby Media Server
# docker run -d -p 8096:8096 --name=emby-server \
# -v /mnt/Backup/Library/Media:/media \
# -v /mnt/Backup/Library/Config:/config
# -v /etc/localtime:/etc/localtime:ro \
# -e UMASK=000 -e PUID=1000 -e PGID=1000 \
# nvllsvm/emby-unlocked
sudo usermod -aG docker $USER
# Set gnome themes
gsettings set org.gnome.desktop.interface gtk-theme Numix
gsettings set org.gnome.desktop.interface icon-theme Numix-Circle
# Install powerline font
wget https://github.com/powerline/powerline/raw/develop/font/PowerlineSymbols.otf
wget https://github.com/powerline/powerline/raw/develop/font/10-powerline-symbols.conf
mkdir ~/.fonts && mv PowerlineSymbols.otf ~/.fonts/
fc-cache -vf ~/.fonts
mkdir -p ~/.config/fontconfig/conf.d/ && mv 10-powerline-symbols.conf ~/.config/fontconfig/conf.d/
# Install some Gogh themes for gnome-terminal
# Freya
wget -O xt http://git.io/v3D4o && chmod +x xt && ./xt && rm xt
# Monokai Dark
wget -O xt https://git.io/v5mPp && chmod +x xt && ./xt && rm xt
# Solarized Dark
wget -O xt http://git.io/v5f6B && chmod +x xt && ./xt && rm xt
# Flat
wget -O xt http://git.io/v3D4z && chmod +x xt && ./xt && rm xt
# Material Colors
wget -O xt http://git.io/v3DBv && chmod +x xt && ./xt && rm xt
# Upgrade pip
pip install --upgrade pip
# Install thefuck package
pip install thefuck
echo 'thefuck --alias | source' >> ~/.config/fish/config.fish
# Temporary fix for fuck on fish shell
# echo 'alias fish_key_reader /usr/local/bin/fish_key_reader' >> ~/.config/fish/config.fish
# Reload python shims
asdf reshim python
curl -L https://get.oh-my.fish | fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment