Skip to content

Instantly share code, notes, and snippets.

View danielpsf's full-sized avatar

Daniel Fernandes danielpsf

View GitHub Profile
@danielpsf
danielpsf / list_ssm.py
Created June 6, 2023 13:17
List SSM parameters and its value in CSV mode (simple print)
import time
from typing import List, Tuple
from boto3 import session
from mypy_boto3_ssm import SSMClient
_PROFILE = "YOUR_PROFILE"
_REGION = "YOUR_AWS_REGION"
_MAX_RESULT=50
@danielpsf
danielpsf / terminate_rds_without_connection.py
Last active May 8, 2023 16:17
Script to terminate RDS instances without connection
import datetime
import boto3
import botocore
import argparse
from distutils.util import strtobool
from datetime import datetime, timedelta
def define_parameters():
parser = argparse.ArgumentParser(
@danielpsf
danielpsf / .zshrc
Created May 27, 2022 09:52
Always put in the end of ~/..zshrc
# tfenv
export PATH="$HOME/.tfenv/bin:$PATH"
# PyEnv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
# Sdkman
source ~/.bash_profile;
@danielpsf
danielpsf / list_ecr_images.py
Last active March 22, 2022 11:17
List (with some limitations) all ECR images
from ast import parse
import boto3
import argparse
parser = argparse.ArgumentParser(
usage="list_ecr_images.py --profile YOUR_PROFILE --region YOUR_REGION",
description="Print all image details for reporting purpose"
)
@danielpsf
danielpsf / github_org_contribution_report.py
Last active July 5, 2021 07:26
Report of contrigution per repo
import csv
import datetime
import os
import time
from github import Github
def generate_report():
with open('report.csv', 'w', newline='') as csv_file:
@danielpsf
danielpsf / devops_questions_1.md
Last active December 3, 2020 08:42
A devops small set of questions to be used on interviews

DevOps questions to be asked

  • Please describe how would you do the deploy and configure of the items below in terms of technologies and deployment (CICD):
    • Deploy a high available Application using EC2
      • https://botkit.ai
      • https://riot.im
      • A PostgreSQL
      • Web API using Java SpringBoot, Python (Flask), Go (MUX), NodeJS (Express or Restify) that connects with a PostgreSQL
    • Deploy a SPA
  • Please describe how would you architect, configure and deploy your network in terms of technologies and deployment (CICD) in a way that your applications would be safe
@danielpsf
danielpsf / challenge_1.md
Last active August 31, 2019 16:32
Simple Python challenge

Coding challenge

The main goal of the coding challenge is to exercise Python development skills while also improving the knowledge of the broad variety of technologies from Docker to AWS as well as features from Python itself.

Pre-requirements

  • Python 3.7
  • Pip
  • An IDE (PyCharm, VSCode, VIM, etc)
@danielpsf
danielpsf / k8s_intro_cloudacademy_notes.md
Created July 19, 2019 14:36
Cloud Academy K8s course notes

Kubernetes introduction

After this course I should be able to know how to:

  • Deploy a single or a multiple container application to K8s
  • Configure Service Discovery
  • Expose applications to the public internet (well, if applicable)
  • Deploy probes to monitor containers
  • Bootstrap applications with init containers
  • Manage Secrets
@danielpsf
danielpsf / ElasticSearch_definitive_guide_notes.md
Last active June 10, 2019 19:32
ElasticSearch Definitive Guide's notes

Elastic Search’s definitive guide notes

Chapter 1. You know, for search

  • RESTful web service on top of Apache Lucene
  • Has many clients that either uses TrasportClientor HTTP Clients
    • TransportClientis scheduled to be removed on ElasticSearch 8.0
  • Has two kind of query mechanisms
@danielpsf
danielpsf / devsecops_challenge_1.md
Last active April 30, 2019 14:56
A devops small challenge to be used on interviews

AWS Security monitoring and alert

After a technical interview where the candidate will have the oportunity to go over these topics this challenge can be used to assess the automation and coding skills as well as the AWS knowledge of a candidate.

Assumptions

  • Although documentation is not mandatory for this challenge it still is quite important
  • Any automation tool can be used, so feel free to use whatever you are most comfortable with, bash script included
  • Although our main development languages are Python and Go, feel free to pick whatever you are most comfortable with