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
Purpose Lab: Install and test salt running on the following structure:
- 1 Salt Master (CentOS 7)
- 1 Salt Minion (CentOS 7)
- 1 Salt Minion (Ubuntu 20.04.4 (Focal Fossa))
# Download and install the latest release of Salt.
- Salt Master Centos 7:
@alexolinux
alexolinux / httpd.conf
Created May 26, 2022 14:43
apache sample conf for os RedHat
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# See the httpd.conf(5) man page for more information on this configuration,
# and httpd.service(8) on using and configuring the httpd service.
#
@alexolinux
alexolinux / apache2.conf
Created May 26, 2022 14:46
apache sample conf for os Debian
# This is the main Apache server configuration file. It contains the
# configuration directives that give the server its instructions.
# See http://httpd.apache.org/content/2.4/ for detailed information about
# the directives and /usr/share/doc/apache2/README.Debian about Debian specific
# hints.
#
#
# Summary of how the Apache 2 configuration works in Debian:
# The Apache 2 web server configuration in Debian is quite different to
# upstream's suggested way to configure the web server. This is because Debian's
@alexolinux
alexolinux / nginx.conf
Created May 27, 2022 19:58
nginx sample conf
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
@alexolinux
alexolinux / node_exporter_install.sh
Created June 29, 2022 00:00
Install node_exporter
#!/bin/bash
BINDIR=/tmp/binnaries
VERSION="1.3.1"
mkdir $BINDIR
cd $BINDIR
curl -LO https://github.com/prometheus/node_exporter/releases/download/v${VERSION}/node_exporter-${VERSION}.linux-amd64.tar.gz
tar -xf node_exporter-${VERSION}.linux-amd64.tar.gz
mv node_exporter-${VERSION}.linux-amd64/node_exporter /usr/local/bin/
@alexolinux
alexolinux / zsh_environment.md
Last active January 13, 2024 20:38
ZSH More Productive Enviroment for DevOps.

Becoming the ZSH More Productive

My Personal Preferences

This 'HowTo' goes through steps to become your shell env fully productive.

Features

  • Install newer ZSH version
  • Install OHMyZSH
  • Install Powerlevel10k
@alexolinux
alexolinux / fedora_post_installation.md
Last active February 6, 2024 23:11
fedora-post_installation.md

Fedora Workstation: Post Installation


This customization aims to become my Linux environment more elegant and more productive. Includes the most important DevOps tools.

RPM Fusion Configuration Extra Repositories

sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
@alexolinux
alexolinux / configure-pat.sh
Created December 29, 2023 12:16
AWS Nat Instance EC2 Port Address Translator
#!/bin/bash
# Configure the instance to run as a Port Address Translator (PAT) to provide
# Internet connectivity to private instances.
# https://docs.aws.amazon.com/vpc/latest/userguide/VPC_NAT_Instance.html
set -x
echo "Determining the MAC address on eth0"
ETH0_MAC=`/sbin/ifconfig | /bin/grep eth0 | awk '{print tolower($5)}' | grep '^[0-9a-f]\{2\}\(:[0-9a-f]\{2\}\)\{5\}$'`
if [ $? -ne 0 ] ; then
@alexolinux
alexolinux / cloud-init-user.sh
Last active April 7, 2024 13:50
Create a devops user with small customizations
#!/bin/bash
USER="<ADD-THE-USER-HERE!!!>"
PUBLIC_KEY="<ADD-THE-PUBLIC-KEY-HERE!!!>"
# Function to display a fancy message
fancy_echo() {
printf "\n\e[1;36m%s\e[0m\n" "$1"
}
@alexolinux
alexolinux / create-k3d-cluster.sh
Created January 6, 2024 13:11
script for creating and deleting kubernetes cluster with K3d
#!/bin/bash
create_k3d_cluster() {
local cluster_name=$1
echo "Creating k3d cluster $cluster_name..."
k3d cluster create "$cluster_name" \
--agents 3 \
--k3s-node-label topology.kubernetes.io/zone=zone-a@agent:0 \
--k3s-node-label topology.kubernetes.io/zone=zone-b@agent:1 \
--k3s-node-label topology.kubernetes.io/zone=zone-c@agent:2