Skip to content

Instantly share code, notes, and snippets.

View kitos9112's full-sized avatar
💭
#AutomateEveything

Marcos Soutullo Rodriguez kitos9112

💭
#AutomateEveything
  • Reading, UK
View GitHub Profile
@kitos9112
kitos9112 / handlers.py
Created November 22, 2017 13:38 — forked from hectcastro/handlers.py
A Python log handler for Papertrail.
import logging
import socket
class PapertrailHandler(logging.Handler):
"""An RFC 5425 log handler that has been tested to interact
with Papertrail.
"""
# RFC 5424 Severities
LOG_EMERG = 0
@kitos9112
kitos9112 / README-Template.md
Created January 9, 2018 15:27 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@kitos9112
kitos9112 / self-signed-certificate-with-custom-ca.md
Last active September 20, 2023 12:54 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place! - Ensure you have installed OpenSSL in your system either Windows or Linux, here we're just using neutral OpenSSL commands.

openssl genrsa -des3 -out rootCA.key 4096
@kitos9112
kitos9112 / install-docker-rpi.sh
Last active July 1, 2019 17:24
This small Bash script will install the latest version of Docker on your Raspberry pi - It works on Raspberry Pi 4 B+ - Just run --> curl -fsSL http://bit.ly/2xm7kxb | sh
#!/bin/bash
##################################################
#- version ${SCRIPT_NAME} 0.0.1
#- author Marcos Soutullo
#- license GNU General Public License
# DESCRIPTION
# This small bash script will install Docker on your RaspberryPi for you without human interaction.
# If your Raspbian version it's not currently available on get.docker.com
# It will download use the latest Debian stable version defined in variable DOCKER_STABLE
# EXECUTION
@kitos9112
kitos9112 / get-tmux
Last active June 20, 2020 09:21 — forked from suhlig/install-tmux
Install from source TMUX VERSION 3.1 on rhel/centos/fedora/amazonLinux2 7 -- This gist also takes care of installing developer dependencies for the compilation phase
#!/bin/bash
TMUX_VERSION=3.1b
# Install tmux version 3.1 on rhel/centos 7
# Single command:
###$> curl -Ls https://gist.githubusercontent.com/kitos9112/8907c420435ce1e1fc6e99de0e994131/raw/d5c4965b541e6348c882c9546bcfb08f74788784/get-tmux | bash
# install deps
sudo -E yum install gcc kernel-devel make ncurses-devel -y
# DOWNLOAD SOURCES FOR LIBEVENT, CONFIGURE, MAKE, AND INSTALL
curl -o /tmp/libevent-2.1.11-stable.tar.gz -L https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
@kitos9112
kitos9112 / get-minikube.sh
Last active June 2, 2020 16:29
Fetches the latest minikube release (x86_64 systems only) and installs it to /usr/local/bin
#!/bin/bash
##################################################################
# This script downloads and install the latest version of minikube
# for x86_64 architectures
# curl -Ls https://gist.githubusercontent.com/kitos9112/32a67139325d3e4a2fc3d7a41b392b3a/raw/d16157f301b95659997e732df29a982088fa9eae/get-minikube.sh | bash
##################################################################
# Retrieve the latest version of minikube
if [[ $(uname -m) == "x86_64" ]]; then
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
@kitos9112
kitos9112 / get-terraform.sh
Last active March 26, 2024 14:41 — forked from josh-padnick/get-latest-terraform.sh
Bash script that automatically updates to latest version of Terraform and TFlint
#!/bin/bash
###########################################################################
# Fetch and install the latest Terraform and tflint version
# curl -Ls https://gist.github.com/kitos9112/70faa4b7e53a84f72cf21256f2aa86a8/raw/get-terraform.sh | bash
##########################################################################
function get_latest_github_release {
curl -s https://api.github.com/repos/$1/$2/releases/latest | grep -oP '"tag_name": "[v]\K(.*)(?=")'
}
@kitos9112
kitos9112 / get-kops.sh
Last active June 2, 2020 17:49
Fetches and installs the latest Kops Liux AMD64 version released on GitHub artifacts
#!/bin/bash
###########################################################################
# Fetch and install the latest Kops release from the official GitHub repository
# curl -Ls https://gist.githubusercontent.com/kitos9112/4265c492442865ef0fe54ade671d9f4a/raw/50d70d9044a77ade7e7e05aabc34f66155b11b5e/get-kops.sh | bash
##########################################################################
function get_latest_github_release {
curl -s https://api.github.com/repos/$1/$2/releases/latest | grep -oP '"tag_name": "[v]\K(.*)(?=")'
}
#!/bin/bash
###########################################################################
# Fetch and install the latest Packer version
# curl -Ls https://gist.githubusercontent.com/kitos9112/2252c54fff5bde6638b340fcade9076b/raw/777667f390965c6ad79e8b4e2a0c1a1ad70e2801/get-packer.sh | bash
##########################################################################
function get_latest_github_release {
curl -s https://api.github.com/repos/$1/$2/releases/latest | grep -oP '"tag_name": "[v]\K(.*)(?=")'
}
#!/usr/bin/env bash
# You should have your cloudflare ini-like file in the following location
CLOUDFLARE_INI="/etc/letsencrypt-cloudflare/cf.ini"
if [ "$#" -ne 2 ]
then
echo "Usage: $0 <command> (e.g. certonly, renew) $1 <domain> (e.g. my-domain.example.com)"
exit 1
fi
COMMAND=$1 # certonly