M. Edward (Ed) Borasky znmeb@znmeb.net and Scott Lewis slewis@hackoregon.org
File an issue at https://github.com/hackoregon/getting-started/issues/new.
- As always, reliable wall power and internet connectivity!
- A 64-bit host system, preferably with virtualization hardware. This is unlikely to work on a 32-bit host even though there are claims that it will. It's just not worth the hassle.
- VirtualBox 5.0 or later.
-
Download the .ova file - it's available here in our Google Drive repository. The name is
Hack Oregon Base v2.ova
. It's ~2GB in size, so if you can get it from someone directly (via thumb drive) then that will be faster and use less bandwidth. Please ask around before you download it directly. This .ova file has an entire environment already installed on it (e.g. Python Mini-Conda, Jupyter Notebook and various Python libraries). -
Start VirtualBox installed in step 1. In the
File
menu, selectImport Appliance
. Browse to the downloaded .ova file from step 2 and select 'Next' and thenImport
. This will take several minutes to complete the import. When complete it will look something like this -
Select the
Hack Oregon Base v2
virtual machine in Virtual Box and select the greenStart
arrow. VirtualBox will open a separate window for this vm and once visible the vm will take some time to start producing text output as it starts. -
Once it appears, at the login prompt, log in as
vagrant
, passwordORturkeyeggs
. -
The box ships with a publicly-known password,
ORturkeyeggs
, for thevagrant
account. For personal security you should change the password! To do so, at the prompt enterpasswd
.$ passwd Changing password for vagrant. (current) UNIX password: Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
-
To configure postgressql, enter
cd getting-started/datascience/linux-laptop-setup git checkout master git pull ./configure-postgresql
git pull
updates thegetting-started
repository to the latest release and./configure-postgresql
configures the PostgreSQL database.First, you will need to set the PostgreSQL password for the PostgreSQL
vagrant
superuser. The script will prompt you. Don't use a colon (':') in the password. The configuration file in the next step uses colon as a separator. If you mis-type one of the password entries, just run the script again.Second, you will be put into and editor to edit the file
~/.pgpass
. You should replace the string 'password' at the top of the file with the password you set above and save your changes by entering ':wq' to write your changes and quit. Once created, this file allows you to connect to thevagrant
database as thevagrant
user in a Jupyter notebook without exposing the database password!
-
Open a terminal on the host system.
-
If the virtual machine is powered off, start it with the green arrow.
-
Enter
ssh vagrant@localhost -p 2222
. You will be asked for the new password you defined above. -
Enter
activate-data-science
. This starts an environment that allows you to run jupyter notebook and other tools setup for Hack Oregon data science work. -
Enter
jupyternb
. As output you should see[I 16:41:20.615 NotebookApp] [nb_conda_kernels] enabled, 2 kernels found [I 16:41:20.621 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret [I 16:41:51.427 NotebookApp] [nb_conda] enabled [I 16:41:51.681 NotebookApp] ✓ nbpresent HTML export ENABLED [W 16:41:51.682 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'nbbrowserpdf' [I 16:41:51.843 NotebookApp] [nb_anacondacloud] enabled [I 16:41:51.876 NotebookApp] Serving notebooks from local directory: /home/vagrant [I 16:41:51.877 NotebookApp] 0 active kernels [I 16:41:51.878 NotebookApp] The Jupyter Notebook is running at: http://0.0.0.0:8888/ [I 16:41:51.878 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
-
On the host (your computer rather than the virtual machine), browse to http://localhost:7777/tree. You'll be in the Hack Oregon Jupyter notebook environment!
-
In the Jupyter file tree tab, go into
getting-started/datascience/linux-laptop-setup
. Click the link on the notebookpsycopg2_test.ipynb
. When the notebook tab opens, selectRun All
in theCell
menu. If the system is configured correctly there will be no errors.
- Close all/any Jupyter Notebook browser tabs to make sure you have saved your work.
- Stop the Jupyter notebook server by typing
Control-C
twice in the vm terminal where the jupyternb server is running. - Deactivate the environment by entering
deactivate-data-science
. - Enter
sudo shutdown -h now
to shut down the virtual machine. You can close the host terminal.