Skip to content

Instantly share code, notes, and snippets.

View alexolinux's full-sized avatar
🤠
Working from home

Alex Mendes alexolinux

🤠
Working from home
View GitHub Profile
@alexolinux
alexolinux / PythonCompilation.md
Last active November 23, 2025 00:26
Compiling and installing Python for NonSudo Users

Python Compilation


To have another Python versions for the Linux Users without impacting the operating system, the best approach is to install Python locally in the user's home directory. This method avoids requiring root/sudo access and does not alter the system-wide Python installation.

To install Python (e.g.: 3.9.25) locally for a user without sudo access, including the pip module, follow these steps:

@alexolinux
alexolinux / portainer-agent.sh
Created November 16, 2025 17:53
Docker Agent for Portainer Environment
#!/bin/bash
#https://hub.docker.com/r/portainer/agent
AGENT_VERSION="2.33.3-alpine"
# Check if the script is being run as root.
if [ "$(id -u)" -eq 0 ]; then
echo "This script should not be run as root. Run it as a non-root user."
exit 1
fi
@alexolinux
alexolinux / AWX.md
Last active November 1, 2025 14:05
AWX Operator on K8s Installation

AWX K8s Installation


  1. Preparation
mkdir AWX && cd AWX && \
  git clone https://github.com/ansible/awx-operator.git && \
  cd awx-operator/ && \
@alexolinux
alexolinux / python-virtualenv.md
Last active June 21, 2025 19:46
Python virtualenv by module

Create virtual environment in Python

Virtualenv using python

  1. Check if venv module is installed
python -m venv --help
@alexolinux
alexolinux / opera-fix-ffmpeg.sh
Last active November 5, 2025 23:52
Fixing for "Opera Browser video not supported" in Linux Platforms
#!/bin/bash
ARCH="x64"
FFMPEG_VER="0.105.0"
FFMPEG_URL="https://github.com/nwjs-ffmpeg-prebuilt/nwjs-ffmpeg-prebuilt/releases/download/$FFMPEG_VER/$FFMPEG_VER-linux-$ARCH.zip"
OPERA_LIB="/usr/lib64/opera"
TMP_DIR="/tmp/operalib"
if [ -f "${OPERA_LIB}/libffmpeg.so" ]; then
echo "libffmpeg.so already exists in ${OPERA_LIB}. Making backup..."
@alexolinux
alexolinux / kubernetes-install.sh
Last active March 3, 2025 13:05
Script to install/configure kubernetes cluster (control-plane/worker nodes).
#!/bin/bash
# -- ------------------------------------------------------------------------------------------------
# Author: alexolinux
# This script to install and configure a Kubernetes cluster with control-plane and nodes.
# -- ------------------------------------------------------------------------------------------------
# https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/
# https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-upgrade/
# -- ------------------------------------------------------------------------------------------------
@alexolinux
alexolinux / install-repo.sh
Created November 9, 2024 18:37
Script to install additional repositories
#!/bin/bash
# Detect RHEL version
if [ -f /etc/os-release ]; then
. /etc/os-release
RHEL_VERSION=$(echo $VERSION_ID | cut -d '.' -f1)
else
echo "Unable to determine OS version."
exit 1
fi
@alexolinux
alexolinux / TMUX.md
Last active September 16, 2025 21:55
TMUX: Transform Your Terminal into a Productivity Powerhouse

TMUX: Elevate Your Terminal Experience


Session Management:

  • Start TMUX Session: tmux new
  • Start TMUX Named session: tmux new -s <NAME>
  • Start TMUX Named detached session: tmux new -s <NAME> -d
  • Kill session: tmux kill-session -t <NAME>
  • Kill ALL sessions: tmux kill-server

Consul Installation


sudo yum install yum-utils
sudo yum-config-manager --add-repo https://rpm.releases.hashicorp.com/RHEL/hashicorp.repo
sudo yum install consul

Running consul as dev (single mode)

@alexolinux
alexolinux / kubectl-remove-node.sh
Created May 14, 2024 08:51
K8s - Remove kubernetes node from cluster
#!/bin/bash
NODE="kube-node-02"
kubectl cordon $NODE
kubectl drain $NODE --ignore-daemonsets --delete-emptydir-data
kubectl delete node $NODE