<commit_before>Lesson 1: The Very Basics
=========================

Today's Agenda
--------------

* Getting (to) Linux
* The Terminal & Shell
    * Scripts, file paths, special characters
* Productivity tricks
    * Getting help

.. figure:: /static/Tux.png
    :align: right

* IRC
    * Vocabulary
    * Get connected
    * Etiquette

A note about notation
---------------------

.. figure:: /static/stickynote.png
    :align: right
    :scale: 20%

* Variables
    * ``$varname``
    * ``<varname>``
* Shell prompt
    * ``$``
    * ```literal stuff in backticks```
* foo, bar, baz, username, etc.

How to get (to) Linux
---------------------

.. figure:: /static/dualboot.png
    :align: right
    :scale: 40%

* How many have it already installed?
* Install VM or dual-boot
* When stuck on Windows, use `PuTTy`_:
* Students::

    ssh <onidusername>@shell.onid.oregonstate.edu


.. figure:: /static/osm_server.jpg
    :align: right
    :scale: 50%

* flip{1-3} are Engineering servers; less reliable

.. _PuTTy: http://www.chiark.greenend.org.uk/~sgtatham/putty/

Trying Linux on a Virtual Machine
---------------------------------

Virtual machines act as a full system on a physical machine

.. figure:: /static/virtualbox.png
    :align: right
    :scale: 50%

* Hypervisors:
    * VirtualBox (free)
    * VMWare (mostly free)
    * KVM (Linux only hosts)
    * Parallels
* Public Cloud Virtual Machines
    * Amazon EC2, Rackspace Cloud, Google Compute Engine, etc
* Easy way to test without breaking your machine!

Installing Linux on Virtualbox
------------------------------

.. note:: 
  Try other distributions if you like to see what's different. Debian is a great
  next step to try out.

#. Download and install: https://www.virtualbox.org/wiki/Downloads
#. Grab the latest minimal ISO: http://centos.osuosl.org/6/isos/x86_64/
#. Create VM
    #. New -> Name "CentOS" -> Default Ram -> Default Disk settings
    #. Settings -> Storage -> Empty -> CD/DVD Drive -> Select ISO
    #. Start -> press enter -> Skip media check
#. ``\o/``

Vagrant & VirtualBox
--------------------

.. note::
  We're using CentOS as our base image for now but will use Debian later. You
  can see the gui by uncommenting the line in the Vagrantfile.

* Vagrant is a tool used with Virtualbox (and other) platforms
* Make a reproducible pre-installed Linux environment
* Download and install: http://www.vagrantup.com/
* Clone our repo, start and access the vm:

.. code-block:: bash

    # clone
    git clone https://github.com/WWUDevOps/vagrantfile

    # rename
    mv vagrantfile devopsbootcamp-vagrant

    # start up
    cd devopsbootcamp-vagrant
    vagrant up

    # access vm
    vagrant ssh

Vagrant cheat sheet
-------------------

.. note::
  We'll get into more detail later in how you can access ports on your VMs and
  other use cases.

.. code-block:: bash

    # start<commit_msg>Added warning about VMs over NFS<commit_after>Lesson 1: The Very Basics
=========================

Today's Agenda
--------------

* Getting (to) Linux
* The Terminal & Shell
    * Scripts, file paths, special characters
* Productivity tricks
    * Getting help

.. figure:: /static/Tux.png
    :align: right

* IRC
    * Vocabulary
    * Get connected
    * Etiquette
    * #wwucs, #wwu-devops, #wwu-alumni
A note about notation
---------------------

.. figure:: /static/stickynote.png
    :align: right
    :scale: 20%

* Variables
    * ``$varname``
    * ``<varname>``
* Shell prompt
    * ``$``
    * ```literal stuff in backticks```
* foo, bar, baz, username, etc.

How to get (to) Linux
---------------------

.. figure:: /static/dualboot.png
    :align: right
    :scale: 40%

* How many have it already installed?
* Install VM or dual-boot
* When stuck on Windows, use `PuTTy`_:
* Students::

    ssh <<EMAIL>


.. figure:: /static/osm_server.jpg
    :align: right
    :scale: 50%

.. _PuTTy: http://www.chiark.greenend.org.uk/~sgtatham/putty/

Trying Linux on a Virtual Machine
---------------------------------

Virtual machines act as a full system on a physical machine

.. figure:: /static/virtualbox.png
    :align: right
    :scale: 50%

* Hypervisors:
    * VirtualBox (free)
    * VMWare (mostly free)
    * KVM (Linux only hosts)
    * Parallels
* Public Cloud Virtual Machines
    * Amazon EC2, Rackspace Cloud, Google Compute Engine, etc
* Easy way to test without breaking your machine!

Installing Linux on Virtualbox
------------------------------

.. warning::
  Your home directories in all CS labs are mounted over NFS. If you run a 
  virtual machine from your home directory you will crash the file server and 
  get your account disabled.
  
  You can stop this from happening by adding "export 
  VAGRANT_HOME=/tmp/$USER-vagrant.d/" to your .bashrc (or .zshrc, etc.) and 
  changing the virtualbox default machine location to /tmp. This setting can be
  found in File -> Preferences -> General in Virtualbox.

.. note:: 
  Try other distributions if you like to see what's different. Debian is a great
  next step to try out.

#. Download and install: https://www.virtualbox.org/wiki/Downloads
#. Grab the latest minimal ISO: http://centos.osuosl.org/6/isos/x86_64/
#. Create VM
    #. New -> Name "CentOS" -> Default Ram -> Default Disk settings
    #. Settings -> Storage -> Empty -> CD/DVD Drive -> Select ISO
    #. Start -> press enter -> Skip media check
#. ``\o/``

Vagrant & VirtualBox
--------------------

.. note::
  We're using CentOS as our base image for now but will use Debian later. You
  can see the gui by uncommenting the line in the Vagrantfile.

* Vagrant is a tool used with Virtualbox (and other) platforms
* Make a reproducible pre-installed Linux environment
* Download and install: http://www.vagrantup.com/
* Clone our repo, start and access the vm:

.. code-block:: bash

  # clone
  git clone https://github.com/WWUDevOps/vagrantfile

  # rename
  mv vagrantfile devopsbootcamp-vagrant

  # start up
  cd devopsbootcamp-vagrant
  vagrant up

  # access vm
  vagrant ssh

Vagrant cheat sheet
-------------------

.. note::
  We'll get into more detail later in how you can access ports on your VMs and
  other use cases.

.. code-block:: bash

    # start
{'fraction_non_alphanumeric': 0.1559278350515464, 'fraction_numerical': 0.005154639175257732, 'mean_word_length': 2.4687150837988825, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 27, 'https://': 4, 'lorem ipsum': 0, 'www.': 6, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '98135', 'n_tokens_mistral': 1994, 'n_tokens_neox': 1863, 'n_words': 698}