Skip to content

Instantly share code, notes, and snippets.

View manuelcoppotelli's full-sized avatar
👨‍💻

Manuel Coppotelli manuelcoppotelli

👨‍💻
View GitHub Profile
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 / 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
#!/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 / vpn.md
Created February 20, 2023 13:34 — forked from joepie91/vpn.md
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.15294118225574493</real>
@manuelcoppotelli
manuelcoppotelli / arch-uefi-luks-installation.txt
Created January 2, 2023 16:42 — forked from jkauppinen/arch-uefi-luks-installation.txt
Arch linux installation with full disk encryption via dm-crypt + LUKS
# This installation guide will create basic working arch linux installation with encryption.
# Encryption is implemented with dm-crypt + LUKS on a single disk.
# Following articles/posts/gists were used as reference
# https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/
# https://wiki.archlinux.org/index.php/Installation_guide
# https://wiki.archlinux.org/index.php/Dm-crypt/System_configuration
# https://wiki.archlinux.org/index.php/Dm-crypt/Device_encryption
# https://blog.tinned-software.net/automount-a-luks-encrypted-volume-on-system-start/
# https://gist.github.com/mattiaslundberg/8620837
@manuelcoppotelli
manuelcoppotelli / macOS-IPv6-Tunnel-DNS-HOWTO.md
Created December 15, 2022 13:15 — forked from smammy/macOS-IPv6-Tunnel-DNS-HOWTO.md
How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

This was a huge hassle to figure out, so I wrote up a little guide in hopes that others would find it helpful:

How to convince macOS to do IPv6 DNS lookups when your only IPv6 address is via a VPN or tunnel of some sort

The Problem

macOS's domain name resolver will only return IPv6 addresses (from AAAA records) when it thinks that you have a valid routable IPv6 address. For physical interfaces like Ethernet or Wi-Fi it's enough to set or be assigned an IPv6 address, but for tunnels (such as those using utun interfaces) there are some extra annoying steps that need to be taken to convince the system that yes, you indeed have an IPv6 address, and yes, you'd like to get IPv6 addresses back for DNS lookups.

I use wg-quick to establish a WireGuard tunnel between my laptop and a Linode virtual server. WireGuard uses a utun user-space tunnel device to make the connection. Here's how that device gets configured:

@manuelcoppotelli
manuelcoppotelli / LICENSE
Created October 27, 2022 19:57 — forked from suhailpatel/LICENSE
Implementation of a database for "Dissecting the humble LSM Tree and SSTable" for SRECon EMEA 2022
The MIT License (MIT)
Copyright (c) 2022 Suhail Patel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@manuelcoppotelli
manuelcoppotelli / 1-add-middleware.php
Created February 16, 2018 10:51 — forked from adamwathan/1-add-macros.php
Multiformat Endpoints in Laravel
<?php
namespace App\Http\Middleware;
class CaptureRequestExtension
{
public function handle($request, $next)
{
if ($request->route()->parameter('_extension') !== null) {
$request->attributes->set('_extension', substr($request->route()->parameter('_extension'), 1));
@manuelcoppotelli
manuelcoppotelli / boudaries.css
Created February 13, 2018 09:14
Quickly see the boundaries of every element without affecting the layout
* {
outline: 1px solid red !important;
}