Skip to content

Instantly share code, notes, and snippets.

View maurobaraldi's full-sized avatar

Mauro Navarro Baraldi maurobaraldi

View GitHub Profile
# create/update resources
kubectl --context=minikube apply -f ./postgres.yaml
# In order for the service to reach the statefulset, the following should
# be true:
# statefulset.spec.selector.matchLabels.app == service.spec.selector.app
# statefulset.spec.selector.matchLabels.role == service.spec.selector.role
# give the server some time to start up
# ...
@maurobaraldi
maurobaraldi / results.csv
Created June 30, 2024 20:35
FIFA International football results from 1872 to 2024
We can't make this file beautiful and searchable because it's too large.
date,home_team,away_team,home_score,away_score,tournament,city,country,neutral
1872-11-30,Scotland,England,0,0,Friendly,Glasgow,Scotland,FALSE
1873-03-08,England,Scotland,4,2,Friendly,London,England,FALSE
1874-03-07,Scotland,England,2,1,Friendly,Glasgow,Scotland,FALSE
1875-03-06,England,Scotland,2,2,Friendly,London,England,FALSE
1876-03-04,Scotland,England,3,0,Friendly,Glasgow,Scotland,FALSE
1876-03-25,Scotland,Wales,4,0,Friendly,Glasgow,Scotland,FALSE
1877-03-03,England,Scotland,1,3,Friendly,London,England,FALSE
1877-03-05,Wales,Scotland,0,2,Friendly,Wrexham,Wales,FALSE
1878-03-02,Scotland,England,7,2,Friendly,Glasgow,Scotland,FALSE
@maurobaraldi
maurobaraldi / server.py
Last active February 14, 2024 18:57
Tests BaseHTTPRequestHandler
#!/usr/bin/env python
from http.server import HTTPServer, BaseHTTPRequestHandler
class HTTPRequestHandler(BaseHTTPRequestHandler):
protocol_version = "HTTP/1.0"
def do_GET(self):
self.send_response(200)
@maurobaraldi
maurobaraldi / TradingBotOanda.ipynb
Created November 20, 2023 19:47
Trading bot for Oanda platform
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maurobaraldi
maurobaraldi / uniswap_pools_analyser.js
Created April 30, 2023 21:58
Uniswap Pools Analyser for Enthereum network.
//
// Uniswap Pools Analyser
// Author: Mauro Navarro Baraldi <mauro.baraldi@gmail.com>
// License: MIT License
//
// If you consider pay me a coffee here are the wallets
// {
// "bitcoin": "1EUGcJHS49242UpDXNVoLVzWSTVPRKmRth",
// "litecoin": "LbqRSz5i225FqED4QTFwjU5qQS72cRdvoe",
// "ethereum": "0xfA5c619f46848Fefe1E35Da1A04d4cBCeaf16B1f"
@maurobaraldi
maurobaraldi / key.md
Created February 6, 2023 14:34
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@maurobaraldi
maurobaraldi / gen_btc_wallet.py
Last active December 28, 2022 16:42
Generate Bitcoin Wallets in Python 3
#!/usr/bin/env python3
import binascii
import hashlib
import pip
# Install base58 and ecdsa libs if not installed yeat.
try:
import base58
import ecdsa
@maurobaraldi
maurobaraldi / advent_of_code_2022.py
Last active December 5, 2022 22:03
Advent of Code 2022
#!/usr/bin/env python
# Solutions for Advent of Code 2022
# Problem 1.1
with open('./input.txt') as f:
elves_kal = [list(map(int, i.split())) for i in f.read().split('\n\n')]
print(max(sum(k) for k in elves_kal))
# Problem 1.2
@maurobaraldi
maurobaraldi / systemd.py
Last active July 8, 2022 01:10
Self healing systemd services if it is in failed status.
#!/usr/bin/env python3
from subprocess import (
Popen,
PIPE
)
class Service(object):
def __init__(self, service_name):
@maurobaraldi
maurobaraldi / install-docker.sh
Created June 22, 2022 06:36 — forked from roberson-miguel/install-docker.sh
Script para instalar Docker e Dependências, que já teste com imagem do Hello World.
#!/usr/bin/env bash
#Salve esse conteudo em um arquivo com o nome "install-docker.sh" ou outro de sua preferencia, e execute em um terminal
#usando "sh install-docker.sh"
executa_imagem=$()
echo "Removendo versões antigas do Docker...\n"
sudo apt-get remove -y docker docker-engine docker.io containerd runc > /dev/null