Skip to content

Instantly share code, notes, and snippets.



Last active Sep 15, 2018
What would you like to do?
Ubuntu 18.04 Setup
Description=Emby Media Server
ExecStart=/usr/bin/docker start -a emby-server
ExecStop=/usr/bin/docker stop -t 5 emby-server
wget -O - | bash
Description=No-IP Dynamic DNS Update Client
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 "$1/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")'
COMPOSE_VERSION=$(get_latest_release docker/compose)
# Add Docker’s official GPG key
curl -fsSL | sudo apt-key add -
# Add Microsoft's GPG key
curl | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] stable main" > /etc/apt/sources.list.d/vscode.list'
sudo sh -c 'echo "deb [arch=amd64] $(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$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 ~/.asdf --branch master --depth=1
# Fish
echo 'source ~/.asdf/' >> ~/.config/fish/
mkdir -p ~/.config/fish/completions; and cp ~/.asdf/completions/ ~/.config/fish/completions
# Use neofetch as a greeting for fish
echo -e 'function fish_greeting\n neofetch\nend' > ~/.config/fish/functions/
# Bash
echo -e '\n. $HOME/.asdf/' >> ~/.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"
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 -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
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 && chmod +x xt && ./xt && rm xt
# Monokai Dark
wget -O xt && chmod +x xt && ./xt && rm xt
# Solarized Dark
wget -O xt && chmod +x xt && ./xt && rm xt
# Flat
wget -O xt && chmod +x xt && ./xt && rm xt
# Material Colors
wget -O xt && chmod +x xt && ./xt && rm xt
# Upgrade pip
pip install --upgrade pip
# Install thefuck package
pip install thefuck
echo 'thefuck --alias | source' >> ~/.config/fish/
# Temporary fix for fuck on fish shell
# echo 'alias fish_key_reader /usr/local/bin/fish_key_reader' >> ~/.config/fish/
# Reload python shims
asdf reshim python
curl -L | fish
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment