Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save felipepodesta/9010d38cebeab0ff8bc4f8d7bc385b98 to your computer and use it in GitHub Desktop.

Select an option

Save felipepodesta/9010d38cebeab0ff8bc4f8d7bc385b98 to your computer and use it in GitHub Desktop.
#!/bin/sh
# update the system
apt-get update
apt-get upgrade
################################################################################
# Install the mandatory tools
################################################################################
export LANGUAGE='en_US.UTF-8'
export LANG='en_US.UTF-8'
export LC_ALL='en_US.UTF-8'
locale-gen en_US.UTF-8
dpkg-reconfigure locales
# install utilities
apt-get -y install vim git zip bzip2 fontconfig curl language-pack-en
# install Java 8
apt-get install openjdk-8-jdk
# install node.js
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs unzip python g++ build-essential
# update npm
npm install -g npm
# install yarn
npm install -g yarn
su -c "yarn config set prefix ~/.yarn-global" $USERNAME
# install yeoman grunt bower gulp
su -c "yarn global add yo" $USERNAME
# install JHipster
su -c "yarn global add generator-jhipster@5.1.0" $USERNAME
# install JHipster UML
su -c "yarn global add jhipster-uml@2.0.3" $USERNAME
################################################################################
# Install the graphical environment
################################################################################
# force encoding
echo 'LANG=en_US.UTF-8' >> /etc/environment
echo 'LANGUAGE=en_US.UTF-8' >> /etc/environment
echo 'LC_ALL=en_US.UTF-8' >> /etc/environment
echo 'LC_CTYPE=en_US.UTF-8' >> /etc/environment
# run GUI as non-privileged user
echo 'allowed_users=anybody' > /etc/X11/Xwrapper.config
# install Ubuntu desktop and VirtualBox guest tools
apt-get install -y xubuntu-desktop virtualbox-guest-dkms virtualbox-guest-utils virtualbox-guest-x11
# remove light-locker (see https://github.com/jhipster/jhipster-devbox/issues/54)
apt-get remove -y light-locker --purge
# change the default wallpaper
#wget https://jhipster.github.io/images/wallpaper-004-2560x1440.png -O /usr/share/xfce4/backdrops/jhipster-wallpaper.png
wget https://raw.githubusercontent.com/jhipster/jhipster-devbox/master/images/jhipster-wallpaper.png -O /usr/share/xfce4/backdrops/jhipster-wallpaper.png
sed -i -e 's/xubuntu-wallpaper.png/jhipster-wallpaper.png/' /etc/xdg/xdg-xubuntu/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
################################################################################
# Install the development tools
################################################################################
# install Ubuntu Make - see https://wiki.ubuntu.com/ubuntu-make
apt-get install -y ubuntu-make
# install Chromium Browser
apt-get install -y chromium-browser
# install MySQL Workbench
apt-get install -y mysql-workbench
# install PgAdmin
apt-get install -y pgadmin3
# install Heroku toolbelt
wget -O- https://toolbelt.heroku.com/install-ubuntu.sh | sh
# install Guake
apt-get install -y guake
cp /usr/share/applications/guake.desktop /etc/xdg/autostart/
# install jhipster-devbox
git clone git://github.com/jhipster/jhipster-devbox.git ~/jhipster-devbox
chmod +x ~/jhipster-devbox/tools/*.sh
# install zsh
apt-get install -y zsh
# install oh-my-zsh
git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
chsh -s /bin/zsh $USERNAME
echo 'SHELL=/bin/zsh' >> /etc/environment
# install jhipster-oh-my-zsh-plugin
git clone https://github.com/jhipster/jhipster-oh-my-zsh-plugin.git ~/.oh-my-zsh/custom/plugins/jhipster
sed -i -e "s/plugins=(git)/plugins=(git docker docker-compose jhipster)/g" ~/.zshrc
echo 'export PATH="$PATH:/usr/bin:~/.yarn-global/bin:~/.yarn/bin:~/.config/yarn/global/node_modules/.bin"' >> ~/.zshrc
# change user to $USERNAME
chown -R $USERNAME:$USERNAME ~/.zshrc ~/.oh-my-zsh
# install Visual Studio Code
su -c 'umake ide visual-studio-code ~/.local/share/umake/ide/visual-studio-code --accept-license' $USERNAME
# fix links (see https://github.com/ubuntu/ubuntu-make/issues/343)
sed -i -e 's/visual-studio-code\/code/visual-studio-code\/bin\/code/' ~/.local/share/applications/visual-studio-code.desktop
# disable GPU (see https://code.visualstudio.com/docs/supporting/faq#_vs-code-main-window-is-blank)
sed -i -e 's/"$CLI" "$@"/"$CLI" "--disable-gpu" "$@"/' ~/.local/share/umake/ide/visual-studio-code/bin/code
#install IDEA ultimate edition
su -c 'umake ide idea-ultimate ~/.local/share/umake/ide/idea-ultimate' $USERNAME
# increase Inotify limit (see https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit)
echo "fs.inotify.max_user_watches = 524288" > /etc/sysctl.d/60-inotify.conf
sysctl -p --system
# install latest Docker
curl -sL https://get.docker.io/ | sh
# install latest docker-compose
curl -L "$(curl -s https://api.github.com/repos/docker/compose/releases | grep browser_download_url | head -n 4 | grep Linux | grep -v sha256 | cut -d '"' -f 4)" > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
# configure docker group (docker commands can be launched without sudo)
usermod -aG docker $USERNAME
# fix ownership of home
chown -R $USERNAME:$USERNAME ~/
# clean the box
apt-get -y autoclean
apt-get -y clean
apt-get -y autoremove
dd if=/dev/zero of=/EMPTY bs=1M > /dev/null 2>&1
rm -f /EMPTY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment