<commit_before># Ubuntu-only stuff. Abort if not Ubuntu.
is_ubuntu || return 1

apt_keys=()
apt_source_files=()
apt_source_texts=()
apt_packages=()
deb_installed=()
deb_sources=()

# Ubuntu distro release name, eg. "xenial"
release_name=$(lsb_release -c | awk '{print $2}')

function add_ppa() {
  apt_source_texts+=($1)
  IFS=':/' eval 'local parts=($1)'
  apt_source_files+=("${parts[1]}-ubuntu-${parts[2]}-$release_name")
}

#############################
# WHAT DO WE NEED TO INSTALL?
#############################

# Misc.
apt_packages+=(
  ansible
  awscli
  build-essential
  byobu
  cmatrix
  cowsay
  curl
  git-core
  groff
  htop
  id3tool
  imagemagick
  jq
  nmap
  silversearcher-ag
  sl
  steam
  telnet
  tree
  mysql-server
  libmysqlclient-dev
)

apt_packages+=(vim)
is_ubuntu_desktop && apt_packages+=(vim-gnome)

## https://launchpad.net/~stebbins/+archive/ubuntu/handbrake-releases
#add_ppa ppa:stebbins/handbrake-releases
#apt_packages+=(handbrake-cli)
#is_ubuntu_desktop && apt_packages+=(handbrake-gtk)

# https://github.com/rbenv/ruby-build/wiki
apt_packages+=(
  autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev
  libncurses5-dev libffi-dev libgdbm3 libgdbm-dev zlib1g-dev
)

# https://github.com/pyenv/pyenv/wiki/Common-build-problems
apt_packages+=(
  make libbz2-dev libreadline-dev libsqlite3-dev llvm libncursesw5-dev
  xz-utils tk-dev
)


if is_ubuntu_desktop; then
  # http://www.omgubuntu.co.uk/2016/06/install-latest-arc-gtk-theme-ubuntu-16-04
  apt_keys+=(http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_16.04/Release.key)
  apt_source_files+=(arc-theme)
  apt_source_texts+=("deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /")
  apt_packages+=(arc-theme)

  # https://www.ubuntuupdates.org/ppa/google_chrome
  apt_keys+=(https://dl-ssl.google.com/linux/linux_signing_key.pub)
  apt_source_files+=(google-chrome)
  apt_source_texts+=("deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main")
  apt_packages+=(google-chrome-stable)

  # https://www.spotify.com/us/download/linux/
  apt_keys+=('--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <KEY>')
  apt_source_files+=(spotify)
  apt_source_texts+=("deb http://repository.spotify.com stable non-free")
  apt_packages+=(spotify-client)

  # https://tecadmin.net/install-oracle-virtualbox-on-ubuntu/
  apt_keys+=(https://www.virtualbox.org/download/oracle_vbox_2016.asc)
  apt_source_files+=(virtualbox)
  apt_source_texts+=("deb http://download.virtualbox.org/virtualbox/debian $release_name contrib")
  apt_packages+=(virtualbox-5.1)

  # http://askubuntu.com/a/190674
  add_ppa ppa:webupd8team/java
  apt_packages+=(oracle-java8-installer)
  function preinstall_oracle-java8-installer() {
    echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
    echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
  }

  # https://github.com/colinkeenan/silentcast/#ubuntu
  # https://github.com/colinkeenan/silentcast/#ubuntu-linux-full-install
  add_ppa ppa:sethj/silentcast
  add_ppa ppa:webupd8team/y-ppa-manager
  apt_packages+=(
    libav-tools x11-xserver-utils xdotool wininfo wmctrl python-gobject python-cairo xdg-utils yad
    silentcast
  )

  # Misc
  apt_packages+=(adb fastboot)
  apt_packages+=(
    k4dirstat
    openssh-server
    shutter
    transgui
    unity-tweak-tool
    vlc
    zenmap
    frozen-bubble
    frozen-bubble-data
  )

  # Manage online accounts via "gnome-control-center" in launcher
  apt_packages+=(gnome-control-center gnome-online-accounts)

  # https://github.com/mitchellh/vagrant/issues/7411<commit_msg>Add KeepassX on ubuntu desktop<commit_after># Ubuntu-only stuff. Abort if not Ubuntu.
is_ubuntu || return 1

apt_keys=()
apt_source_files=()
apt_source_texts=()
apt_packages=()
deb_installed=()
deb_sources=()

# Ubuntu distro release name, eg. "xenial"
release_name=$(lsb_release -c | awk '{print $2}')

function add_ppa() {
  apt_source_texts+=($1)
  IFS=':/' eval 'local parts=($1)'
  apt_source_files+=("${parts[1]}-ubuntu-${parts[2]}-$release_name")
}

#############################
# WHAT DO WE NEED TO INSTALL?
#############################

# Misc.
apt_packages+=(
  ansible
  awscli
  build-essential
  byobu
  cmatrix
  cowsay
  curl
  git-core
  groff
  htop
  id3tool
  imagemagick
  jq
  nmap
  silversearcher-ag
  sl
  steam
  telnet
  tree
  mysql-server
  libmysqlclient-dev
)

apt_packages+=(vim)
is_ubuntu_desktop && apt_packages+=(vim-gnome)

## https://launchpad.net/~stebbins/+archive/ubuntu/handbrake-releases
#add_ppa ppa:stebbins/handbrake-releases
#apt_packages+=(handbrake-cli)
#is_ubuntu_desktop && apt_packages+=(handbrake-gtk)

# https://github.com/rbenv/ruby-build/wiki
apt_packages+=(
  autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev
  libncurses5-dev libffi-dev libgdbm3 libgdbm-dev zlib1g-dev
)

# https://github.com/pyenv/pyenv/wiki/Common-build-problems
apt_packages+=(
  make libbz2-dev libreadline-dev libsqlite3-dev llvm libncursesw5-dev
  xz-utils tk-dev
)


if is_ubuntu_desktop; then
  # http://www.omgubuntu.co.uk/2016/06/install-latest-arc-gtk-theme-ubuntu-16-04
  apt_keys+=(http://download.opensuse.org/repositories/home:Horst3180/xUbuntu_16.04/Release.key)
  apt_source_files+=(arc-theme)
  apt_source_texts+=("deb http://download.opensuse.org/repositories/home:/Horst3180/xUbuntu_16.04/ /")
  apt_packages+=(arc-theme)

  # https://www.ubuntuupdates.org/ppa/google_chrome
  apt_keys+=(https://dl-ssl.google.com/linux/linux_signing_key.pub)
  apt_source_files+=(google-chrome)
  apt_source_texts+=("deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main")
  apt_packages+=(google-chrome-stable)

  # https://www.spotify.com/us/download/linux/
  apt_keys+=('--keyserver hkp://keyserver.ubuntu.com:80 --recv-keys <KEY>')
  apt_source_files+=(spotify)
  apt_source_texts+=("deb http://repository.spotify.com stable non-free")
  apt_packages+=(spotify-client)

  # https://tecadmin.net/install-oracle-virtualbox-on-ubuntu/
  apt_keys+=(https://www.virtualbox.org/download/oracle_vbox_2016.asc)
  apt_source_files+=(virtualbox)
  apt_source_texts+=("deb http://download.virtualbox.org/virtualbox/debian $release_name contrib")
  apt_packages+=(virtualbox-5.1)

  # http://askubuntu.com/a/190674
  add_ppa ppa:webupd8team/java
  apt_packages+=(oracle-java8-installer)
  function preinstall_oracle-java8-installer() {
    echo debconf shared/accepted-oracle-license-v1-1 select true | sudo debconf-set-selections
    echo debconf shared/accepted-oracle-license-v1-1 seen true | sudo debconf-set-selections
  }

  # https://github.com/colinkeenan/silentcast/#ubuntu
  # https://github.com/colinkeenan/silentcast/#ubuntu-linux-full-install
  add_ppa ppa:sethj/silentcast
  add_ppa ppa:webupd8team/y-ppa-manager
  apt_packages+=(
    libav-tools x11-xserver-utils xdotool wininfo wmctrl python-gobject python-cairo xdg-utils yad
    silentcast
  )

  # Misc
  apt_packages+=(adb fastboot)
  apt_packages+=(
    k4dirstat
    openssh-server
    shutter
    transgui
    unity-tweak-tool
    vlc
    zenmap
    frozen-bubble
    frozen-bubble-data
    keepassx
  )

  # Manage online accounts via "gnome-control-center" in launcher
  apt_packages+=(gnome-control-center gnome-online-accounts)

  # https://github.com/mitchellh/vagrant/issues/7411
{'fraction_non_alphanumeric': 0.15104025938935423, 'fraction_numerical': 0.019184004323155902, 'mean_word_length': 4.5246268656716415, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 22, 'lorem ipsum': 0, 'www.': 8, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '771394', 'n_tokens_mistral': 3052, 'n_tokens_neox': 2773, 'n_words': 390}