2017-02-28

Python / Linux / VMware 5: Git-it with PyCharm

I'm trying to expand my knowledge of Linux and Python. I'm taking a "start from scratch" approach, building some virtual environments at home, and documenting every step along the way. This is the fifth of five posts capturing those steps; the end-state is PyCharm IDE, Python 3.6, CentOS 7.3, VMware Workstation Pro 12 running on Windows 10.

Part 1: Installing VMware and CentOS
Part 2: Expanding CentOS's Minimal Install
Part 3: Installing Python 3.6
Part 4: Linking PyCharm to Github via SSH
This is Part 5: Running through Git-It again, this time with PyCharm

Run through Git-it again, but with PyCharm


At this point we're just about ready to start working in PyCharm. All that remains is to work through Git-it again, but using only PyCharm, to discover any differences along the way (or to become more familiar with PyCharm). Each numbered step below corresponds to a step in the Git-it sequence.

Before you begin: Remove hello-world and patchwork


In Github, remove hello-world and patchwork by going to https://github.com/my_user_name/repo_name/settings (like https://github.com/gbarwis/hello-world/settings, for example) and scrolling down to the bottom of the page to the delete this repository feature.

In a terminal, remove both the hello-world and patchwork repositories from your local host via:
$ rm -rf ~/hello-world/ ~/patchwork/

2017-02-20

Python / Linux / VMware 4: Linking PyCharm to GitHub via SSH

I'm trying to expand my knowledge of Linux and Python. I'm taking a "start from scratch" approach, building some virtual environments at home, and documenting every step along the way. This is the fourth of five posts capturing those steps; the end-state is PyCharm IDE, Python 3.6, CentOS 7.3, VMware Workstation Pro 12 running on Windows 10.

Part 1: Installing VMware and CentOS
Part 2: Expanding CentOS's Minimal Install
Part 3: Installing Python 3.6
This is Part 4: Linking PyCharm to Github via SSH
Part 5: Running through Git-It again, this time with PyCharm

In this post I'm going to configure PyCharm to use GitHub for version control (then I'm going to get it working with SSH). This will let me accomplish two things:
  • It will let me work more easily from multiple machines on the same code.
  • It will make it easier for me to review or assist with other projects that are on my radar, because those are also in GitHub.

What is GitHub?


First, GitHub is not git. git is a version control tool written by Linus Torvalds, the guy responsible for Linux. Think of it as a series of snapshots of your code - so you can say 'oops, I really screwed this up, I want to go back to what I had 36 hours ago.'

GitHub is an online, web-based version control repository (with some other cool features, too). Imagine taking all of those incremental snapshots (with git) and saving them to DropBox or Google Drive. GitHub accomplishes this, but because it is specifically designed around this sort of purpose, it does it really, really well. This provides a few benefits:
  • It allows multiple people to work on the same project without the need for a common physical network. I can concurrently collaborate on code with colleagues in Kansas, Colorado, Kenya and Kuala Lumpur.
  • It allows work to continue on the same code, from multiple machines - I can make a lot of progress on my system at home, but if I have an idea while I'm at work, I can make a change without waiting to get back to my home system.

2017-02-08

Python / Linux / VMware 3: Installing Python 3.6

I'm trying to expand my knowledge of Linux and Python. I'm taking a "start from scratch" approach, building some virtual environments at home, and documenting every step along the way. This is the third of five posts capturing those steps; the end-state is PyCharm IDE, Python 3.6, CentOS 7.3, VMware Workstation Pro 12 running on Windows 10.

Part 1: Installing VMware and CentOS
Part 2: Expanding CentOS's Minimal Install
This is Part 3: Installing Python 3.6
Part 4: Linking PyCharm to Github via SSH
Part 5: Running through Git-It again, this time with PyCharm

I'm going to install the most recent version of Python, which at the moment is 3.6.0. I want to use the latest version for two reasons:
  • To align with the book that I'm using, which focuses on version 3
  • To experience software installation that's a bit more involved than yum install
This means that I'm going to need to download the source and compile it.

It's important to know that Python 2.7 is already installed, since it's a default part of most Linux distributions. Because of this, if I just install Python 3 without changing some of the standard installation behavior, I'm going to create trouble for myself later; the default Python installation and version are used by some important Linux system tools, which I'd rather not break.

2017-02-04

Python / Linux / VMware 2: Expanding CentOS's Minimal Install

I'm trying to expand my knowledge of Linux and Python. I'm taking a "start from scratch" approach, building some virtual environments at home, and documenting every step along the way. This is the second of five posts capturing those steps; the end-state is PyCharm IDE, Python 3.6, CentOS 7.3, VMware Workstation Pro 12 running on Windows 10.

Part 1: Installing VMware and CentOS
This is Part 2: Expanding CentOS's Minimal Install
Part 3: Installing Python 3.6
Part 4: Linking PyCharm to Github via SSH
Part 5: Running through Git-It again, this time with PyCharm

At this point, I'm working with a CentOS 7 virtual machine based on a Minimal Install. I have Internet connectivity, and have used yum update to make sure that all currently installed packages are at their latest versions.

Today I'm going to install the things I need to get started working in Python 3.6 in a graphical IDE. I could have taken care of all of this by using something other than the Minimal Install when I installed CentOS, but where's the fun in that?

Linux-based systems use a Package Manager to find and install software. CentOS uses yum so that's what I'll be playing with today. On Debian and Ubuntu, apt or apt-get are more common; here is a good reference if you're more familiar with those than with yum.

Note that the next few sections explain my thought process as I figured out what I'd need to install (so it's easier for folks to tell me where I went wrong, if they spot something). If you want to skip straight to the actual install steps, then go to the Putting it all together section, further down the page.

Figuring out what to install: nslookup is inside of package bind-utils

When I had finished the preliminary installation of CentOS, before I tried to ping an IP address, I had first tried to use nslookup - and discovered that it is not included in the Minimal Install. That's a tool I will want to have available, but I want to find out a little bit more.