Skip to content

Instantly share code, notes, and snippets.

View dalmosantos's full-sized avatar

Dalmo Santos dalmosantos

View GitHub Profile
@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 / 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 / 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 \__ / // | \ \ *----*
/ / \/_/ // | \ \ \ |
@___@` \/_ // | \ \ \/\ \
@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 \__ / // | \ \ *----*
/ / \/_/ // | \ \ \ |
@___@` \/_ // | \ \ \/\ \
@dalmosantos
dalmosantos / Vagrantfile
Created January 2, 2021 18:19 — forked from mhiro2/Vagrantfile
CentOS k8s cluster with vagrant-libvirt
# -*- mode: ruby -*-
# vi: set ft=ruby :
$master_cpus = 2
$master_memory = 2048
$num_workers = 3
$worker_cpus = 4
$worker_memory = 4096
$common_script = <<-SCRIPT
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
@dalmosantos
dalmosantos / jboss.plugin.zsh
Created October 6, 2020 05:43 — forked from chrisweibel/jboss.plugin.zsh
jboss deployment script
# Simple JBoss7 helper functions
# set var to jboss home dir
JBOSS_HOME="/usr/local/jboss/jboss-as-web-7.0.2.Final"
#Start BBoss
alias jboss-start="sudo $JBOSS_HOME/bin/standalone.sh"
#Stop JBoss
alias jboss-stop="sudo $JBOSS_HOME/bin/jboss-admin.sh --connect command=:shutdown"