Skip to content

Instantly share code, notes, and snippets.

View beattidp's full-sized avatar

Douglas Beattie, Jr. beattidp

View GitHub Profile
@beattidp
beattidp / inst-py38-virtenv.sh
Created May 2, 2022 21:04
Install Python 3.8 into virtenv on CentOS/RHEL
sudo `which pip` install virtualenv
sudo yum install python38
virtualenv -p python3.8 venv38
echo "alias exit='unalias exit ; deactivate'" >> venv38/bin/activate
. venv38/bin/activate
pip3 install --upgrade pip wheel
@beattidp
beattidp / build-git.md
Last active October 17, 2023 18:04 — forked from egorsmkv/build-git.md
Build git from source code on CentOS 7

Build git from source code, without GUI and with Python support (e.g. git-p4)

1) Get the latest version of Git from GitHub.

Look at https://github.com/git/git/tags and toward the top pick a recent version. (e.g. at the time of this edit, v2.31.1)

method A: download a compressed archive of the sources

GITVER=2.31.1
wget https://github.com/git/git/archive/refs/tags/v${GITVER}.tar.gz
@beattidp
beattidp / prime0020.py
Last active February 22, 2021 00:39
Calculate Prime Numbers in Python
''' calculate prime numbers '''
DEBUG = False
HIGH_NUMBER = 2000
# initial list of primes contains only the number 2.
known_primes = [ 2 ]
for n in range(known_primes[0]+1,HIGH_NUMBER,2):
if DEBUG:
@beattidp
beattidp / aws-cloudformation-ssh-admin.sh
Last active December 29, 2020 16:42
Given the name of a CloudFormation stack, upload a local SSH public key and connect to its EC2 instance.
# Note: requires 'jq' utility, https://stedolan.github.io/jq/
# Download or install it locally with your package manager.
# your cloudformation stack name here
export STACK_NAME="eastern-sky-2020"
# your SSH key name here
export SSH_KEY_NAME="id_rsa_aws_ec2"
# filter by Tag named 'aws:cloudformation:stack-name'
aws ec2 describe-instances --filter Name=tag:aws:cloudformation:stack-name,Values=${STACK_NAME} \
@beattidp
beattidp / build-pypy-on-osx.sh
Created August 26, 2017 00:33
Build PyPy on Mac OS X El Capitan 10.11.6
# Build PyPy on Mac OS X El Capitan 10.11.6
# re. http://pypy.readthedocs.io/en/latest/build.html
cd ~/Downloads/
wget https://bitbucket.org/pypy/pypy/downloads/pypy2-v5.8.0-src.tar.bz2
cd /tmp/
tar -xjf ~/Downloads/pypy2-v5.8.0-src.tar.bz2
cd pypy2-v5.8.0-src/pypy/goal/
python ../../rpython/bin/rpython -Ojit targetpypystandalone
# And a long time later the build completes
@beattidp
beattidp / Install-Pulp-with-Debian-plugin-CentOS-7.txt
Created June 9, 2017 00:29
Install Pulp repository management with Debian plugin on CentOS 7
## CentOS Linux release 7.3.1611
## MongoDB 2.6.12 is the default version for this release
## Pulp Platform Version: 2.13.1
##
## This is cleaned-up and sanitized chronology of several console sessions
## Confirm the VM is up and running on hypervisor
macturbo:~ beattidp$ ssh root@smartos 'uname -a && date && vmadm list | grep linuxrepo'
SunOS 18-a9-05-73-95-99 5.11 joyent_20150820T062742Z i86pc i386 i86pc