Skip to content

Instantly share code, notes, and snippets.

View richardsonlima's full-sized avatar
:octocat:
Focusing

Richardson Lima richardsonlima

:octocat:
Focusing
View GitHub Profile
#sum_process_resources.py
from collections import OrderedDict
import subprocess
def run_cmd(cmd_string):
"""Runs commands and saves output to variable"""
cmd_list = cmd_string.split(" ")
popen_obj = subprocess.Popen(cmd_list, stdout=subprocess.PIPE)
output = popen_obj.stdout.read()
output = output.decode("utf8")
cat inventory/hosts.ini|awk '{print substr($2,14);}'
for host in $(cat inventory/hosts.ini|awk '{print substr($2,14);}');
do echo -e '\033[1;32m [+] host \033[0m'$host && ssh-copy-id user@$host;
done
TASK [download : Download items] *************************************************************************************************************************************************************************************************************
Saturday 05 January 2019 01:35:36 -0200 (0:00:00.184) 0:15:59.806 ******
fatal: [c987mrponesrc]: FAILED! => {"reason": "'delegate_to' is not a valid attribute for a TaskInclude\n\nThe error appears to be in '/home/richardson/git/kubespray/roles/download/tasks/download_container.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- name: container_download | Make download decision if pull is required by tag or sha256\n ^ here\n"}
name: container_download | Make download decision if pull is required by tag or sha256
include_tasks: set_docker_image_facts.yml
delegate_to: "{{ download_delegate if download_run_once or omit }}"
delegate_facts: yes
run_once: "{{ download_r
git clone https://github.com/kubernetes-incubator/kubespray.git /opt/kubespray
cd /opt/kubespray && pip3.6 install -r requirements.txt
declare -a IPS=(192.168.56.101 192.168.56.105 192.168.56.102 192.168.56.103)
mkdir /opt/kubespray/inventory/mycluster
touch /opt/kubespray/inventory/mycluster/hosts.ini
CONFIG_FILE=/opt/kubespray/inventory/mycluster/hosts.ini python36 contrib/inventory_builder/inventory.py ${IPS[@]}
# on all master Servers
systemctl stop firewalld
systemctl disable firewalld
#firewall-cmd --permanent --add-port=6443/tcp
#firewall-cmd --permanent --add-port=6443/tcp
#firewall-cmd --permanent --add-port=2379-2380/tcp
#firewall-cmd --permanent --add-port=10250/tcp
#firewall-cmd --permanent --add-port=10251/tcp
#firewall-cmd --permanent --add-port=10252/tcp
#firewall-cmd --permanent --add-port=10255/tcp
@richardsonlima
richardsonlima / pentester-box.Dockerfile
Last active October 29, 2018 13:58
docker run --name hacklab --net=host --privileged -it richardsonlima/pentester-box zsh | # ~/.bashrc alias hacklab='docker run -d --name hacklab --net=host --privileged=true -v /tmp/:/mnt -it richardsonlima/pentester-box bash > /dev/null 2>&1; docker start hacklab > /dev/null; docker exec -it -e COLUMNS=$COLUMNS -e LINES=$LINES -e TERM=$TERM hac…
FROM kalilinux/kali-linux-docker
########
# INIT #
########
ENV DEBIAN_FRONTEND noninteractive
ENV INITRD No
# Term
@richardsonlima
richardsonlima / amazon.py
Created October 17, 2018 15:17
Python script to Start+Associate/Stop instances in AWS EC2
#!/usr/bin/env python2
# AWS Management
import optparse
import ConfigParser
import os, time
import boto.ec2
def start():
https://tenor.com/search/dank-meme-gifs
https://www.pexels.com/
@richardsonlima
richardsonlima / jira_letsencrypt.md
Created October 2, 2018 01:49 — forked from dborin/jira_letsencrypt.md
HOWTO Configure Atlassian Jira to use Letsencrypt certificate

HOWTO Configure Atlassian Jira to use Letsencrypt certificate with default Tomcat

This is a primer for installing a Letsencrypt certificate on a Jira server that is running the Jira provided, default Tomcat for serving webpages.

I found lots of information about how to do it using a free-standing Tomcat or nginx, but nothing about this particular combination. I hope it helps you!

Obviously, in all the examples, you need to replace jira.example.com with your own domain! And (duh) you need to use your own password, not 1234

You need to have installed Java (outside the scope of this document). Then in your user's shell RC file and probably root's RC file, add