Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atoonk
atoonk / test.geojson
Last active September 1, 2019 21:02
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@atoonk
atoonk / mysocket-client.py
Last active December 5, 2020 01:00
mysocket example code
from mysocketctl.socket import get_sockets, new_socket
from mysocketctl.tunnel import new_tunnel
from mysocketctl.login import get_token
from mysocketctl.ssh import SystemSSH, Paramiko
import jwt
username="xxx@gmail.com"
password="xxx"
token = get_token(username,password)
@atoonk
atoonk / connect_mysocket.py
Created December 5, 2020 01:35
connect_mysocket.py
#!/usr/bin/env python3
import os
import time
import jwt as jwt
from mysocketctl.tunnel import new_tunnel, delete_tunnel
from mysocketctl.login import get_token
from mysocketctl.utils import ssh_tunnel
username = os.getenv("email")
@atoonk
atoonk / gif_service.py
Last active December 7, 2020 01:54
a random gif web-service
#!/usr/bin/python3
import platform
import giphy_client
from giphy_client.rest import ApiException
from http.server import HTTPServer, BaseHTTPRequestHandler
api_key = "REPLACE_WITH_YOUR_GIPHY_API_KEY" # str | Giphy API Key.
# create an instance of the API class
api_instance = giphy_client.DefaultApi()
#!/bin/bash
if [ `whoami` != 'root' ]; then
echo "Please run this as root..., don't worry about it..."
exit 1
fi
echo "updating fstab"
r=`grep hugetlbfs /etc/fstab`
@atoonk
atoonk / dpdk_ifstats.py
Created April 7, 2021 22:43
VPP DPDK interface stats
#!/usr/bin/env python3
import subprocess
import time
import signal
import sys, os
def get_stats(interface):
command=["vppctl", "show", "hardware-interfaces", interface]
arin_entities = ["GOOGL-2", "GOOGL-1", "YL-29", "GOGL"]
urls = ["https://www.gstatic.com/ipranges/cloud.json", "https://www.gstatic.com/ipranges/goog.json"]
4.3.2.0/24
8.8.4.0/24
8.8.8.0/24
8.34.208.0/20
8.35.192.0/20
23.236.48.0/20
23.251.128.0/19
@atoonk
atoonk / ipv4_prefixes_aws_2024.md
Last active February 8, 2024 10:50
IPv4 addresses allocated to Amazon and their worth
@atoonk
atoonk / ipv4_prefixes_aws_2023.md
Last active February 20, 2024 10:24
ipv4_prefixes_aws_2023

Summary

2023 AWS data Total number of IPv4 addresses: 127,972,688 That’s the equivalent of 7.6 /8’s Also see this blog: https://toonk.io/aws-ipv4-estate-now-worth-4-5-billion/index.html

just for fun, let's put a value number on that

value at $20 per ip: $2,559,453,760
value at $25 per ip: $3,199,317,200
value at $30 per ip: $3,839,180,640