Skip to content

Instantly share code, notes, and snippets.

@ksafranski
Last active February 3, 2016 01:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ksafranski/b821979456610f3a145a to your computer and use it in GitHub Desktop.
Save ksafranski/b821979456610f3a145a to your computer and use it in GitHub Desktop.
Environement Setup
#!/bin/bash
# Run update
apt-get update
wait
# Install build-essentials
apt-get --yes --force-yes install build-essential
wait
# Install git
apt-get --yes --force-yes install git
wait
# Install NVM
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
source ~/.nvm/nvm.sh
wait
nvm install 0.10.26
wait
nvm alias default 0.10.26
# Install ZSH
apt-get --yes --force-yes install zsh
wait
wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh
wait
chsh -s `which zsh`
# Change to better oh-my-zsh theme
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="avit"/g' ~/.zshrc
# Set NVM to start automatically
echo "source ~/.nvm/nvm.sh && nvm use default" >> ~/.zshrc
# If "ide" is passed in arguments + username and password (ex: ./script.sh ide foo bar)
if [ $1 = "ide" ]; then
# Create workspace
mkdir ~/workspace
# Install forever
npm install forever -g
wait
# Clone C9 Core
git clone https://github.com/Fluidbyte/core.git ~/c9
wait
# Run setup
source ~/c9/scripts/install-sdk.sh
wait
exit
# Start C9 automatically
echo "forever start ~/c9/server.js -p 8181 -l 0.0.0.0 --auth $2:$3 -w ~/workspace" >> ~/.zshrc
fi
# Restart
shutdown -r 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment