Skip to content

Instantly share code, notes, and snippets.


Noam Tamim noamtamim

View GitHub Profile
noamtamim / redoc.html
Created Jul 5, 2021
redoc openapi template
View redoc.html
<!DOCTYPE html>
<title>FastAPI - ReDoc</title>
<!-- needed for adaptive design -->
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href=",400,700|Roboto:300,400,700" rel="stylesheet">
noamtamim /
Created Apr 21, 2021
Get AWS Region (with cache)
def get_region_name():
from urllib import request, error
me = get_region_name
if hasattr(me, 'cache'):
return me.cache
with request.urlopen("", timeout=1) as res:
me.cache =
noamtamim /
Created Apr 18, 2021
Kinesis Stream Reader
#!/usr/bin/env python3
import boto3
import time
from pprint import pprint
import json
import sys
client = boto3.client('kinesis')
noamtamim /
Last active Apr 12, 2021
macOS Terminal Tricks



This command writes (pastes) the content of the clipboard to stdout.

To use - copy (cmd-c) some text; then in the terminal type pbpaste and enter:

$ pbpaste
Hello, World!
View bitrates.csv
Country WIFI 2G 3G 4G
AD 3500 148 2200 5300
AE 3500 95 490 690
AF 470 95 810 1400
AG 1100 148 2200 3200
AI 3500 200 2200 1400
AL 3500 132 2200 3200
AM 2000 132 970 2000
AO 1100 95 970 5300
AR 2000 115 970 2000
noamtamim /
Last active Dec 1, 2022
AWS: IP ranges of API Gateway in us-east-1
# Assuming jq ( and curl are installed.
# Show only the entries for region = us-east-1 and service = API_GATEWAY.
curl -s | jq --raw-output '.prefixes[] | select(.region=="us-east-1" and .service=="API_GATEWAY") | .ip_prefix'
<< ////
Output (2022/12/01):
noamtamim / docker-compose.yml
Created Nov 29, 2019
Simple Prometheus Docker Compose setup
View docker-compose.yml
version: '3.7'
prometheus_data: {}
# Setup:
# The app root directory contains an "etc" subdir with the config files required by all containers.
# Docker Compose creates an internal network for all containers so they can call each other by name.
noamtamim /
Last active Nov 22, 2022
Markdown with PlantUML

How to use PlantUML with Markdown

PlantUML is a really awesome way to create diagrams by writing code instead of drawing and dragging visual elements. Markdown is a really nice documentation tool.

Here's how I combine the two, to create docs with embedded diagrams.

Step 0: Setup

Get the command-line PlantUML from the download page or your relevant package manager.

noamtamim /
Created May 15, 2019
Convert mp4 files to mp3 (extract audio from mp4)

Convert mp4 files to mp3 (extract audio from mp4)

Assuming a simple mp4 with one video stream and one audio stream.

for f in *.mp4
  ffmpeg -i "$f" "${f%mp4}mp3"