Skip to content

Instantly share code, notes, and snippets.

@Zeebrow
Zeebrow / get-my-ip.py
Created January 27, 2023 13:44
compare popular public ip getter sites
#!/usr/bin/env python3
from time import time
import threading
import urllib3
timeout = urllib3.Timeout(total=5.0) # see note https://urllib3.readthedocs.io/en/stable/reference/urllib3.util.html#urllib3.util.Timeout
header = { 'Cache-Control': 'no-cache' }
http = urllib3.PoolManager(timeout=timeout)
def time_request(url):
@Zeebrow
Zeebrow / getopts-tryhard.sh
Created December 17, 2022 20:30
A good start to working around the limitations of bash's getopt
#!/bin/bash
function _template(){
local OPTION1
local OPTION2
while [ "$#" -gt 0 ]; do
case "$1" in
-o1|--option1) echo o1; OPTION1='true' ;;
-o2|--option2) echo o2; OPTION2='true' ;;
-h|--help) echo "listem get all instances tagged with '${QH_APP_TAG}'