Skip to content

Instantly share code, notes, and snippets.

View santiagobasulto's full-sized avatar

Santiago Basulto santiagobasulto

View GitHub Profile
@santiagobasulto
santiagobasulto / aws_spot_instance_dataset.csv
Created May 12, 2025 15:01
Dataset of interruption and discount of AWS Spot instances per instance type per region
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 67 columns, instead of 22 in line 1.
,ram,cores,ca-west-1-r,ca-west-1-s,mx-central-1-r,mx-central-1-s,ap-southeast-7-r,ap-southeast-7-s,me-south-1-r,me-south-1-s,ap-east-1-r,ap-east-1-s,il-central-1-r,il-central-1-s,ap-south-2-r,ap-south-2-s,ap-southeast-5-r,ap-southeast-5-s,af-south-1-r,af-south-1-s,ap-northeast-3-r,ap-northeast-3-s,eu-south-1-r,eu-south-1-s,eu-west-3-r,eu-west-3-s,us-west-1-r,us-west-1-s,eu-north-1-r,eu-north-1-s,ca-central-1-r,ca-central-1-s,sa-east-1-r,sa-east-1-s,eu-west-2-r,eu-west-2-s,ap-northeast-2-r,ap-northeast-2-s,ap-south-1-r,ap-south-1-s,us-east-2-r,us-east-2-s,eu-west-1-r,eu-west-1-s,ap-southeast-1-r,ap-southeast-1-s,ap-southeast-2-r,ap-southeast-2-s,eu-central-1-r,eu-central-1-s,us-west-2-r,us-west-2-s,us-east-1-r,us-east-1-s,ap-northeast-1-r,ap-northeast-1-s,me-central-1-r,me-central-1-s,eu-central-2-r,eu-central-2-s,ap-southeast-4-r,ap-southeast-4-s,ap-southeast-3-r,ap-southeast-3-s,eu-south-2-r,eu-south-2-s
c6i.32xlarge,256.0,128,4.0,58.0,4.0,53.0,3.0,59.0,1.0,68.0,4.0,87.0,0.0,51.0,4.0,65.0,4.0,53.0,1.0,79.0,4
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# This is a proof of concept of a wait function that preserves
# the order of the futures.
#
# I'm working on a library on top of concurrent.futures
# and I needed a `wait` function that would preserve the order of the futures passed
# so I wrote a simple `wait_in_order` function.
# Using this also makes `ThreadPoolExecutor.map`'s implemenation simpler
@santiagobasulto
santiagobasulto / server.py
Created April 4, 2021 13:21
A Python 3 debugging server based on http.server that logs every request. Use it to inspect incoming connections.
import time
from functools import partialmethod
from http.server import BaseHTTPRequestHandler, HTTPServer
import utils
class Request:
def __init__(self, method, path, headers, stream):
self.path = path
self.method = method.upper()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@santiagobasulto
santiagobasulto / relative_to_absolute.py
Last active November 20, 2021 19:09
A quick script to transform a Markdown file's relative images to absolute by uploading them to a plugin-based service (S3, Imgur)
import re
import mimetypes
from pathlib import Path
import requests
import boto3
from botocore.exceptions import ClientError
{
"a": 4,
"b": 5
}
{
"a": 4,
"b": 5,
}