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):
#!/usr/bin/env python
import boto3
import argparse
from operator import itemgetter
from collections import defaultdict
def nested_defaultdict():
return defaultdict(nested_defaultdict)
@ImIOImI
ImIOImI / README.md
Last active March 5, 2023 08:31
Env0 Project Module

Tagging

Env0 relies on git tags to version modules. By default the tag workflow automagically increments the release patch version (so applying a tag to a PR is unecessary). Acceptable tags are

Requirements

@morrolinux
morrolinux / linux-full-desktop-container.md
Last active July 12, 2024 07:41
Run a full linux desktop in a container

In the following gist I'm going to guide you through the process of installing and booting an entire linux distribution with full desktop environment just like you would have with a classical VM, but with much better performance and much worse isolation :)

The reason why I did this was mainly because it's cool, but also to test new distros with decent graphics performance without actually booting them on my PC.

If you "try this at home" just keep in mind a container is not as secure as a VM, and some of the option we're going to explore will weaken container isolation from "a bit risky" to "totally unsafe" depending on what you choose.

Also, we're going to use systemd-nspawn for containers as it's probably the best fit for our use case and can also boot any linux partition without needing to prepare an apposite container image.

Less go!

@barsa-net
barsa-net / Dockerfile
Last active February 29, 2024 16:14
wagoodman/dive image builder for ARM64/aarch64
FROM golang:alpine AS builder
RUN apk update && \
apk add git make
WORKDIR /go/src
ARG DIVE_VERSION=${DIVE_VERSION:-v0.10.0}
RUN git clone https://github.com/wagoodman/dive.git dive && \
git -C /go/src/dive checkout ${DIVE_VERSION}
@ImIOImI
ImIOImI / cloudshell-init.sh
Last active May 9, 2024 15:46
AWS Cloudshell init script
#!/bin/sh
defaultUser="ImIOImI"
defaultEmail="troy.knapp@gmail.com"
rsaKeyFile=/home/cloudshell-user/.ssh/id_rsa
if [ ! -f "$rsaKeyFile" ]; then
#add rsa key
ssh-keygen -b 2048 -t rsa -f "$rsaKeyFile" -q -N ""
echo "Please copy the following into your GitHub profile here: https://github.com/settings/ssh/new
"
@sammyrulez
sammyrulez / lint_and_test.yaml
Last active January 12, 2022 23:30
sniplet
on:
push:
branches:
- main
paths:
- "amazon_scraper/**"
@jkauppinen
jkauppinen / arch-uefi-luks-installation.txt
Last active May 25, 2024 04:34
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
@eyarz
eyarz / commit-msg-hook.py
Last active December 15, 2021 17:57
Git commit-msg hook to verify commit message convention => https://datree.io/blog/git-commit-message-conventions-for-readable-git-log/
#!/usr/bin/env python
"""
Git commit hook:
.git/hooks/commit-msg
Check commit message according to guidelines
"""
import sys
import re
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):