Skip to content

Instantly share code, notes, and snippets.

View maurobaraldi's full-sized avatar

Mauro Navarro Baraldi maurobaraldi

View GitHub Profile
@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
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
@maurobaraldi
maurobaraldi / xrp_history_mercado_bitcoin.csv
Last active October 21, 2021 18:06
Histórico diário do XRP a partir do Mercado Bitcoin, desde 10/10/2018 (quando o XRP começou lá).
date opening closing lowest highest volume quantity amount avg_price
2018-10-10 1.5 1.65796 1.5 3.99 801301.09566204 433794.72838648 2552 1.84718956
2018-10-11 1.65794 1.55901 1.46 1.7474 983668.51610792 613071.13758692 2116 1.60449327
2018-10-12 1.55 1.62999 1.523 1.7 223158.52971305 136410.13539226 736 1.63593804
2018-10-13 1.63 1.61995 1.6 1.7 158644.91389793 96865.23944556 527 1.63778993
2018-10-14 1.61989 1.56 1.55 1.68 199750.14166781 123145.50911021 623 1.62206598
2018-10-15 1.598 1.686 1.51 1.75 503712.90168951 303882.55315445 1473 1.65759072
2018-10-16 1.66005 1.8299 1.64795 1.99998 564935.82582822 322736.91790896 1639 1.75045306
2018-10-17 1.78105 1.77901 1.73 1.875 301418.01795127 169484.65835049 1274 1.77843836
2018-10-18 1.779 1.73999 1.6999 1.805 257539.85030187 148232.1956103 947 1.73740832
@maurobaraldi
maurobaraldi / naturais.py
Created August 3, 2021 01:50
Exercícios com números naturais
from random import randint, choice
def plus_minus_expressions(quantity: int = 30) -> None:
for i in range(quantity):
n = lambda: choice([1,-1])*randint(0, 10)
oper = choice(['-', '+'])
print(f'{n()} {oper} {n()} {oper} {n()} = ')
def division_times_expressions(quantity: int = 30) -> None:
for i in range(quantity):