Skip to content

Instantly share code, notes, and snippets.

@learncodeacademy
Last active July 16, 2024 04:56
Show Gist options
  • Save learncodeacademy/5f84705f2229f14d758d to your computer and use it in GitHub Desktop.
Save learncodeacademy/5f84705f2229f14d758d to your computer and use it in GitHub Desktop.

Revisions

  1. learncodeacademy revised this gist Jul 2, 2014. No changes.
  2. learncodeacademy revised this gist Jul 2, 2014. 1 changed file with 8 additions and 24 deletions.
    32 changes: 8 additions & 24 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -29,31 +29,15 @@ _Now you are connected to a new machine!_

    _Nice! Now going to mytestsite.com will connect to our machine!_

    ###Let's install Node.js and fire up a webapp###
    ###Let's install nginx so we can see if our "domain" is working###
    ```
    sudo apt-get install python-software-properties
    sudo apt-add-repository ppa:chris-lea/node.j`
    #always update apt-get on a new machine
    sudo apt-get update
    sudo apt-get install nodejs
    sudo apt-get install git
    sudo npm install -g express-generator
    express myTestSite
    cd myTestSite && npm install
    npm start
    #install nginx
    sudo apt-get install nginx
    #start-er up
    sudo service nginx start
    ```

    _go to mytestsite.com:3000 and you're rocking!_

    ###Let's add a new user so it feels even more like the real world###
    ```
    #add user
    sudo useradd will --create-home
    ##give user "sudo" powers
    sudo adduser will sudo
    #set their password
    sudo passwd will
    ```
    - make bash the default login `sudo nano /etc/passwd`
    - on last line, change `sh` to `bash`, hit ctrl+x to exit
    - exit `exit`
    - log in as new user `ssh [email protected]`
    Now, go to mytestsite.com...you should see
    _Welcome to nginx!_
  3. learncodeacademy revised this gist Jun 27, 2014. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    ##Let's install Vagrant##
    ###Let's install Vagrant###
    - _Install VirtualBox: https://www.virtualbox.org/_
    - _Install Vagrant: http://vagrantup.com/_


    ##Select a Vagrant Box from https://vagrantcloud.com##
    ###Select a Vagrant Box from https://vagrantcloud.com###
    ```
    #add it to your list of boxes
    vagrant box add hashicorp/precise32
    @@ -19,7 +19,7 @@ _Now you are connected to a new machine!_

    - hit `exit` to disconnect

    ##Let's make this feel like the real world by adding a fake domain name##
    ###Let's make this feel like the real world by adding a fake domain name###
    - open the Vagrantfile and uncomment the private_network line & change to your desired IP
    - `config.vm.network "private_network", ip: "22.22.22.22"`
    - run `vagrant reload`
    @@ -29,7 +29,7 @@ _Now you are connected to a new machine!_

    _Nice! Now going to mytestsite.com will connect to our machine!_

    ##Let's install Node.js and fire up a webapp##
    ###Let's install Node.js and fire up a webapp###
    ```
    sudo apt-get install python-software-properties
    sudo apt-add-repository ppa:chris-lea/node.j`
    @@ -44,7 +44,7 @@ npm start

    _go to mytestsite.com:3000 and you're rocking!_

    _Let's add a new user so it feels even more like the real world_
    ###Let's add a new user so it feels even more like the real world###
    ```
    #add user
    sudo useradd will --create-home
  4. learncodeacademy revised this gist Jun 27, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    _Install VirtualBox: https://www.virtualbox.org/_
    _Install Vagrant: http://vagrantup.com/_
    ##Let's install Vagrant##
    - _Install VirtualBox: https://www.virtualbox.org/_
    - _Install Vagrant: http://vagrantup.com/_


    ##Select a Vagrant Box from https://vagrantcloud.com##
  5. learncodeacademy created this gist Jun 27, 2014.
    58 changes: 58 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,58 @@
    _Install VirtualBox: https://www.virtualbox.org/_
    _Install Vagrant: http://vagrantup.com/_


    ##Select a Vagrant Box from https://vagrantcloud.com##
    ```
    #add it to your list of boxes
    vagrant box add hashicorp/precise32
    #create a new folder for your project & init vagrant
    vagrant init hashicorp/precise32
    #run your new machine
    vagrant up
    #ssh into your new machine
    vagrant ssh
    ```

    _Now you are connected to a new machine!_

    - hit `exit` to disconnect

    ##Let's make this feel like the real world by adding a fake domain name##
    - open the Vagrantfile and uncomment the private_network line & change to your desired IP
    - `config.vm.network "private_network", ip: "22.22.22.22"`
    - run `vagrant reload`
    - make a fake domain for that ip
    - run `sudo open /etc/hosts -a "Sublime Text"` to open your /etc/hosts file in Sublime Text
    - add this line to the end of the file and save `22.22.22.22 mytestsite.com`

    _Nice! Now going to mytestsite.com will connect to our machine!_

    ##Let's install Node.js and fire up a webapp##
    ```
    sudo apt-get install python-software-properties
    sudo apt-add-repository ppa:chris-lea/node.j`
    sudo apt-get update
    sudo apt-get install nodejs
    sudo apt-get install git
    sudo npm install -g express-generator
    express myTestSite
    cd myTestSite && npm install
    npm start
    ```

    _go to mytestsite.com:3000 and you're rocking!_

    _Let's add a new user so it feels even more like the real world_
    ```
    #add user
    sudo useradd will --create-home
    ##give user "sudo" powers
    sudo adduser will sudo
    #set their password
    sudo passwd will
    ```
    - make bash the default login `sudo nano /etc/passwd`
    - on last line, change `sh` to `bash`, hit ctrl+x to exit
    - exit `exit`
    - log in as new user `ssh [email protected]`