#!/bin/bash export DEBIAN_FRONTEND=noninteractive set -x set -e exec 1> >(tee -a /var/log/sandboxbuild.log) 2>&1 MURM="main universe restricted multiverse" C="$(lsb_release -cs)" cat > /etc/apt/sources.list.new <> /etc/bash.bashrc <<'EOF' if ! shopt -oq posix; then if [ -f /usr/share/bash-completion/bash_completion ]; then . /usr/share/bash-completion/bash_completion elif [ -f /etc/bash_completion ]; then . /etc/bash_completion fi fi for FN in /etc/bashrc.d/*.sh; do source "$FN" done if [[ -d "$HOME/.bashrc.d" ]]; then for FN in /etc/bashrc.d/*.sh; do source "$FN" done fi if ! shopt -oq posix; then for FN in /etc/profile.d/*.sh; do source "$FN" done if [[ -d "$HOME/.profile.d" ]]; then for FN in /etc/profile.d/*.sh; do source "$FN" done fi fi EOF ################################################################################ ## install nvm + node ################################################################################ export NVM_DIR='/usr/local/nvm' mkdir -p "$NVM_DIR" curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash cat > /etc/bashrc.d/100.nvm.sh <<'EOF' source /usr/local/nvm/nvm.sh EOF source /etc/bashrc.d/100.nvm.sh nvm install node nvm use node ################################################################################ ## install yarn ################################################################################ curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list apt update && apt install -y yarn ################################################################################ ## install rbenv + ruby ################################################################################ git clone https://github.com/rbenv/rbenv.git /usr/local/rbenv cat > /etc/bashrc.d/100.rbenv.sh <<'EOF' export PATH="/usr/local/rbenv/bin:$PATH" eval "$(rbenv init -)" EOF source /etc/bashrc.d/100.rbenv.sh mkdir -p "$(rbenv root)"/plugins git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build rbenv install $(rbenv install -l | grep -v - | tail -1) #rbenv install 2.6.3 #rbenv install jruby-9.0.5.0 # install some gems GEMS=" bundler " for GEM in $GEMS ; do gem install -V $GEM done ################################################################################ ## install ppss, paralell processing shell script ################################################################################ cd /usr/local/bin wget https://git.eeqj.de/sneak/ppss/raw/branch/master/ppss chmod +x ./ppss ################################################################################ ## upgrade pip and install bare essentials ## update other python packages as possible ################################################################################ #pip3 install --upgrade pip pip3 install setuptools #pip3 install pip-review #pip-review --verbose --auto # install other python packages PIP_PKGS=" awscli pipenv pylint virtualenv glances " for PKG in $PIP_PKGS; do pip3 install $PKG done ################################################################################ ## add working user and add to sudo nopassword ################################################################################ groupadd -g $GID_TO_ADD $USERNAME_TO_ADD useradd -u $UID_TO_ADD -g $GID_TO_ADD -s /bin/bash $USERNAME_TO_ADD usermod -p '*' $USERNAME_TO_ADD echo "$USERNAME_TO_ADD ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers