Skip to content

Instantly share code, notes, and snippets.

@tracypholmes
Last active September 7, 2017 00:45
Show Gist options
  • Save tracypholmes/a42707b5d96561447120165895f13553 to your computer and use it in GitHub Desktop.
Save tracypholmes/a42707b5d96561447120165895f13553 to your computer and use it in GitHub Desktop.
Live USB + Learn Setup

Setting up your Linux drive

Creating a Bootable USB

The USB drive we're about to create a full bootable version of the Linux operating system. Go here to create the usb: http://www.everydaylinuxuser.com/2015/11/how-to-install-ubuntu-linux-alongside.html

This drive is set up so that you can boot up your computer to run Linux right off of this drive without having to change your current operating system. This drive will not modify your current Windows or Mac installation.

First off, shut your computer down and plug in the USB drive. Now we're going to tell the computer to boot from the USB rather than the hard drive.

If you're using a PC

Every computer is a little different in terms of what needs to be done to be able to boot up using something other than your hard drive. The goal here is to enter what is called the BIOS and change your boot order to boot from the USB drive. When your computer starts up, you usually get a black screen and for just a second and it will say something like Press F12 to Choose Boot Device. This is exactly what we want you to look out for. It sometime pops up quick so you may need to restart your computer to try and see it a second time. Once you find out what you have to press, you're going to want to press that key on start up and navigate through the menus to boot from your USB drive. If your windows desktop/login comes up, you did not trigger the boot device selection and you'll have to restart and try again.

If you don't see an option to choose your boot device, you can look for options to enter the BIOS. If you enter the BIOS, look through the settings for "Boot Device" or "Boot Order" (or something along those lines, again, every computer is different). In these menus you can select what order your computer checks to boot from. Use the Boot Order menu to set 'booting from a USB' above 'booting from the HDD' (or Hard Drive). What this is telling your computer is to simply check to see if there is a bootable USB in a port before booting the operating system from the hard drive.

If you're not seeing any options when the computer starts up, try pressing F12, F8, F2 or DEL as those are buttons that are commonly used to enter the boot menu or the BIOS.

If the PC/Mac instructions did not work

If none of the above works, we'll first fall back to our old friend Google and search something along the lines of "How to boot from a USB on ". If you look around for a bit and still cannot figure out how to boot from the USB stick, then give me a holler.

Using the Linux OS

If you've never used linux before and you'd like to learn a bit more before you get started, feel free to play around in the system a bit Since this is a Live USB, nothing will be modified or nor break. You can use it, but nothing will be saved once you reboot. Read a bit more here: https://www.ubuntu.com/download/desktop/try-ubuntu-before-you-install

Important Note: When you want to shutdown your bootable Linux USB go to the top menu bar and select System > Shutdown (or some other software tool), but do not use your computer's power button.

Once you are ready to install Ubuntu and setup your dual-boot, double-click on the icon on your desktop: ’Install Ubuntu 16.10 LTS’.

Setting up your Ubuntu Developer Environment

In this readme we are going to go over the steps for setting up your development environment in Ubuntu.

First off: you need to be a user with sudo access to perform this setup. You can check to see if you have sudo access by typing sudo echo ok in your terminal. If you get back ok, then you have the correct access.

We also want to make sure that your terminal is set to be a login shell. Setting your terminal to a login shell ensures that our .bash_profile will be run. In Ubuntu, open up your terminal, select Edit > Profile Preferences. Then on the Command tab, check off 'Run command as login shell'.

Install git

Now we're going to install git. We'll cover git in more detail soon, but for now know that it's version control software – it has fancy ways of keeping track of your work that allow you to selectively apply changes or to revert to a prior state. Pretty sweet.

apt makes installation easy:

sudo apt-get install git

And you're done!

Install Ruby

Prerequisites

Ruby requires a few additional libraries to install. Run

sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev

to get them.

Set up group

Here we are setting up a group with the name "npm". This is so that we can set reasonable permissions on packages that get installed via npm (more on permissions and npm later). These permissions ensure that we can globally install npm packages.

  • sudo groupadd npm
  • sudo usermod -a -G npm,staff $USER

Make sure everything is up to date

Before we start installing all of our developer tools, we want to make sure that everything is up to date. For this, we're going to use the apt-get Linux package manager to update everything using the following commands:

  • sudo apt-get update
  • sudo apt-get upgrade
  • sudo apt-get dist-upgrade (this one is optional)

Installing Dev tools

The essentials

Now we can install some essential dev tools (postgres, node...) using curl:

  • sudo apt-get -y install curl postgresql libpq-dev default-jre build-essential phantomjs
  • curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
  • sudo apt-get install nodejs
  • sudo dpkg --add-architecture i386 This will install an architecture needed to install Team Viewer later.

The non-essentials:

You can also install a few non-essential tools (ack-grep, vim, and libgnome) if you like:

  • sudo apt-get -y install ack-grep vim libgnome2-bin

  • ack-grep - A more advanced tool to take the place of the grep (search) command in the terminal

  • vim - A terminal based text editor

  • libgnome2-bin - Provides documentation for the GNOME desktop environment and acts as a handy open tool.

Setting file permissions

To be able to properly use some of these tools, we need to manually set some of the permissions and owners of some of the recently installed files:

  • sudo chown root:staff /usr/bin
  • sudo chmod 0775 /usr/bin
  • sudo chown -R root:npm /usr/lib/node_modules
  • sudo chmod 0775 /usr/lib/node_modules

If you're curious, you can read more about chmod (setting permissions) and chown (setting the owner) here: http://www.unixtutorial.org/2014/07/difference-between-chmod-and-chown/ Take a look at this page if you want to understand the permission values (0755, 0600, ...)

Set up .netrc file for the learn gem

The learn gem needs this netrc file to work. The .netrc file is a standard location to store login/token info, so it is we store information needed for Learn.

  • touch ~/.netrc && chmod 0600 ~/.netrc

Installing RVM

RVM is a great tool that lets you run different versions of Ruby on your computer. This is really useful because if you know one project your working on works with Ruby version 2.1.0 and another needs 2.3.0, you can easily switch between the two versions when you switch between projects. You can install it and set it up with the following commands:

  • gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
  • \curl -sSL https://get.rvm.io | bash
  • echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*"
  • rvm install 2.3.4
  • rvm use 2.3.4 --default

You can easily install different Ruby verions with rvm install <version number>, switch between versions with rvm use <version number> and check to see which you've already installed with rvm list. You can always check what version your current terminal window is with ruby -v.

Setting up (and getting) Ruby gems

If your familiar with any other program language, Ruby gems are like libraries. If you're not familiar with programing libraries, it's basically isolated chunks of code that you can easily add to your project. For example, the learn-co gem allows you to easily interface with Learn from your command line (opening and submitting labs among many other things).

  1. echo "gem: --no-ri --no-rdoc" > $HOME/.gemrc
  2. gem update --system 2.6.7
  3. gem install learn-co
  4. gem install phantomjs
  5. gem install pg
  6. gem install sqlite3
  7. gem install bundler
  8. gem install rails
  9. gem install pry

Installing a Node Pacakge

One thing you'll see more of later in the course is npm, or Node Package Manager. This is very similar to Ruby gems, but it's for JavaScript. We're also going to do a global install for an npm testing package Protractor with the following command:

  • sudo npm install -g n
  • sudo npm install -g protractor

Install Java and Ant

Compared to installing Ruby, installing Java and Ant (a Java build tool) is easy. Just run

sudo apt-get install default-jre default-jdk ant

Setting up your computer up with Github

All of this courses content is stored on Github so you're going to have to do a lot of cloning (copying files from your github account to your computer) and pushing (taking files you've saved on your computer, and updating your github files with them).

It would be a real pain if you have to type your password in every time you wanted to perform one of these actions. Luckily you don't have to with an SSH key. You can set this up by following the following steps:

  • Type the following into your terminal: ls -al ~/.ssh (This will check for existing SSH keys. If you have a key, skip to the next to last step in these github instructions (copying your key).

Note: To use copy or paste in the terminal, use ctrl + shift + c and ctrl + shift + v

  • Next, type this into your terminal: ssh-keygen (ONLY DO THIS IF YOU DON'T ALREADY HAVE A GENERATED SSH KEY: just press return for everything, and don't enter a passphrase)
  • You will then be asked where you want to save the key: Enter file in which to save the key (/home/flatironschool/.ssh/id_rsa):. You can just press enter here for the default location. If there's already something there, you can overwrite it in this case.
  • Add your new SSH key to your ssh-agent by typing in ssh-add ~/.ssh/id_rsa.
  • Type cat ~/.ssh/id_rsa.pub to display your newly generated SSH key. Copy this key and add it to your github account
  • You're also going to want to let the git that is running on your machine to know you you are. You can set this up by running: git config --global user.email "you@example.com" and git config --global user.name "Your Name".

Now when you go to clone a repository, be sure to clone it with SSH!

Set up your Learn app

  • Open the terminal, and type the command learn whoami to set up learn. This will ask you for the auth token at the bottom of your Learn profile (from https://learn.co/<github_username>). Paste it in, and you should be all set.

Recommended Software Installs

Most of these apps are by no means required tools, just a couple of things that make working a bit easier.

Atom

This is the Learn preferred editor. To install it, head to https://atom.io/ and click the "Download .deb" button. Install and you are all set! You can find some recommended packages here: https://gist.github.com/tracypholmes/dc0a18498c6c31d8fc0be52505e31656

If you prefer a different text editor, that's fine too.

Chrome or Firefox

Chrome is the Learn recommended browser. It can sometimes have issues. So, install both if you'd like - Firefox *should not give you any issues. You can find both in the Ubuntu Software Manager or download from the respective websites. You can also install Chromium ((with Chromium being the open-source web browser project from which Google Chrome draws its source code). There are very few differences between Chromium and Chrome.

Install TeamViewer 11 and Zoom

When screensharing, this is what we use. Many of the study groups are held using Zoom also. You're going to want to download and install Team Viewer v11.x for Ubuntu here: https://www.teamviewer.com/en/download/previous-versions/. See if you can Google the installs for Zoom! (Hint: you want the .deb install)

Synapse

This is just a quick launcher. After install, it has a blue S logo at the top of your screen.

To install Synapse in Ubuntu 16.04 open Terminal (Press Ctrl+Alt+T) and copy the following commands in the Terminal:

  • sudo add-apt-repository ppa:synapse-core/testing
  • sudo apt-get update
  • sudo apt-get install synapse

After installation run Synapse. Right click, select Preferences and you can set up a shortcut for the Activate command. This just lets you pull up a bar to quickly find and run applications. In preferences, check "Startup on Login". To activate Synapse Press Ctrl+Space (You can change shortcut from preferences).

ScudCloud

Slack, for Linux. This is app is not currently installed, so you get to install it yourself!

Let's run the commands to install the app:

sudo apt-add-repository -y ppa:rael-gc/scudcloud
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get update
sudo apt-get install scudcloud

And just like that, ScudCloud should be installed for you.

Note: apt is a popular package manger for linux is many apps can be installed using the apt-get install command.

For more information on ScudCloud, you can check out their github: https://github.com/raelgc/scudcloud

Slack for Linux (Beta)

You can try the official beta client, but keep in mind that it is still in the works. I have not had any issues with it. There are binary packages for Ubuntu and Fedora that can be found here: https://slack.com/downloads

Download the 64-bit version for Ubuntu, cd ~/Downloads and run:

sudo dpkg -i slack-desktop-*.deb

Parcellite

This app stores your clipboard history and makes it really easy to paste anything from your history. This can be installed from Ubuntu Software Manager. Search for "Parcellite" in the search box, and install. Afterwards, take a look at the settings and you can customize your keybindings for it.

That's it!

You should be all set. At this point, I like to reboot my computer so it can settle in a bit. Once you reboot, open Terminal again and run these two commands:

  1. sudo apt-get update
  2. sudo apt-get upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment