Skip to content

Instantly share code, notes, and snippets.

@bparaj
bparaj / iou_visualization.py
Last active April 22, 2021 20:50
Script to compute and visualize intersection over union (iou) for example rectangle pairs. Uses matplotlib.
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
def get_iou(b1, b2):
b1_x, b1_y, b1_w, b1_h = b1
b2_x, b2_y, b2_w, b2_h = b2
# Assume b1 is the bottom-left-most rectangle.
assert b1_x <= b2_x and b1_y <= b2_y
@bparaj
bparaj / forward-ssh-agent-to-docker-container.md
Created February 14, 2023 10:11
How to share ssh agent with a docker container

You might want to ssh into a docker container and pull some remote repository which requires the SSH keys stored on the host machine. Edit your docker-compose file as follows:

  1. Set the environment variable SSH_AUTH_SOCK to the socket being used by the agent.
  2. Mount that agent in the container.
services:
  app:
 environment: