Skip to content

Instantly share code, notes, and snippets.

@rranelli
Created April 22, 2016 22:21
Show Gist options
  • Save rranelli/49e8c657a4733ee840da11e372dadce5 to your computer and use it in GitHub Desktop.
Save rranelli/49e8c657a4733ee840da11e372dadce5 to your computer and use it in GitHub Desktop.
#!/bin/sh
# this script is intended to run on a debian8 box
set -e
USERNAME=user
_prep () {
apt-get update
apt-get install -q --yes --force-yes debconf-utils
echo en_US ISO-8859-1 >/etc/locale.gen
echo en_US.UTF-8 UTF-8 >>/etc/locale.gen
cat <<EOF | debconf-set-selections
locales locales/default_environment_locale select en_US.UTF-8
locales locales/locales_to_be_generated multiselect en_US ISO-8859-1, en_US.UTF-8 UTF-8
EOF
apt-get install locales
}
_system () {
apt-get install -q --yes --force-yes \
gcc wget curl sudo debconf-utils imagemagick postgresql postgresql-client \
libgraphicsmagick-dev git libtool-bin
adduser -q --system --home /home/xerpa --shell /bin/bash --uid $uid xerpa
usermod -a -G sudo xerpa
echo $USERNAME:$USERNAME | chpasswd
}
_nodejs () {
apt-get install -q --yes --force-yes nodejs npm
cat <<EOF >/usr/local/bin/node
#!/bin/sh
exec nodejs "\$@"
EOF
chmod 755 /usr/local/bin/node
}
_pgsql () {
/etc/init.d/postgresql start
su postgres -c "psql -c \"create role $USERNAME with login superuser password '$USERNAME'\""
}
_elixir () {
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
dpkg -i erlang-solutions_1.0_all.deb
apt-get update
apt-get install -q --yes --force-yes \
elixir erlang-xmerl erlang-tools erlang-dev erlang-parsetools
}
_prep
_system
_pgsql
_nodejs
_elixir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment