Skip to content

Instantly share code, notes, and snippets.

View matiasba's full-sized avatar

matiasba

  • Argentina
View GitHub Profile

steam-region-speedtest

Finds which Steam download region is actually fastest from your connection.

Steam lets you choose a download region, but that choice does not decide which server answers you. Each region returns a list of servers ranked by a priority_class that Valve assigns, and that ranking reflects peering arrangements, not throughput. The server at the top can be slower than one further down the same list, and you cannot pick between them from the UI.

@matiasba
matiasba / zabbix_aws_asg_deregister.py
Last active December 6, 2022 15:42
This lambda function allows to deregister a host based on a "EC2 Instance Terminate Successful" event on AWS. It requires an EventBridge with the following configuration as trigger Event pattern: { "source": [ "aws.autoscaling" ], "detail-type": [ "EC2 Instance Terminate Successful" ] }
import json
import urllib3
from datetime import date
def lambda_handler(event, context):
today = date.today().strftime("%Y-%m-%d")
# Parse the EC2 instance ID from the event data
instance_id = event['detail']['EC2InstanceId']
# create urllib3 pool to make HTTP requests
@matiasba
matiasba / cloudflare-ddns.sh
Created June 8, 2022 19:00
Bash script for DDNS using cloudflare DNS service, with options for enabling https proxy
#!/bin/bash
# A bash script to update a Cloudflare DNS A record with the external IP of the source machine
# Used to provide DDNS service from anywhere
# DNS redord needs to be pre-created on Cloudflare
# Proxy - uncomment and provide details if using a proxy
#export https_proxy=http://<proxyuser>:<proxypassword>@<proxyip>:<proxyport>
# Cloudflare zone is the zone which holds the record