Skip to content

Instantly share code, notes, and snippets.

View maurobaraldi's full-sized avatar

Mauro Navarro Baraldi maurobaraldi

View GitHub Profile
FROM python:2.7-alpine
MAINTAINER Nick Janetakis <[email protected]>
ENV INSTALL_PATH /bsawf
RUN mkdir -p $INSTALL_PATH
WORKDIR $INSTALL_PATH
COPY requirements.txt requirements.txt
RUN apk add --no-cache --virtual .build-deps \
@maurobaraldi
maurobaraldi / tweepy_runner.py
Created October 28, 2019 02:06 — forked from MihaiTabara/tweepy_runner.py
Script to download Twitter timeline for a user and store it to MongoDB
# script to download up to <= 3200 (the official API limit) of most recent tweets from a user's timeline
from pymongo import MongoClient
import tweepy
import json
#Twitter API credentials
CONSUMER_KEY = ''
CONSUMER_SECRET = ''
ACCESS_TOKEN = ''
@maurobaraldi
maurobaraldi / Dockerfile
Created September 26, 2019 21:00
Dockerfile Alpine based with Python3 + Django + lxml + PyCrypto
FROM python:3.6-alpine
ENV PYTHONUNBUFFERED 1
ARG git_username
ARG git_password
EXPOSE 8004
RUN mkdir /opt/app
WORKDIR /opt/app
@maurobaraldi
maurobaraldi / docker_info.md
Created September 25, 2019 00:18
Docker info for monitoring

Docker info for monitoring

Node/Cluster

Node Info

Information about node (docker/swarm daemon) info.

Addresses

@maurobaraldi
maurobaraldi / software_testing.html
Last active September 5, 2019 11:30
Apresentação sobre Teste de Software
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="keywords" content="remark,remarkjs,markdown,slideshow,presentation" />
<meta name="description" content="A simple, in-browser, markdown-driven slideshow tool." />
<title>Software Testing</title>
<style>
@import url(https://fonts.googleapis.com/css?family=Droid+Serif);
@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
[{"city": "Aarhus", "country": "Denmark", "iata_code": "AAR"}, {"city": "Abadan", "country": "Iran", "iata_code": "ABD"}, {"city": "Abeche", "country": "Chad", "iata_code": "AEH"}, {"city": "Aberdeen", "country": "United Kingdom", "iata_code": "ABZ"}, {"city": "Aberdeen (SD) ", "country": "USA", "iata_code": "ABR"}, {"city": "Abidjan", "country": "Cote d'Ivoire", "iata_code": "ABJ"}, {"city": "Abilene (TX) ", "country": "USA", "iata_code": "ABI"}, {"city": "Abu Dhabi - Abu Dhabi International", "country": "United Arab Emirates", "iata_code": "AUH"}, {"city": "Abuja - Nnamdi Azikiwe International Airport", "country": "Nigeria", "iata_code": "ABV"}, {"city": "Abu Rudeis", "country": "Egypt", "iata_code": "AUE"}, {"city": "Abu Simbel", "country": "Egypt", "iata_code": "ABS"}, {"city": "Acapulco", "country": "Mexico", "iata_code": "ACA"}, {"city": "Accra - Kotoka International Airport", "country": "Ghana", "iata_code": "ACC"}, {"city": "Adana", "country": "Turkey", "iata_code": "ADA"}, {"city": "Addis Ababa - Bol
@maurobaraldi
maurobaraldi / BracketsUtils.java
Created May 28, 2019 20:33 — forked from caandradeduarte/BracketsUtils.java
BairesDev test - Given a string with brackets. If the start index of the open bracket is given, find the index of the closing bracket
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Stack;
public class BracketsUtils {
private static final char OPENING_BRACKET = '[';
private static final char CLOSING_BRACKET = ']';
public static int findClosingBracket(String text, int openingBracketIndex) {
@maurobaraldi
maurobaraldi / bumpversion.py
Created May 8, 2019 20:04
Bump version from YAML files. Used to bump version form Helm chart files.
#!/usr/bin/env python3
import yaml
def version(filename):
'''Load version from Chart.yaml file.'''
with open(filename, 'r') as f:
return yaml.load(f).get('version')
def set(filename, major, minor, patch):
@maurobaraldi
maurobaraldi / pre-commit
Created May 7, 2019 15:12
pre-commit git hook to check if chart version is updated.
#!/bin/bash
ORIGIN=$(git log -n 1 --oneline --format=format:%H origin/master helm/pfapi/Chart.yaml)
LOCAL=$(git log -n 1 --oneline --format=format:%H HEAD helm/pfapi/Chart.yaml)
CHART=$(git status --porcelain | grep Chart.yaml)
if [ "$ORIGIN" = "$LOCAL" ]; then
if [[ -z "$CHART" ]]; then
echo -e "#######################################\n# Don't forget to update Charts.yaml. #\n#######################################"
fi
@maurobaraldi
maurobaraldi / simpletree.py
Created February 27, 2019 22:41 — forked from jsbueno/simpletree.py
Simple example of ranged binary tree in Python, able to perform slice retrieval
# coding: utf-8
class EmptyClass(object):
def __repr__(self):
return ""
Empty = EmptyClass()
class Node(object):
def __init__(self, value, key=None):