Python IDE – 2

Months ago, I completed an Edx course on Python. A couple hours ago, on my second try, I was able to solve the (admittedly simple) initiation challenge at codewars.

So, back to trying to get this IDE stood up.

I’ve gotten Vundle working, and the venv thingy working down in a home folder subdirectory.
I’m not going to use an autocomplete plugin. If the goal is to grok it, autocomplete feels like a crutch (at least for now).
We’ll start with two panes, with a vertical split. Editing on the left, live python prompt and error readouts on the right.

Ok, wow. All ‘dem plugins, tho.

A Python IDE in VIM

One of the threads in my dive into propellerhead territory is coding. I’d like to be able to complete the challenges in Project Euler in a few languages.

The question you run into is what IDE and OS to use.

For the purposes of an Edx course I took in Python last year, I just downloaded Anaconda and Spyder. It was their recommendation, and it worked just fine, but I felt a desire to go a bit deeper.

You see, I’m the kind of guy who drives a manual transmission. I’m not super concerned with staying on the absolute bleeding edge of technology, as it’s a space (imho) often defined by overzealous marketers rather than engineers. You can spend a great deal of time (your most precious asset) becoming fluent in a particular toolset, only to encounter inexplicable malfunctions and unresponsive vendors. So you migrate to the new whiz-bang tool with slick marketing material, only to begin the cycle anew. This is not to say I don’t believe in the sincerity and dedication of the Anaconda/Spyder devs, I simply would like to remove as many layers of abstraction between myself and the code as possible.

I feel my time would be much better spent becoming fluent in a tool that has survived the test of time even if it perhaps lacks a few fancy features. I also don’t care for tools that try to be all things to all people.

Therefore, my choice in the (voluminous) IDE wars is to just use VIM. It’s focused (unlike the general-purpose emacs), it’s been around for nearly thirty years, it comes already installed on ‘nix systems, and even represents an opportunity to become fluent in regex.

Now, regarding OS; Windows was out, as I know myself well enough to know I should remove the opportunity to rely on the GUI gVim provides. I don’t own a Mac, nor am I enthused about becoming locked into that pricey ecosystem. So that leaves Linux. I settled on a PopOS iso spun up in VirtualBox. As an Ubuntu derivative, it’s got the backing of dedicated developers, is widely deployed as desktops and servers, and System76 seems to be on a good trajectory.

So, settled; Python VIM IDE in PopOS.

I spent most of the day yesterday savoring the vimtutor walkthrough, while generating multiple post-its.

Today, I’m going to try and get a barebones Python IDE stood up.

######
First, we did an update
sudo apt-get update
sudo apt-get -y upgrade
python3 -V
Python 3.6.9

Dope. Working. Following the tutorial from DigitalOcean here:
pip is evidently a package manager for python for sorting out dependencies and whatnot, so we’ll follow DO’s direction:
sudo apt-get install -y python3-pip
Next, DO recommends a few more for setting up a dev enviroment:
sudo apt-get install build-essential libssl-dev libffi-dev python-dev
So let’s see what that means….
Build-essential is evidently a collection of compilers and other tools for development.
libssl-dev: for doing stuff with with SSL (Secure Sockets Layer)
libffi-dev: “foreign function interface runtime”….dunno
python-dev: well….Python.
Next, DO says to set up virtual environments, and to do that you need “venv”
sudo apt-get install -y python3-venv
Now, while in the file directory I want to create an environment, I tell venv to set one up named “pyproject”
python3 -m venv pyproject
This created a subfolder named “pyproject” with a few things:
bin include lib lib64 pyvenv.cfg share
Interesting. It’s like it set up an itty bitty linux computer. I hadn’t ever though about it, but this makes perfect sense; you would totally want a miniature, pared-down computing environment to limit noise and side effects. Rockin’.
Now we fire that thing up with
source my_env/bin/activate
Dopesauce.
Seems like from here, I’ll just need to fiddle with my .vimrc file.
I’ll be shooting for three “panes” to start: file tree, main editor, and a python prompt for testing and outputs.
Many thanks to Digital Ocean for that spot-on tutorial.





VirtualBox on Centos, part deux

Ok, back to figuring this out.

Hmm….concerning….my server booted to a single red rectangle. Hard rebooted….and it came back to normal….gonna have to just roll past that.

Found a walkthrough for installing GCC here. It says I have GCC version 8.3.1 installed…

And now installing from the .rpm seems to work… Ok maybe it just needed a reboot…would make sense for a low-level change like kernel updates..

Now how do I start it?
Right on, it’s available in the main menu.
>>>>
In case I have to do this again:
sudo yum groupinstall “Development Tools”
Download the .rpm from virtualbox site and run sudo yum install <VirtualBoxfilename>.rpm
….
Welp…still need to sign kernel modules, somehow.

Bollocks.

Helps if you read the syslog that the error prompts you to.
Installing elfutils-libelf-devel did…something.

WE HAVE A VM RUNNING.

VirtualBox on CentOS; A journey.

RTFM’ing on VirtualBox’s site here
….hmm…what is “Qt”?
Some kind of graphical front-end, I’m gathering.
Ok how do I install it?
The install commands need a name.
A man needs a name.

Ok found a guide here:
The guide is for CentOS 6 …. I’m on CentOS 8, but we’re going to try.

Right, so this guide listed “GCC” as a step…and “GCC” itself has… we’ll say a non-trivial list of prerequisites.

Fuck that noise I’m just going to try and make this .rpm I downloaded with VirtualBox in the name work.

That did not work.
It immediately threw errors about needing “libQt5Core” and a dozen other Qt packages.

Maybe there’s a command for “install needed dependencies for this package”

yum is now my homeslice. It resolves dependencies and gets it done.

So it downloaded eleven things, many with “qt” in the name, but it’s failing here:
vboxdrv.sh:Building VirtualBox kernel modules.
This brings us back to the GCC requirement, evidently.
Right. That’ll be tomorrow.

Let’s do this.

Hardware has arrived.
Refurb Dell T7610 Workstation and a shiny new laptop.
Kali/Windows dual-boot on the laptop is working like a champ.

I intended to use the Dell as a host for virtual machines from VulnHub, which mostly has VirtualBox machines (at least the few that I spot-checked).
Looking at VirtualBox’s website, I saw downloads for Debian 10.

Long story short, that didn’t work at all.

I managed to mangle up my sources.list file (but, hey, I learned what that thing is for!), and then restore it, but VirtualBox just wouldn’t install

Ultimately I discovered that Debian doesn’t officially support VirtualBox since 2015 (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=794466).

Tomorrow, CentOS.