Skip to content

Instantly share code, notes, and snippets.

@pongstr
Last active August 29, 2015 14:07
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 pongstr/4f7e802195452585b8c2 to your computer and use it in GitHub Desktop.
Save pongstr/4f7e802195452585b8c2 to your computer and use it in GitHub Desktop.
Ubuntu Workspace

I'm going to try and get out of my comfort zone and try to embark a week of coding personal projects and maybe learn couple of new things using an Ubuntu machine. These are some setup stuff I've ripped off from my osx dotfiles to set up my Ubuntu environment.

This setup is basically for Front-end Development and MEAN-stack apps.

Table of Contents

  1. Bootstrap Workspace
  2. Install GnomeShell
  3. Generate SSH Keys for Github and Bitbucket
  4. Ruby Stuff
  5. NodeJS Stuff

Bootstrapping Workspace

# From the terminal preference window,
# command settings must: Run command as a login shell
# this lets your terminal emulate `/bin/bash`

# Update Aptitude
$ sudo apt-get update && apt-get dist-upgrade

# Install GSL for ruby-gsl
$ sudo apt-get install libgsl0ldbl libgsl0-dev

# Install Xsel
$ sudo apt-get install xsel

# Install Curl
$ sudo apt-get install curl

# Install Git latest version
$ sudo add-apt-repository ppa:git-core/ppa
$ sudo apt-get update && apt-get install git

# Cleanup package cache
$ sudo apt-get clean

Install Gnome Shell

# Update
$ sudo apt-get update

# install
$ sudo apt-get install gnome-shell ubuntu-gnome-desktop

screenshot

Generate SSH Keys for Github and Bitbucket

Generate SSH Key (Github)

# make sure it's saved to: /home/your-home-folder/.ssh/github_rsa
$ ssh-keygen -t rsa -C your_email@somedomain.com

# Add SSH Key
$ ssh-add /home/your-home-folder/.ssh/github_rsa.pub

# Copy to clipboard and make sure it's added to
# your github ssh-key settings: https://github.com/settings/ssh
$ xsel --clipboard < ~/.ssh/github_rsa.pub

# Then check if it works
$ ssh -T git@github.com

Generate SSH Key (Bitbucket)

# make sure it's saved to: /home/your-home-folder/.ssh/bitbucket_rsa
$ ssh-keygen

# Add SSH-Key
$ ssh-add /home/your-home-folder/.ssh/bitbucket_rsa

# Copy to clipboard and make sure it's added to
# your github ssh-key settings: https://github.com/settings/ssh
$ xsel --clipboard < ~/.ssh/bitbucket_rsa.pub

# Then check if it works
$ ssh -T git@bitbucket.org

SSH Config

# Save it to: /home/pongstr/.ssh/config

Host bitbucket.org
  Hostname bitbucket.org
  IdentityFile /home/your-home-folder/.ssh/bitbucket_rsa

Host github.com
  Hostname github.com
  IdentityFile /home/your-home-folder/.ssh/github_rsa

Ruby Stuff

# Install RVM, once installed Terminal has to
# be restarted in order for the `rvm` command
# to take effect.
$ \curl -sSL https://get.rvm.io | bash -s stable

# Install Ruby
$ rvm install ruby-2.1.3 --disable-binary

# Reload RVM and set ruby-2.1.3 as
# the default ruby version
$ rvm reload  && rvm use 2.1.3 --default

# Reload RVM again just to be sure
$ rvm reload

# Update SSL Certs
$ sudo apt-get install ca-certificates

# Update and install Gems
$ gem update --system

$ gem install rb-gsl bundler github-pages rails

# Cleanup stuff
$ gem cleanup

Nodejs Stuff

# Setup for Ubuntu info from:
# https://github.com/joyent/node/wiki/installing-node.js-via-package-manager
$ curl -sL https://deb.nodesource.com/setup | sudo bash -
$ sudo apt-get update
$ sudo apt-get install nodejs

# Install Packages
npm install -g bower coffee-script express grunt-cli karma-cli strongloop meanio mongoose nodemon shelljs

MongoDB

For more details on installation, you can go here.

# Import the public key used by the package management system
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

# Create list file for MongoDB
$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

# Reload local package database
$ sudo apt-get update

# Install MongoDB Packages
$ sudo apt-get install -y mongodb-org

# Start MongoDB
$ sudo service mongod start

# Stop MongoDB
$ sudo service mongod stop

# Restart MongoDB
$ sudo service mongod restart

Sublime Text & Vim

# Sublime Text Stuff
# ------------------

$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
$ sudo apt-get update
$ sudo apt-get install sublime-text-installer

# Install Package Control
$ git clone https://github.com/wbond/sublime_package_control.git ~/.config/sublime-text-3/Packages/Package\ Control/

# Install Modded Spacegray
$ git clone git clone https://github.com/pongstr/spacegray.git  ~/.config/sublime-text-3/Packages/Themes\ -\ Spacegray/

# Sublime Text Preferences
$ curl -o ~/.config/sublime-text-3/Packages/User/Preferences.sublime-settings https://raw.githubusercontent.com/pongstr/dotfiles/master/bin/subl/Preferences.sublime-settings

# Package Control Packages
$ curl -o ~/.config/sublime-text-3/Packages/User/Package\ Control.sublime-settings https://raw.githubusercontent.com/pongstr/dotfiles/master/bin/subl/Package%20Control.sublime-settings


# Vim Stuff
# ------------------

# Update Vim to latest
$ sudo apt-get install vim-nox

# set vim-nox as the default text editor for optimum awesome
$ sudo update-alternatives --config editor

# Centralise Vim Stuff
$ mkdir -p .vim/.viminfo .vim/backups/ .vim/colors .vim/swaps .vim/undo

# Download .vimrc from https://github.com/pongstr/dotfiles
$ curl -o ~/.vimrc https://raw.githubusercontent.com/pongstr/dotfiles/master/bin/vim/.vimrc

# Download Base16 Ocean Dark for vim
$ curl -o ~/.vim/colors/Pongstr\ Base-16.vim https://raw.githubusercontent.com/pongstr/dotfiles/master/bin/vim/Pongstr%20Base-16.vim
@dumbledork
Copy link

Atom Installation and Atom Packages

Based on dotfiles/init/.atom minus installation using homebrew
https://github.com/pongstr/dotfiles/blob/master/init/.atom

sudo add-apt-repository ppa:webupd8team/atom
sudo apt-get update
sudo apt-get install atom

ATOMCONF="$HOME/.atom/config.cson"
ATOMCSS="$HOME/.atom/styles.less"

echo "Installing Atom Packages:"
echo "========================="
apm install spacegray-dark-ui
apm install base16-ocean-dark
apm install term2
apm install jshint
apm install angularjs

cat <<EOM >$ATOMCONF
'editor':
  'fontFamily': 'Ubuntu Mono'
  'fontSize': 14
  'scrollPastEnd': true
  'lineHeight': 1.5
  'invisibles': {}
  'showIndentGuide': true
'core':
  'themes': [
    'spacegray-dark-ui'
    'base16-ocean-dark'
  ]
EOM

cat <<EOM >$ATOMCSS
.editor.is-focused {
  .line.cursor-line {
    background-color: fade(#4f5b66, 45%);
  }
}
EOM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment