Skip to content

Instantly share code, notes, and snippets.

View manuelcoppotelli's full-sized avatar
👨‍💻

Manuel Coppotelli manuelcoppotelli

👨‍💻
View GitHub Profile
#!/usr/bin/env python
import boto3
import argparse
from operator import itemgetter
from collections import defaultdict
def nested_defaultdict():
return defaultdict(nested_defaultdict)
@manuelcoppotelli
manuelcoppotelli / markdown_examples.md
Created February 20, 2024 14:56 — forked from cseeman/markdown_examples.md
Markdown for info panel/warning box

Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.

All the boxes are single/two cell tables or two row tables.

Warning box

❗ You have to read about this
import boto3
def pull_s3_prefix(dst_dir, bucket, prefix):
client = boto3.client('s3')
resource = boto3.resource('s3')
download_dir(client, resource, prefix, prefix, dst_dir, bucket)
def download_dir(client, resource, prefix, start_prefix, local, bucket ):
paginator = client.get_paginator('list_objects')
for result in paginator.paginate(Bucket=bucket, Delimiter='/', Prefix=prefix):
@manuelcoppotelli
manuelcoppotelli / gist:99d0a519ba68cfe9d88b33174e66ab62
Created August 6, 2024 10:27 — forked from suhas316380/gist:7399af4e7c3fb1ca2a8d39403e9a00f5
Check if DNS queries to the Amazon provided DNS server are failing due to VPC DNS throttling

I use this script to check for any throttling issues for EKS or Kubernetes running on AWS. Feel free to customize it depending on your needs.

Explaination of the script:

  • Capture packets on ENIs associated with EC2 and exlcude "eth*" and "lo" interfaces. The list of interfaces can be obtained by running the command: ls -1 /sys/class/net
  • If you'd like to capture packets on all interfaces, replace "[[ $i = eni* ]] && tcpdump_func $i &" with "tcpdump_func $i &"
  • Iterates through all the ENIs associated with the worker nodes and captures packets for 60 seconds
  • I used this as a reference to come up with this script

Bash Script

<?php
/** @noinspection PhpUnused */
namespace App\Http\Livewire\Traits;
use Exception;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Facades\Gate;
use Livewire\Component;