List the Roles for a User or Service Account in a Specific GCP Project

If you do not have web console permissions to do so, but have the ability to activate a service account that has the viewer permissions or IAM permissons to list IAM roles in a given project, the following is how you can list the roles for a given user or service account.

gcloud projects get-iam-policy <gcp-project\
--filter="bindings.members:<email-address" \
--flatten="bindings[].members" --format="table(bindings.role)"
Continue reading “List the Roles for a User or Service Account in a Specific GCP Project”

Compiling Python 3.8.x Under Linux

Yes, I know. 3.8.x? That’s an older version of Python but there are still a number of current applications and libs that require 3.8 as well as a number of distros that still have 3.8 as the most recent easily installable version. With that being said, the following is a quick how to on getting it compiled under both RedHat/CentOS/Almalinux and Debian based systems.

Install Dependencies

This assumes that you already have the “build-essentials” and kernel headers installed on the → Continue reading “Compiling Python 3.8.x Under Linux”

Using fc to Edit and Re-execute Bash Commands

I recently learned about the Bash built-in fc. It is a great tool that enables you to edit and re-execute commands from your bash history.

Oftentimes there is a command in your history that instead of just grepping through the history and then re-executing as-is you’ll want to make a modification or two. With fc you can first edit it in your favorite editor and then when closing the editor fc will execute the command.

For me, vim is my → Continue reading “Using fc to Edit and Re-execute Bash Commands”