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
@richardsonlima
richardsonlima / install_dirb.sh
Created August 12, 2020 00:46 — forked from gmolveau/install_dirb.sh
mac osx dirb install
cd ~/Applications
wget https://downloads.sourceforge.net/project/dirb/dirb/2.22/dirb222.tar.gz
tar -xvf dirb222.tar.gz
rm dirb222.tar.gz
brew install autoconf
chmod -R 755 dirb222
cd dirb222
./configure
make
make install
@richardsonlima
richardsonlima / mail_body.j2
Created April 10, 2020 05:18 — forked from halberom/mail_body.j2
ansible - example of using mail module to send one email for all hosts
# templates/mail_body.j2
{% for host in play_hosts %}
The {{ host }} says {{ hostvars[host]['result']['stdout'] }}
{% endfor %}
@richardsonlima
richardsonlima / Jenkinsfile
Created November 8, 2019 18:15 — forked from mrhockeymonkey/Jenkinsfile
Jenkins pipeline running a remote ansible playbook
#!groovy
pipeline {
agent any
//These params will be displayed for user input when running a build, They are also accepted by the API
parameters {
string(name: 'BUILD_HOSTNAME', description: 'The name of the server to build (from Mdb)')
string(name: 'ILO_IP', description: 'The IP address for the server ilo')
booleanParam(name: 'skipOneView', description: 'Skip the OneView stage?', defaultValue: false)
@richardsonlima
richardsonlima / Jenkinsfile.groovy
Created July 11, 2019 21:00 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@richardsonlima
richardsonlima / deploy_docker.go
Created February 22, 2019 21:21 — forked from cescoferraro/deploy_docker.go
docker & kubernetes client example golang
package cmd
import (
"bitbucket.org/cescoferraro/api/util"
"github.com/fatih/color"
"github.com/spf13/cobra"
)
var (
logger = util.Block{
@richardsonlima
richardsonlima / letsencrypt_2018.md
Created February 20, 2019 14:26 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

{
"Description" : "ProjectX scalable stack of frontal nodes",
"Parameters" : {
"InstanceType" : {
"Description" : "Type of EC2 instance to launch",
"Type" : "String",
"Default" : "m1.xlarge"
},
"SSHKeyName" : {
"Description" : "The EC2 Key Pair to allow SSH access to the instances",
@richardsonlima
richardsonlima / beanstalk deploy script
Created January 26, 2019 02:54 — forked from wgrisa/beanstalk deploy script
beanstalk deploy prepared (but not only) for gitlab ci
#!/bin/bash
# EB_APP_NAME = application name
# EB_APP_ENV = application environment
# S3_BUCKET = S3 bucket for ElasticBeanstalk
# S3_KEY = S3 folder to upload built app
# Zip up everything with the exception of node_modules (including dist), .git and zip files
ts=`date +%s`
fn="$EB_APP_NAME-$ts.zip"
@richardsonlima
richardsonlima / create_eb_env.sh
Created January 26, 2019 02:53 — forked from wolfg1969/create_eb_env.sh
create a eb environment
#!/usr/bin/env bash
set -e
EB_CLI_HOME=$1
APP_NAME=$2
CONFIG_NAME=$3
export AWS_CREDENTIAL_FILE=/var/lib/jenkins/.elasticbeanstalk/aws_credential_file
export PATH=$PATH:$EB_CLI_HOME/api/bin/
@richardsonlima
richardsonlima / amazon.py
Created October 17, 2018 15:17 — forked from lucaskatayama/amazon.py
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():