Skip to content

Instantly share code, notes, and snippets.

View sassyn's full-sized avatar

Sassy Natan sassyn

  • Israel
View GitHub Profile
@sassyn
sassyn / migrate-ecr.py
Created June 26, 2021 18:13 — forked from fabidick22/migrate-ecr.py
Migrate AWS ECR images from one account to another in different regions
import docker
import sys
import boto3 as b3
ECR_URI = "{}.dkr.ecr.{}.amazonaws.com/{}"
TAG_URI = "{}:{}"
class Repository:
def __init__(self, repository_name: str, region: str, account_id: str, specific_tag=None, profile="default"):
@sassyn
sassyn / ec2_multicast.sh
Created June 8, 2021 14:18 — forked from kntyskw/ec2_multicast.sh
Script to enable IP multicast without using Ethernet broadcast. It uses tc mirred and pedit actions to copy and edit an IP multicast packet to send over multiple Ethernet unicast frames. It requires two network interfaces to work. One is the interface to grab original multicast packets from and the other is to send out modified packets. This is …
#!/bin/sh
[[ -n "$1" && -n "$2" ]] || { echo "Usage: $0 <interface to grab multicast packets from> <interface to send modified packets to> [target MAC address 1] [target MAC address 2] ..."; exit 0 ; }
IIF=$1
OIF=$2
shift
shift
SRC_MACADDR=`ip link show $OIF | awk '/ether/ {print $2}' | tr -d :`
@sassyn
sassyn / full.sh
Last active October 8, 2020 18:35 — forked from taxilian/README.md
Mongodb scripts for incremental backup
#!/bin/bash
source $(dirname "$0")/initParams.inc.sh
mkdir -p -v "${OUTPUT_DIRECTORY}"
DEST_PATH=${OUTPUT_DIRECTORY}/full/$(date \+\%Y\%m\%d_\%s)
log $LOG_MESSAGE_INFO "[INFO] starting full backup of ${MONGODB_URI} to ${DEST_PATH}"
@sassyn
sassyn / haproxy-db.conf
Created November 8, 2018 19:31 — forked from aw/haproxy-db.conf
HAProxy configuration for MySQL failover and redundancy
# HAProxy configuration - haproxy-db.cfg
##
## FRONTEND ##
##
# Load-balanced IPs for DB writes and reads
#
frontend db_write
bind 172.16.0.50:3306