Skip to content

This is pretty simple when comes to compiling Python on any *nix OS. There must compilation tools to be first installed before continuing onto compiling a opensource software such as the Python programming language.

on Ubuntu types of Distros:
we must install the following tools on the command prompt.

>>> sudo apt-get install build-essential

on CentOS like OSes:
We can do the following to obtain development tools

>>> sudo yum groupinstall 'Development Tools'

Finally, we can then roll over to python website to download the latest release candidate.

https://www.python.org/downloads/release/python-390rc2/

Download either the Gzipped source tarball or XZ compressed source tarball. If you have downloaded the GZ source code package. We can do the following to extract code into a directory and compile like a boss.

>>> tar xzvf Python-3.9.0rc2.tar.gz
>>> cd Python-3.9.0rc2/

Missing _lzma ? No problem we can first install xz and lzma using macports then configure the CFLAGS and LDFLAGS ENV variable to enable lzma header info unto bash.

>>> sudo port install xz lzma
>>> export LDFLAGS="-L/opt/local/lib"
>>> export CFLAGS="-I/opt/local/include"
>>> ./configure --enable-optimizations
>>> make
>>> make test
>>> make install

One of my previous post when installing python was to use the XML file which was by far the best approach in installing Python v3.8.x silently. After some experimenting using XML, it stopped functioning after i've upgraded to windows 10 v2004. after some thoughts, i then decided to use their other method to install this software unto windows.

you must first download either the python v3.8.5 64 bit installer software or their python v3.8.5 32 bit installer software from python.org.

afterwards, fire up your DOS prompt/terminal and run the terminal as administrator instead of a regular user to gain access to install this python software unto the C-Drive.

enter a command to change your directory to your download folder where the python installer executable has been placed.

C:\users\UserName\Download> python-3.8.5-amd64.exe /quiet InstallAllUsers=1 TargetDir=c:\Python38 AssociateFiles=1 CompileAll=1 PrependPath=0 Shortcuts=0 Include_doc=1 Include_debug=0 Include_dev=0 Include_exe=1 Include_launcher=1 InstallLauncherAllUsers=1 Include_lib=1 Include_pip=1 Include_symbol=0 Include_tcltk=1 Include_test=1 Include_tools=1

Now, wait 10 to 15 seconds before entering command onto the command prompt. There is still one additional task we must do before we could call this a successful install due to pip package manager. In the next block, we will show you how we can simply install pip unto your windows 10.

Ok, in order to install pip, we first must upgrade pip to the latest version since if you plan to use it immediately after installing Python by using the method from above , it will complaint to you that you have an older pip package manager.

so now, we will upgrade pip. Execute the below commands inside your ADMIN command prompt window !!

C:\users\UserName\Download> C:\Python38\python.exe -m pip install --upgrade pip

To install python packages, you will have to do the following.

C:\users\UserName\Download> C:\python38\scripts\pip.exe install requests diceware scipy

Done !

This was something , which intrigued me for the past few months. I couldnt find time to work on this docker item until today. The concept in using Docker to build your own unique cluster farm of bots was quite kool. One can make as many worker bees in a single cluster farm as long as there is DISK and RAM space available. I will provide one example on how i was able to build a simple cluster using Docker and Docker-tools.

1) Docker
2) Docker-Toolbox

In order for us to build a simple docker cluster bots, we must create a BOSS worker agent then create other worker bees in this exact order.

I am assuming you are on linux/mac since windows docker worker agents will be a whole different beast, where one has to deal with, when comes to building a docker cluster bot farm aka a Borg Collective.

1) docker-machine create --driver virtualbox boss1
2) docker-machine ip boss1
3) docker-machine ssh boss1

so now, we are inside boss1 the container, we must initialize the boss1 to become the BOSS in this docker Cluster.

1) docker swarm init --advertise-addr boss1_IP_addr
it returns something like this:

docker swarm join --token SWMTKN-1-5qualk27cjkwaplb1j7zn88me2zlxqe7owe1cn2c2s14wb2mpt-3liv5iz5sz9c8j6jtd3w5nql8 192.168.99.100:2377


2) docker node ls
it returns something like this:

ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS ENGINE VERSION
88ruvvd93cwd7cp4jt5u1tkwg * boss1 Ready Active Leader 19.03.5

So now, you can see that this container had became a cluster leader in our swarm. We must now add other worker bees to our cluster (Borg Collective). We must now fire-up another terminal tab in your OS to create additional worker containers (repeat this task below to create more borgs/bees by changing work1 to work2 or *workN).

*where workN , N is a number.

1) docker-machine create --driver virtualbox work1
2) docker-machine ip work1
3) docker-machine ssh work1

Now, we would need to paste that command from above to allow this worker1 to join the BOSS Collective.

