Skip to content

Instantly share code, notes, and snippets.

View noamtamim's full-sized avatar

Noam Tamim noamtamim

View GitHub Profile
@noamtamim
noamtamim / README.md
Last active April 12, 2021 14:22
macOS Terminal Tricks

Clipboard

pbpaste

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!
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
noamtamim / aws-ip-range.sh
Last active December 1, 2022 14:38
AWS: IP ranges of API Gateway in us-east-1
#!/bin/bash
# Assuming jq (https://stedolan.github.io/jq/) and curl are installed.
# Show only the entries for region = us-east-1 and service = API_GATEWAY.
curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq --raw-output '.prefixes[] | select(.region=="us-east-1" and .service=="API_GATEWAY") | .ip_prefix'
<< ////
Output (2022/12/01):
3.216.135.0/24
3.216.136.0/21
3.216.144.0/23
@noamtamim
noamtamim / docker-compose.yml
Created November 29, 2019 14:36
Simple Prometheus Docker Compose setup
version: '3.7'
volumes:
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.
services:
@noamtamim
noamtamim / README.md
Last active April 15, 2025 08:59
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
noamtamim / mp4-to-mp3.md
Created May 15, 2019 20:11
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
do 
  ffmpeg -i "$f" "${f%mp4}mp3"
done
#!/bin/bash
<< ////
The script creates 'licenses' under '$ANDROID_HOME' and creates a file which proves
that the SDK license was accepted by the user.
Please copy this to your own account/gist/server. Every time there's an updated license, update the file with the new
license hash.
Legally if you run this script (or your own version of it), it means YOU accepted the license - don't trust someone else.
The hashes below are supposed to be taken from $ANDROID_HOME/licenses/android-sdk-license on YOUR machine, after you