Skip to content

Instantly share code, notes, and snippets.

View dalmosantos's full-sized avatar

Dalmo Santos dalmosantos

View GitHub Profile
@dalmosantos
dalmosantos / init.py
Last active January 16, 2025 04:44
Cuttlefish Environment Setup Script
import os
import sys
import time
import logging
import shutil
from pathlib import Path
from typing import List, Dict, Optional
from dataclasses import dataclass
from git import Repo
import docker
@dalmosantos
dalmosantos / README.md
Last active September 5, 2023 13:58 — forked from danielepolencic/README.md
Create 3 nodes Kubernetes cluster locally with Vagrant

3 Virtual Machines Kubernetes cluster

Dependencies

You should install VirtualBox and Vagrant before you start.

Creating the cluster

You should create a Vagrantfile in an empty directory with the following content:

@dalmosantos
dalmosantos / boa_ideia.txt
Last active September 21, 2023 21:19
change nodegroup.sh
#!/bin/bash
# Verificar se o kubectl está instalado
if ! command -v kubectl &> /dev/null; then
echo "O kubectl não está instalado. Por favor, instale-o antes de continuar."
exit 1
fi
# Defina o namespace do seu aplicativo ou o namespace padrão
NAMESPACE="default"
@dalmosantos
dalmosantos / logging_config.py
Created April 30, 2022 00:06 — forked from willywongi/logging_config.py
Python logging configuration example
import logging
import logging.config
logging.dictConfig({
'version': 1,
'disable_existing_loggers': False,
"formatters": {
"standard": {
"format": '%(asctime)s %(name)s %(levelname)s %(message)s'
}
@dalmosantos
dalmosantos / ExtractAWSRoleBasedKeys.sh
Created November 5, 2021 15:25 — forked from kananlanginhooper/ExtractAWSRoleBasedKeys.sh
Shell script to extract Temporary AWS keys (Access Key Id and Secret Access Key) from Role Based EC2 instance using 169.254.169.254 and dynamic role names
#!/bin/sh
ROLENAME=$(curl http://169.254.169.254/latest/meta-data/iam/security-credentials/ -s)
KeyURL="http://169.254.169.254/latest/meta-data/iam/security-credentials/"$ROLENAME"/"
wget $KeyURL -q -O Iam.json
KEYID=$(grep -Po '.*"AccessKeyId".*' Iam.json | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/AccessKeyId://g')
SECRETKEY=$(grep -Po '.*"SecretAccessKey".*' Iam.json | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/SecretAccessKey://g')
SECURITYTOKEN=$(grep -Po '.*"Token".*' Iam.json | sed 's/ //g' | sed 's/"//g' | sed 's/,//g' | sed 's/Token://g')
rm Iam.json -f
@dalmosantos
dalmosantos / docker-compose.yml
Created August 24, 2021 15:09
rundeck-over-http
version: '3'
services:
rundeck:
image: ${RUNDECK_IMAGE:-rundeck/rundeck:3.4.3}
container_name: rundeck
hostname: rundeck.lab.local
volumes:
- ./rundeck/data:/home/rundeck/server/data
- ./rundeck/home/rundeck/configs:/home/rundeck/configs
- ./rundeck/rundeck_plugins:/opt/rundeck-plugins
@dalmosantos
dalmosantos / docker-stack-logs
Created April 7, 2021 22:19
View docker stack logs (all services)
docker stack services -q <stack_name> | xargs -L1 -I{} sh -c 'docker service logs -f {} &'
@dalmosantos
dalmosantos / k8s.sh
Created March 29, 2021 17:53 — forked from nguyendhoan/k8s.sh
a script install kubernetes master & node on CentOS7
#!/bin/bash
set -e
reset=$(tput sgr0)
green=$(tput setaf 76)
blue=$(tput setaf 25)
red=$(tput setaf 1)
info() {
@dalmosantos
dalmosantos / setenv.sh
Created January 19, 2021 23:35 — forked from patmandenver/setenv.sh
Tomcat8 setenv.sh
#
# Cutom Environment Variables for Tomcat
#
############################################
export JAVA_HOME=/usr/lib/jvm/java-7-oracle/jre
export PATH=${JAVA_HOME}/bin:${PATH}
############################################
#
# JAVA_OPTS
@dalmosantos
dalmosantos / thou shall not pusg merge commits.txt
Created January 19, 2021 06:01 — forked from ArtBIT/thou shall not pusg merge commits.txt
PUSH REJECTED BY EVIL DRAGON BUREAUCRATS
+---------------------------------------------------------------+
| * * * PUSH REJECTED BY EVIL DRAGON BUREAUCRATS * * * |
+---------------------------------------------------------------+
\
\ ^ /^
\ / \ // \
\ |\___/| / \// .\
\ /V V \__ / // | \ \ *----*
/ / \/_/ // | \ \ \ |
@___@` \/_ // | \ \ \/\ \