4) docker swarm join --token SWMTKN-1-5qualk27cjkwaplb1j7zn88me2zlxqe7owe1cn2c2s14wb2mpt-3liv5iz5sz9c8j6jtd3w5nql8 192.168.99.100:2377

Its weird how this worked so well, but continue to open a new tab and run steps 1,2,3 in creating additional worker borg agents then add the BOSS ID to each of the worker bees (depending how many you wish to make). These steps did worked ! After creating a dozen or so bots, you can install all kinds of opensource software unto them and allow the BOSS to control the worker bees/borgs aka swarm/collective.

If you do decide for your worker bees to get out of your swarm. In each of the workers, one can execute including the leader.

docker swarm leave

once outside of the swarm cluster, you can use the commands to stop the instances/containers and delete them by using the following commands.

docker-machine stop work2
docker-machine rm work2

docker-machine stop work1
docker-machine rm work1

docker-machine stop boss1
docker-machine rm boss1

Happy Dockering !

From our previous mention of using homebrew on mac. This time we will be going through how to add, delete, and clean software installed using macports.

1) https://macports.org

I have briefly mentioned the use of using homebrew for adding additional software packages to MacOS from highsierra to newer OS in our previous posting. After some thought, it would also be useful to jogged my memory on how to use macports when one is on a mac device after installing this package manager utility. I recommend using either one or even both software package manager. The Fink utility is a foreign to me, i have not used this at the moment but i am certain it will be as good as macports.

Install macports:
Download their binary executable from their website for your MacOS.

Once installed, one can fire up a native mac terminal or install Hyper or even iTerm v3.x.x console. When comes to running commands, it is your preference that you should choose and be comfortable with one to two terminal on mac before executing the following commands once you have macports installed.

# to update package listings
sudo port selfupdate

# to search for packages
sudo port search PACKAGEName

# to Install packages
sudo port install PACKAGEName

# to upgrade outdated packages
port upgrade outdated

# to check current inactive packages
sudo port installed inactive

# to clean current inactive packages
sudo port uninstall inactive

# to check current active packages
sudo port installed active

# to delete package
sudo port uninstall PACKAGEName

# to check dependencies software packages
sudo port echo leaves

# to clean out dependencies
sudo port uninstall leaves

# Start / Stop
sudo port load mariadb-10.1-server
sudo port unload mariadb-10.1-server

# secure install
sudo /opt/local/lib/mariadb-10.1/bin/mysql_secure_installation

# login
/opt/local/lib/mariadb-10.1/bin/mysql -u username -p

# Change Password
/opt/local/lib/mariadb-10.1/bin/mysqladmin -u root password ''

The Simple answer is yes, one can script the docker like a Boss. Kind of struggled this semester trying to make sense what Docker is and what Docker can do for System Engineering as a whole. My struggle was to understand how does a local installation of Docker be able to connect to DockerHub. This was my one and only struggle ! After realizing that all of the files (images) aka resources were coming from this Dockerhub website, I was in an absolute euphoric state, once this had been resolved. A LED lightbulb had woken me up in a deep slumber and everything made sense.

The Key is how to write commands in order to control the delivery of these Software images into your local machine (mac, windows, linux). Once an image has been pull from DockerHub, one has the ability to customize an image. One has the ability to make an image from Dockerhub to a single instance of that image, or to as many as thousands of local instances of that one particular image. These Local Runnable images can then be copied with unique customization then turned into Containers. After customization, one would run the containers, altered its configs, add features, and finally delete them, if necessary.

For example: the following 10 lines of code can be saved into a file called: Dockerfile. Once the code has been inserted into this special file. One can run this file in your terminal and execute all the commands. Your supervisor would be impressed that you are busy ! **b/c the longer this file is, the more text will fly across your terminal like a screen saver.

# This is a Docker Script

FROM ubuntu
ENV PATH /usr/local/bin:$PATH
ENV LANG C.UTF-8
MAINTAINER Yourname (email@isp.com)
RUN set -eux; \
apt-get update -y; \
apt-get install -y wget; \
apt-get install -y vim; \
apt-get install -y apache2; \
apt-get install -y mariadb
ENTRYPOINT ["/usr/sbin/apache2ctl", "start"]
EXPOSE 80

so.. now, you asked yourself, what do you do with the code from above ? right, in your OS, do a few things add that script and save it as Dockerfile.

mkdir $HOME/dockerimg
# copy that code from above and save it inside this $HOME/dockerimg location as "Dockerfile"
# to build this dockerscript, you can run the following command.
docker build -t NameofYourContainer:latest .

Now, you will see all kinds of text fly across your screen as if you are super busy doing something. You can also push it to your dockerhub account but one problem is that some of these images are pretty large. Unless that you have paid for a dockerhub account, generally its not allow to upload more than a a certain size of your image to dockerhub.