Skip to content

Instantly share code, notes, and snippets.

View selfup's full-sized avatar
💻
doing the most

Regis Boudinot selfup

💻
doing the most
View GitHub Profile
@selfup
selfup / linux_free_as_in_freedom.md
Last active August 29, 2015 14:28
Student Led Session

##Linux - Free as in Freedom

####Setting up a VM or repurposing an old machine

  • Downloading/Getting an iso (I will have a few USB sticks with ISO's)
  • Loading the machine (Spinning up a VM or setting the BIOS load order)
  • Installing Ubuntu 15.04
  • During install we will talk about different distro's

####Familiar place

  • Bash based terminal
@selfup
selfup / setup_vm_mac.md
Last active October 6, 2015 22:09
How to get Linux on a VM
Here is my link for Vagrant Setup: link

Download Virtual Box

  • Here
  • Now click the amd64 link: VirtualBox 5.0.2 for OS X hosts
  • Or just click this link: Here
  • Install VB

Download Ubuntu

Fusion

  • Is it real?
  • Where does it exist?
  • How are we going to do it?
  • THE SUN - ON EARTH

Real Life

  • ITER

- Mission

The purpose of this tutorial is to mimic setting up a DigitalOcean/AWS EC2/Linode server. The main advantages of having a virtual machine is that you can learn without worry of breaking things.

The first lesson will be all about getting familiar with a headless machine and getting a language we all know and love (ruby). Then we can mess around and try things out purely in the terminal.

The only three good options for a text editor are: emacs, vi, and vim. We will be using vim but vi itself is great and comes by default on Ubuntu 12.04.

Now you can practice getting used to ssh'ing into headless machines, using terminal based text editors, and using a terminal based window/session manager (tmux). The reason we have to use vim and tmux is that there is no X environment in a headless machine (the GUI, graphics, pretty things, etc..). The main reason for this is to save space on precious costly SSD data.

set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required

To have PG accept user DB creation from mix ecto.create for Phoenix with PG installed from homebrew

    createuser postgres -d

then run

mix ecto.create

Now that we have ruby, node, and rails, it is time to get pg

    ssh root@your_ip_address_for_DO
    sudo apt-get update
    mkdir -p ~/.rbenv/plugins
    cd ~/.rbenv/plugins
    git clone https://github.com/sstephenson/rbenv-vars.git
    cd
    sudo apt-get install postgresql postgresql-contrib libpq-dev
$ rails g model Role name
      invoke  active_record
      create    db/migrate/20151014151416_create_roles.rb
      create    app/models/role.rb
      invoke    test_unit
      create      test/models/role_test.rb
      create      test/fixtures/roles.yml
$ rails g model UserRole user:references role:references
      invoke  active_record

create db/migrate/20151014151448_create_user_roles.rb

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'hashicorp/precise64'
config.vm.network :private_network, ip: '10.10.10.10'