Last active
December 26, 2019 06:14
-
-
Save cdaven/d4576552d2da4cc92c6517271976b6f2 to your computer and use it in GitHub Desktop.
Setup Ubuntu Development Machine on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Instructions for setting up a custom development machine | |
# on Ubuntu 18.04, distributed via Microsoft Store. | |
# Step 1: Install the Windows Subsystem for Linux: | |
# https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
# Step 2: Install Ubuntu via Windows Store: | |
# https://www.microsoft.com/store/apps/9N9TNGVNDL3Q | |
# Step 3: Start Ubuntu setup as below: | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get install -y curl git silversearcher-ag | |
# Node.js via NVM (including npm): | |
# (NVM avoids requiring root permissions when using npm: https://stackoverflow.com/a/24404451/12534) | |
# See https://github.com/creationix/nvm for updates and more information | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash | |
# Now close and re-open your Bash environment | |
nvm install node | |
# gulp.js | |
npm install gulp-cli -g | |
# rvm and Ruby 2.x: | |
sudo apt-get install -y gnupg2 | |
gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
curl -sSL https://get.rvm.io | bash -s stable | |
source ~/.rvm/scripts/rvm | |
rvm install ruby | |
rvm use ruby --default | |
gem install bundler | |
# Java | |
sudo apt-get install -y default-jre-headless | |
# Copy SSH keys from somewhere | |
mkdir ~/.ssh | |
cp /mnt/r/id_rsa* ~/.ssh/ | |
chmod 700 ~/.ssh | |
chmod 600 ~/.ssh/id_rsa | |
chmod 644 ~/.ssh/id_rsa.pub | |
# Create a symlink to Windows disk area | |
ln -s /mnt/c/Users/.../code code | |
# Fix unreadable dark blue text color in "ls" | |
echo "LS_COLORS='rs=0:di=1;35:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:';" >> .bashrc | |
echo "export LS_COLORS" >> .bashrc | |
# Clean up command prompt, inspired by Git Bash | |
echo "PS1='\n\${debian_chroot:+(\$debian_chroot)}\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n$ '" >> .bashrc | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment