Sign up for digitalocean. The promo code we give you provides a $50 credit, that will easily cover all your bootcamp needs, and will have plenty left over for your personal adventures. However, you still need to enter a credit card to activate the account.
Create a droplet by entering a name for your machine. Call your machine whatever you fancy. We will use this for McNulty, so [yourname]-mcnulty (like irmak-mcnulty) is pretty straightforward, but go crazy.
Choose the machine size as the smallest: $5/mo, you can leave the rest of the defaults alone. Region and Available Settings are fine as they are, and the default Ubuntu installation is great. Click "Create Droplet" and you will get an email with your root password.
Open a terminal and connect to your machine by typing
ssh email@example.com (replace the x'es with the ip address of your digitalocean machine). The first time you connect, it will ask you to change your password (asking the old password twice and then asking you to write a new one twice).
Great! Now let's start installing things.
We already have python installed (you can check that by typing
python, hitting enter, and noticing that you are now at a python command line. Type
import pickle. See how nothing happened? That means it's working. Use ctrl-d to get out of there.
since we're on the subject of importing packages on a brand new installation of python, you can see all of the modules that come with python in this documetation index.
apt-get is a handy package management tool. The Ubuntu guide mentions that it is "a powerful command line tool that" performs several functions, but most people just use
apt-get for its one to two main uses, most notably
I'll also mention the related and handy
apt search command, which I use when I pretty much know the name of the thing I want, but I'm not sure I have it exactly right.
Let's try that out now. We know we'll want
pip to help us install all our python packages. Is it just
apt-get install pip? I never remember.
apt search, update your libraries (the things
apt search is going to search) by typing
When that finishes, try
apt search pip.
Holy moly that's a lot of pip returns. Scroll up to the "p's" and see if you can find the winner.
pip by typing [spoiler alert]
apt-get install python-pip. Accept the myriad suggestions it makes, and hit enter to watch it go. It will take a medium amount of time for this to finish up.
fun fact: we'd usually be typing
sudo apt-get install [whatever], but this time we didn't use
sudo! that's because when we created our servers, we start out as root. It is wise to create a user and not go around being root all day, because that is a bad idea in general. We'll make a user in just a bit. Here are some handy instructions for this and other server setup tasks.
now that we're on Ubuntu instead of OS X, we can install our stack of usual tools with this line:
sudo apt-get install python-numpy python-scipy python-matplotlib ipython ipython-notebook python-pandas python-sympy python-nose
We'll also be interacting with repositories from our server, so let's
apt-get install git. I won't make you search that one because there are way too many packages that have 'git' in the name. So I'll save you the trouble -- it's just called 'git'.
git config --global user.email [firstname.lastname@example.org] git config --global user.name [your username]
Let's go ahead and make a user account for ourself at this point. Choose a name for yourself and add a user acount with the intuitive command:
Pick a password, re-enter it, and then feel free to hit enter through all of the other questions.
Make yourself special by granting yourself root privileges: type
visudo, this will open up nano (a text editor) to edit the sudoers file. Find the line that says
root ALL=(ALL:ALL) ALL. Give yourself a line beneath that which says
[username] ALL=(ALL:ALL) ALL. Save by hitting Ctrl-o and then Enter when asked for the file name. Exit nano with Ctrl-x.
fun fact: did you know that when you see a yes/no prompt in this format
[Y]/n, that you can simply hit enter and it will assume you mean the default (capital and bracketed) option? You'd be surprised how many people I've caught carefully typing a capital Y. It's a lot.
Now stop being root and start being you using
su stands for switch user. Now type
cd and enter to get into your home directory.
create an alias to make it easier to log in to your cloud machine. On your local laptop (you can open up a new terminal for this), in your home directory (
cd ~or just
cd), go to your hidden
.sshdirectory (view hidden directories by adding the flag
lscommand). Create a file called
config. You can create a file by just opening it in an editor (like nano) and saving it. Put the following information in it:
Host mcnulty HostName xxx.xxx.xxx.xxx User bo
Here, replace the
xxx.xxx.xxx.xxxwith the cloud machine's ip, replace
mcnultywith whatever nickname you want to give the machine, and replace
bowith the username you created on the machine. Now you can quickly log in by doing:
sudo apt-get install mysql-server and give yourself a root password. The Mysql server root password is different from the system root password, and you'll have to remember it, so keep that in mind when choosing one.
Done? Move on to getting mysql setup on your cloud server.